archidocs 1.4.0-beta.2 → 1.4.0-beta.3

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.
@@ -1,23 +1,23 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./svg-DXIkkkSu.js","./teams-N-WbqOXA.js","./rolldown-runtime-pP25SEvz.js","./font-BEgf3E5J.js","./sequence-svg-BtEmwvN4.js","./png-D-pNKY71.js"])))=>i.map(i=>d[i]);
2
- import{r as e,t}from"./rolldown-runtime-pP25SEvz.js";import{C as n,S as r,_ as i,a,b as o,d as s,f as c,g as l,h as u,i as d,m as f,p,t as m,u as h,v as g,w as _,x as v,y}from"./teams-N-WbqOXA.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var b=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=N(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(ee(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function te(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var re=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ie(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,re)}catch(e){re(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function ae(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ie(ae.bind(null,e))}var oe={map:te,forEach:function(e,t,n){te(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return te(e,function(){t++}),t},toArray:function(e){return te(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=oe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=ae,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ie,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),x=t(((e,t)=>{t.exports=b()})),S=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),C=t(((e,t)=>{t.exports=S()})),w=t((e=>{var t=x();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),T=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=w()})),E=t((e=>{var t=C(),n=x(),r=T();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function p(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function m(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function h(e){var t=[null,null],n=p(e);return n===null||g(t,e,n.child,{foundSelf:!1}),t}function g(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&g(e,t,n.child,r))return!0;n=n.sibling}return!1}function _(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var v=null,y=null;function b(e,t,n){return e===n||e===t&&(v=e,!0)}function S(e,t,n){return e===n?(y=e,!1):e===t&&(y!==null&&(v=e),!0)}function w(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),ee=Symbol.for(`react.profiler`),N=Symbol.for(`react.consumer`),te=Symbol.for(`react.context`),ne=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function P(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case ee:return`Profiler`;case M:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case te:return e.displayName||`Context`;case N:return(e._context.displayName||`Context`)+`.Consumer`;case ne:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var he=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function ye(e){return{current:e}}function be(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function xe(e,t){ve++,_e[ve]=e.current,e.current=t}var Se=ye(null),L=ye(null),Ce=ye(null),we=ye(null);function Te(e,t){switch(xe(Ce,t),xe(L,e),xe(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?mp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=mp(t),e=hp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}be(Se),xe(Se,e)}function Ee(){be(Se),be(L),be(Ce)}function De(e){var t=e.memoizedState;t!==null&&(dh._currentValue=t.memoizedState,xe(we,e)),t=Se.current;var n=hp(t,e.type);t!==n&&(xe(L,e),xe(Se,n))}function Oe(e){L.current===e&&(be(Se),be(L)),we.current===e&&(be(we),dh._currentValue=ge)}var ke,Ae;function je(e){if(ke===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ke=t&&t[1]||``,Ae=-1<e.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./svg-Cboa7QX_.js","./teams-N-WbqOXA.js","./rolldown-runtime-pP25SEvz.js","./font-BEgf3E5J.js","./sequence-svg-DDwcPtpC.js","./png-D-pNKY71.js"])))=>i.map(i=>d[i]);
2
+ import{r as e,t}from"./rolldown-runtime-pP25SEvz.js";import{C as n,S as r,_ as i,a,b as o,d as s,f as c,g as l,h as u,i as d,m as f,p,t as m,u as h,v as g,w as _,x as v,y}from"./teams-N-WbqOXA.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var b=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function te(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=te(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(ee(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ne(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ie=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ae(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ie)}catch(e){ie(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function N(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ae(N.bind(null,e))}var oe={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=oe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=N,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:re}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ae,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),x=t(((e,t)=>{t.exports=b()})),S=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),C=t(((e,t)=>{t.exports=S()})),w=t((e=>{var t=x();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),T=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=w()})),E=t((e=>{var t=C(),n=x(),r=T();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;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.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function p(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function m(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function h(e){var t=[null,null],n=p(e);return n===null||g(t,e,n.child,{foundSelf:!1}),t}function g(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&g(e,t,n.child,r))return!0;n=n.sibling}return!1}function _(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var v=null,y=null;function b(e,t,n){return e===n||e===t&&(v=e,!0)}function S(e,t,n){return e===n?(y=e,!1):e===t&&(y!==null&&(v=e),!0)}function w(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),ee=Symbol.for(`react.profiler`),te=Symbol.for(`react.consumer`),ne=Symbol.for(`react.context`),re=Symbol.for(`react.forward_ref`),ie=Symbol.for(`react.suspense`),ae=Symbol.for(`react.suspense_list`),N=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function P(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var pe=Symbol.for(`react.client.reference`);function me(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case ee:return`Profiler`;case M:return`StrictMode`;case ie:return`Suspense`;case ae:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case ne:return e.displayName||`Context`;case te:return(e._context.displayName||`Context`)+`.Consumer`;case re:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case N:return t=e.displayName||null,t===null?me(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}var he=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},_e=[],ve=-1;function ye(e){return{current:e}}function be(e){0>ve||(e.current=_e[ve],_e[ve]=null,ve--)}function xe(e,t){ve++,_e[ve]=e.current,e.current=t}var Se=ye(null),L=ye(null),Ce=ye(null),we=ye(null);function Te(e,t){switch(xe(Ce,t),xe(L,e),xe(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?mp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=mp(t),e=hp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}be(Se),xe(Se,e)}function Ee(){be(Se),be(L),be(Ce)}function De(e){var t=e.memoizedState;t!==null&&(dh._currentValue=t.memoizedState,xe(we,e)),t=Se.current;var n=hp(t,e.type);t!==n&&(xe(L,e),xe(Se,n))}function Oe(e){L.current===e&&(be(Se),be(L)),we.current===e&&(be(we),dh._currentValue=ge)}var ke,Ae;function je(e){if(ke===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ke=t&&t[1]||``,Ae=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+ke+e+Ae}var Me=!1;function Ne(e,t){if(!e||Me)return``;Me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
5
  `),l=s.split(`
6
6
  `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
7
  `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?je(n):``}function Pe(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je(`Lazy`);case 13:return e.child!==t&&t!==null?je(`Suspense Fallback`):je(`Suspense`);case 19:return je(`SuspenseList`);case 0:case 15:return Ne(e.type,!1);case 11:return Ne(e.type.render,!1);case 1:return Ne(e.type,!0);case 31:return je(`Activity`);case 30:return je(`ViewTransition`);default:return``}}function Fe(e){try{var t=``,n=null;do t+=Pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
8
  Error generating stack: `+e.message+`
9
- `+e.stack}}var Ie=Object.prototype.hasOwnProperty,Le=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function Qe(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var $e=Math.clz32?Math.clz32:nt,et=Math.log,tt=Math.LN2;function nt(e){return e>>>=0,e===0?32:31-(et(e)/tt|0)|0}var rt=256,it=262144,at=4194304;function ot(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function st(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ot(n))):i=ot(o):i=ot(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ot(n))):i=ot(o)):i=ot(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-$e(n),i=1<<r;t|=e[r],n&=~i}return t}function ut(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dt(){var e=at;return at<<=1,!(at&62914560)&&(at=4194304),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-$e(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ht(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ht(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-$e(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$e(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function _t(e,t){var n=t&-t;return n=n&42?1:vt(n),(n&(e.suspendedLanes|t))===0?n:0}function vt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function yt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:Eh(e.type)):e}function xt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var St=Math.random().toString(36).slice(2),Ct=`__reactFiber$`+St,wt=`__reactProps$`+St,Tt=`__reactContainer$`+St,Et=`__reactEvents$`+St,Dt=`__reactListeners$`+St,Ot=`__reactHandles$`+St,kt=`__reactResources$`+St,At=`__reactMarker$`+St,jt=`__reactLoad$`+St;function Mt(e){delete e[Ct],delete e[wt],delete e[Dt],delete e[Ot]}function Nt(e){var t;if(t=e[Ct])return t;for(var n=e.parentNode;n;){if(t=n[Tt]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gm(e);e!==null;){if(n=e[Ct])return n;e=gm(e)}return t}e=n,n=e.parentNode}return null}function Pt(e){if(e=e[Ct]||e[Tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function It(e){var t=e[kt];return t||=e[kt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Lt(e){e[At]=!0}function Rt(e){e[jt]=void 0}var zt=new Set,Bt={};function Vt(e,t){Ht(e,t),Ht(e+`Capture`,t)}function Ht(e,t){for(Bt[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Ut=RegExp(`^[: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]*$`),Wt={},Gt={};function Kt(e){return Ie.call(Gt,e)?!0:Ie.call(Wt,e)?!1:Ut.test(e)?Gt[e]=!0:(Wt[e]=!0,!1)}var R=!1;function qt(){var e=R;return R=!1,e}function Jt(e,t,n){if(Kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Yt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Xt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Zt(s):e.removeAttribute(`name`)}function on(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Zt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ln(e,t,n){t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function pn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,R=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),R=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(e){if(e.indexOf(`-`)===-1)return!1;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 gn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),_n=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Pt(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[wt]||null;if(!a)throw Error(i(90));an(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Vd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[wt]||null;if(r===null)return null;n=r[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Nn=i.slice(e,1<r?1-r:void 0)}function Fn(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 In(){return!0}function Ln(){return!1}function Rn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?In:Ln,this.isPropagationStopped=Ln,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=D({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=D({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,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!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(D({},Kn,{dataTransfer:0})),Yn=Rn(D({},Vn,{relatedTarget:0})),Xn=Rn(D({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(D({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(D({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={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`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(D({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(D({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(D({},zn,{submitter:0})),sr=Rn(D({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(D({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(D({},Kn,{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})),ur=Rn(D({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=On&&`CompositionEvent`in window,pr=null;On&&`documentMode`in document&&(pr=document.documentMode);var mr=On&&`TextEvent`in window&&!pr,hr=On&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!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 hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={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 wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=Zf(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){Wf(e,0)}function kr(e){if(tn(Ft(e)))return e}function Ar(e,t){if(e===`change`)return t}var jr=!1;if(On){var Mr;if(On){var Nr=`oninput`in document;if(!Nr){var Pr=document.createElement(`div`);Pr.setAttribute(`oninput`,`return;`),Nr=typeof Pr.oninput==`function`}Mr=Nr}else Mr=!1;jr=Mr&&(!document.documentMode||9<document.documentMode)}function Fr(){Er&&(Er.detachEvent(`onpropertychange`,Ir),Dr=Er=null)}function Ir(e){if(e.propertyName===`value`&&kr(Dr)){var t=[];Tr(t,Dr,e,xn(e)),En(Or,t)}}function Lr(e,t,n){e===`focusin`?(Fr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&Fr()}function Rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return kr(Dr)}function zr(e,t){if(e===`click`)return kr(t)}function Br(e,t){if(e===`input`||e===`change`)return kr(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)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 i=n[r];if(!Ie.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(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}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Yr(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`)}var Xr=On&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(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}),$r&&Ur($r,r)||($r=r,r=Zf(Qr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};On&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Vt(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Sd.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ad;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-$e(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<jd)throw jd=0,Md=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(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.refCleanup=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 Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(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&1206910976,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.refCleanup=e.refCleanup,n}function Ii(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=Zm(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Ni(31,n,t,a),e.elementType=se,e.lanes=o,e;case j:return Ri(n.children,a,o,t);case M:s=8,a|=24;break;case ee:return e=Ni(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case re:return e=Ni(13,n,t,a),e.elementType=re,e.lanes=o,e;case ie:return e=Ni(19,n,t,a),e.elementType=ie,e.lanes=o,e;case ce:case ue:return e=a|32,e=Ni(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case te:s=10;break a;case N:s=9;break a;case ne:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Fe(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Fe(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-$e(r)-1;r&=~(1<<i),n+=1;var a=32-$e(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-$e(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,z=null,B=!1,aa=null,oa=!1,sa=Error(i(519));function ca(e){throw ma(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),sa}function la(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[wt]=r,n){case`dialog`:Y(`cancel`,t),Y(`close`,t);break;case`iframe`:case`object`:case`embed`:Y(`load`,t);break;case`video`:case`audio`:for(n=0;n<Hf.length;n++)Y(Hf[n],t);break;case`source`:Y(`error`,t);break;case`img`:case`image`:case`link`:Y(`error`,t),Y(`load`,t);break;case`details`:Y(`toggle`,t);break;case`input`:Y(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Y(`invalid`,t);break;case`textarea`:Y(`invalid`,t),un(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||rp(t.textContent,n)?(r.popover!=null&&(Y(`beforetoggle`,t),Y(`toggle`,t)),r.onScroll!=null&&Y(`scroll`,t),r.onScrollEnd!=null&&Y(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||ca(e,!0)}function ua(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:ia=ia.return}}function da(e){if(e!==ia)return!1;if(!B)return ua(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||_p(e.type,e.memoizedProps)),n=!n),n&&z&&ca(e),ua(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));z=hm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));z=hm(e)}else t===27?(t=z,Ep(e.type)?(e=mm,mm=null,z=e):z=t):z=ia?pm(e.stateNode.nextSibling):null;return!0}function fa(){z=ia=null,B=!1}function pa(){var e=aa;return e!==null&&(md===null?md=e:md.push.apply(md,e),aa=null),e}function ma(e){aa===null?aa=[e]:aa.push(e)}var ha=ye(null),ga=null,_a=null;function va(e,t,n){xe(ha,t._currentValue),t._currentValue=n}function ya(e){e._currentValue=ha.current,be(ha)}function ba(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function xa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ba(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ba(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ba(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Sa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===we.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[dh]:e.push(dh))}a=a.return}return e!==null&&xa(t,e,n,r),t.flags|=262144,e!==null}function Ca(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wa(e){ga=e,_a=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ta(e){return Da(ga,e)}function Ea(e,t){return ga===null&&wa(e),Da(e,t)}function Da(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},_a===null){if(e===null)throw Error(i(308));_a=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _a=_a.next=t;return n}var Oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ka=t.unstable_scheduleCallback,Aa=t.unstable_NormalPriority,ja={$$typeof:te,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ma(){return{controller:new Oa,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&ka(Aa,function(){e.controller.abort()})}function Pa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Fa=null;function Ia(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var La=null,Ra=0,za=0,Ba=null;function Va(e,t){if(La===null){var n=La=[];Ra=0,za=Lf(),Ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ra++,t.then(Ha,Ha),t}function Ha(){if(--Ra===0&&(Fa=null,La!==null)){Ba!==null&&(Ba.status=`fulfilled`);var e=La;La=null,za=0,Ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Wa=F.S;F.S=function(e,t){if(_d=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&Va(e,t),Fa!==null)for(var n=Cf;n!==null;)Pa(n,Fa),n=n.next;if(n=e.types,n!==null){for(var r=Cf;r!==null;)Pa(r,n),r=r.next;if(za!==0){r=Fa,r===null&&(r=Fa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Wa!==null&&Wa(e,t)};var Ga=ye(null);function Ka(){var e=Ga.current;return e===null?ed.pooledCache:e}function qa(e,t){t===null?xe(Ga,Ga.current):xe(Ga,t.pool)}function Ja(){var e=Ka();return e===null?null:{parent:ja._currentValue,pool:e}}var Ya=Error(i(460)),Xa=Error(i(474)),Za=Error(i(542)),Qa={then:function(){}};function $a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function eo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=ed,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e}throw no=t,Ya}}function to(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(no=e,Ya):e}}var no=null;function ro(){if(no===null)throw Error(i(459));var e=no;return no=null,e}function io(e){if(e===Ya||e===Za)throw Error(i(483))}var ao=null,oo=0;function so(e){var t=oo;return oo+=1,ao===null&&(ao=[]),eo(ao,e,t)}function co(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function lo(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function uo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Fi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),co(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&to(i)===t.type)?(t=a(t,n.props),co(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),co(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Vi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ri(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Li(t.type,t.key,t.props,null,e.mode,n),co(n,t),n.return=e,n;case A:return t=Vi(t,e.mode,n),t.return=e,t;case oe:return t=to(t),f(e,t,n)}if(he(t)||P(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,so(t),n);if(t.$$typeof===te)return f(e,Ea(e,t),n);lo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case oe:return n=to(n),p(e,t,n,r)}if(he(n)||P(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,so(n),r);if(n.$$typeof===te)return p(e,t,Ea(e,n),r);lo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=to(r),m(e,t,n,r,i)}if(he(r)||P(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,so(r),i);if(r.$$typeof===te)return m(e,t,n,Ea(t,r),i);lo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),B&&$i(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return B&&$i(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),B&&$i(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),B&&$i(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return B&&$i(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),B&&$i(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),co(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&to(l)===r.type){n(e,r.sibling),c=a(r,o.props),co(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ri(o.props.children,e.mode,c,o.key),co(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),co(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=to(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(P(o)){if(l=P(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,so(o),c);if(o.$$typeof===te)return _(e,r,Ea(e,o),c);lo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{oo=0;var i=_(e,t,n,r);return ao=null,i}catch(t){if(t===Ya||t===Za)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var fo=uo(!0),po=uo(!1),mo=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function yo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}function bo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var xo=!1;function So(){if(xo){var e=Ba;if(e!==null)throw e}}function Co(e,t,n,r){xo=!1;var i=e.updateQueue;mo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===za&&(xo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:mo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),cd|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wo(n[e],t)}var Eo=ye(null),Do=ye(0);function Oo(e,t){e=od,xe(Do,e),xe(Eo,t),od=e|t.baseLanes}function ko(){xe(Do,od),xe(Eo,Eo.current)}function Ao(){od=Do.current,be(Eo),be(Do)}var jo=ye(null),Mo=null;function No(e){var t=e.alternate;xe(Ro,Ro.current&1),xe(jo,e),Mo===null&&(t===null||Eo.current!==null||t.memoizedState!==null)&&(Mo=e)}function Po(e){xe(Ro,Ro.current),xe(jo,e),Mo===null&&(Mo=e)}function Fo(e){e.tag===22?(xe(Ro,Ro.current),xe(jo,e),Mo===null&&(Mo=e)):Io()}function Io(){xe(Ro,Ro.current),xe(jo,jo.current)}function Lo(e){be(jo),Mo===e&&(Mo=null),be(Ro)}var Ro=ye(0);function zo(e,t){xe(jo,jo.current),xe(Ro,t)}function Bo(e){be(Ro),be(jo),Mo===e&&(Mo=null)}function Vo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||um(n)||dm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Ho=0,V=null,H=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(i(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Ho=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?hc:gc,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){F.H=mc;var t=H!==null&&H.next!==null;if(Ho=0,Uo=H=V=null,Wo=!1,Jo=0,Yo=null,t)throw Error(i(300));e===null||Nc||(e=e.dependencies,e!==null&&Ca(e)&&(Nc=!0))}function ts(e,t,n,r){V=e;var a=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=a)throw Error(i(301));if(a+=1,Uo=H=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=_c,o=t(n,r)}while(Go);return o}function ns(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(H===null?null:H.memoizedState)!==e&&(V.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Ho=0,Uo=H=V=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?V.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(H===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=H.next;var t=Uo===null?V.memoizedState:Uo.next;if(t!==null)Uo=t,H=e;else{if(e===null)throw V.alternate===null?Error(i(467)):Error(i(310));H=e,e={memoizedState:H.memoizedState,baseState:H.baseState,baseQueue:H.baseQueue,queue:H.queue,next:null},Uo===null?V.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=eo(Yo,e,t),t=V,(Uo===null?t.memoizedState:Uo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?hc:gc),e}function us(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===de)return;if(e.$$typeof===te)return Ta(e)}throw Error(i(438,String(e)))}function ds(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=cs(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=le;return t.index++,n}function fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(ss(),H,e)}function ms(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ho&f)===f:(J&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===za&&(d=!0);else if((Ho&p)===p){u=u.next,p===za&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,V.lanes|=p,cd|=p;f=u.action,Ko&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,V.lanes|=f,cd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(Nc=!0,d&&(n=Ba,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function hs(e){var t=ss(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Hr(o,t.memoizedState)||(Nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function gs(e,t,n){var r=V,a=ss(),o=B;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Hr((H||a).memoizedState,n);if(s&&(a.memoizedState=n,Nc=!0),a=a.queue,Bs(vs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Uo!==null&&!!(Uo.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},U.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ed===null)throw Error(i(349));o||Ho&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=cs(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function U(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&bs(e)}function vs(e,t,n){return n(function(){ys(t)&&bs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function bs(e){var t=Oi(e,2);t!==null&&Id(t,e,2)}function xs(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){Qe(!0);try{n()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},t}function Ss(e,t,n,r){return e.baseState=n,ms(e,H,typeof r==`function`?r:fs)}function Cs(e,t,n,r,a){if(dc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ws(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ws(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};o.types=a===null?null:a.types,F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Ts(e,t,s)}catch(n){Ds(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Ts(e,t,a)}catch(n){Ds(e,t,n)}}function Ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Es(e,t,n)},function(n){return Ds(e,t,n)}):Es(e,t,n)}function Es(e,t,n){t.status=`fulfilled`,t.value=n,Os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ws(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Os(t),t=t.next;while(t!==r)}e.action=null}function Os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ks(e,t){return t}function As(e,t){if(B){var n=ed.formState;if(n!==null){a:{var r=V;if(B){if(z){b:{for(var i=z,a=oa;i.nodeType!==8;)if(!a||(i=pm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){z=pm(i.nextSibling),r=i.data===`F!`;break a}}ca(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,V,r),r.dispatch=n,r=xs(!1),a=uc.bind(null,V,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(ss(),H,e)}function Ms(e,t,n){if(t=ms(e,t,ks)[0],e=ps(fs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ls(t)}catch(e){throw e===Ya?Za:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.flags|=2048,Fs(9,{destroy:void 0},Ns.bind(null,i,n),null)),[r,a,e]}function Ns(e,t){e.action=t}function Ps(e){var t=ss(),n=H;if(n!==null)return Ms(t,n,e);ss(),t=t.memoizedState,n=ss();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=V.updateQueue,t===null&&(t=cs(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Is(){return ss().memoizedState}function Ls(e,t,n,r){var i=os();V.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;H!==null&&r!==null&&Qo(r,H.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(V.flags|=e,i.memoizedState=Fs(1|t,a,n,r))}function zs(e,t){Ls(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=cs(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=ss().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||Ho&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=Pd(),V.lanes|=e,cd|=e,n)}function Zs(e,t,n,r){return Hr(n,t)?n:Eo.current===null?!(Ho&106)||Ho&1073741824&&!(J&261930)?(Nc=!0,e.memoizedState=n):(e=Pd(),V.lanes|=e,cd|=e,t):(e=Xs(e,n,r),Hr(e,t)||(Nc=!0),e)}function Qs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};s.types=o===null?null:o.types,F.T=s,uc(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Ua(c,r),Nd(e)):lc(e,t,r,Nd(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},Nd())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=tc(e).queue;Qs(e,a,t,ge,n===null?$s:function(){return nc(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nc(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),lc(e,t.next.queue,{},Nd())}function rc(){return Ta(dh)}function ic(){return ss().memoizedState}function ac(){return ss().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Nd();e=_o(n);var r=vo(t,e,n);r!==null&&(Id(r,t,n),yo(r,t,n)),t={cache:Ma()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=Nd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dc(e)?fc(t,n):(n=Di(e,t,n,r),n!==null&&(Id(n,e,r),pc(n,t,r)))}function cc(e,t,n){lc(e,t,n,Nd())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dc(e))fc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Hr(s,o))return Ei(e,t,i,0),ed===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Id(n,e,r),pc(n,t,r),!0}return!1}function uc(e,t,n,r){if(r={lane:2,revertLane:Lf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&Id(t,e,2)}function dc(e){var t=e.alternate;return e===V||t!==null&&t===V}function fc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var mc={readContext:Ta,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},hc={readContext:Ta,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:Ta,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ls(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var n=os();t=t===void 0?null:t;var r=e();if(Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){Qe(!0);try{n(t)}finally{Qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=sc.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(os(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,V,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,a=os();if(B){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ed===null)throw Error(i(349));J&127||_s(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(vs.bind(null,r,o,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},U.bind(null,r,o,n,t),null),n},useId:function(){var e=os(),t=ed.identifierPrefix;if(B){var n=Qi,r=Zi;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=os();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=uc.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return os().memoizedState=oc.bind(null,V)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:Ta,use:us,useCallback:Js,useContext:Ta,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:ps,useRef:Is,useState:function(){return ps(fs)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(ss(),H.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(ss(),H,e,t)},useMemoCache:ds,useCacheRefresh:ac,useEffectEvent:Hs},_c={readContext:Ta,use:us,useCallback:Js,useContext:Ta,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:hs,useRef:Is,useState:function(){return hs(fs)},useDebugValue:qs,useDeferredValue:function(e,t){var n=ss();return H===null?Xs(n,e,t):Zs(n,H.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=ss();return H===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,H,e,t)},useMemoCache:ds,useCacheRefresh:ac,useEffectEvent:Hs};function vc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Nd(),i=_o(r);i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Id(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Nd(),i=_o(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Id(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Nd(),r=_o(n);r.tag=2,t!=null&&(r.callback=t),t=vo(e,r,n),t!==null&&(Id(t,e,n),yo(t,e,n))}};function bc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ur(n,r)||!Ur(i,a):!0}function xc(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&&yc.enqueueReplaceState(t,t.state,null)}function Sc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Cc(e){xi(e)}function wc(e){console.error(e)}function Tc(e){xi(e)}function Ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Dc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Oc(e,t,n){return n=_o(n),n.tag=3,n.payload={element:null},n.callback=function(){Ec(e,t)},n}function kc(e){return e=_o(e),e.tag=3,e}function Ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Dc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Dc(t,n,r),typeof i!=`function`&&(bd===null?bd=new Set([this]):bd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function jc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Sa(t,n,a,!0),n=jo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Mo===null?Jd():n.alternate===null&&sd===0&&(sd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),_f(e,r,a)),!1;case 22:return n.flags|=65536,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),_f(e,r,a)),!1}throw Error(i(435,n.tag))}return _f(e,r,a),Jd(),!1}if(B)return t=jo.current,t===null?(r!==sa&&(t=Error(i(423),{cause:r}),ma(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=Oc(e.stateNode,r,a),bo(e,a),sd!==4&&(sd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==sa&&(e=Error(i(422),{cause:r}),ma(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),pd===null?pd=[o]:pd.push(o),sd!==4&&(sd=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,r,e),bo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(bd===null||!bd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=kc(a),Ac(a,e,n,r),bo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Mc=Error(i(461)),Nc=!1;function Pc(e,t,n,r){t.child=e===null?po(t,null,n,r):fo(t,e.child,n,r)}function Fc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return wa(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Nc?(is(e,t,i),ll(e,t,i)):(B&&s&&ta(t),t.flags|=1,Pc(e,t,r,i),t.child)}function Ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Lc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ul(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(Nc=!1,t.pendingProps=r=a,ul(e,i))e.flags&131072&&(Nc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return Gc(e,t,n,r,i)}function Rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qa(t,a===null?null:a.cachePool),a===null?ko():Oo(t,a),Fo(t);else return r=t.lanes=536870912,Bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&qa(t,null),ko(),Io()):(qa(t,a.cachePool),Oo(t,a),Io(),t.memoizedState=null);return Pc(e,t,i,n),t.child}function zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bc(e,t,n,r,i){var a=Ka();return a=a===null?null:{parent:ja._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&qa(t,null),ko(),Fo(t),e!==null&&Sa(e,t,r,!0),t.childLanes=i,null}function Vc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(e,t,n){return fo(t,e.child,null,n),e=Vc(t,t.pendingProps),e.flags|=2,Lo(t),t.memoizedState=null,e}function Uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(B){if(r.mode===`hidden`)return e=Vc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zc(null,e);if(Po(t),(e=z)?(e=lm(e,oa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,z=null)):e=null,e===null)throw ca(t);return t.lanes=536870912,null}return Vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Po(t),a){if(t.flags&256)t.flags&=-257,t=Hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Nc||Sa(e,t,n,!1),a=(n&e.childLanes)!==0,Nc||a){if(Eo.current===null){if(r=ed,r!==null&&(s=_t(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),Id(r,e,s),Mc;Jd()}t=Hc(e,t,n)}else e=o.treeContext,z=pm(s.nextSibling),ia=t,B=!0,aa=null,oa=!1,e!==null&&ra(t,e),t=Vc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Gc(e,t,n,r,i){return wa(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Nc?(is(e,t,i),ll(e,t,i)):(B&&r&&ta(t),t.flags|=1,Pc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return wa(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Nc?(is(e,t,a),ll(e,t,a)):(B&&r&&ta(t),t.flags|=1,Pc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(wa(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=yc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ho(t),o=n.contextType,a.context=typeof o==`object`&&o?Ta(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(vc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&yc.enqueueReplaceState(a,a.state,null),Co(t,r,a,i),So(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Sc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&xc(t,a,r,o),mo=!1;var f=t.memoizedState;a.state=f,Co(t,r,a,i),So(),l=t.memoizedState,s||f!==l||mo?(typeof d==`function`&&(vc(t,n,d,r),l=t.memoizedState),(c=mo||bc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,go(e,t),o=t.memoizedProps,u=Sc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&xc(t,a,r,c),mo=!1,f=t.memoizedState,a.state=f,Co(t,r,a,i),So();var p=t.memoizedState;o!==d||f!==p||mo||e!==null&&e.dependencies!==null&&Ca(e.dependencies)?(typeof s==`function`&&(vc(t,n,s,r),p=t.memoizedState),(u=mo||bc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ca(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Wc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=fo(t,e.child,null,i),t.child=fo(t,null,n,i)):Pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return fa(),t.flags|=256,Pc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Ja()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=dd),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ro.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(B){if(i?No(t):Io(),(e=z)?(e=lm(e,oa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,z=null)):e=null,e===null)throw ca(t);return t.lanes=dm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Io(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(null,r)):(No(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(Io(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,zc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=Ja():(s=ja._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(e.child,r)):(No(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return fo(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(No(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(Io(),o=a.fallback,s=t.mode,a=el({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,fo(t,e.child,null,c),a=t.child,a.memoizedState=Xc(c),a.childLanes=Zc(e,r,c),t.memoizedState=Yc,zc(null,a)):(Io(),t.child=e.child,t.flags|=128,null);if(No(t),dm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ma({value:a,source:null,stack:null})),tl(e,t,c)}if(Nc||Sa(e,t,c,!1),r=(c&e.childLanes)!==0,Nc||r){if(Eo.current!==null)return tl(e,t,c);if(r=ed,r!==null&&(a=_t(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),Id(r,e,a),Mc;return um(o)||Jd(),tl(e,t,c)}return um(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,z=pm(o.nextSibling),ia=t,B=!0,aa=null,oa=!1,e!==null&&ra(t,e),t=$c(t,a.children),t.flags|=134221824,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ba(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Vo(n)===null&&(t=e),e=e.sibling}return t}function al(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ol(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ro.current;if(t.flags&128)return zo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,zo(t,o),i===`backwards`&&e!==null?(ol(e),Pc(e,t,r,n),ol(e)):Pc(e,t,r,n),r=B?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return va(t,t.type,r.value),Pc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Sa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ul(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ca(e)))}function dl(e,t,n){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),va(t,ja,e.memoizedState.cache),fa();break;case 27:case 5:De(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:va(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Po(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return No(t),t.flags|=128,null;r=Sa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(No(t),e=ll(e,t,n),e===null?null:e.sibling)}No(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Sa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),zo(t,Ro.current),r)break;return null;case 22:return t.lanes=0,Rc(e,t,n,t.pendingProps);case 24:va(t,ja,e.memoizedState.cache)}return ll(e,t,n)}function fl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Nc=!0;else{if(!ul(e,n)&&!(t.flags&128))return Nc=!1,dl(e,t,n);Nc=!!(e.flags&131072)}}else Nc=!1,B&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=to(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=Sc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=Gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ne){t.tag=11,t=Fc(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Ic(null,t,e,r,n);break a}if(a===te){t.tag=10,t.type=e,t=cl(null,t,n);break a}}throw t=me(e)||e,Error(i(306,t,``))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Sc(r,t.pendingProps),qc(e,t,r,a,n);case 3:a:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,go(e,t),Co(t,r,null,n);var s=t.memoizedState;if(r=s.cache,va(t,ja,r),r!==o.cache&&xa(t,[ja],n,!0),So(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Jc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ma(a),t=Jc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(z=pm(e.firstChild),ia=t,B=!0,aa=null,oa=!0,n=po(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(fa(),r===a){t=ll(e,t,n);break a}Pc(e,t,r,n)}t=t.child}return t;case 26:return Wc(e,t),e===null?(n=Lm(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(t.stateNode=gp(t.type,t.pendingProps,Ce.current,t)):t.memoizedState=Lm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&B&&(r=t.stateNode=ym(t.type,t.pendingProps,Ce.current),ia=t,oa=!0,a=z,Ep(t.type)?(mm=a,z=pm(r.firstChild)):z=a),Pc(e,t,t.pendingProps.children,n),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((a=r=z)&&(r=sm(r,t.type,t.pendingProps,oa),r===null?a=!1:(t.stateNode=r,ia=t,z=pm(r.firstChild),oa=!1,a=!0)),a||ca(t)),De(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,_p(a,o)?r=null:s!==null&&_p(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=$o(e,t,ns,null,null,n),dh._currentValue=a),Wc(e,t),Pc(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=z)&&(n=cm(n,t.pendingProps,oa),n===null?e=!1:(t.stateNode=n,ia=t,z=null,e=!0)),e||ca(t)),null;case 13:return Qc(e,t,n);case 4:return Te(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fo(t,null,r,n):Pc(e,t,r,n),t.child;case 11:return Fc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Wc(e,t),Pc(e,t,r,n),t.child;case 8:return Pc(e,t,t.pendingProps.children,n),t.child;case 12:return Pc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,wa(t),a=Ta(a),r=r(a),t.flags|=1,Pc(e,t,r,n),t.child;case 14:return Ic(e,t,t.type,t.pendingProps,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Uc(e,t,n);case 22:return Rc(e,t,n,t.pendingProps);case 24:return wa(t),r=Ta(ja),e===null?(a=Ka(),a===null&&(a=ed,o=Ma(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ho(t),va(t,ja,a)):((e.lanes&n)!==0&&(go(e,t),Co(t,null,null,n),So()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,va(t,ja,r),r!==a.cache&&xa(t,[ja],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),va(t,ja,r))),Pc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:B&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Wc(e,t),Pc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function pl(e){e.flags|=4}function ml(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Qm(t,r):Qm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Gd())e.flags|=8192;else throw no=Qa,Xa}}else e.flags&=-16777217}function hl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$m(t)){if(Gd())e.flags|=8192;else throw no=Qa,Xa}}function gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:dt(),e.lanes|=t,fd|=t)}function _l(e,t){if(!B)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function vl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function yl(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vl(t),null;case 1:return vl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ya(ja),Ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(da(t)?pl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pa())),vl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(pl(t),o===null?(vl(t),ml(t,a,null,r,n)):(vl(t),hl(t,o))):o?o===e.memoizedState?(vl(t),t.flags&=-16777217):(pl(t),vl(t),hl(t,o)):(e=e.memoizedProps,e!==r&&pl(t),vl(t),ml(t,a,e,r,n)),null;case 27:if(Oe(t),n=Ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}e=Se.current,da(t)?la(t,e):(e=ym(a,r,n),t.stateNode=e,pl(t))}return vl(t),t.subtreeFlags&=-33554433,null;case 5:if(Oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,da(t))la(t,o);else{var s=pp(Ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Ct]=t,o[wt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(op(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&pl(t)}}return vl(t),t.subtreeFlags&=-33554433,ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ce.current,da(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||rp(e.nodeValue,n)),e||ca(t,!0)}else e=pp(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return vl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=da(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Ct]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),e=!1}else n=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lo(t),t):(Lo(t),null);if(t.flags&128)throw Error(i(558))}return vl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=da(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Ct]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),a=!1}else a=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Lo(t),t):(Lo(t),null)}return Lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),gl(t,t.updateQueue),vl(t),null);case 4:return Ee(),e===null&&qf(t.stateNode.containerInfo),t.flags|=67108864,vl(t),null;case 10:return ya(t.type),vl(t),null;case 19:if(Bo(t),r=t.memoizedState,r===null)return vl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)_l(r,!1);else{if(sd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Vo(e),o!==null){for(t.flags|=128,_l(r,!1),e=o.updateQueue,t.updateQueue=e,gl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return zo(t,Ro.current&1|2),B&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>vd&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Vo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,gl(t,e),_l(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!B)return vl(t),null}else 2*Ve()-r.renderingStartTime>vd&&n!==536870912&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=Ro.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||B?zo(t,o):(n=o,xe(jo,t),xe(Ro,n),Mo===null&&(Mo=t)),B&&$i(t,r.treeForkCount),e}return vl(t),null;case 22:case 23:return Lo(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(vl(t),t.subtreeFlags&6&&(t.flags|=8192)):vl(t),n=t.updateQueue,n!==null&&gl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&be(Ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ya(ja),vl(t),null;case 25:return null;case 30:return t.flags|=33554432,vl(t),null}throw Error(i(156,t.tag))}function bl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(ja),Ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(Lo(t),t.alternate===null)throw Error(i(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ee(),null;case 10:return ya(t.type),null;case 22:case 23:return Lo(t),Ao(),e!==null&&be(Ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(ja),null;case 25:return null;default:return null}}function xl(e,t){switch(na(t),t.tag){case 3:ya(ja),Ee();break;case 26:case 27:case 5:Oe(t);break;case 4:Ee();break;case 31:t.memoizedState!==null&&Lo(t);break;case 13:Lo(t);break;case 19:Bo(t);break;case 10:ya(t.type);break;case 22:case 23:Lo(t),Ao(),e!==null&&be(Ga);break;case 24:ya(ja)}}function Sl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){gf(t,t.return,e)}}function Cl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){gf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){gf(t,t.return,e)}}function wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){gf(e,e.return,t)}}}function Tl(e,t,n){n.props=Sc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){gf(e,t,n)}}function El(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Rp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new zp(e);f(e.child,!1,nm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){gf(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){gf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){gf(e,t,n)}else n.current=null}}function Ol(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)im(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&im(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&am(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){gf(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;cp(r,e.type,n,t),r[wt]=t}catch(t){gf(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ep(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(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.tag===27&&Ep(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),Ol(e,r),R=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Ep(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),R=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Ep(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);op(t,r,n),t[Ct]=e,t[wt]=n}catch(t){gf(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Mp(o);r.push(s),s.view&&(a=!0)}else a||Mp(o).view&&(a=!0);Bl=!0,kp(o,Gl===0?t:t+`_`+Gl,n),Gl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Ap(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Jl(e.child,t),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Fd(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Fd(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Fd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Fd(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=Mp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&kp(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Np)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Fd(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,ou=!1,W=!1,su=!1,cu=typeof WeakSet==`function`?WeakSet:Set,lu=null,uu=!1,G=!1,du=!1,fu=!1;function pu(e,t,n){if(e=e.containerInfo,dp=yh,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(fp={focusedElem:e,selectionRange:r},yh=!1,n=(n&335544064)===n,lu=t,t=n?9270:1024;lu!==null;){if(e=lu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),mu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),mu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),mu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,lu=r):(n&&$l(e),mu(n))}}Vl=null}function mu(e){for(;lu!==null;){var t=lu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Sc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){gf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)om(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:om(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=bi(a.default,a.update),a!==`none`&&Kl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,lu=r;break}lu=t.return}}function hu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fu(e,n),r&4&&Sl(5,n);break;case 1:if(Fu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){gf(n,n.return,e)}else{var i=Sc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){gf(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Fu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{To(e,t)}catch(e){gf(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Fu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Fu(e,n);break;case 31:Fu(e,n),r&4&&wu(e,n);break;case 13:Fu(e,n),r&4&&Tu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=bf.bind(null,n),fm(e,n))));break;case 22:if(r=n.memoizedState!==null||au,!r){var a=t!==null&&t.memoizedState!==null||ou;t=au,i=ou,au=r,(ou=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Lu(e,n,r)):Fu(e,n),au=t,ou=i}break;case 30:Fu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Fu(e,n)}}function gu(e,t){for(e=e.child;e!==null;)_u(e,t),e=e.sibling}function _u(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){gf(e,e.return,t)}vu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,R=!0}catch(t){gf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Op(s,!0):Op(e.stateNode,!1)}catch(t){gf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&gu(e,t);break;default:gu(e,t)}}function vu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:_u(n,r);break a;case 22:n.memoizedState===null&&vu(n,r);break a;default:vu(n,r)}}e=e.sibling}}function yu(e){var t=e.alternate;t!==null&&(e.alternate=null,yu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var bu=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:ou||Dl(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ou&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ou||Dl(n,t),Al(n);var r=bu,i=xu;Ep(n.type)&&(bu=n.stateNode,xu=!1),Su(e,t,n),bm(n.stateNode,n.type,n.memoizedProps),bu=r,xu=i;break;case 5:ou||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=bu,i=xu,bu=null,Su(e,t,n),bu=r,xu=i,bu!==null){if(xu)try{(bu.nodeType===9?bu.body:bu.nodeName===`HTML`?bu.ownerDocument.body:bu).removeChild(n.stateNode),R=!0}catch(e){gf(n,t,e)}else try{bu.removeChild(n.stateNode),R=!0}catch(e){gf(n,t,e)}}break;case 18:bu!==null&&(xu?(e=bu,Dp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Gh(e)):Dp(bu,n.stateNode));break;case 4:r=bu,i=xu,bu=n.stateNode.containerInfo,xu=!0,Su(e,t,n),bu=r,xu=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),ou||Cl(4,n,t),Su(e,t,n);break;case 1:ou||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:ou=(r=ou)||n.memoizedState!==null,Su(e,t,n),ou=r;break;case 30:Dl(n,t),Su(e,t,n);break;case 7:ou||Dl(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gh(e)}catch(e){gf(t,t.return,e)}}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gh(e)}catch(e){gf(t,t.return,e)}}function Eu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cu),t;default:throw Error(i(435,e.tag))}}function Du(e,t){var n=Eu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=xf.bind(null,e,t);t.then(r,r)}})}function Ou(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Ep(l.type)){bu=l.stateNode,xu=!1;break a}break;case 5:bu=l.stateNode,xu=!1;break a;case 3:case 4:bu=l.stateNode.containerInfo,xu=!0;break a}l=l.return}if(bu===null)throw Error(i(160));Cu(s,c,o),bu=null,xu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Au(t,e,n),t=t.sibling}var ku=null;function Au(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Ou(t,e,n),ju(e),a&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:Ou(t,e,n),ju(e),a&512&&(ou||r===null||Dl(r,r.return)),a&64&&au&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ku,Ou(t,e,n),ju(e),a&512&&(ou||r===null||Dl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(au)e.stateNode=gp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[At]||r[Ct]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),op(r,t,n),r[Ct]=e,Lt(r),t=r;break a;case`link`:if(o=Ym(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),op(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Ym(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),op(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Ct]=e,Lt(r),t=r}e.stateNode=t}}else au||Xm(o,e.type,e.stateNode)}else e.stateNode=Wm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ou||t.parentNode.removeChild(t)):a.count--,n===null?au||Xm(o,e.type,e.stateNode):Wm(o,n,e.memoizedProps))}break;case 27:Ou(t,e,n),ju(e),a&512&&(ou||r===null||Dl(r,r.return)),r!==null&&a&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=W,W=!1,Ou(t,e,n),W=o,ju(e),a&512&&(ou||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),R=!0}catch(t){gf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),a&1024&&(su=!0);break;case 6:if(Ou(t,e,n),ju(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,R=!0}catch(t){gf(e,e.return,t)}}break;case 3:if(R=!1,Jm=null,o=ku,ku=wm(t.containerInfo),Ou(t,e,n),ku=o,ju(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Gh(t.containerInfo)}catch(t){gf(e,e.return,t)}su&&(su=!1,Mu(e)),R=!1;break;case 4:a=W,W=au,r=qt(),o=ku,ku=wm(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=o,R&&G&&(du=!0),R=r,W=a;break;case 12:Ou(t,e,n),ju(e);break;case 31:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 13:Ou(t,e,n),ju(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(gd=Ve()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=ou,u=W;au=c||o,W=u||o,ou=l||s,Ou(t,e,n),ou=l,W=u,au=c,ju(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||au||ou||(t=s||ou,n=au,r=ou,au=o||au,ou=t,Iu(e,2),au=n,ou=r),!o&&W||gu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Du(e,n))));break;case 19:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 30:a&512&&(ou||r===null||Dl(r,r.return)),a=qt(),o=G,s=(n&335544064)===n,c=e.memoizedProps,G=s&&bi(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),s&&r!==null&&R&&(e.flags|=4),G=o,R=a;break;case 21:break;case 7:a&512&&(ou||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ou(t,e,n),ju(e)}}function ju(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ml(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(jl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(i(161))}}catch(t){gf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,yh=!0,t.reset(),yh=!1),e=e.sibling}}function Nu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pu(t,e),t=t.sibling;else iu(t,!1)}function Pu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(fu=uu=!1,Wl(),Nu(t,e),!uu&&!du){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ap(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),fu=!0}Ul=null;break;case 5:Nu(t,e);break;case 4:r=uu,uu=!1,Nu(t,e),uu&&(du=!0),uu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Nu(t,e):Xl(e,!1));break;case 30:r=uu,i=Wl(),uu=!1,Nu(t,e),uu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Fd(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),uu=e.flags&32?!0:r;break;default:Nu(t,e)}}function Fu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hu(e,t.alternate,t),t=t.sibling}function Iu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Iu(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Iu(n,r);break;case 27:r&2&&bm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Iu(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ou||i.parentNode.removeChild(i),Iu(n,r);break;case 22:n.memoizedState===null&&Iu(n,r);break;case 30:Dl(n,n.return),Iu(n,r);break;case 7:Dl(n,n.return);default:Iu(n,r)}e=e.sibling}}function Lu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Lu(i,a,n),Sl(4,a);break;case 1:if(Lu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){gf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)wo(l[i],c)}catch(e){gf(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),Lu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||Xm(wm(c.ownerDocument),a.type,c),Lu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:Lu(i,a,n);break;case 31:Lu(i,a,n),s&&o&4&&wu(i,a);break;case 13:Lu(i,a,n),s&&o&4&&Tu(i,a);break;case 22:a.memoizedState===null&&Lu(i,a,n),El(a,a.return);break;case 30:Lu(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:Lu(i,a,n)}t=t.sibling}}function Ru(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Na(n))}function zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e))}function Bu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Vu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Vu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Bu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Bu(e,t,n,r);break;case 3:Bu(e,t,n,r),i&&fu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Na(a)));break;case 12:if(a&2048){Bu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){gf(t,t.return,e)}}else Bu(e,t,n,r);break;case 31:Bu(e,t,n,r);break;case 13:Bu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&tu(t),o._visibility&2?Bu(e,t,n,r):(o._visibility|=2,Hu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Bu(e,t,n,r):Uu(e,t)),a&2048&&Ru(s,t);break;case 24:Bu(e,t,n,r),a&2048&&zu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Bu(e,t,n,r);break;default:Bu(e,t,n,r)}}function Hu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Hu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Hu(a,o,s,c,i)):u._visibility&2?Hu(a,o,s,c,i):Uu(a,o),i&&l&2048&&Ru(o.alternate,o);break;case 24:Hu(a,o,s,c,i),i&&l&2048&&zu(o.alternate,o);break;default:Hu(a,o,s,c,i)}t=t.sibling}}function Uu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Uu(n,r),i&2048&&Ru(r.alternate,r);break;case 24:Uu(n,r),i&2048&&zu(r.alternate,r);break;default:Uu(n,r)}t=t.sibling}}var Wu=8192;function Gu(e,t,n){if(e.subtreeFlags&Wu)for(e=e.child;e!==null;)Ku(e,t,n),e=e.sibling}function Ku(e,t,n){switch(e.tag){case 26:Gu(e,t,n),e.flags&Wu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&th(n,e)):nh(n,ku,e.memoizedState,e.memoizedProps));break;case 5:Gu(e,t,n),e.flags&Wu&&(e=e.stateNode,(t&335544128)===t&&th(n,e));break;case 3:case 4:var r=ku;ku=wm(e.stateNode.containerInfo),Gu(e,t,n),ku=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Wu,Wu=16777216,Gu(e,t,n),Wu=r):Gu(e,t,n));break;case 30:if((e.flags&Wu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}Gu(e,t,n);break;default:Gu(e,t,n)}}function qu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Zu(r,e)}qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yu(e),e=e.sibling}function Yu(e){switch(e.tag){case 0:case 11:case 15:Ju(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:Ju(e);break;case 12:Ju(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ju(e);break;default:Ju(e)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Zu(r,e)}qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function Zu(e,t){for(;lu!==null;){var n=lu;switch(n.tag){case 0:case 11:case 15:Cl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,lu=r;else a:for(n=e;lu!==null;){r=lu;var i=r.sibling,a=r.return;if(yu(r),r===n){lu=null;break a}if(i!==null){i.return=a,lu=i;break a}lu=a}}}var Qu={getCacheForType:function(e){var t=Ta(ja),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ta(ja).controller.signal}},$u=typeof WeakMap==`function`?WeakMap:Map,K=0,ed=null,q=null,J=0,td=0,nd=null,rd=!1,id=!1,ad=!1,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=0,pd=null,md=null,hd=!1,gd=0,_d=0,vd=1/0,yd=null,bd=null,xd=0,Sd=null,Cd=null,wd=0,Td=0,Ed=null,Dd=null,Od=null,kd=null,Ad=null,jd=0,Md=null;function Nd(){return K&2&&J!==0?J&-J:F.T===null?bt():Lf()}function Pd(){if(dd===0){if(!(J&536870912)||B){var e=it;it<<=1,!(it&3932160)&&(it=262144),dd=e}else dd=536870912}return e=jo.current,e!==null&&(e.flags|=32),dd}function Fd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Rp(vi(e.memoizedProps,n))),kd===null&&(kd=[]),kd.push(t.bind(null,r))}}function Id(e,t,n){(e===ed&&(td===2||td===9)||e.cancelPendingCommit!==null)&&(Ud(e,0),Bd(e,J,dd,!1)),pt(e,n),K&2&&e===ed||(e===ed&&(!(K&2)&&(ld|=n),sd===4&&Bd(e,J,dd,!1)),kf(e))}function Ld(e,t,n){if(K&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ct(e,t),a=r?Zd(e,t):Yd(e,t,!0),o=r;do{if(a===0){id&&!r&&Bd(e,t,0,!1);break}if(n=e.current.alternate,o&&!zd(n))a=Yd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=pd;var l=c.current.memoizedState.isDehydrated;if(l&&(Ud(c,s).flags|=256),s=Yd(c,s,!1),s!==2&&s!==6){if(ad&&!l){c.errorRecoveryDisabledLanes|=o,ld|=o,a=4;break a}o=md,md=a,o!==null&&(md===null?md=o:md.push.apply(md,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Ud(e,0),Bd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Bd(r,t,dd,!rd);break a;case 2:md=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=gd+300-Ve(),10<a)){if(Bd(r,t,dd,!rd),st(r,0,!0)!==0)break a;wd=t,r.timeoutHandle=bp(Rd.bind(null,r,n,md,yd,hd,t,dd,ld,fd,rd,o,`Throttled`,-0,0),a);break a}Rd(r,n,md,yd,hd,t,dd,ld,fd,rd,o,null,-0,0)}break}}while(1);kf(e)}function Rd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Vl=null,Ku(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=oh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?gd-Ve():(a&4194048)===a?_d-Ve():0,m=ih(d,m),m!==null)?(wd=a,e.cancelPendingCommit=m(af.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Bd(e,a,o,!l)):af(e,t,a,n,r,i,o,s,c,l,u,d)}function zd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Hr(a(),i))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 Bd(e,t,n,r){t=lt(e,t),t&=~ud,t&=~ld,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-$e(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ht(e,n,t)}function Vd(){return K&6?!0:(Af(0,!1),!1)}function Hd(){if(q!==null){if(td===0)var e=q.return;else e=q,_a=ga=null,as(e),ao=null,oo=0,e=q;for(;e!==null;)xl(e.alternate,e),e=e.return;q=null}}function Ud(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,xp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),wd=0,Hd(),ed=e,q=n=Fi(e.current,null),J=t,td=0,nd=null,rd=!1,id=ct(e,t),ad=!1,fd=dd=ud=ld=cd=sd=0,md=pd=null,hd=!1,od=lt(e,t),Ti(),n}function Wd(e,t){V=null,F.H=mc,t===Ya||t===Za?(t=ro(),td=3):t===Xa?(t=ro(),td=4):td=t===Mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,nd=t,q===null&&(sd=1,Ec(e,Ui(t,e.current)))}function Gd(){var e=jo.current;return e===null?!0:(J&4194048)===J?Mo===null:(J&62914560)===J||J&536870912?e===Mo:!1}function Kd(){var e=F.H;return F.H=mc,e===null?mc:e}function qd(){var e=F.A;return F.A=Qu,e}function Jd(){sd=4,rd||(J&4194048)!==J&&jo.current!==null||(id=!0),!(cd&134217727)&&!(ld&134217727)||ed===null||Bd(ed,J,dd,!1)}function Yd(e,t,n){var r=K;K|=2;var i=Kd(),a=qd();(ed!==e||J!==t)&&(yd=null,Ud(e,t)),t=!1;var o=sd;a:do try{if(td!==0&&q!==null){var s=q,c=nd;switch(td){case 8:Hd(),o=6;break a;case 3:case 2:case 9:case 6:jo.current===null&&(t=!0);var l=td;if(td=0,nd=null,tf(e,s,c,l),n&&id){o=0;break a}break;default:l=td,td=0,nd=null,tf(e,s,c,l)}}Xd(),o=sd;break}catch(t){Wd(e,t)}while(1);return t&&e.shellSuspendCounter++,_a=ga=null,K=r,F.H=i,F.A=a,q===null&&(ed=null,J=0,Ti()),o}function Xd(){for(;q!==null;)$d(q)}function Zd(e,t){var n=K;K|=2;var r=Kd(),a=qd();ed!==e||J!==t?(yd=null,vd=Ve()+500,Ud(e,t)):id=ct(e,t);a:do try{if(td!==0&&q!==null){t=q;var o=nd;b:switch(td){case 1:td=0,nd=null,tf(e,t,o,1);break;case 2:case 9:if($a(o)){td=0,nd=null,ef(t);break}t=function(){td!==2&&td!==9||ed!==e||(td=7),kf(e)},o.then(t,t);break a;case 3:td=7;break a;case 4:td=5;break a;case 7:$a(o)?(td=0,nd=null,ef(t)):(td=0,nd=null,tf(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?$m(s):c.stateNode.complete){td=0,nd=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,nf(u))}break b}}td=0,nd=null,tf(e,t,o,5);break;case 6:td=0,nd=null,tf(e,t,o,6);break;case 8:Hd(),sd=6;break a;default:throw Error(i(462))}}Qd();break}catch(t){Wd(e,t)}while(1);return _a=ga=null,F.H=r,F.A=a,K=n,q===null?(ed=null,J=0,Ti(),sd):0}function Qd(){for(;q!==null&&!ze();)$d(q)}function $d(e){var t=fl(e.alternate,e,od);e.memoizedProps=e.pendingProps,t===null?nf(e):q=t}function ef(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:as(t);var r=t;r===ia&&(B?(ua(r),r.tag===5&&r.stateNode!=null&&(z=r.stateNode)):(ua(r),B=!0));default:xl(n,t),t=q=Ii(t,od),t=fl(n,t,od)}e.memoizedProps=e.pendingProps,t===null?nf(e):q=t}function tf(e,t,n,r){_a=ga=null,as(t),ao=null,oo=0;var i=t.return;try{if(jc(e,i,t,n,J)){sd=1,Ec(e,Ui(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;sd=1,Ec(e,Ui(n,e.current)),q=null;return}t.flags&32768?(B||r===1?e=!0:id||J&536870912?e=!1:(rd=e=!0,(r===2||r===9||r===3||r===6)&&(r=jo.current,r!==null&&r.tag===13&&(r.flags|=16384))),rf(t,e)):nf(t)}function nf(e){var t=e;do{if(t.flags&32768){rf(t,rd);return}e=t.return;var n=yl(t.alternate,t,od);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);sd===0&&(sd=5)}function rf(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);sd=6,q=null}function af(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do pf();while(xd!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ed&&(q=ed=null,J=0),Cd=t,Sd=e,wd=n,Ed=a,Dd=r,of(e,t,n,s,c,l,f)}}function of(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Td=s,s|=wi,mt(e,n,s,r,i,a),kd=null,(n&335544064)===n?(Ad=Ia(e),r=10262):(Ad=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Sf(Ge,function(){return mf(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=I.p,I.p=2,a=K,K|=4;try{pu(e,t,n)}finally{K=a,I.p=i,F.T=r}}xd=1,Bl?Od=Ip(o,e.containerInfo,Ad,lf,uf,cf,df,mf,sf,null,null):(lf(),uf(),df())}function sf(e){if(xd!==0){var t=Sd.onRecoverableError;t(e,{componentStack:null})}}function cf(){xd===3&&(xd=0,Pu(Cd,Sd),xd=4)}function lf(){if(xd===1){xd=0;var e=Sd,t=Cd,n=wd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=F.T,F.T=null;var i=I.p;I.p=2;var a=K;K|=4;try{G=du=!1,Au(t,e,n),n=fp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Kr(s,h),v=Kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}yh=!!dp,fp=dp=null}finally{K=a,I.p=i,F.T=r}}e.current=t,xd=2}}function uf(){if(xd===2){xd=0;var e=Sd,t=Cd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=K;K|=4;try{hu(e,t.alternate,t)}finally{K=i,I.p=r,F.T=n}}xd=3}}function df(){if(xd===4||xd===3){xd=0;var e=Od;Od=null,Be();var t=Sd,n=Cd,r=wd,i=Dd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?xd=5:(xd=0,Cd=Sd=null,ff(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(bd=null),yt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=F.T,a=I.p,I.p=2,F.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{F.T=n,I.p=a}}if(i=kd,o=Ad,Ad=null,i!==null&&(kd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);wd&3&&pf(),kf(t),a=t.pendingLanes,r&261930&&a&42?t===Md?jd++:(jd=0,Md=t):(jd=0,Md=null),Af(0,!1)}}function ff(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function pf(){return Od!==null&&(Od.skipTransition(),Od=null),lf(),uf(),df(),mf()}function mf(){if(xd!==5)return!1;var e=Sd,t=Td;Td=0;var n=yt(wd),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=Ed,Ed=null;var o=Sd,s=wd;if(xd=0,Cd=Sd=null,wd=0,K&6)throw Error(i(331));var c=K;if(K|=4,Yu(o.current),Vu(o,o.current,s,n),K=c,Af(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{I.p=a,F.T=r,ff(e,t)}}function hf(e,t,n){t=Ui(n,t),t=Oc(e.stateNode,t,2),e=vo(e,t,2),e!==null&&(pt(e,2),kf(e))}function gf(e,t,n){if(e.tag===3)hf(e,e,n);else for(;t!==null;){if(t.tag===3){hf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(bd===null||!bd.has(r))){e=Ui(n,e),n=kc(2),r=vo(t,n,2),r!==null&&(Ac(n,r,t,e),pt(r,2),kf(r));break}}t=t.return}}function _f(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ad=!0,i.add(n),e=vf.bind(null,e,t,n),t.then(e,e))}function vf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ed===e&&(J&n)===n&&(sd===4||sd===3&&(J&62914560)===J&&300>Ve()-gd?K&2?ud|=n:Ud(e,0):ud|=n,fd===J&&(fd=0)),kf(e)}function yf(e,t){t===0&&(t=dt()),e=Oi(e,t),e!==null&&(pt(e,t),kf(e))}function bf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),yf(e,n)}function xf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),yf(e,n)}function Sf(e,t){return Le(e,t)}var Cf=null,wf=null,Tf=!1,Ef=!1,Df=!1,Of=0;function kf(e){e!==wf&&e.next===null&&(wf===null?Cf=wf=e:wf=wf.next=e),Ef=!0,Tf||(Tf=!0,If())}function Af(e,t){if(!Df&&Ef){Df=!0;do for(var n=!1,r=Cf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-$e(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Ff(r,a))}else a=J,a=st(r,r===ed?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,Ff(r,a))}r=r.next}while(n);Df=!1}}function jf(){Mf()}function Mf(){Ef=Tf=!1;var e=0;Of!==0&&yp()&&(e=Of);for(var t=Ve(),n=null,r=Cf;r!==null;){var i=r.next,a=Nf(r,t);a===0?(r.next=null,n===null?Cf=i:n.next=i,i===null&&(wf=n)):(n=r,(e!==0||a&3)&&(Ef=!0)),r=i}xd!==0&&xd!==5||Af(e,!1),Of!==0&&(Of=0)}function Nf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-$e(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ut(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ed,n=J,n=st(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(td===2||td===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Re(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ct(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Re(r),yt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=Pf.bind(null,e),n=Le(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Re(r),e.callbackPriority=2,e.callbackNode=null,2}function Pf(e,t){if(xd!==0&&xd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(pf()&&e.callbackNode!==n)return null;var r=J;return r=st(e,e===ed?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ld(e,r,t),Nf(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?Pf.bind(null,e):null)}function Ff(e,t){if(pf())return null;Ld(e,t,!0)}function If(){wp(function(){K&6?Le(Ue,jf):Mf()})}function Lf(){if(Of===0){var e=za;e===0&&(e=rt,rt<<=1,!(rt&261888)&&(rt=256)),Of=e}return Of}function Rf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function zf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Rf((i[wt]||null).action),o=r.submitter;o&&(t=(t=o[wt]||null)?Rf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Of!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Bf=0;Bf<hi.length;Bf++){var Vf=hi[Bf];gi(Vf.toLowerCase(),`on`+(Vf[0].toUpperCase()+Vf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Ht(`onMouseEnter`,[`mouseout`,`mouseover`]),Ht(`onMouseLeave`,[`mouseout`,`mouseover`]),Ht(`onPointerEnter`,[`pointerout`,`pointerover`]),Ht(`onPointerLeave`,[`pointerout`,`pointerover`]),Vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Hf=`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(` `),Uf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Hf));function Wf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}}}}function Y(e,t){var n=t[Et];n===void 0&&(n=t[Et]=new Set);var r=e+`__bubble`;n.has(r)||(Jf(t,e,2,!1),n.add(r))}function Gf(e,t,n){var r=0;t&&(r|=4),Jf(n,e,r,t)}var Kf=`_reactListening`+Math.random().toString(36).slice(2);function qf(e){if(!e[Kf]){e[Kf]=!0,zt.forEach(function(t){t!==`selectionchange`&&(Uf.has(t)||Gf(t,!1,e),Gf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Kf]||(t[Kf]=!0,Gf(`selectionchange`,!1,t))}}function Jf(e,t,n,r){switch(Eh(t)){case 2:var i=bh;break;case 8:i=xh;break;default:i=Sh}n=i.bind(null,t,n,e),i=void 0,!kn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Yf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Nt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}En(function(){var r=a,i=xn(n),s=[];a:{var c=mi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case si:case ci:case li:l=Xn;break;case pi:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Dn(m,p),g!=null&&d.push(Xf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Nt(u)||u[Tt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Nt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ft(c),h=l==null?u:Ft(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Nt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Qf):null,c!==null&&$f(s,u,c,d,!1),l!==null&&f!==null&&$f(s,f,l,d,!0)))}a:{if(c=r?Ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ar;else if(wr(c)){if(jr)_=Br;else{_=Rr;var v=Lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Ar):_=zr;if(_&&=_(e,r)){Tr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ft(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(s,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(s,n,i)}var y;if(fr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=Zf(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=Zf(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),zf(s,e,r,n,i)}Wf(s,t)})}function Xf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Dn(e,n),i!=null&&r.unshift(Xf(e,i,a)),i=Dn(e,t),i!=null&&r.push(Xf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Qf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Dn(n,a),l!=null&&o.unshift(Xf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(Xf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ep=/\r\n?/g,tp=/\u0000|\uFFFD/g;function np(e){return(typeof e==`string`?e:``+e).replace(ep,`
10
- `).replace(tp,``)}function rp(e,t){return t=np(t),np(e)===t}function ip(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ip(e,t,`name`,a.name,a,null),ip(e,t,`formEncType`,a.formEncType,a,null),ip(e,t,`formMethod`,a.formMethod,a,null),ip(e,t,`formTarget`,a.formTarget,a,null)):(ip(e,t,`encType`,a.encType,a,null),ip(e,t,`method`,a.method,a,null),ip(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&Y(`scroll`,e);return;case`onScrollEnd`:r!=null&&Y(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=vn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Y(`beforetoggle`,e),Y(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}R=!0}function ap(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&Y(`scroll`,e);return;case`onScrollEnd`:r!=null&&Y(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}R=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}R=!0}function op(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Y(`error`,e),Y(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ip(e,t,o,s,n,null)}}a&&ip(e,t,`srcSet`,n.srcSet,n,null),r&&ip(e,t,`src`,n.src,n,null);return;case`input`:Y(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:ip(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Y(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ip(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in Y(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:ip(e,t,s,c,n,null)}un(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ip(e,t,l,r,n,null)}return;case`dialog`:Y(`beforetoggle`,e),Y(`toggle`,e),Y(`cancel`,e),Y(`close`,e);break;case`iframe`:case`object`:Y(`load`,e);break;case`video`:case`audio`:for(r=0;r<Hf.length;r++)Y(Hf[r],e);break;case`image`:Y(`error`,e),Y(`load`,e);break;case`details`:Y(`toggle`,e);break;case`embed`:case`source`:case`link`:Y(`error`,e),Y(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ip(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&ap(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ip(e,t,c,r,n,null))}var sp={};function cp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ip(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(R=!0),o=m;break;case`name`:m!==f&&(R=!0),a=m;break;case`checked`:m!==f&&(R=!0),u=m;break;case`defaultChecked`:m!==f&&(R=!0),d=m;break;case`value`:m!==f&&(R=!0),s=m;break;case`defaultValue`:m!==f&&(R=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ip(e,t,p,m,r,f)}}an(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ip(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(R=!0),p=o;break;case`defaultValue`:o!==l&&(R=!0),c=o;break;case`multiple`:o!==l&&(R=!0),s=o;default:o!==l&&ip(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ip(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(R=!0),p=a;break;case`defaultValue`:a!==o&&(R=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ip(e,t,s,a,r,o)}ln(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ip(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(R=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ip(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ip(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:ip(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&ap(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||ap(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ip(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ip(e,t,f,p,r,m)}function lp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function up(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&lp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&lp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var dp=null,fp=null;function pp(e){return e.nodeType===9?e:e.ownerDocument}function mp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function hp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function gp(e,t,n,r){return n=pp(n).createElement(e),n[Ct]=r,n[wt]=t,op(n,e,t),Lt(n),n}function _p(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var vp=null;function yp(){var e=window.event;return e&&e.type===`popstate`?e!==vp&&(vp=e,!0):(vp=null,!1)}var bp=typeof setTimeout==`function`?setTimeout:void 0,xp=typeof clearTimeout==`function`?clearTimeout:void 0,Sp=typeof Promise==`function`?Promise:void 0,Cp=typeof requestAnimationFrame==`function`?requestAnimationFrame:bp,wp=typeof queueMicrotask==`function`?queueMicrotask:Sp===void 0?bp:function(e){return Sp.resolve(null).then(e).catch(Tp)};function Tp(e){setTimeout(function(){throw e})}function Ep(e){return e===`head`}function Dp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Gh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)xm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,xm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&xm(e.ownerDocument.body)}n=i}while(n);Gh(t)}function Op(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function kp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ap(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function jp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Mp(e){return jp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Np(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return jp(t,n,e)}function Pp(e){return e.documentElement.clientHeight}function Fp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Ip(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Pp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=eh(f),u>rh){s.length=o;break}f=new Promise(Fp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Lp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Lp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Lp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Lp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Rp(e){return{name:e,group:new Lp(`group`,e),imagePair:new Lp(`image-pair`,e),old:new Lp(`old`,e),new:new Lp(`new`,e)}}function zp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}zp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Wp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Hp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Bp,e,s,r)}this._eventListeners=a}};function Bp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}zp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Wp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Hp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Vp,e,n,i),r.splice(t,1),a!==null&&a()}};function Vp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Hp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Up(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Wp(e,t,n,r){if(e.length===0)return-1;r=Up(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Up(a.optionsOrUseCapture)===r)return i}return-1}zp.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},zp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag!==6&&(e=_(e),_m(e,t))}zp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Kp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Gp(t[n],e);n--);};function Kp(e,t){return t.push(e),!1}zp.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=pp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,qp,e,void 0,void 0))};function qp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}zp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}zp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,Yp,e,void 0,void 0);for(var n=t=0;n<Xp.length;n++){var r=Xp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Xp[t++]=r}Xp.length=t}};function Yp(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var Xp=[],Zp=!1;function Qp(e,t,n){Xp.push({fragmentInstance:e,observer:t,instance:n}),Zp||(Zp=!0,vm(function(){Zp=!1;var e=Xp;Xp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}zp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,$p,e,void 0,void 0),e};function $p(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}zp.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},zp.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Kp,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||em(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function em(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,w),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,w),t===null?t=!1:(f(t,!0,S,a,r),a=v,y=v=null,t=a!==null)),t):!1}function tm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}zp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Kp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),tm(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),tm(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function nm(e,t){return e=_(e),rm(e,t),!1}function rm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function im(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Xp.length;i++){var a=Xp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Xp[r++]=a)}Xp.length=r,n.observe(e)}),rm(e,t))}function am(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Qp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function om(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:om(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[At])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pm(e.nextSibling),e===null)break}return null}function cm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pm(e.nextSibling),e===null))return null;return e}function lm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pm(e.nextSibling),e===null))return null;return e}function um(e){return e.data===`$?`||e.data===`$~`}function dm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function fm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pm(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var mm=null;function hm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _m(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function vm(e){Cp(function(){Cp(function(t){return e(t)})})}function ym(e,t,n){switch(t=pp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function bm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ip(e,t,r,null,sp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Mt(e)}function xm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var Sm=new Map,Cm=new Set;function wm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Tm=I.d;I.d={f:Em,r:Dm,D:Am,C:jm,L:Mm,m:Nm,X:Fm,S:Pm,M:Im};function Em(){var e=Tm.f(),t=Vd();return e||t}function Dm(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):Tm.r(e)}var Om=typeof document>`u`?null:document;function km(e,t,n){var r=Om;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cm.has(i)||(Cm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),op(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Am(e){Tm.D(e),km(`dns-prefetch`,e,null)}function jm(e,t){Tm.C(e,t),km(`preconnect`,e,t)}function Mm(e,t,n){Tm.L(e,t,n);var r=Om;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Rm(e);break;case`script`:a=Hm(e)}if(!(Sm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zm(a))||t===`script`&&r.querySelector(Um(a))))){var o=r.createElement(`link`);op(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function Nm(e,t){Tm.m(e,t);var n=Om;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hm(e)}if(!Sm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Sm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Um(a)))return}r=n.createElement(`link`),op(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Pm(e,t,n){Tm.S(e,t,n);var r=Om;if(r&&e){var i=It(r).hoistableStyles,a=Rm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sm.get(a))&&Km(e,n);var c=o=r.createElement(`link`);Lt(c),op(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Gm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Fm(e,t){Tm.X(e,t);var n=Om;if(n&&e){var r=It(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Lt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Im(e,t){Tm.M(e,t);var n=Om;if(n&&e){var r=It(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Lt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lm(e,t,n,r){var a=(a=Ce.current)?wm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Rm(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Rm(n.href);var o=It(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(zm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Sm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sm.set(e,o)),Vm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Hm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Rm(e){return`href="`+rn(e)+`"`}function zm(e){return`link[rel="stylesheet"][`+e+`]`}function Bm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Vm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),op(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Hm(e){return`[src="`+rn(e)+`"]`}function Um(e){return`script[async]`+e}function Wm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),op(r,`style`,a),Gm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Rm(n.href);var o=e.querySelector(zm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Bm(n),(a=Sm.get(a))&&Km(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),op(o,`link`,r),t.state.loading|=4,Gm(o,n.precedence,e),t.instance=o;case`script`:return o=Hm(n.src),(a=e.querySelector(Um(o)))?(t.instance=a,Lt(a),a):(r=n,(a=Sm.get(o))&&(r=D({},n),qm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),op(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Gm(r,n.precedence,e));return t.instance}function Gm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Km(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jm=null;function Ym(e,t,n){if(Jm===null){var r=new Map,i=Jm=new Map;i.set(n,r)}else i=Jm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[At]||a[Ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Xm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Qm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function $m(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function eh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function th(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=eh(t),e.suspenseyImages.push(t)),e=sh.bind(e),t.decode().then(e,e))}function nh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Rm(r.href),a=t.querySelector(zm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=oh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Bm(r),(i=Sm.get(i))&&Km(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),op(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=oh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rh=0;function ih(e,t){return e.stylesheets&&e.count===0&&lh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rh===0&&(rh=62500*up());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ah(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function oh(){this.count--,ah(this)}function sh(){this.imgCount--,ah(this)}var ch=null;function lh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ch=new Map,t.forEach(uh,e),ch=null,oh.call(e))}function uh(e,t){if(!(t.state.loading&4)){var n=ch.get(e);if(n)var r=n.get(null);else{n=new Map,ch.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=oh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var dh={$$typeof:te,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function fh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function ph(e,t,n,r,i,a,o,s,c,l,u,d){return e=new fh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Ma(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ho(a),e}function mh(e){return e?(e=ji,e):ji}function hh(e,t,n,r,i,a){i=mh(i),r.context===null?r.context=i:r.pendingContext=i,r=_o(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=vo(e,r,t),n!==null&&(Id(n,e,t),yo(n,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _h(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function vh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Id(t,e,67108864),_h(e,67108864)}}function X(e){if(e.tag===13||e.tag===31){var t=Nd();t=vt(t);var n=Oi(e,t);n!==null&&Id(n,e,t),_h(e,t)}}var yh=!0;function bh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,Sh(e,t,n,r)}finally{I.p=a,F.T=i}}function xh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,Sh(e,t,n,r)}finally{I.p=a,F.T=i}}function Sh(e,t,n,r){if(yh){var i=Ch(r);if(i===null)Yf(e,t,r,wh,n),Fh(e,r);else if(Lh(i,e,t,n,r))r.stopPropagation();else if(Fh(e,r),t&4&&-1<Ph.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}kf(a),!(K&6)&&(vd=Ve()+500,Af(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Id(s,a,2),Vd(),_h(a,2)}if(a=Ch(r),a===null&&Yf(e,t,r,wh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Yf(e,t,r,null,n)}}function Ch(e){return e=xn(e),Th(e)}var wh=null;function Th(e){if(wh=null,e=Nt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 wh=e,null}function Eh(e){switch(e){case`beforetoggle`: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`seeked`:case`submit`:case`toggle`: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`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Dh=!1,Oh=null,kh=null,Ah=null,jh=new Map,Mh=new Map,Nh=[],Ph=`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`.split(` `);function Fh(e,t){switch(e){case`focusin`:case`focusout`:Oh=null;break;case`dragenter`:case`dragleave`:kh=null;break;case`mouseover`:case`mouseout`:Ah=null;break;case`pointerover`:case`pointerout`:jh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mh.delete(t.pointerId)}}function Ih(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pt(t),t!==null&&vh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lh(e,t,n,r,i){switch(t){case`focusin`:return Oh=Ih(Oh,e,t,n,r,i),!0;case`dragenter`:return kh=Ih(kh,e,t,n,r,i),!0;case`mouseover`:return Ah=Ih(Ah,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jh.set(a,Ih(jh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mh.set(a,Ih(Mh.get(a)||null,e,t,n,r,i)),!0}return!1}function Rh(e){var t=Nt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,xt(e.priority,function(){X(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){X(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 zh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ch(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Pt(n),t!==null&&vh(t),e.blockedOn=n,!1;t.shift()}return!0}function Bh(e,t,n){zh(e)&&n.delete(t)}function Vh(){Dh=!1,Oh!==null&&zh(Oh)&&(Oh=null),kh!==null&&zh(kh)&&(kh=null),Ah!==null&&zh(Ah)&&(Ah=null),jh.forEach(Bh),Mh.forEach(Bh)}function Hh(e,n){e.blockedOn===n&&(e.blockedOn=null,Dh||(Dh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vh)))}var Uh=null;function Wh(e){Uh!==e&&(Uh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Uh===e&&(Uh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Th(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gh(e){function t(t){return Hh(t,e)}Oh!==null&&Hh(Oh,e),kh!==null&&Hh(kh,e),Ah!==null&&Hh(Ah,e),jh.forEach(t),Mh.forEach(t);for(var n=0;n<Nh.length;n++){var r=Nh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Nh.length&&(n=Nh[0],n.blockedOn===null);)Rh(n),n.blockedOn===null&&Nh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[wt]||null;if(typeof a==`function`)o||Wh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(Th(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wh(n)}}}function Kh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function qh(e){this._internalRoot=e}Jh.prototype.render=qh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;hh(n,Nd(),e,t,null,null)},Jh.prototype.unmount=qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hh(e.current,2,null,e,null,null),Vd(),t[Tt]=null}};function Jh(e){this._internalRoot=e}Jh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nh.length&&t!==0&&t<Nh[n].priority;n++);Nh.splice(n,0,e),n===0&&Rh(e)}};var Yh=n.version;if(Yh!==`19.3.1`)throw Error(i(527,Yh,`19.3.1`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Xh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zh.isDisabled&&Zh.supportsFiber)try{Xe=Zh.inject(Xh),Ze=Zh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Cc,s=wc,c=Tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ph(e,1,!1,null,null,n,r,null,o,s,c,Kh),e[Tt]=t.current,qf(e),new qh(t)}})),D=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=E()})),O=e(x(),1),k=D(),A=e=>JSON.stringify({...e,source:void 0});function j(e,t,n){let r=new Set(t.map(n));return[...t,...e.filter(e=>!r.has(n(e)))]}var M=e=>e.id,ee=e=>`${e.service}\0${e.environment}\0${e.target}`;function N(e,t){return{...t,teams:j(e.teams,t.teams,M),environments:j(e.environments,t.environments,M),projects:j(e.projects,t.projects,M),elements:j(e.elements,t.elements,M),relationships:j(e.relationships,t.relationships,A),targets:j(e.targets,t.targets,M),deployments:j(e.deployments,t.deployments,ee),views:j(e.views,t.views,M),adrs:j(e.adrs,t.adrs,M)}}var te=[`team`,`environment`,`project`,`element`,`relationship`,`target`,`deployment`,`view`,`adr`];function ne(e,t){let n=[],r=(e,t,r)=>se(e,ae(t,r,e=>e.id),e=>e.id,n);r(`team`,e.teams,t.teams),r(`environment`,e.environments,t.environments),r(`project`,e.projects,t.projects),r(`element`,e.elements,t.elements),se(`relationship`,oe(e.relationships,t.relationships),re,n),r(`target`,e.targets,t.targets),se(`deployment`,ae(e.deployments,t.deployments,ie),ie,n),r(`view`,e.views,t.views),r(`adr`,e.adrs,t.adrs);let i={changed:0,removed:1,added:2};return n.sort((e,t)=>te.indexOf(e.kind)-te.indexOf(t.kind)||ue(e.id,t.id)||i[e.type]-i[t.type])}var re=e=>e.id??`${e.from} -> ${e.to}`,ie=e=>`${e.service} in ${e.environment} on ${e.target}`;function ae(e,t,n){let r=e=>{let t=new Map;for(let r of e)t.set(n(r),[...t.get(n(r))??[],r]);return t},i=r(e),a=r(t),o=new Set,s=[];for(let[e,t]of i){let n=a.get(e);t.length===1&&n?.length===1&&(s.push([t[0],n[0]]),o.add(t[0]).add(n[0]))}return{pairs:s,removed:e.filter(e=>!o.has(e)),added:t.filter(e=>!o.has(e))}}function oe(e,t){let n=e=>e.filter(e=>e.id!==null),r=ae(n(e),n(t),e=>e.id),i=new Set(r.pairs.flat()),a=e.filter(e=>!i.has(e)),o=t.filter(e=>!i.has(e)),s=[...r.pairs],c=new Set(i),l=(e,t)=>{let n=t=>t.reduce((t,n)=>t.set(e(n),(t.get(e(n))??0)+1),new Map),[r,i]=[n(a),n(o)],l=new Map;for(let t of o)c.has(t)||l.set(e(t),[...l.get(e(t))??[],t]);for(let n of a){if(c.has(n)||t&&(r.get(e(n))!==1||i.get(e(n))!==1))continue;let a=l.get(e(n))?.shift();a&&(s.push([n,a]),c.add(n).add(a))}};return l(e=>le(ce(e)),!1),l(e=>JSON.stringify([e.from,e.to]),!0),l(e=>JSON.stringify([e.from,e.to,e.technology,e.interaction]),!0),{pairs:s,removed:e.filter(e=>!c.has(e)),added:t.filter(e=>!c.has(e))}}function se(e,t,n,r){for(let[i,a]of t.pairs){let t=ce(i),o=ce(a),s=[...new Set([...Object.keys(t),...Object.keys(o)])].filter(e=>le(t[e])!==le(o[e]));s.length>0&&r.push({type:`changed`,kind:e,id:n(a),fields:s,before:t,after:o})}for(let i of t.removed)r.push({type:`removed`,kind:e,id:n(i),fields:[],before:ce(i),after:null});for(let i of t.added)r.push({type:`added`,kind:e,id:n(i),fields:[],before:null,after:ce(i)})}function ce(e){return Object.fromEntries(Object.entries(e).filter(([e])=>e!==`source`))}function le(e){return JSON.stringify(e,(e,t)=>typeof t==`object`&&t&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>ue(e,t))):t)}var ue=(e,t)=>e<t?-1:+(e>t);function de(e,t,n,r={}){let i=N(e,t),a=new g(i),o=f(i,a,n,r);if(!o)return;let[s,c]=[e,t].map(e=>f(e,new g(e),n,r)),l=new Set(ne(e,t).filter(e=>e.kind===`element`).map(e=>e.id)),u=e=>[...l].some(t=>t!==e&&a.ancestry(t).includes(e)),d=(e,t)=>[s,c].map(n=>new Map((n?e(n):[]).map(e=>[t(e),e]))),[p,m]=d(e=>e.nodes,e=>e.id),h=e=>`${e.from}\0${e.to}`,[_,v]=d(e=>e.edges,h),y=(e,t,n)=>t&&!e?`added`:e&&!t?`removed`:n()?`changed`:`unchanged`;for(let e of o.nodes)e.change=y(p.has(e.id),m.has(e.id),()=>l.has(e.id)||e.collapsed&&u(e.id));let b=e=>(e?.relationships.map(A).sort()??[]).join(`
9
+ `+e.stack}}var Ie=Object.prototype.hasOwnProperty,Le=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function Qe(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var $e=Math.clz32?Math.clz32:nt,et=Math.log,tt=Math.LN2;function nt(e){return e>>>=0,e===0?32:31-(et(e)/tt|0)|0}var rt=256,it=262144,at=4194304;function ot(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function st(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ot(n))):i=ot(o):i=ot(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ot(n))):i=ot(o)):i=ot(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-$e(n),i=1<<r;t|=e[r],n&=~i}return t}function ut(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dt(){var e=at;return at<<=1,!(at&62914560)&&(at=4194304),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-$e(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ht(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ht(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-$e(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$e(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function _t(e,t){var n=t&-t;return n=n&42?1:vt(n),(n&(e.suspendedLanes|t))===0?n:0}function vt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function yt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:Eh(e.type)):e}function xt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var St=Math.random().toString(36).slice(2),Ct=`__reactFiber$`+St,wt=`__reactProps$`+St,Tt=`__reactContainer$`+St,Et=`__reactEvents$`+St,Dt=`__reactListeners$`+St,Ot=`__reactHandles$`+St,kt=`__reactResources$`+St,At=`__reactMarker$`+St,jt=`__reactLoad$`+St;function Mt(e){delete e[Ct],delete e[wt],delete e[Dt],delete e[Ot]}function Nt(e){var t;if(t=e[Ct])return t;for(var n=e.parentNode;n;){if(t=n[Tt]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gm(e);e!==null;){if(n=e[Ct])return n;e=gm(e)}return t}e=n,n=e.parentNode}return null}function Pt(e){if(e=e[Ct]||e[Tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function It(e){var t=e[kt];return t||=e[kt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Lt(e){e[At]=!0}function Rt(e){e[jt]=void 0}var zt=new Set,Bt={};function Vt(e,t){Ht(e,t),Ht(e+`Capture`,t)}function Ht(e,t){for(Bt[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Ut=RegExp(`^[: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]*$`),Wt={},Gt={};function Kt(e){return Ie.call(Gt,e)?!0:Ie.call(Wt,e)?!1:Ut.test(e)?Gt[e]=!0:(Wt[e]=!0,!1)}var R=!1;function qt(){var e=R;return R=!1,e}function Jt(e,t,n){if(Kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Yt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Xt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Zt(s):e.removeAttribute(`name`)}function on(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Zt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ln(e,t,n){t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function pn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,R=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),R=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(e){if(e.indexOf(`-`)===-1)return!1;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 gn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),_n=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Pt(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[wt]||null;if(!a)throw Error(i(90));an(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Vd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[wt]||null;if(r===null)return null;n=r[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Nn=i.slice(e,1<r?1-r:void 0)}function Fn(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 In(){return!0}function Ln(){return!1}function Rn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?In:Ln,this.isPropagationStopped=Ln,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=D({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=D({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,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!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(D({},Kn,{dataTransfer:0})),Yn=Rn(D({},Vn,{relatedTarget:0})),Xn=Rn(D({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(D({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(D({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={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`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(D({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(D({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(D({},zn,{submitter:0})),sr=Rn(D({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(D({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(D({},Kn,{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})),ur=Rn(D({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=On&&`CompositionEvent`in window,pr=null;On&&`documentMode`in document&&(pr=document.documentMode);var mr=On&&`TextEvent`in window&&!pr,hr=On&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!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 hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={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 wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=Zf(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){Wf(e,0)}function kr(e){if(tn(Ft(e)))return e}function Ar(e,t){if(e===`change`)return t}var jr=!1;if(On){var Mr;if(On){var Nr=`oninput`in document;if(!Nr){var Pr=document.createElement(`div`);Pr.setAttribute(`oninput`,`return;`),Nr=typeof Pr.oninput==`function`}Mr=Nr}else Mr=!1;jr=Mr&&(!document.documentMode||9<document.documentMode)}function Fr(){Er&&(Er.detachEvent(`onpropertychange`,Ir),Dr=Er=null)}function Ir(e){if(e.propertyName===`value`&&kr(Dr)){var t=[];Tr(t,Dr,e,xn(e)),En(Or,t)}}function Lr(e,t,n){e===`focusin`?(Fr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&Fr()}function Rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return kr(Dr)}function zr(e,t){if(e===`click`)return kr(t)}function Br(e,t){if(e===`input`||e===`change`)return kr(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)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 i=n[r];if(!Ie.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(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}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Yr(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`)}var Xr=On&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(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}),$r&&Ur($r,r)||($r=r,r=Zf(Qr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};On&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Vt(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Sd.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ad;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-$e(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<jd)throw jd=0,Md=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(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.refCleanup=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 Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(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&1206910976,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.refCleanup=e.refCleanup,n}function Ii(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=Zm(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Ni(31,n,t,a),e.elementType=se,e.lanes=o,e;case j:return Ri(n.children,a,o,t);case M:s=8,a|=24;break;case ee:return e=Ni(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case ie:return e=Ni(13,n,t,a),e.elementType=ie,e.lanes=o,e;case ae:return e=Ni(19,n,t,a),e.elementType=ae,e.lanes=o,e;case ce:case ue:return e=a|32,e=Ni(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ne:s=10;break a;case te:s=9;break a;case re:s=11;break a;case N:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Fe(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Fe(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-$e(r)-1;r&=~(1<<i),n+=1;var a=32-$e(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-$e(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,z=null,B=!1,aa=null,oa=!1,sa=Error(i(519));function ca(e){throw ma(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),sa}function la(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[wt]=r,n){case`dialog`:Y(`cancel`,t),Y(`close`,t);break;case`iframe`:case`object`:case`embed`:Y(`load`,t);break;case`video`:case`audio`:for(n=0;n<Hf.length;n++)Y(Hf[n],t);break;case`source`:Y(`error`,t);break;case`img`:case`image`:case`link`:Y(`error`,t),Y(`load`,t);break;case`details`:Y(`toggle`,t);break;case`input`:Y(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Y(`invalid`,t);break;case`textarea`:Y(`invalid`,t),un(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||rp(t.textContent,n)?(r.popover!=null&&(Y(`beforetoggle`,t),Y(`toggle`,t)),r.onScroll!=null&&Y(`scroll`,t),r.onScrollEnd!=null&&Y(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||ca(e,!0)}function ua(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:ia=ia.return}}function da(e){if(e!==ia)return!1;if(!B)return ua(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||_p(e.type,e.memoizedProps)),n=!n),n&&z&&ca(e),ua(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));z=hm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));z=hm(e)}else t===27?(t=z,Ep(e.type)?(e=mm,mm=null,z=e):z=t):z=ia?pm(e.stateNode.nextSibling):null;return!0}function fa(){z=ia=null,B=!1}function pa(){var e=aa;return e!==null&&(md===null?md=e:md.push.apply(md,e),aa=null),e}function ma(e){aa===null?aa=[e]:aa.push(e)}var ha=ye(null),ga=null,_a=null;function va(e,t,n){xe(ha,t._currentValue),t._currentValue=n}function ya(e){e._currentValue=ha.current,be(ha)}function ba(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function xa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ba(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ba(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ba(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Sa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===we.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[dh]:e.push(dh))}a=a.return}return e!==null&&xa(t,e,n,r),t.flags|=262144,e!==null}function Ca(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wa(e){ga=e,_a=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ta(e){return Da(ga,e)}function Ea(e,t){return ga===null&&wa(e),Da(e,t)}function Da(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},_a===null){if(e===null)throw Error(i(308));_a=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _a=_a.next=t;return n}var Oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ka=t.unstable_scheduleCallback,Aa=t.unstable_NormalPriority,ja={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ma(){return{controller:new Oa,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&ka(Aa,function(){e.controller.abort()})}function Pa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Fa=null;function Ia(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var La=null,Ra=0,za=0,Ba=null;function Va(e,t){if(La===null){var n=La=[];Ra=0,za=Lf(),Ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ra++,t.then(Ha,Ha),t}function Ha(){if(--Ra===0&&(Fa=null,La!==null)){Ba!==null&&(Ba.status=`fulfilled`);var e=La;La=null,za=0,Ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Wa=F.S;F.S=function(e,t){if(_d=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&Va(e,t),Fa!==null)for(var n=Cf;n!==null;)Pa(n,Fa),n=n.next;if(n=e.types,n!==null){for(var r=Cf;r!==null;)Pa(r,n),r=r.next;if(za!==0){r=Fa,r===null&&(r=Fa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Wa!==null&&Wa(e,t)};var Ga=ye(null);function Ka(){var e=Ga.current;return e===null?ed.pooledCache:e}function qa(e,t){t===null?xe(Ga,Ga.current):xe(Ga,t.pool)}function Ja(){var e=Ka();return e===null?null:{parent:ja._currentValue,pool:e}}var Ya=Error(i(460)),Xa=Error(i(474)),Za=Error(i(542)),Qa={then:function(){}};function $a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function eo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=ed,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e}throw no=t,Ya}}function to(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(no=e,Ya):e}}var no=null;function ro(){if(no===null)throw Error(i(459));var e=no;return no=null,e}function io(e){if(e===Ya||e===Za)throw Error(i(483))}var ao=null,oo=0;function so(e){var t=oo;return oo+=1,ao===null&&(ao=[]),eo(ao,e,t)}function co(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function lo(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function uo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Fi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),co(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&to(i)===t.type)?(t=a(t,n.props),co(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),co(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Vi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Ri(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Li(t.type,t.key,t.props,null,e.mode,n),co(n,t),n.return=e,n;case A:return t=Vi(t,e.mode,n),t.return=e,t;case oe:return t=to(t),f(e,t,n)}if(he(t)||P(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,so(t),n);if(t.$$typeof===ne)return f(e,Ea(e,t),n);lo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case oe:return n=to(n),p(e,t,n,r)}if(he(n)||P(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,so(n),r);if(n.$$typeof===ne)return p(e,t,Ea(e,n),r);lo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=to(r),m(e,t,n,r,i)}if(he(r)||P(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,so(r),i);if(r.$$typeof===ne)return m(e,t,n,Ea(t,r),i);lo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),B&&$i(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return B&&$i(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),B&&$i(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),B&&$i(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return B&&$i(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),B&&$i(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),co(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&to(l)===r.type){n(e,r.sibling),c=a(r,o.props),co(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ri(o.props.children,e.mode,c,o.key),co(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),co(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=to(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(P(o)){if(l=P(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,so(o),c);if(o.$$typeof===ne)return _(e,r,Ea(e,o),c);lo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{oo=0;var i=_(e,t,n,r);return ao=null,i}catch(t){if(t===Ya||t===Za)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var fo=uo(!0),po=uo(!1),mo=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function yo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}function bo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var xo=!1;function So(){if(xo){var e=Ba;if(e!==null)throw e}}function Co(e,t,n,r){xo=!1;var i=e.updateQueue;mo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===za&&(xo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:mo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),cd|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wo(n[e],t)}var Eo=ye(null),Do=ye(0);function Oo(e,t){e=od,xe(Do,e),xe(Eo,t),od=e|t.baseLanes}function ko(){xe(Do,od),xe(Eo,Eo.current)}function Ao(){od=Do.current,be(Eo),be(Do)}var jo=ye(null),Mo=null;function No(e){var t=e.alternate;xe(Ro,Ro.current&1),xe(jo,e),Mo===null&&(t===null||Eo.current!==null||t.memoizedState!==null)&&(Mo=e)}function Po(e){xe(Ro,Ro.current),xe(jo,e),Mo===null&&(Mo=e)}function Fo(e){e.tag===22?(xe(Ro,Ro.current),xe(jo,e),Mo===null&&(Mo=e)):Io()}function Io(){xe(Ro,Ro.current),xe(jo,jo.current)}function Lo(e){be(jo),Mo===e&&(Mo=null),be(Ro)}var Ro=ye(0);function zo(e,t){xe(jo,jo.current),xe(Ro,t)}function Bo(e){be(Ro),be(jo),Mo===e&&(Mo=null)}function Vo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||um(n)||dm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Ho=0,V=null,H=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(i(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Ho=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?hc:gc,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){F.H=mc;var t=H!==null&&H.next!==null;if(Ho=0,Uo=H=V=null,Wo=!1,Jo=0,Yo=null,t)throw Error(i(300));e===null||Nc||(e=e.dependencies,e!==null&&Ca(e)&&(Nc=!0))}function ts(e,t,n,r){V=e;var a=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=a)throw Error(i(301));if(a+=1,Uo=H=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=_c,o=t(n,r)}while(Go);return o}function ns(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(H===null?null:H.memoizedState)!==e&&(V.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Ho=0,Uo=H=V=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?V.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(H===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=H.next;var t=Uo===null?V.memoizedState:Uo.next;if(t!==null)Uo=t,H=e;else{if(e===null)throw V.alternate===null?Error(i(467)):Error(i(310));H=e,e={memoizedState:H.memoizedState,baseState:H.baseState,baseQueue:H.baseQueue,queue:H.queue,next:null},Uo===null?V.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=eo(Yo,e,t),t=V,(Uo===null?t.memoizedState:Uo.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?hc:gc),e}function us(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===de)return;if(e.$$typeof===ne)return Ta(e)}throw Error(i(438,String(e)))}function ds(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=cs(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=le;return t.index++,n}function fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(ss(),H,e)}function ms(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ho&f)===f:(J&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===za&&(d=!0);else if((Ho&p)===p){u=u.next,p===za&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,V.lanes|=p,cd|=p;f=u.action,Ko&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,V.lanes|=f,cd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(Nc=!0,d&&(n=Ba,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function hs(e){var t=ss(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Hr(o,t.memoizedState)||(Nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function gs(e,t,n){var r=V,a=ss(),o=B;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Hr((H||a).memoizedState,n);if(s&&(a.memoizedState=n,Nc=!0),a=a.queue,Bs(vs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Uo!==null&&!!(Uo.memoizedState.tag&1),Fs(e?9:8,{destroy:void 0},U.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ed===null)throw Error(i(349));o||Ho&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=cs(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function U(e,t,n,r){t.value=n,t.getSnapshot=r,ys(t)&&bs(e)}function vs(e,t,n){return n(function(){ys(t)&&bs(e)})}function ys(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function bs(e){var t=Oi(e,2);t!==null&&Id(t,e,2)}function xs(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){Qe(!0);try{n()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},t}function Ss(e,t,n,r){return e.baseState=n,ms(e,H,typeof r==`function`?r:fs)}function Cs(e,t,n,r,a){if(dc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,ws(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ws(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};o.types=a===null?null:a.types,F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Ts(e,t,s)}catch(n){Ds(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Ts(e,t,a)}catch(n){Ds(e,t,n)}}function Ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Es(e,t,n)},function(n){return Ds(e,t,n)}):Es(e,t,n)}function Es(e,t,n){t.status=`fulfilled`,t.value=n,Os(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,ws(e,n)))}function Ds(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Os(t),t=t.next;while(t!==r)}e.action=null}function Os(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ks(e,t){return t}function As(e,t){if(B){var n=ed.formState;if(n!==null){a:{var r=V;if(B){if(z){b:{for(var i=z,a=oa;i.nodeType!==8;)if(!a||(i=pm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){z=pm(i.nextSibling),r=i.data===`F!`;break a}}ca(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:t},n.queue=r,n=cc.bind(null,V,r),r.dispatch=n,r=xs(!1),a=uc.bind(null,V,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Cs.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function js(e){return Ms(ss(),H,e)}function Ms(e,t,n){if(t=ms(e,t,ks)[0],e=ps(fs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ls(t)}catch(e){throw e===Ya?Za:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.flags|=2048,Fs(9,{destroy:void 0},Ns.bind(null,i,n),null)),[r,a,e]}function Ns(e,t){e.action=t}function Ps(e){var t=ss(),n=H;if(n!==null)return Ms(t,n,e);ss(),t=t.memoizedState,n=ss();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Fs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=V.updateQueue,t===null&&(t=cs(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Is(){return ss().memoizedState}function Ls(e,t,n,r){var i=os();V.flags|=e,i.memoizedState=Fs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Rs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;H!==null&&r!==null&&Qo(r,H.memoizedState.deps)?i.memoizedState=Fs(t,a,n,r):(V.flags|=e,i.memoizedState=Fs(1|t,a,n,r))}function zs(e,t){Ls(8390656,8,e,t)}function Bs(e,t){Rs(2048,8,e,t)}function Vs(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=cs(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Hs(e){var t=ss().memoizedState;return Vs({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Us(e,t){return Rs(4,2,e,t)}function Ws(e,t){return Rs(4,4,e,t)}function Gs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ks(e,t,n){n=n==null?null:n.concat([e]),Rs(4,4,Gs.bind(null,t,e),n)}function qs(){}function Js(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ys(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r}function Xs(e,t,n){return n===void 0||Ho&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=Pd(),V.lanes|=e,cd|=e,n)}function Zs(e,t,n,r){return Hr(n,t)?n:Eo.current===null?!(Ho&106)||Ho&1073741824&&!(J&261930)?(Nc=!0,e.memoizedState=n):(e=Pd(),V.lanes|=e,cd|=e,t):(e=Xs(e,n,r),Hr(e,t)||(Nc=!0),e)}function Qs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};s.types=o===null?null:o.types,F.T=s,uc(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?lc(e,t,Ua(c,r),Nd(e)):lc(e,t,r,Nd(e))}catch(n){lc(e,t,{then:function(){},status:`rejected`,reason:n},Nd())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function $s(){}function ec(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=tc(e).queue;Qs(e,a,t,ge,n===null?$s:function(){return nc(e),n(r)})}function tc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function nc(e){var t=tc(e);t.next===null&&(t=e.alternate.memoizedState),lc(e,t.next.queue,{},Nd())}function rc(){return Ta(dh)}function ic(){return ss().memoizedState}function ac(){return ss().memoizedState}function oc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Nd();e=_o(n);var r=vo(t,e,n);r!==null&&(Id(r,t,n),yo(r,t,n)),t={cache:Ma()},e.payload=t;return}t=t.return}}function sc(e,t,n){var r=Nd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},dc(e)?fc(t,n):(n=Di(e,t,n,r),n!==null&&(Id(n,e,r),pc(n,t,r)))}function cc(e,t,n){lc(e,t,n,Nd())}function lc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(dc(e))fc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Hr(s,o))return Ei(e,t,i,0),ed===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Id(n,e,r),pc(n,t,r),!0}return!1}function uc(e,t,n,r){if(r={lane:2,revertLane:Lf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},dc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&Id(t,e,2)}function dc(e){var t=e.alternate;return e===V||t!==null&&t===V}function fc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var mc={readContext:Ta,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},hc={readContext:Ta,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:Ta,useEffect:zs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ls(4194308,4,Gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ls(4194308,4,e,t)},useInsertionEffect:function(e,t){Ls(4,2,e,t)},useMemo:function(e,t){var n=os();t=t===void 0?null:t;var r=e();if(Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){Qe(!0);try{n(t)}finally{Qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=sc.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=xs(e);var t=e.queue,n=cc.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:qs,useDeferredValue:function(e,t){return Xs(os(),e,t)},useTransition:function(){var e=xs(!1);return e=Qs.bind(null,V,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,a=os();if(B){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ed===null)throw Error(i(349));J&127||_s(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,zs(vs.bind(null,r,o,e),[e]),r.flags|=2048,Fs(9,{destroy:void 0},U.bind(null,r,o,n,t),null),n},useId:function(){var e=os(),t=ed.identifierPrefix;if(B){var n=Qi,r=Zi;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:rc,useFormState:As,useActionState:As,useOptimistic:function(e){var t=os();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=uc.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return os().memoizedState=oc.bind(null,V)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},gc={readContext:Ta,use:us,useCallback:Js,useContext:Ta,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:ps,useRef:Is,useState:function(){return ps(fs)},useDebugValue:qs,useDeferredValue:function(e,t){return Zs(ss(),H.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ic,useHostTransitionStatus:rc,useFormState:js,useActionState:js,useOptimistic:function(e,t){return Ss(ss(),H,e,t)},useMemoCache:ds,useCacheRefresh:ac,useEffectEvent:Hs},_c={readContext:Ta,use:us,useCallback:Js,useContext:Ta,useEffect:Bs,useImperativeHandle:Ks,useInsertionEffect:Us,useLayoutEffect:Ws,useMemo:Ys,useReducer:hs,useRef:Is,useState:function(){return hs(fs)},useDebugValue:qs,useDeferredValue:function(e,t){var n=ss();return H===null?Xs(n,e,t):Zs(n,H.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ic,useHostTransitionStatus:rc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e,t){var n=ss();return H===null?(n.baseState=e,[e,n.queue.dispatch]):Ss(n,H,e,t)},useMemoCache:ds,useCacheRefresh:ac,useEffectEvent:Hs};function vc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Nd(),i=_o(r);i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Id(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Nd(),i=_o(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Id(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Nd(),r=_o(n);r.tag=2,t!=null&&(r.callback=t),t=vo(e,r,n),t!==null&&(Id(t,e,n),yo(t,e,n))}};function bc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ur(n,r)||!Ur(i,a):!0}function xc(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&&yc.enqueueReplaceState(t,t.state,null)}function Sc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Cc(e){xi(e)}function wc(e){console.error(e)}function Tc(e){xi(e)}function Ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Dc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Oc(e,t,n){return n=_o(n),n.tag=3,n.payload={element:null},n.callback=function(){Ec(e,t)},n}function kc(e){return e=_o(e),e.tag=3,e}function Ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Dc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Dc(t,n,r),typeof i!=`function`&&(bd===null?bd=new Set([this]):bd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function jc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Sa(t,n,a,!0),n=jo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Mo===null?Jd():n.alternate===null&&sd===0&&(sd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),_f(e,r,a)),!1;case 22:return n.flags|=65536,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),_f(e,r,a)),!1}throw Error(i(435,n.tag))}return _f(e,r,a),Jd(),!1}if(B)return t=jo.current,t===null?(r!==sa&&(t=Error(i(423),{cause:r}),ma(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=Oc(e.stateNode,r,a),bo(e,a),sd!==4&&(sd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==sa&&(e=Error(i(422),{cause:r}),ma(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),pd===null?pd=[o]:pd.push(o),sd!==4&&(sd=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,r,e),bo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(bd===null||!bd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=kc(a),Ac(a,e,n,r),bo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Mc=Error(i(461)),Nc=!1;function Pc(e,t,n,r){t.child=e===null?po(t,null,n,r):fo(t,e.child,n,r)}function Fc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return wa(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Nc?(is(e,t,i),ll(e,t,i)):(B&&s&&ta(t),t.flags|=1,Pc(e,t,r,i),t.child)}function Ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Lc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ul(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return ll(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(Nc=!1,t.pendingProps=r=a,ul(e,i))e.flags&131072&&(Nc=!0);else return t.lanes=e.lanes,ll(e,t,i)}}return Gc(e,t,n,r,i)}function Rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Bc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qa(t,a===null?null:a.cachePool),a===null?ko():Oo(t,a),Fo(t);else return r=t.lanes=536870912,Bc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&qa(t,null),ko(),Io()):(qa(t,a.cachePool),Oo(t,a),Io(),t.memoizedState=null);return Pc(e,t,i,n),t.child}function zc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bc(e,t,n,r,i){var a=Ka();return a=a===null?null:{parent:ja._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&qa(t,null),ko(),Fo(t),e!==null&&Sa(e,t,r,!0),t.childLanes=i,null}function Vc(e,t){return t=el({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Hc(e,t,n){return fo(t,e.child,null,n),e=Vc(t,t.pendingProps),e.flags|=2,Lo(t),t.memoizedState=null,e}function Uc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(B){if(r.mode===`hidden`)return e=Vc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},zc(null,e);if(Po(t),(e=z)?(e=lm(e,oa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,z=null)):e=null,e===null)throw ca(t);return t.lanes=536870912,null}return Vc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Po(t),a){if(t.flags&256)t.flags&=-257,t=Hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Nc||Sa(e,t,n,!1),a=(n&e.childLanes)!==0,Nc||a){if(Eo.current===null){if(r=ed,r!==null&&(s=_t(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),Id(r,e,s),Mc;Jd()}t=Hc(e,t,n)}else e=o.treeContext,z=pm(s.nextSibling),ia=t,B=!0,aa=null,oa=!1,e!==null&&ra(t,e),t=Vc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Gc(e,t,n,r,i){return wa(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Nc?(is(e,t,i),ll(e,t,i)):(B&&r&&ta(t),t.flags|=1,Pc(e,t,n,i),t.child)}function Kc(e,t,n,r,i,a){return wa(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Nc?(is(e,t,a),ll(e,t,a)):(B&&r&&ta(t),t.flags|=1,Pc(e,t,n,a),t.child)}function qc(e,t,n,r,i){if(wa(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=yc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ho(t),o=n.contextType,a.context=typeof o==`object`&&o?Ta(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(vc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&yc.enqueueReplaceState(a,a.state,null),Co(t,r,a,i),So(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Sc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&xc(t,a,r,o),mo=!1;var f=t.memoizedState;a.state=f,Co(t,r,a,i),So(),l=t.memoizedState,s||f!==l||mo?(typeof d==`function`&&(vc(t,n,d,r),l=t.memoizedState),(c=mo||bc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,go(e,t),o=t.memoizedProps,u=Sc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&xc(t,a,r,c),mo=!1,f=t.memoizedState,a.state=f,Co(t,r,a,i),So();var p=t.memoizedState;o!==d||f!==p||mo||e!==null&&e.dependencies!==null&&Ca(e.dependencies)?(typeof s==`function`&&(vc(t,n,s,r),p=t.memoizedState),(u=mo||bc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ca(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Wc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=fo(t,e.child,null,i),t.child=fo(t,null,n,i)):Pc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ll(e,t,i),e}function Jc(e,t,n,r){return fa(),t.flags|=256,Pc(e,t,n,r),t.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Ja()}}function Zc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=dd),e}function Qc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ro.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(B){if(i?No(t):Io(),(e=z)?(e=lm(e,oa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,z=null)):e=null,e===null)throw ca(t);return t.lanes=dm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Io(),i=t.mode,a=el({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Xc(n),r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(null,r)):(No(t),$c(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return nl(e,t,a,o,r,c,s,n)}return i?(Io(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,zc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Xc(n):(a=i.cachePool,a===null?a=Ja():(s=ja._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Zc(e,o,n),t.memoizedState=Yc,zc(e.child,r)):(No(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function $c(e,t){return t=el({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function el(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function tl(e,t,n){return fo(t,e.child,null,n),e=$c(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(No(t),t.flags&=-257,tl(e,t,c)):t.memoizedState===null?(Io(),o=a.fallback,s=t.mode,a=el({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,fo(t,e.child,null,c),a=t.child,a.memoizedState=Xc(c),a.childLanes=Zc(e,r,c),t.memoizedState=Yc,zc(null,a)):(Io(),t.child=e.child,t.flags|=128,null);if(No(t),dm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ma({value:a,source:null,stack:null})),tl(e,t,c)}if(Nc||Sa(e,t,c,!1),r=(c&e.childLanes)!==0,Nc||r){if(Eo.current!==null)return tl(e,t,c);if(r=ed,r!==null&&(a=_t(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),Id(r,e,a),Mc;return um(o)||Jd(),tl(e,t,c)}return um(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,z=pm(o.nextSibling),ia=t,B=!0,aa=null,oa=!1,e!==null&&ra(t,e),t=$c(t,a.children),t.flags|=134221824,t)}function rl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ba(e.return,t,n)}function il(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Vo(n)===null&&(t=e),e=e.sibling}return t}function al(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function ol(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function sl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ro.current;if(t.flags&128)return zo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,zo(t,o),i===`backwards`&&e!==null?(ol(e),Pc(e,t,r,n),ol(e)):Pc(e,t,r,n),r=B?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rl(e,n,t);else if(e.tag===19)rl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ol(t)),al(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}al(t,!0,n,null,a,r);break;case`together`:al(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=il(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),al(t,!1,i,n,a,r)}return t.child}function cl(e,t,n){var r=t.pendingProps;return va(t,t.type,r.value),Pc(e,t,r.children,n),t.child}function ll(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),cd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Sa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ul(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ca(e)))}function dl(e,t,n){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),va(t,ja,e.memoizedState.cache),fa();break;case 27:case 5:De(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:va(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Po(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return No(t),t.flags|=128,null;r=Sa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Qc(e,t,n):(No(t),e=ll(e,t,n),e===null?null:e.sibling)}No(t);break;case 19:if(t.flags&128)return sl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Sa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return sl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),zo(t,Ro.current),r)break;return null;case 22:return t.lanes=0,Rc(e,t,n,t.pendingProps);case 24:va(t,ja,e.memoizedState.cache)}return ll(e,t,n)}function fl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Nc=!0;else{if(!ul(e,n)&&!(t.flags&128))return Nc=!1,dl(e,t,n);Nc=!!(e.flags&131072)}}else Nc=!1,B&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=to(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=Sc(e,r),t.tag=1,t=qc(null,t,e,r,n)):(t.tag=0,t=Gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===re){t.tag=11,t=Fc(null,t,e,r,n);break a}if(a===N){t.tag=14,t=Ic(null,t,e,r,n);break a}if(a===ne){t.tag=10,t.type=e,t=cl(null,t,n);break a}}throw t=me(e)||e,Error(i(306,t,``))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Sc(r,t.pendingProps),qc(e,t,r,a,n);case 3:a:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,go(e,t),Co(t,r,null,n);var s=t.memoizedState;if(r=s.cache,va(t,ja,r),r!==o.cache&&xa(t,[ja],n,!0),So(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Jc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ma(a),t=Jc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(z=pm(e.firstChild),ia=t,B=!0,aa=null,oa=!0,n=po(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(fa(),r===a){t=ll(e,t,n);break a}Pc(e,t,r,n)}t=t.child}return t;case 26:return Wc(e,t),e===null?(n=Lm(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(t.stateNode=gp(t.type,t.pendingProps,Ce.current,t)):t.memoizedState=Lm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&B&&(r=t.stateNode=ym(t.type,t.pendingProps,Ce.current),ia=t,oa=!0,a=z,Ep(t.type)?(mm=a,z=pm(r.firstChild)):z=a),Pc(e,t,t.pendingProps.children,n),Wc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((a=r=z)&&(r=sm(r,t.type,t.pendingProps,oa),r===null?a=!1:(t.stateNode=r,ia=t,z=pm(r.firstChild),oa=!1,a=!0)),a||ca(t)),De(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,_p(a,o)?r=null:s!==null&&_p(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=$o(e,t,ns,null,null,n),dh._currentValue=a),Wc(e,t),Pc(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=z)&&(n=cm(n,t.pendingProps,oa),n===null?e=!1:(t.stateNode=n,ia=t,z=null,e=!0)),e||ca(t)),null;case 13:return Qc(e,t,n);case 4:return Te(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fo(t,null,r,n):Pc(e,t,r,n),t.child;case 11:return Fc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Wc(e,t),Pc(e,t,r,n),t.child;case 8:return Pc(e,t,t.pendingProps.children,n),t.child;case 12:return Pc(e,t,t.pendingProps.children,n),t.child;case 10:return cl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,wa(t),a=Ta(a),r=r(a),t.flags|=1,Pc(e,t,r,n),t.child;case 14:return Ic(e,t,t.type,t.pendingProps,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 19:return sl(e,t,n);case 31:return Uc(e,t,n);case 22:return Rc(e,t,n,t.pendingProps);case 24:return wa(t),r=Ta(ja),e===null?(a=Ka(),a===null&&(a=ed,o=Ma(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ho(t),va(t,ja,a)):((e.lanes&n)!==0&&(go(e,t),Co(t,null,null,n),So()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,va(t,ja,r),r!==a.cache&&xa(t,[ja],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),va(t,ja,r))),Pc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:B&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Wc(e,t),Pc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function pl(e){e.flags|=4}function ml(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Qm(t,r):Qm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Gd())e.flags|=8192;else throw no=Qa,Xa}}else e.flags&=-16777217}function hl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!$m(t)){if(Gd())e.flags|=8192;else throw no=Qa,Xa}}function gl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:dt(),e.lanes|=t,fd|=t)}function _l(e,t){if(!B)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function vl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function yl(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vl(t),null;case 1:return vl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ya(ja),Ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(da(t)?pl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pa())),vl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(pl(t),o===null?(vl(t),ml(t,a,null,r,n)):(vl(t),hl(t,o))):o?o===e.memoizedState?(vl(t),t.flags&=-16777217):(pl(t),vl(t),hl(t,o)):(e=e.memoizedProps,e!==r&&pl(t),vl(t),ml(t,a,e,r,n)),null;case 27:if(Oe(t),n=Ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}e=Se.current,da(t)?la(t,e):(e=ym(a,r,n),t.stateNode=e,pl(t))}return vl(t),t.subtreeFlags&=-33554433,null;case 5:if(Oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return vl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,da(t))la(t,o);else{var s=pp(Ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Ct]=t,o[wt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(op(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&pl(t)}}return vl(t),t.subtreeFlags&=-33554433,ml(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&pl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ce.current,da(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||rp(e.nodeValue,n)),e||ca(t,!0)}else e=pp(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return vl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=da(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Ct]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),e=!1}else n=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lo(t),t):(Lo(t),null);if(t.flags&128)throw Error(i(558))}return vl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=da(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Ct]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vl(t),a=!1}else a=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Lo(t),t):(Lo(t),null)}return Lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),gl(t,t.updateQueue),vl(t),null);case 4:return Ee(),e===null&&qf(t.stateNode.containerInfo),t.flags|=67108864,vl(t),null;case 10:return ya(t.type),vl(t),null;case 19:if(Bo(t),r=t.memoizedState,r===null)return vl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)_l(r,!1);else{if(sd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Vo(e),o!==null){for(t.flags|=128,_l(r,!1),e=o.updateQueue,t.updateQueue=e,gl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return zo(t,Ro.current&1|2),B&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>vd&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Vo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,gl(t,e),_l(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!B)return vl(t),null}else 2*Ve()-r.renderingStartTime>vd&&n!==536870912&&(t.flags|=128,a=!0,_l(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=Ro.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||B?zo(t,o):(n=o,xe(jo,t),xe(Ro,n),Mo===null&&(Mo=t)),B&&$i(t,r.treeForkCount),e}return vl(t),null;case 22:case 23:return Lo(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(vl(t),t.subtreeFlags&6&&(t.flags|=8192)):vl(t),n=t.updateQueue,n!==null&&gl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&be(Ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ya(ja),vl(t),null;case 25:return null;case 30:return t.flags|=33554432,vl(t),null}throw Error(i(156,t.tag))}function bl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(ja),Ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(Lo(t),t.alternate===null)throw Error(i(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ee(),null;case 10:return ya(t.type),null;case 22:case 23:return Lo(t),Ao(),e!==null&&be(Ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(ja),null;case 25:return null;default:return null}}function xl(e,t){switch(na(t),t.tag){case 3:ya(ja),Ee();break;case 26:case 27:case 5:Oe(t);break;case 4:Ee();break;case 31:t.memoizedState!==null&&Lo(t);break;case 13:Lo(t);break;case 19:Bo(t);break;case 10:ya(t.type);break;case 22:case 23:Lo(t),Ao(),e!==null&&be(Ga);break;case 24:ya(ja)}}function Sl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){gf(t,t.return,e)}}function Cl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){gf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){gf(t,t.return,e)}}function wl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){gf(e,e.return,t)}}}function Tl(e,t,n){n.props=Sc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){gf(e,t,n)}}function El(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Rp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new zp(e);f(e.child,!1,nm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){gf(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){gf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){gf(e,t,n)}else n.current=null}}function Ol(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)im(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&im(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&am(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){gf(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;cp(r,e.type,n,t),r[wt]=t}catch(t){gf(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ep(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(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.tag===27&&Ep(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),Ol(e,r),R=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Ep(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),R=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Ep(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);op(t,r,n),t[Ct]=e,t[wt]=n}catch(t){gf(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Mp(o);r.push(s),s.view&&(a=!0)}else a||Mp(o).view&&(a=!0);Bl=!0,kp(o,Gl===0?t:t+`_`+Gl,n),Gl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Ap(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Jl(e.child,t),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Fd(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Fd(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Fd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Fd(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=Mp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&kp(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Np)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Fd(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,ou=!1,W=!1,su=!1,cu=typeof WeakSet==`function`?WeakSet:Set,lu=null,uu=!1,G=!1,du=!1,fu=!1;function pu(e,t,n){if(e=e.containerInfo,dp=yh,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(fp={focusedElem:e,selectionRange:r},yh=!1,n=(n&335544064)===n,lu=t,t=n?9270:1024;lu!==null;){if(e=lu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),mu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),mu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),mu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,lu=r):(n&&$l(e),mu(n))}}Vl=null}function mu(e){for(;lu!==null;){var t=lu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Sc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){gf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)om(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:om(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=bi(a.default,a.update),a!==`none`&&Kl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,lu=r;break}lu=t.return}}function hu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Fu(e,n),r&4&&Sl(5,n);break;case 1:if(Fu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){gf(n,n.return,e)}else{var i=Sc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){gf(n,n.return,e)}}}r&64&&wl(n),r&512&&El(n,n.return);break;case 3:if(Fu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{To(e,t)}catch(e){gf(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Fu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Fu(e,n);break;case 31:Fu(e,n),r&4&&wu(e,n);break;case 13:Fu(e,n),r&4&&Tu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=bf.bind(null,n),fm(e,n))));break;case 22:if(r=n.memoizedState!==null||au,!r){var a=t!==null&&t.memoizedState!==null||ou;t=au,i=ou,au=r,(ou=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Lu(e,n,r)):Fu(e,n),au=t,ou=i}break;case 30:Fu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Fu(e,n)}}function gu(e,t){for(e=e.child;e!==null;)_u(e,t),e=e.sibling}function _u(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){gf(e,e.return,t)}vu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,R=!0}catch(t){gf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Op(s,!0):Op(e.stateNode,!1)}catch(t){gf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&gu(e,t);break;default:gu(e,t)}}function vu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:_u(n,r);break a;case 22:n.memoizedState===null&&vu(n,r);break a;default:vu(n,r)}}e=e.sibling}}function yu(e){var t=e.alternate;t!==null&&(e.alternate=null,yu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var bu=null,xu=!1;function Su(e,t,n){for(n=n.child;n!==null;)Cu(e,t,n),n=n.sibling}function Cu(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:ou||Dl(n,t),Su(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ou&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ou||Dl(n,t),Al(n);var r=bu,i=xu;Ep(n.type)&&(bu=n.stateNode,xu=!1),Su(e,t,n),bm(n.stateNode,n.type,n.memoizedProps),bu=r,xu=i;break;case 5:ou||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=bu,i=xu,bu=null,Su(e,t,n),bu=r,xu=i,bu!==null){if(xu)try{(bu.nodeType===9?bu.body:bu.nodeName===`HTML`?bu.ownerDocument.body:bu).removeChild(n.stateNode),R=!0}catch(e){gf(n,t,e)}else try{bu.removeChild(n.stateNode),R=!0}catch(e){gf(n,t,e)}}break;case 18:bu!==null&&(xu?(e=bu,Dp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Gh(e)):Dp(bu,n.stateNode));break;case 4:r=bu,i=xu,bu=n.stateNode.containerInfo,xu=!0,Su(e,t,n),bu=r,xu=i;break;case 0:case 11:case 14:case 15:Cl(2,n,t),ou||Cl(4,n,t),Su(e,t,n);break;case 1:ou||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),Su(e,t,n);break;case 21:Su(e,t,n);break;case 22:ou=(r=ou)||n.memoizedState!==null,Su(e,t,n),ou=r;break;case 30:Dl(n,t),Su(e,t,n);break;case 7:ou||Dl(n,t),Su(e,t,n);break;default:Su(e,t,n)}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gh(e)}catch(e){gf(t,t.return,e)}}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gh(e)}catch(e){gf(t,t.return,e)}}function Eu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cu),t;default:throw Error(i(435,e.tag))}}function Du(e,t){var n=Eu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=xf.bind(null,e,t);t.then(r,r)}})}function Ou(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Ep(l.type)){bu=l.stateNode,xu=!1;break a}break;case 5:bu=l.stateNode,xu=!1;break a;case 3:case 4:bu=l.stateNode.containerInfo,xu=!0;break a}l=l.return}if(bu===null)throw Error(i(160));Cu(s,c,o),bu=null,xu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Au(t,e,n),t=t.sibling}var ku=null;function Au(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Ou(t,e,n),ju(e),a&4&&(Cl(3,e,e.return),Sl(3,e),Cl(5,e,e.return));break;case 1:Ou(t,e,n),ju(e),a&512&&(ou||r===null||Dl(r,r.return)),a&64&&au&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=ku,Ou(t,e,n),ju(e),a&512&&(ou||r===null||Dl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(au)e.stateNode=gp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[At]||r[Ct]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),op(r,t,n),r[Ct]=e,Lt(r),t=r;break a;case`link`:if(o=Ym(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),op(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Ym(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),op(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Ct]=e,Lt(r),t=r}e.stateNode=t}}else au||Xm(o,e.type,e.stateNode)}else e.stateNode=Wm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ou||t.parentNode.removeChild(t)):a.count--,n===null?au||Xm(o,e.type,e.stateNode):Wm(o,n,e.memoizedProps))}break;case 27:Ou(t,e,n),ju(e),a&512&&(ou||r===null||Dl(r,r.return)),r!==null&&a&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=W,W=!1,Ou(t,e,n),W=o,ju(e),a&512&&(ou||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),R=!0}catch(t){gf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),a&1024&&(su=!0);break;case 6:if(Ou(t,e,n),ju(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,R=!0}catch(t){gf(e,e.return,t)}}break;case 3:if(R=!1,Jm=null,o=ku,ku=wm(t.containerInfo),Ou(t,e,n),ku=o,ju(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Gh(t.containerInfo)}catch(t){gf(e,e.return,t)}su&&(su=!1,Mu(e)),R=!1;break;case 4:a=W,W=au,r=qt(),o=ku,ku=wm(e.stateNode.containerInfo),Ou(t,e,n),ju(e),ku=o,R&&G&&(du=!0),R=r,W=a;break;case 12:Ou(t,e,n),ju(e);break;case 31:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 13:Ou(t,e,n),ju(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(gd=Ve()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=ou,u=W;au=c||o,W=u||o,ou=l||s,Ou(t,e,n),ou=l,W=u,au=c,ju(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||au||ou||(t=s||ou,n=au,r=ou,au=o||au,ou=t,Iu(e,2),au=n,ou=r),!o&&W||gu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Du(e,n))));break;case 19:Ou(t,e,n),ju(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Du(e,t)));break;case 30:a&512&&(ou||r===null||Dl(r,r.return)),a=qt(),o=G,s=(n&335544064)===n,c=e.memoizedProps,G=s&&bi(c.default,c.update)!==`none`,Ou(t,e,n),ju(e),s&&r!==null&&R&&(e.flags|=4),G=o,R=a;break;case 21:break;case 7:a&512&&(ou||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ou(t,e,n),ju(e)}}function ju(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ml(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(jl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(i(161))}}catch(t){gf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,yh=!0,t.reset(),yh=!1),e=e.sibling}}function Nu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pu(t,e),t=t.sibling;else iu(t,!1)}function Pu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(fu=uu=!1,Wl(),Nu(t,e),!uu&&!du){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ap(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),fu=!0}Ul=null;break;case 5:Nu(t,e);break;case 4:r=uu,uu=!1,Nu(t,e),uu&&(du=!0),uu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Nu(t,e):Xl(e,!1));break;case 30:r=uu,i=Wl(),uu=!1,Nu(t,e),uu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Fd(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),uu=e.flags&32?!0:r;break;default:Nu(t,e)}}function Fu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hu(e,t.alternate,t),t=t.sibling}function Iu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Cl(4,n,n.return),Iu(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Iu(n,r);break;case 27:r&2&&bm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Iu(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ou||i.parentNode.removeChild(i),Iu(n,r);break;case 22:n.memoizedState===null&&Iu(n,r);break;case 30:Dl(n,n.return),Iu(n,r);break;case 7:Dl(n,n.return);default:Iu(n,r)}e=e.sibling}}function Lu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Lu(i,a,n),Sl(4,a);break;case 1:if(Lu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){gf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)wo(l[i],c)}catch(e){gf(r,r.return,e)}}s&&o&64&&wl(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),Lu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||Xm(wm(c.ownerDocument),a.type,c),Lu(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:Lu(i,a,n);break;case 31:Lu(i,a,n),s&&o&4&&wu(i,a);break;case 13:Lu(i,a,n),s&&o&4&&Tu(i,a);break;case 22:a.memoizedState===null&&Lu(i,a,n),El(a,a.return);break;case 30:Lu(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:Lu(i,a,n)}t=t.sibling}}function Ru(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Na(n))}function zu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e))}function Bu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Vu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Vu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Bu(e,t,n,r),a&2048&&Sl(9,t);break;case 1:Bu(e,t,n,r);break;case 3:Bu(e,t,n,r),i&&fu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Na(a)));break;case 12:if(a&2048){Bu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){gf(t,t.return,e)}}else Bu(e,t,n,r);break;case 31:Bu(e,t,n,r);break;case 13:Bu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&tu(t),o._visibility&2?Bu(e,t,n,r):(o._visibility|=2,Hu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Bu(e,t,n,r):Uu(e,t)),a&2048&&Ru(s,t);break;case 24:Bu(e,t,n,r),a&2048&&zu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Bu(e,t,n,r);break;default:Bu(e,t,n,r)}}function Hu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Hu(a,o,s,c,i),Sl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Hu(a,o,s,c,i)):u._visibility&2?Hu(a,o,s,c,i):Uu(a,o),i&&l&2048&&Ru(o.alternate,o);break;case 24:Hu(a,o,s,c,i),i&&l&2048&&zu(o.alternate,o);break;default:Hu(a,o,s,c,i)}t=t.sibling}}function Uu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Uu(n,r),i&2048&&Ru(r.alternate,r);break;case 24:Uu(n,r),i&2048&&zu(r.alternate,r);break;default:Uu(n,r)}t=t.sibling}}var Wu=8192;function Gu(e,t,n){if(e.subtreeFlags&Wu)for(e=e.child;e!==null;)Ku(e,t,n),e=e.sibling}function Ku(e,t,n){switch(e.tag){case 26:Gu(e,t,n),e.flags&Wu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&th(n,e)):nh(n,ku,e.memoizedState,e.memoizedProps));break;case 5:Gu(e,t,n),e.flags&Wu&&(e=e.stateNode,(t&335544128)===t&&th(n,e));break;case 3:case 4:var r=ku;ku=wm(e.stateNode.containerInfo),Gu(e,t,n),ku=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Wu,Wu=16777216,Gu(e,t,n),Wu=r):Gu(e,t,n));break;case 30:if((e.flags&Wu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}Gu(e,t,n);break;default:Gu(e,t,n)}}function qu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ju(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Zu(r,e)}qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Yu(e),e=e.sibling}function Yu(e){switch(e.tag){case 0:case 11:case 15:Ju(e),e.flags&2048&&Cl(9,e,e.return);break;case 3:Ju(e);break;case 12:Ju(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ju(e);break;default:Ju(e)}}function Xu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Zu(r,e)}qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cl(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function Zu(e,t){for(;lu!==null;){var n=lu;switch(n.tag){case 0:case 11:case 15:Cl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,lu=r;else a:for(n=e;lu!==null;){r=lu;var i=r.sibling,a=r.return;if(yu(r),r===n){lu=null;break a}if(i!==null){i.return=a,lu=i;break a}lu=a}}}var Qu={getCacheForType:function(e){var t=Ta(ja),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ta(ja).controller.signal}},$u=typeof WeakMap==`function`?WeakMap:Map,K=0,ed=null,q=null,J=0,td=0,nd=null,rd=!1,id=!1,ad=!1,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=0,pd=null,md=null,hd=!1,gd=0,_d=0,vd=1/0,yd=null,bd=null,xd=0,Sd=null,Cd=null,wd=0,Td=0,Ed=null,Dd=null,Od=null,kd=null,Ad=null,jd=0,Md=null;function Nd(){return K&2&&J!==0?J&-J:F.T===null?bt():Lf()}function Pd(){if(dd===0){if(!(J&536870912)||B){var e=it;it<<=1,!(it&3932160)&&(it=262144),dd=e}else dd=536870912}return e=jo.current,e!==null&&(e.flags|=32),dd}function Fd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Rp(vi(e.memoizedProps,n))),kd===null&&(kd=[]),kd.push(t.bind(null,r))}}function Id(e,t,n){(e===ed&&(td===2||td===9)||e.cancelPendingCommit!==null)&&(Ud(e,0),Bd(e,J,dd,!1)),pt(e,n),K&2&&e===ed||(e===ed&&(!(K&2)&&(ld|=n),sd===4&&Bd(e,J,dd,!1)),kf(e))}function Ld(e,t,n){if(K&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ct(e,t),a=r?Zd(e,t):Yd(e,t,!0),o=r;do{if(a===0){id&&!r&&Bd(e,t,0,!1);break}if(n=e.current.alternate,o&&!zd(n))a=Yd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=pd;var l=c.current.memoizedState.isDehydrated;if(l&&(Ud(c,s).flags|=256),s=Yd(c,s,!1),s!==2&&s!==6){if(ad&&!l){c.errorRecoveryDisabledLanes|=o,ld|=o,a=4;break a}o=md,md=a,o!==null&&(md===null?md=o:md.push.apply(md,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Ud(e,0),Bd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Bd(r,t,dd,!rd);break a;case 2:md=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=gd+300-Ve(),10<a)){if(Bd(r,t,dd,!rd),st(r,0,!0)!==0)break a;wd=t,r.timeoutHandle=bp(Rd.bind(null,r,n,md,yd,hd,t,dd,ld,fd,rd,o,`Throttled`,-0,0),a);break a}Rd(r,n,md,yd,hd,t,dd,ld,fd,rd,o,null,-0,0)}break}}while(1);kf(e)}function Rd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Vl=null,Ku(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=oh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?gd-Ve():(a&4194048)===a?_d-Ve():0,m=ih(d,m),m!==null)?(wd=a,e.cancelPendingCommit=m(af.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Bd(e,a,o,!l)):af(e,t,a,n,r,i,o,s,c,l,u,d)}function zd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Hr(a(),i))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 Bd(e,t,n,r){t=lt(e,t),t&=~ud,t&=~ld,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-$e(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ht(e,n,t)}function Vd(){return K&6?!0:(Af(0,!1),!1)}function Hd(){if(q!==null){if(td===0)var e=q.return;else e=q,_a=ga=null,as(e),ao=null,oo=0,e=q;for(;e!==null;)xl(e.alternate,e),e=e.return;q=null}}function Ud(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,xp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),wd=0,Hd(),ed=e,q=n=Fi(e.current,null),J=t,td=0,nd=null,rd=!1,id=ct(e,t),ad=!1,fd=dd=ud=ld=cd=sd=0,md=pd=null,hd=!1,od=lt(e,t),Ti(),n}function Wd(e,t){V=null,F.H=mc,t===Ya||t===Za?(t=ro(),td=3):t===Xa?(t=ro(),td=4):td=t===Mc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,nd=t,q===null&&(sd=1,Ec(e,Ui(t,e.current)))}function Gd(){var e=jo.current;return e===null?!0:(J&4194048)===J?Mo===null:(J&62914560)===J||J&536870912?e===Mo:!1}function Kd(){var e=F.H;return F.H=mc,e===null?mc:e}function qd(){var e=F.A;return F.A=Qu,e}function Jd(){sd=4,rd||(J&4194048)!==J&&jo.current!==null||(id=!0),!(cd&134217727)&&!(ld&134217727)||ed===null||Bd(ed,J,dd,!1)}function Yd(e,t,n){var r=K;K|=2;var i=Kd(),a=qd();(ed!==e||J!==t)&&(yd=null,Ud(e,t)),t=!1;var o=sd;a:do try{if(td!==0&&q!==null){var s=q,c=nd;switch(td){case 8:Hd(),o=6;break a;case 3:case 2:case 9:case 6:jo.current===null&&(t=!0);var l=td;if(td=0,nd=null,tf(e,s,c,l),n&&id){o=0;break a}break;default:l=td,td=0,nd=null,tf(e,s,c,l)}}Xd(),o=sd;break}catch(t){Wd(e,t)}while(1);return t&&e.shellSuspendCounter++,_a=ga=null,K=r,F.H=i,F.A=a,q===null&&(ed=null,J=0,Ti()),o}function Xd(){for(;q!==null;)$d(q)}function Zd(e,t){var n=K;K|=2;var r=Kd(),a=qd();ed!==e||J!==t?(yd=null,vd=Ve()+500,Ud(e,t)):id=ct(e,t);a:do try{if(td!==0&&q!==null){t=q;var o=nd;b:switch(td){case 1:td=0,nd=null,tf(e,t,o,1);break;case 2:case 9:if($a(o)){td=0,nd=null,ef(t);break}t=function(){td!==2&&td!==9||ed!==e||(td=7),kf(e)},o.then(t,t);break a;case 3:td=7;break a;case 4:td=5;break a;case 7:$a(o)?(td=0,nd=null,ef(t)):(td=0,nd=null,tf(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?$m(s):c.stateNode.complete){td=0,nd=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,nf(u))}break b}}td=0,nd=null,tf(e,t,o,5);break;case 6:td=0,nd=null,tf(e,t,o,6);break;case 8:Hd(),sd=6;break a;default:throw Error(i(462))}}Qd();break}catch(t){Wd(e,t)}while(1);return _a=ga=null,F.H=r,F.A=a,K=n,q===null?(ed=null,J=0,Ti(),sd):0}function Qd(){for(;q!==null&&!ze();)$d(q)}function $d(e){var t=fl(e.alternate,e,od);e.memoizedProps=e.pendingProps,t===null?nf(e):q=t}function ef(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Kc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=Kc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:as(t);var r=t;r===ia&&(B?(ua(r),r.tag===5&&r.stateNode!=null&&(z=r.stateNode)):(ua(r),B=!0));default:xl(n,t),t=q=Ii(t,od),t=fl(n,t,od)}e.memoizedProps=e.pendingProps,t===null?nf(e):q=t}function tf(e,t,n,r){_a=ga=null,as(t),ao=null,oo=0;var i=t.return;try{if(jc(e,i,t,n,J)){sd=1,Ec(e,Ui(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;sd=1,Ec(e,Ui(n,e.current)),q=null;return}t.flags&32768?(B||r===1?e=!0:id||J&536870912?e=!1:(rd=e=!0,(r===2||r===9||r===3||r===6)&&(r=jo.current,r!==null&&r.tag===13&&(r.flags|=16384))),rf(t,e)):nf(t)}function nf(e){var t=e;do{if(t.flags&32768){rf(t,rd);return}e=t.return;var n=yl(t.alternate,t,od);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);sd===0&&(sd=5)}function rf(e,t){do{var n=bl(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);sd=6,q=null}function af(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do pf();while(xd!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ed&&(q=ed=null,J=0),Cd=t,Sd=e,wd=n,Ed=a,Dd=r,of(e,t,n,s,c,l,f)}}function of(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Td=s,s|=wi,mt(e,n,s,r,i,a),kd=null,(n&335544064)===n?(Ad=Ia(e),r=10262):(Ad=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Sf(Ge,function(){return mf(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=I.p,I.p=2,a=K,K|=4;try{pu(e,t,n)}finally{K=a,I.p=i,F.T=r}}xd=1,Bl?Od=Ip(o,e.containerInfo,Ad,lf,uf,cf,df,mf,sf,null,null):(lf(),uf(),df())}function sf(e){if(xd!==0){var t=Sd.onRecoverableError;t(e,{componentStack:null})}}function cf(){xd===3&&(xd=0,Pu(Cd,Sd),xd=4)}function lf(){if(xd===1){xd=0;var e=Sd,t=Cd,n=wd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=F.T,F.T=null;var i=I.p;I.p=2;var a=K;K|=4;try{G=du=!1,Au(t,e,n),n=fp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Kr(s,h),v=Kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}yh=!!dp,fp=dp=null}finally{K=a,I.p=i,F.T=r}}e.current=t,xd=2}}function uf(){if(xd===2){xd=0;var e=Sd,t=Cd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=K;K|=4;try{hu(e,t.alternate,t)}finally{K=i,I.p=r,F.T=n}}xd=3}}function df(){if(xd===4||xd===3){xd=0;var e=Od;Od=null,Be();var t=Sd,n=Cd,r=wd,i=Dd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?xd=5:(xd=0,Cd=Sd=null,ff(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(bd=null),yt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=F.T,a=I.p,I.p=2,F.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{F.T=n,I.p=a}}if(i=kd,o=Ad,Ad=null,i!==null&&(kd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);wd&3&&pf(),kf(t),a=t.pendingLanes,r&261930&&a&42?t===Md?jd++:(jd=0,Md=t):(jd=0,Md=null),Af(0,!1)}}function ff(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function pf(){return Od!==null&&(Od.skipTransition(),Od=null),lf(),uf(),df(),mf()}function mf(){if(xd!==5)return!1;var e=Sd,t=Td;Td=0;var n=yt(wd),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=Ed,Ed=null;var o=Sd,s=wd;if(xd=0,Cd=Sd=null,wd=0,K&6)throw Error(i(331));var c=K;if(K|=4,Yu(o.current),Vu(o,o.current,s,n),K=c,Af(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{I.p=a,F.T=r,ff(e,t)}}function hf(e,t,n){t=Ui(n,t),t=Oc(e.stateNode,t,2),e=vo(e,t,2),e!==null&&(pt(e,2),kf(e))}function gf(e,t,n){if(e.tag===3)hf(e,e,n);else for(;t!==null;){if(t.tag===3){hf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(bd===null||!bd.has(r))){e=Ui(n,e),n=kc(2),r=vo(t,n,2),r!==null&&(Ac(n,r,t,e),pt(r,2),kf(r));break}}t=t.return}}function _f(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $u;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ad=!0,i.add(n),e=vf.bind(null,e,t,n),t.then(e,e))}function vf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ed===e&&(J&n)===n&&(sd===4||sd===3&&(J&62914560)===J&&300>Ve()-gd?K&2?ud|=n:Ud(e,0):ud|=n,fd===J&&(fd=0)),kf(e)}function yf(e,t){t===0&&(t=dt()),e=Oi(e,t),e!==null&&(pt(e,t),kf(e))}function bf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),yf(e,n)}function xf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),yf(e,n)}function Sf(e,t){return Le(e,t)}var Cf=null,wf=null,Tf=!1,Ef=!1,Df=!1,Of=0;function kf(e){e!==wf&&e.next===null&&(wf===null?Cf=wf=e:wf=wf.next=e),Ef=!0,Tf||(Tf=!0,If())}function Af(e,t){if(!Df&&Ef){Df=!0;do for(var n=!1,r=Cf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-$e(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Ff(r,a))}else a=J,a=st(r,r===ed?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,Ff(r,a))}r=r.next}while(n);Df=!1}}function jf(){Mf()}function Mf(){Ef=Tf=!1;var e=0;Of!==0&&yp()&&(e=Of);for(var t=Ve(),n=null,r=Cf;r!==null;){var i=r.next,a=Nf(r,t);a===0?(r.next=null,n===null?Cf=i:n.next=i,i===null&&(wf=n)):(n=r,(e!==0||a&3)&&(Ef=!0)),r=i}xd!==0&&xd!==5||Af(e,!1),Of!==0&&(Of=0)}function Nf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-$e(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ut(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ed,n=J,n=st(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(td===2||td===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Re(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ct(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Re(r),yt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=Pf.bind(null,e),n=Le(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Re(r),e.callbackPriority=2,e.callbackNode=null,2}function Pf(e,t){if(xd!==0&&xd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(pf()&&e.callbackNode!==n)return null;var r=J;return r=st(e,e===ed?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ld(e,r,t),Nf(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?Pf.bind(null,e):null)}function Ff(e,t){if(pf())return null;Ld(e,t,!0)}function If(){wp(function(){K&6?Le(Ue,jf):Mf()})}function Lf(){if(Of===0){var e=za;e===0&&(e=rt,rt<<=1,!(rt&261888)&&(rt=256)),Of=e}return Of}function Rf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function zf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Rf((i[wt]||null).action),o=r.submitter;o&&(t=(t=o[wt]||null)?Rf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Of!==0){var e=new FormData(i,o);ec(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ec(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Bf=0;Bf<hi.length;Bf++){var Vf=hi[Bf];gi(Vf.toLowerCase(),`on`+(Vf[0].toUpperCase()+Vf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Ht(`onMouseEnter`,[`mouseout`,`mouseover`]),Ht(`onMouseLeave`,[`mouseout`,`mouseover`]),Ht(`onPointerEnter`,[`pointerout`,`pointerover`]),Ht(`onPointerLeave`,[`pointerout`,`pointerover`]),Vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Hf=`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(` `),Uf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Hf));function Wf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}}}}function Y(e,t){var n=t[Et];n===void 0&&(n=t[Et]=new Set);var r=e+`__bubble`;n.has(r)||(Jf(t,e,2,!1),n.add(r))}function Gf(e,t,n){var r=0;t&&(r|=4),Jf(n,e,r,t)}var Kf=`_reactListening`+Math.random().toString(36).slice(2);function qf(e){if(!e[Kf]){e[Kf]=!0,zt.forEach(function(t){t!==`selectionchange`&&(Uf.has(t)||Gf(t,!1,e),Gf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Kf]||(t[Kf]=!0,Gf(`selectionchange`,!1,t))}}function Jf(e,t,n,r){switch(Eh(t)){case 2:var i=bh;break;case 8:i=xh;break;default:i=Sh}n=i.bind(null,t,n,e),i=void 0,!kn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Yf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Nt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}En(function(){var r=a,i=xn(n),s=[];a:{var c=mi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case si:case ci:case li:l=Xn;break;case pi:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Dn(m,p),g!=null&&d.push(Xf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Nt(u)||u[Tt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Nt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ft(c),h=l==null?u:Ft(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Nt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Qf):null,c!==null&&$f(s,u,c,d,!1),l!==null&&f!==null&&$f(s,f,l,d,!0)))}a:{if(c=r?Ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ar;else if(wr(c)){if(jr)_=Br;else{_=Rr;var v=Lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Ar):_=zr;if(_&&=_(e,r)){Tr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ft(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(s,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(s,n,i)}var y;if(fr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=Zf(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=Zf(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),zf(s,e,r,n,i)}Wf(s,t)})}function Xf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Zf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Dn(e,n),i!=null&&r.unshift(Xf(e,i,a)),i=Dn(e,t),i!=null&&r.push(Xf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Qf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Dn(n,a),l!=null&&o.unshift(Xf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(Xf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ep=/\r\n?/g,tp=/\u0000|\uFFFD/g;function np(e){return(typeof e==`string`?e:``+e).replace(ep,`
10
+ `).replace(tp,``)}function rp(e,t){return t=np(t),np(e)===t}function ip(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ip(e,t,`name`,a.name,a,null),ip(e,t,`formEncType`,a.formEncType,a,null),ip(e,t,`formMethod`,a.formMethod,a,null),ip(e,t,`formTarget`,a.formTarget,a,null)):(ip(e,t,`encType`,a.encType,a,null),ip(e,t,`method`,a.method,a,null),ip(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&Y(`scroll`,e);return;case`onScrollEnd`:r!=null&&Y(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=vn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Y(`beforetoggle`,e),Y(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}R=!0}function ap(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&Y(`scroll`,e);return;case`onScrollEnd`:r!=null&&Y(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}R=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}R=!0}function op(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Y(`error`,e),Y(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ip(e,t,o,s,n,null)}}a&&ip(e,t,`srcSet`,n.srcSet,n,null),r&&ip(e,t,`src`,n.src,n,null);return;case`input`:Y(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:ip(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Y(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ip(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in Y(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:ip(e,t,s,c,n,null)}un(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ip(e,t,l,r,n,null)}return;case`dialog`:Y(`beforetoggle`,e),Y(`toggle`,e),Y(`cancel`,e),Y(`close`,e);break;case`iframe`:case`object`:Y(`load`,e);break;case`video`:case`audio`:for(r=0;r<Hf.length;r++)Y(Hf[r],e);break;case`image`:Y(`error`,e),Y(`load`,e);break;case`details`:Y(`toggle`,e);break;case`embed`:case`source`:case`link`:Y(`error`,e),Y(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:ip(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&ap(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ip(e,t,c,r,n,null))}var sp={};function cp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ip(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(R=!0),o=m;break;case`name`:m!==f&&(R=!0),a=m;break;case`checked`:m!==f&&(R=!0),u=m;break;case`defaultChecked`:m!==f&&(R=!0),d=m;break;case`value`:m!==f&&(R=!0),s=m;break;case`defaultValue`:m!==f&&(R=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ip(e,t,p,m,r,f)}}an(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ip(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(R=!0),p=o;break;case`defaultValue`:o!==l&&(R=!0),c=o;break;case`multiple`:o!==l&&(R=!0),s=o;default:o!==l&&ip(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ip(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(R=!0),p=a;break;case`defaultValue`:a!==o&&(R=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ip(e,t,s,a,r,o)}ln(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ip(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(R=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ip(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ip(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:ip(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&ap(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||ap(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ip(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ip(e,t,f,p,r,m)}function lp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function up(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&lp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&lp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var dp=null,fp=null;function pp(e){return e.nodeType===9?e:e.ownerDocument}function mp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function hp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function gp(e,t,n,r){return n=pp(n).createElement(e),n[Ct]=r,n[wt]=t,op(n,e,t),Lt(n),n}function _p(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var vp=null;function yp(){var e=window.event;return e&&e.type===`popstate`?e!==vp&&(vp=e,!0):(vp=null,!1)}var bp=typeof setTimeout==`function`?setTimeout:void 0,xp=typeof clearTimeout==`function`?clearTimeout:void 0,Sp=typeof Promise==`function`?Promise:void 0,Cp=typeof requestAnimationFrame==`function`?requestAnimationFrame:bp,wp=typeof queueMicrotask==`function`?queueMicrotask:Sp===void 0?bp:function(e){return Sp.resolve(null).then(e).catch(Tp)};function Tp(e){setTimeout(function(){throw e})}function Ep(e){return e===`head`}function Dp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Gh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)xm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,xm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&xm(e.ownerDocument.body)}n=i}while(n);Gh(t)}function Op(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function kp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ap(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function jp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Mp(e){return jp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Np(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return jp(t,n,e)}function Pp(e){return e.documentElement.clientHeight}function Fp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Ip(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Pp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=eh(f),u>rh){s.length=o;break}f=new Promise(Fp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Lp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Lp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Lp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Lp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Rp(e){return{name:e,group:new Lp(`group`,e),imagePair:new Lp(`image-pair`,e),old:new Lp(`old`,e),new:new Lp(`new`,e)}}function zp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}zp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Wp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Hp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Bp,e,s,r)}this._eventListeners=a}};function Bp(e,t,n,r){return _(e).addEventListener(t,n,r),!1}zp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Wp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Hp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Vp,e,n,i),r.splice(t,1),a!==null&&a()}};function Vp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Hp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Up(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Wp(e,t,n,r){if(e.length===0)return-1;r=Up(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Up(a.optionsOrUseCapture)===r)return i}return-1}zp.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Hp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},zp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag!==6&&(e=_(e),_m(e,t))}zp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Kp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Gp(t[n],e);n--);};function Kp(e,t){return t.push(e),!1}zp.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=pp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,qp,e,void 0,void 0))};function qp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}zp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}zp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,Yp,e,void 0,void 0);for(var n=t=0;n<Xp.length;n++){var r=Xp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Xp[t++]=r}Xp.length=t}};function Yp(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var Xp=[],Zp=!1;function Qp(e,t,n){Xp.push({fragmentInstance:e,observer:t,instance:n}),Zp||(Zp=!0,vm(function(){Zp=!1;var e=Xp;Xp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}zp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,$p,e,void 0,void 0),e};function $p(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}zp.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},zp.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Kp,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||em(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function em(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,w),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,w),t===null?t=!1:(f(t,!0,S,a,r),a=v,y=v=null,t=a!==null)),t):!1}function tm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}zp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Kp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),tm(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),tm(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function nm(e,t){return e=_(e),rm(e,t),!1}function rm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function im(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Xp.length;i++){var a=Xp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Xp[r++]=a)}Xp.length=r,n.observe(e)}),rm(e,t))}function am(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Hp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Qp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function om(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:om(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[At])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=pm(e.nextSibling),e===null)break}return null}function cm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pm(e.nextSibling),e===null))return null;return e}function lm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pm(e.nextSibling),e===null))return null;return e}function um(e){return e.data===`$?`||e.data===`$~`}function dm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function fm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function pm(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===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var mm=null;function hm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function _m(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function vm(e){Cp(function(){Cp(function(t){return e(t)})})}function ym(e,t,n){switch(t=pp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function bm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ip(e,t,r,null,sp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Mt(e)}function xm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var Sm=new Map,Cm=new Set;function wm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Tm=I.d;I.d={f:Em,r:Dm,D:Am,C:jm,L:Mm,m:Nm,X:Fm,S:Pm,M:Im};function Em(){var e=Tm.f(),t=Vd();return e||t}function Dm(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?nc(t):Tm.r(e)}var Om=typeof document>`u`?null:document;function km(e,t,n){var r=Om;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cm.has(i)||(Cm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),op(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Am(e){Tm.D(e),km(`dns-prefetch`,e,null)}function jm(e,t){Tm.C(e,t),km(`preconnect`,e,t)}function Mm(e,t,n){Tm.L(e,t,n);var r=Om;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Rm(e);break;case`script`:a=Hm(e)}if(!(Sm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zm(a))||t===`script`&&r.querySelector(Um(a))))){var o=r.createElement(`link`);op(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function Nm(e,t){Tm.m(e,t);var n=Om;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hm(e)}if(!Sm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Sm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Um(a)))return}r=n.createElement(`link`),op(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Pm(e,t,n){Tm.S(e,t,n);var r=Om;if(r&&e){var i=It(r).hoistableStyles,a=Rm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sm.get(a))&&Km(e,n);var c=o=r.createElement(`link`);Lt(c),op(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Gm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Fm(e,t){Tm.X(e,t);var n=Om;if(n&&e){var r=It(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Lt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Im(e,t){Tm.M(e,t);var n=Om;if(n&&e){var r=It(n).hoistableScripts,i=Hm(e),a=r.get(i);a||(a=n.querySelector(Um(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Sm.get(i))&&qm(e,t),a=n.createElement(`script`),Lt(a),op(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lm(e,t,n,r){var a=(a=Ce.current)?wm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Rm(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Rm(n.href);var o=It(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(zm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Sm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sm.set(e,o)),Vm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Hm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Rm(e){return`href="`+rn(e)+`"`}function zm(e){return`link[rel="stylesheet"][`+e+`]`}function Bm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Vm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),op(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Hm(e){return`[src="`+rn(e)+`"]`}function Um(e){return`script[async]`+e}function Wm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),op(r,`style`,a),Gm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Rm(n.href);var o=e.querySelector(zm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Bm(n),(a=Sm.get(a))&&Km(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),op(o,`link`,r),t.state.loading|=4,Gm(o,n.precedence,e),t.instance=o;case`script`:return o=Hm(n.src),(a=e.querySelector(Um(o)))?(t.instance=a,Lt(a),a):(r=n,(a=Sm.get(o))&&(r=D({},n),qm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),op(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Gm(r,n.precedence,e));return t.instance}function Gm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Km(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jm=null;function Ym(e,t,n){if(Jm===null){var r=new Map,i=Jm=new Map;i.set(n,r)}else i=Jm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[At]||a[Ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Xm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Qm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function $m(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function eh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function th(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=eh(t),e.suspenseyImages.push(t)),e=sh.bind(e),t.decode().then(e,e))}function nh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Rm(r.href),a=t.querySelector(zm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=oh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Bm(r),(i=Sm.get(i))&&Km(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),op(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=oh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rh=0;function ih(e,t){return e.stylesheets&&e.count===0&&lh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rh===0&&(rh=62500*up());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&lh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ah(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)lh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function oh(){this.count--,ah(this)}function sh(){this.imgCount--,ah(this)}var ch=null;function lh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ch=new Map,t.forEach(uh,e),ch=null,oh.call(e))}function uh(e,t){if(!(t.state.loading&4)){var n=ch.get(e);if(n)var r=n.get(null);else{n=new Map,ch.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=oh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var dh={$$typeof:ne,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function fh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function ph(e,t,n,r,i,a,o,s,c,l,u,d){return e=new fh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Ma(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ho(a),e}function mh(e){return e?(e=ji,e):ji}function hh(e,t,n,r,i,a){i=mh(i),r.context===null?r.context=i:r.pendingContext=i,r=_o(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=vo(e,r,t),n!==null&&(Id(n,e,t),yo(n,e,t))}function gh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function _h(e,t){gh(e,t),(e=e.alternate)&&gh(e,t)}function vh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Id(t,e,67108864),_h(e,67108864)}}function X(e){if(e.tag===13||e.tag===31){var t=Nd();t=vt(t);var n=Oi(e,t);n!==null&&Id(n,e,t),_h(e,t)}}var yh=!0;function bh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,Sh(e,t,n,r)}finally{I.p=a,F.T=i}}function xh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,Sh(e,t,n,r)}finally{I.p=a,F.T=i}}function Sh(e,t,n,r){if(yh){var i=Ch(r);if(i===null)Yf(e,t,r,wh,n),Fh(e,r);else if(Lh(i,e,t,n,r))r.stopPropagation();else if(Fh(e,r),t&4&&-1<Ph.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}kf(a),!(K&6)&&(vd=Ve()+500,Af(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Id(s,a,2),Vd(),_h(a,2)}if(a=Ch(r),a===null&&Yf(e,t,r,wh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Yf(e,t,r,null,n)}}function Ch(e){return e=xn(e),Th(e)}var wh=null;function Th(e){if(wh=null,e=Nt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 wh=e,null}function Eh(e){switch(e){case`beforetoggle`: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`seeked`:case`submit`:case`toggle`: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`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Dh=!1,Oh=null,kh=null,Ah=null,jh=new Map,Mh=new Map,Nh=[],Ph=`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`.split(` `);function Fh(e,t){switch(e){case`focusin`:case`focusout`:Oh=null;break;case`dragenter`:case`dragleave`:kh=null;break;case`mouseover`:case`mouseout`:Ah=null;break;case`pointerover`:case`pointerout`:jh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mh.delete(t.pointerId)}}function Ih(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pt(t),t!==null&&vh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lh(e,t,n,r,i){switch(t){case`focusin`:return Oh=Ih(Oh,e,t,n,r,i),!0;case`dragenter`:return kh=Ih(kh,e,t,n,r,i),!0;case`mouseover`:return Ah=Ih(Ah,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jh.set(a,Ih(jh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mh.set(a,Ih(Mh.get(a)||null,e,t,n,r,i)),!0}return!1}function Rh(e){var t=Nt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,xt(e.priority,function(){X(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){X(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 zh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ch(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Pt(n),t!==null&&vh(t),e.blockedOn=n,!1;t.shift()}return!0}function Bh(e,t,n){zh(e)&&n.delete(t)}function Vh(){Dh=!1,Oh!==null&&zh(Oh)&&(Oh=null),kh!==null&&zh(kh)&&(kh=null),Ah!==null&&zh(Ah)&&(Ah=null),jh.forEach(Bh),Mh.forEach(Bh)}function Hh(e,n){e.blockedOn===n&&(e.blockedOn=null,Dh||(Dh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vh)))}var Uh=null;function Wh(e){Uh!==e&&(Uh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Uh===e&&(Uh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Th(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,ec(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gh(e){function t(t){return Hh(t,e)}Oh!==null&&Hh(Oh,e),kh!==null&&Hh(kh,e),Ah!==null&&Hh(Ah,e),jh.forEach(t),Mh.forEach(t);for(var n=0;n<Nh.length;n++){var r=Nh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Nh.length&&(n=Nh[0],n.blockedOn===null);)Rh(n),n.blockedOn===null&&Nh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[wt]||null;if(typeof a==`function`)o||Wh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(Th(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wh(n)}}}function Kh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function qh(e){this._internalRoot=e}Jh.prototype.render=qh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;hh(n,Nd(),e,t,null,null)},Jh.prototype.unmount=qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hh(e.current,2,null,e,null,null),Vd(),t[Tt]=null}};function Jh(e){this._internalRoot=e}Jh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nh.length&&t!==0&&t<Nh[n].priority;n++);Nh.splice(n,0,e),n===0&&Rh(e)}};var Yh=n.version;if(Yh!==`19.3.1`)throw Error(i(527,Yh,`19.3.1`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Xh={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zh.isDisabled&&Zh.supportsFiber)try{Xe=Zh.inject(Xh),Ze=Zh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Cc,s=wc,c=Tc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ph(e,1,!1,null,null,n,r,null,o,s,c,Kh),e[Tt]=t.current,qf(e),new qh(t)}})),D=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=E()})),O=e(x(),1),k=D(),A=e=>JSON.stringify({...e,source:void 0});function j(e,t,n){let r=new Set(t.map(n));return[...t,...e.filter(e=>!r.has(n(e)))]}var M=e=>e.id,ee=e=>`${e.service}\0${e.environment}\0${e.target}`;function te(e,t){return{...t,teams:j(e.teams,t.teams,M),environments:j(e.environments,t.environments,M),projects:j(e.projects,t.projects,M),elements:j(e.elements,t.elements,M),relationships:j(e.relationships,t.relationships,A),targets:j(e.targets,t.targets,M),deployments:j(e.deployments,t.deployments,ee),views:j(e.views,t.views,M),adrs:j(e.adrs,t.adrs,M)}}var ne=[`team`,`environment`,`project`,`element`,`relationship`,`target`,`deployment`,`view`,`adr`];function re(e,t){let n=[],r=(e,t,r)=>se(e,N(t,r,e=>e.id),e=>e.id,n);r(`team`,e.teams,t.teams),r(`environment`,e.environments,t.environments),r(`project`,e.projects,t.projects),r(`element`,e.elements,t.elements),se(`relationship`,oe(e.relationships,t.relationships),ie,n),r(`target`,e.targets,t.targets),se(`deployment`,N(e.deployments,t.deployments,ae),ae,n),r(`view`,e.views,t.views),r(`adr`,e.adrs,t.adrs);let i={changed:0,removed:1,added:2};return n.sort((e,t)=>ne.indexOf(e.kind)-ne.indexOf(t.kind)||ue(e.id,t.id)||i[e.type]-i[t.type])}var ie=e=>e.id??`${e.from} -> ${e.to}`,ae=e=>`${e.service} in ${e.environment} on ${e.target}`;function N(e,t,n){let r=e=>{let t=new Map;for(let r of e)t.set(n(r),[...t.get(n(r))??[],r]);return t},i=r(e),a=r(t),o=new Set,s=[];for(let[e,t]of i){let n=a.get(e);t.length===1&&n?.length===1&&(s.push([t[0],n[0]]),o.add(t[0]).add(n[0]))}return{pairs:s,removed:e.filter(e=>!o.has(e)),added:t.filter(e=>!o.has(e))}}function oe(e,t){let n=e=>e.filter(e=>e.id!==null),r=N(n(e),n(t),e=>e.id),i=new Set(r.pairs.flat()),a=e.filter(e=>!i.has(e)),o=t.filter(e=>!i.has(e)),s=[...r.pairs],c=new Set(i),l=(e,t)=>{let n=t=>t.reduce((t,n)=>t.set(e(n),(t.get(e(n))??0)+1),new Map),[r,i]=[n(a),n(o)],l=new Map;for(let t of o)c.has(t)||l.set(e(t),[...l.get(e(t))??[],t]);for(let n of a){if(c.has(n)||t&&(r.get(e(n))!==1||i.get(e(n))!==1))continue;let a=l.get(e(n))?.shift();a&&(s.push([n,a]),c.add(n).add(a))}};return l(e=>le(ce(e)),!1),l(e=>JSON.stringify([e.from,e.to]),!0),l(e=>JSON.stringify([e.from,e.to,e.technology,e.interaction]),!0),{pairs:s,removed:e.filter(e=>!c.has(e)),added:t.filter(e=>!c.has(e))}}function se(e,t,n,r){for(let[i,a]of t.pairs){let t=ce(i),o=ce(a),s=[...new Set([...Object.keys(t),...Object.keys(o)])].filter(e=>le(t[e])!==le(o[e]));s.length>0&&r.push({type:`changed`,kind:e,id:n(a),fields:s,before:t,after:o})}for(let i of t.removed)r.push({type:`removed`,kind:e,id:n(i),fields:[],before:ce(i),after:null});for(let i of t.added)r.push({type:`added`,kind:e,id:n(i),fields:[],before:null,after:ce(i)})}function ce(e){return Object.fromEntries(Object.entries(e).filter(([e])=>e!==`source`))}function le(e){return JSON.stringify(e,(e,t)=>typeof t==`object`&&t&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>ue(e,t))):t)}var ue=(e,t)=>e<t?-1:+(e>t);function de(e,t,n,r={}){let i=te(e,t),a=new g(i),o=f(i,a,n,r);if(!o)return;let[s,c]=[e,t].map(e=>f(e,new g(e),n,r)),l=new Set(re(e,t).filter(e=>e.kind===`element`).map(e=>e.id)),u=e=>[...l].some(t=>t!==e&&a.ancestry(t).includes(e)),d=(e,t)=>[s,c].map(n=>new Map((n?e(n):[]).map(e=>[t(e),e]))),[p,m]=d(e=>e.nodes,e=>e.id),h=e=>`${e.from}\0${e.to}`,[_,v]=d(e=>e.edges,h),y=(e,t,n)=>t&&!e?`added`:e&&!t?`removed`:n()?`changed`:`unchanged`;for(let e of o.nodes)e.change=y(p.has(e.id),m.has(e.id),()=>l.has(e.id)||e.collapsed&&u(e.id));let b=e=>(e?.relationships.map(A).sort()??[]).join(`
11
11
  `);for(let e of o.edges){let t=h(e);e.change=y(_.has(t),v.has(t),()=>b(_.get(t))!==b(v.get(t)))}return o}var fe=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),P=t(((e,t)=>{t.exports=fe()}))();function pe({source:e,shift:t=0}){return(0,P.jsx)(P.Fragment,{children:ve(e.replace(/\r\n?/g,`
12
12
  `).split(`
13
13
  `),t)})}var me=/^(#{1,6})\s+(.*?)\s*#*\s*$/,he=/^(`{3,}|~{3,})\s*(\S*)/,F=/^\s{0,3}[-*+]\s+(.*)$/,I=/^\s{0,3}\d{1,9}[.)]\s+(.*)$/,ge=/^\s{0,3}([-*_])(\s*\1){2,}\s*$/,_e=/^\s{0,3}>\s?(.*)$/;function ve(e,t){let n=[],r=0,i=()=>n.length;for(;r<e.length;){let a=e[r];if(a.trim()===``){r++;continue}let o=he.exec(a);if(o){let t=[];for(r++;r<e.length&&!e[r].startsWith(o[1]);r++)t.push(e[r]);r++,n.push((0,P.jsx)(`pre`,{children:(0,P.jsx)(`code`,{"data-language":o[2]||void 0,children:t.join(`
14
- `)})},i()));continue}let s=me.exec(a);if(s){let e=`h${Math.min(6,s[1].length+t)}`;n.push((0,P.jsx)(e,{children:be(s[2])},i())),r++;continue}if(ge.test(a)){n.push((0,P.jsx)(`hr`,{},i())),r++;continue}if(_e.test(a)){let a=[];for(;r<e.length&&_e.test(e[r]);r++)a.push(_e.exec(e[r])[1]);n.push((0,P.jsx)(`blockquote`,{children:ve(a,t)},i()));continue}let c=F.test(a)?F:I.test(a)?I:null;if(c){let t=[];for(;r<e.length;r++){let n=e[r],i=c.exec(n);if(i)t.push(i[1]);else if(n.trim()!==``&&/^\s+\S/.test(n)&&t.length>0)t[t.length-1]+=` ${n.trim()}`;else break}let a=c===F?`ul`:`ol`;n.push((0,P.jsx)(a,{children:t.map((e,t)=>(0,P.jsx)(`li`,{children:be(e)},t))},i()));continue}let l=[];for(;r<e.length;r++){let t=e[r];if(t.trim()===``||he.test(t)||me.test(t)||F.test(t)||I.test(t)||_e.test(t)||ge.test(t))break;l.push(t.trim())}n.push((0,P.jsx)(`p`,{children:be(l.join(` `))},i()))}return n}var ye=/`([^`]+)`|\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|<(https?:\/\/[^>\s]+)>|\*\*(.+?)\*\*|__(.+?)__|\*([^*\s][^*]*?)\*|\b_([^_\s][^_]*?)_\b/g;function be(e){let t=[],n=0;for(let r of e.matchAll(ye)){r.index>n&&t.push(e.slice(n,r.index));let i=t.length,[,a,o,s,c,l,u,d,f]=r;a===void 0?o===void 0?c===void 0?l!==void 0||u!==void 0?t.push((0,P.jsx)(`strong`,{children:be(l??u)},i)):t.push((0,P.jsx)(`em`,{children:be(d??f)},i)):t.push((0,P.jsx)(xe,{href:c,children:c},i)):t.push((0,P.jsx)(xe,{href:s,children:be(o)},i)):t.push((0,P.jsx)(`code`,{children:a},i)),n=r.index+r[0].length}return n<e.length&&t.push(e.slice(n)),t}function xe({href:e,children:t}){return/^(https?:|mailto:|[./#]|[^:]*$)/i.test(e)?(0,P.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:t}):(0,P.jsx)(P.Fragment,{children:t})}var Se={find:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.5`}),(0,P.jsx)(`path`,{d:`M10.5 10.5 14 14`})]}),model:(0,P.jsx)(`path`,{d:`M2.5 3h6M5 3v10.5M5 8.25h7.5M5 13.5h7.5`}),teams:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`circle`,{cx:`5`,cy:`5`,r:`2`}),(0,P.jsx)(`circle`,{cx:`11`,cy:`5`,r:`2`}),(0,P.jsx)(`path`,{d:`M1.5 13.5v-1a3.5 3.5 0 0 1 7 0v1M7.5 13.5v-1a3.5 3.5 0 0 1 7 0v1`})]}),views:(0,P.jsx)(`path`,{d:`M2 2h5v5H2zM9 2h5v5H9zM2 9h5v5H2zM9 9h5v5H9z`}),back:(0,P.jsx)(`path`,{d:`M10 2.5 4.5 8l5.5 5.5`}),forward:(0,P.jsx)(`path`,{d:`M6 2.5 11.5 8 6 13.5`}),close:(0,P.jsx)(`path`,{d:`M3 3l10 10M13 3 3 13`}),plus:(0,P.jsx)(`path`,{d:`M8 3v10M3 8h10`}),minus:(0,P.jsx)(`path`,{d:`M3 8h10`}),copy:(0,P.jsx)(`path`,{d:`M5.5 5.5h8v8h-8zM2.5 10.5v-8h8`}),check:(0,P.jsx)(`path`,{d:`M2.5 8.5 6 12l7.5-8`}),recent:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`}),(0,P.jsx)(`path`,{d:`M8 4.5V8l2.5 2`})]}),revisions:(0,P.jsx)(`path`,{d:`M2.5 3v3.5H6M3 6.5A5.5 5.5 0 1 1 2.5 9M8 5v3l2 1.5`}),export:(0,P.jsx)(`path`,{d:`M8 2v8M4.5 6.5 8 10l3.5-3.5M2.5 11v2.5h11V11`}),layout:(0,P.jsx)(`path`,{d:`M2 4h4v8H2zM10 4h4v8h-4zM6 8h4`}),arrow:(0,P.jsx)(`path`,{d:`M2 8h11M9 4l4 4-4 4`}),person:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`circle`,{cx:`8`,cy:`5`,r:`2.5`}),(0,P.jsx)(`path`,{d:`M3 14v-1.5a5 5 0 0 1 10 0V14`})]}),system:(0,P.jsx)(`path`,{d:`M2 2h12v12H2zM5 5h6v6H5z`}),service:(0,P.jsx)(`path`,{d:`M8 1.5 14 5v6l-6 3.5L2 11V5z`}),component:(0,P.jsx)(`path`,{d:`M8 2l6 6-6 6-6-6z`}),datastore:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`5`,ry:`2`}),(0,P.jsx)(`path`,{d:`M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2`})]}),broker:(0,P.jsx)(`path`,{d:`M2 4.5h9.5M9 2l2.5 2.5L9 7M14 11.5H4.5M7 9l-2.5 2.5L7 14`}),deployment:(0,P.jsx)(`path`,{d:`M8 1.5 14 5v6l-6 3.5L2 11V5zM6.5 6.5h3v3h-3z`}),target:(0,P.jsx)(`path`,{d:`M2 6V2h4M10 2h4v4M14 10v4h-4M6 14H2v-4`}),dynamic:(0,P.jsx)(`path`,{d:`M4 2.5 13 8l-9 5.5z`}),play:(0,P.jsx)(`path`,{d:`M4 2.5 13 8l-9 5.5z`}),pause:(0,P.jsx)(`path`,{d:`M4.5 2.5v11M11.5 2.5v11`}),first:(0,P.jsx)(`path`,{d:`M3.5 2.5v11M13 2.5 6.5 8l6.5 5.5z`}),previous:(0,P.jsx)(`path`,{d:`M12 2.5 5 8l7 5.5z`}),next:(0,P.jsx)(`path`,{d:`M2.5 2.5 8 8l-5.5 5.5zM8.5 2.5 14 8l-5.5 5.5z`}),up:(0,P.jsx)(`path`,{d:`M8 14V3M4 7l4-4 4 4`}),down:(0,P.jsx)(`path`,{d:`M8 2v11M4 9l4 4 4-4`}),origin:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5`}),(0,P.jsx)(`path`,{d:`M8 1v3M8 12v3M1 8h3M12 8h3`})]}),saved:(0,P.jsx)(`path`,{d:`M4 2h8v12l-4-3-4 3z`}),impact:(0,P.jsx)(`path`,{d:`M8 1.5v13M4 5.5l4-4 4 4M4 10.5l4 4 4-4`}),connect:(0,P.jsx)(`path`,{d:`M2 5h11M10 2l3 3-3 3M14 11H3M6 8l-3 3 3 3`}),open:(0,P.jsx)(`path`,{d:`M9.5 2.5h4v4M13.5 2.5 8 8M7 3.5H2.5v10h10V9`})};function L({name:e,className:t}){return(0,P.jsx)(`svg`,{className:t?`arc-icon ${t}`:`arc-icon`,viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,focusable:`false`,children:Se[e]})}var Ce={"◉":`person`,"▣":`system`,"▭":`service`,"◇":`component`,"⛁":`target`,"▶":`dynamic`},we={proposed:`Proposed`,accepted:`Accepted`,rejected:`Rejected`,deprecated:`Deprecated`,superseded:`Superseded`};function Te({status:e}){return(0,P.jsx)(`span`,{className:`arc-adr-status`,"data-status":e,children:we[e]})}function Ee({workspace:e,id:t,beside:n,onClose:r,onOpenAdr:i,onFocus:a,onOpenView:o}){let s=(0,O.useMemo)(()=>new Map(e.bundle.adrs.map(e=>[e.id,e])),[e]),c=s.get(t),l=`arc-reader${n?` arc-reader-beside`:``}`,u=(0,P.jsx)(`button`,{type:`button`,className:`arc-reader-close`,"aria-label":`Close ADR`,onClick:r,children:(0,P.jsx)(L,{name:`close`})});if(!c)return(0,P.jsx)(`article`,{className:l,"aria-label":`ADR`,children:(0,P.jsxs)(`header`,{className:`arc-reader-head`,children:[u,(0,P.jsxs)(`p`,{className:`arc-empty`,children:[`No ADR `,t,` in this Workspace.`]})]})});let d=e=>(0,P.jsxs)(`button`,{type:`button`,className:`arc-link`,onClick:()=>i(e),children:[(0,P.jsx)(`code`,{children:e}),` `,s.get(e)?.title??``]},e),f=t=>{if(e.byId.has(t))return(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>a(t),children:e.name(t)},t);let n=e.bundle.targets.find(e=>e.id===t);return(0,P.jsx)(`span`,{title:t,children:n?`${n.name} (${n.kind})`:t},t)},p=t=>(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>o(t),children:e.title(t)??t},t),m=c.effectiveStatus!==c.status;return(0,P.jsxs)(`article`,{className:l,"aria-label":`ADR`,children:[(0,P.jsxs)(`header`,{className:`arc-reader-head`,children:[u,(0,P.jsx)(`h2`,{children:c.title}),(0,P.jsx)(`code`,{className:`arc-panel-id`,children:c.id})]}),(0,P.jsxs)(`div`,{className:`arc-reader-body`,children:[c.supersededBy.length>0&&(0,P.jsxs)(`p`,{className:`arc-reader-banner`,role:`status`,children:[`Superseded by `,Oe(c.supersededBy.map(d),` `)]}),(0,P.jsxs)(`dl`,{className:`arc-facts`,children:[(0,P.jsx)(`dt`,{children:`Status`}),(0,P.jsxs)(`dd`,{children:[(0,P.jsx)(Te,{status:c.effectiveStatus}),m&&(0,P.jsxs)(`span`,{className:`arc-muted`,children:[` (written as `,we[c.status],`)`]})]}),(0,P.jsx)(`dt`,{children:`Date`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(`time`,{dateTime:c.date,children:c.date})}),De(`Decision makers`,c.decisionMakers),De(`Consulted`,c.consulted),De(`Informed`,c.informed),De(`Tags`,c.tags),De(`Elements`,c.elements.map(f),` `),De(`Views`,c.views.map(p),` `),De(`Supersedes`,c.supersedes.map(d),` `),De(`Superseded by`,c.supersededBy.map(d),` `)]}),(0,P.jsx)(`section`,{className:`arc-markdown`,role:`region`,"aria-label":`Decision`,children:(0,P.jsx)(pe,{source:ke(c.body,c.title),shift:1})}),(0,P.jsx)(`p`,{className:`arc-muted arc-reader-source`,children:c.source.file})]})]})}function De(e,t,n=`, `){return t.length===0?null:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:Oe(t,n)})]})}var Oe=(e,t)=>e.flatMap((e,n)=>n===0?[e]:[t,e]);function ke(e,t){let n=/^\s*#\s+(.*?)\s*#*\s*(\n|$)/.exec(e);return n&&n[1]===t?e.slice(n[0].length):e}function Ae(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=Ae(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var je={value:()=>{}};function Me(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Ne(n)}function Ne(e){this._=e}function Pe(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Ne.prototype=Me.prototype={constructor:Ne,on:function(e,t){var n=this._,r=Pe(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Fe(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Ie(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ie(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ne(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Fe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Ie(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=je,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Le=`http://www.w3.org/1999/xhtml`,Re={svg:`http://www.w3.org/2000/svg`,xhtml:Le,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function ze(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Re.hasOwnProperty(t)?{space:Re[t],local:e}:e}function Be(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Le&&t.documentElement.namespaceURI===Le?t.createElement(e):t.createElementNS(n,e)}}function Ve(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function He(e){var t=ze(e);return(t.local?Ve:Be)(t)}function Ue(){}function We(e){return e==null?Ue:function(){return this.querySelector(e)}}function Ge(e){typeof e!=`function`&&(e=We(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Nn(r,this._parents)}function Ke(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qe(){return[]}function Je(e){return e==null?qe:function(){return this.querySelectorAll(e)}}function Ye(e){return function(){return Ke(e.apply(this,arguments))}}function Xe(e){e=typeof e==`function`?Ye(e):Je(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Nn(r,i)}function Ze(e){return function(){return this.matches(e)}}function Qe(e){return function(t){return t.matches(e)}}var $e=Array.prototype.find;function et(e){return function(){return $e.call(this.children,e)}}function tt(){return this.firstElementChild}function nt(e){return this.select(e==null?tt:et(typeof e==`function`?e:Qe(e)))}var rt=Array.prototype.filter;function it(){return Array.from(this.children)}function at(e){return function(){return rt.call(this.children,e)}}function ot(e){return this.selectAll(e==null?it:at(typeof e==`function`?e:Qe(e)))}function st(e){typeof e!=`function`&&(e=Ze(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Nn(r,this._parents)}function ct(e){return Array(e.length)}function lt(){return new Nn(this._enter||this._groups.map(ct),this._parents)}function ut(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ut.prototype={constructor:ut,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 dt(e){return function(){return e}}function ft(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new ut(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function pt(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new ut(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function mt(e){return e.__data__}function ht(e,t){if(!arguments.length)return Array.from(this,mt);var n=t?pt:ft,r=this._parents,i=this._groups;typeof e!=`function`&&(e=dt(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=gt(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Nn(o,r),o._enter=s,o._exit=c,o}function gt(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function _t(){return new Nn(this._exit||this._groups.map(ct),this._parents)}function vt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function yt(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Nn(s,this._parents)}function bt(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function xt(e){e||=St;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Nn(i,this._parents).order()}function St(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ct(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wt(){return Array.from(this)}function Tt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Et(){let e=0;for(let t of this)++e;return e}function Dt(){return!this.node()}function Ot(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function kt(e){return function(){this.removeAttribute(e)}}function At(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jt(e,t){return function(){this.setAttribute(e,t)}}function Mt(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Nt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Pt(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 Ft(e,t){var n=ze(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?At:kt:typeof t==`function`?n.local?Pt:Nt:n.local?Mt:jt)(n,t))}function It(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Lt(e){return function(){this.style.removeProperty(e)}}function Rt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function zt(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Bt(e,t,n){return arguments.length>1?this.each((t==null?Lt:typeof t==`function`?zt:Rt)(e,t,n??``)):Vt(this.node(),e)}function Vt(e,t){return e.style.getPropertyValue(t)||It(e).getComputedStyle(e,null).getPropertyValue(t)}function Ht(e){return function(){delete this[e]}}function Ut(e,t){return function(){this[e]=t}}function Wt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Gt(e,t){return arguments.length>1?this.each((t==null?Ht:typeof t==`function`?Wt:Ut)(e,t)):this.node()[e]}function Kt(e){return e.trim().split(/^|\s+/)}function R(e){return e.classList||new qt(e)}function qt(e){this._node=e,this._names=Kt(e.getAttribute(`class`)||``)}qt.prototype={add:function(e){this._names.indexOf(e)<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 Jt(e,t){for(var n=R(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Yt(e,t){for(var n=R(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Xt(e){return function(){Jt(this,e)}}function Zt(e){return function(){Yt(this,e)}}function Qt(e,t){return function(){(t.apply(this,arguments)?Jt:Yt)(this,e)}}function $t(e,t){var n=Kt(e+``);if(arguments.length<2){for(var r=R(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Qt:t?Xt:Zt)(n,t))}function en(){this.textContent=``}function tn(e){return function(){this.textContent=e}}function nn(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function rn(e){return arguments.length?this.each(e==null?en:(typeof e==`function`?nn:tn)(e)):this.node().textContent}function an(){this.innerHTML=``}function on(e){return function(){this.innerHTML=e}}function sn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function cn(e){return arguments.length?this.each(e==null?an:(typeof e==`function`?sn:on)(e)):this.node().innerHTML}function ln(){this.nextSibling&&this.parentNode.appendChild(this)}function un(){return this.each(ln)}function dn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function fn(){return this.each(dn)}function pn(e){var t=typeof e==`function`?e:He(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function mn(){return null}function hn(e,t){var n=typeof e==`function`?e:He(e),r=t==null?mn:typeof t==`function`?t:We(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function gn(){var e=this.parentNode;e&&e.removeChild(this)}function _n(){return this.each(gn)}function vn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bn(e){return this.select(e?yn:vn)}function xn(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Sn(e){return function(t){e.call(this,t,this.__data__)}}function Cn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function wn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Tn(e,t,n){return function(){var r=this.__on,i,a=Sn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function En(e,t,n){var r=Cn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?Tn:wn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function Dn(e,t,n){var r=It(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function On(e,t){return function(){return Dn(this,e,t)}}function kn(e,t){return function(){return Dn(this,e,t.apply(this,arguments))}}function An(e,t){return this.each((typeof t==`function`?kn:On)(e,t))}function*jn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Mn=[null];function Nn(e,t){this._groups=e,this._parents=t}function Pn(){return new Nn([[document.documentElement]],Mn)}function Fn(){return this}Nn.prototype=Pn.prototype={constructor:Nn,select:Ge,selectAll:Xe,selectChild:nt,selectChildren:ot,filter:st,data:ht,enter:lt,exit:_t,join:vt,merge:yt,selection:Fn,order:bt,sort:xt,call:Ct,nodes:wt,node:Tt,size:Et,empty:Dt,each:Ot,attr:Ft,style:Bt,property:Gt,classed:$t,text:rn,html:cn,raise:un,lower:fn,append:pn,insert:hn,remove:_n,clone:bn,datum:xn,on:En,dispatch:An,[Symbol.iterator]:jn};function In(e){return typeof e==`string`?new Nn([[document.querySelector(e)]],[document.documentElement]):new Nn([[e]],Mn)}var Ln=0;function Rn(){return new zn}function zn(){this._=`@`+(++Ln).toString(36)}zn.prototype=Rn.prototype={constructor:zn,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function Bn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Vn(e,t){if(e=Bn(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 i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Hn={passive:!1},Un={capture:!0,passive:!1};function Wn(e){e.stopImmediatePropagation()}function Gn(e){e.preventDefault(),e.stopImmediatePropagation()}function Kn(e){var t=e.document.documentElement,n=In(e).on(`dragstart.drag`,Gn,Un);`onselectstart`in t?n.on(`selectstart.drag`,Gn,Un):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function qn(e,t){var n=e.document.documentElement,r=In(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,Gn,Un),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Jn=e=>()=>e;function Yn(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){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:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Yn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Xn(e){return!e.ctrlKey&&!e.button}function Zn(){return this.parentNode}function Qn(e,t){return t??{x:e.x,y:e.y}}function $n(){return navigator.maxTouchPoints||`ontouchstart`in this}function er(){var e=Xn,t=Zn,n=Qn,r=$n,i={},a=Me(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Hn).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(In(n.view).on(`mousemove.drag`,m,Un).on(`mouseup.drag`,h,Un),Kn(n.view),Wn(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(Gn(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){In(e.view).on(`mousemove.drag mouseup.drag`,null),qn(e.view,l),Gn(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Wn(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(Gn(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Wn(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Vn(l||r,t),p,m,h;if((h=n.call(e,new Yn(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Vn(l||a,t),_=o}u.call(r,e,new Yn(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Jn(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Jn(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Jn(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Jn(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function tr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nr(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function rr(){}var ir=.7,ar=1/ir,or=`\\s*([+-]?\\d+)\\s*`,sr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,cr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,lr=/^#([0-9a-f]{3,8})$/,ur=RegExp(`^rgb\\(${or},${or},${or}\\)$`),dr=RegExp(`^rgb\\(${cr},${cr},${cr}\\)$`),fr=RegExp(`^rgba\\(${or},${or},${or},${sr}\\)$`),pr=RegExp(`^rgba\\(${cr},${cr},${cr},${sr}\\)$`),mr=RegExp(`^hsl\\(${sr},${cr},${cr}\\)$`),hr=RegExp(`^hsla\\(${sr},${cr},${cr},${sr}\\)$`),gr={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};tr(rr,xr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_r,formatHex:_r,formatHex8:vr,formatHsl:yr,formatRgb:br,toString:br});function _r(){return this.rgb().formatHex()}function vr(){return this.rgb().formatHex8()}function yr(){return Pr(this).formatHsl()}function br(){return this.rgb().formatRgb()}function xr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=lr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Sr(t):n===3?new Er(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Cr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Cr(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=ur.exec(e))?new Er(t[1],t[2],t[3],1):(t=dr.exec(e))?new Er(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=fr.exec(e))?Cr(t[1],t[2],t[3],t[4]):(t=pr.exec(e))?Cr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mr.exec(e))?Nr(t[1],t[2]/100,t[3]/100,1):(t=hr.exec(e))?Nr(t[1],t[2]/100,t[3]/100,t[4]):gr.hasOwnProperty(e)?Sr(gr[e]):e===`transparent`?new Er(NaN,NaN,NaN,0):null}function Sr(e){return new Er(e>>16&255,e>>8&255,e&255,1)}function Cr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Er(e,t,n,r)}function wr(e){return e instanceof rr||(e=xr(e)),e?(e=e.rgb(),new Er(e.r,e.g,e.b,e.opacity)):new Er}function Tr(e,t,n,r){return arguments.length===1?wr(e):new Er(e,t,n,r??1)}function Er(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}tr(Er,Tr,nr(rr,{brighter(e){return e=e==null?ar:ar**+e,new Er(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ir:ir**+e,new Er(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Er(jr(this.r),jr(this.g),jr(this.b),Ar(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:Dr,formatHex:Dr,formatHex8:Or,formatRgb:kr,toString:kr}));function Dr(){return`#${Mr(this.r)}${Mr(this.g)}${Mr(this.b)}`}function Or(){return`#${Mr(this.r)}${Mr(this.g)}${Mr(this.b)}${Mr((isNaN(this.opacity)?1:this.opacity)*255)}`}function kr(){let e=Ar(this.opacity);return`${e===1?`rgb(`:`rgba(`}${jr(this.r)}, ${jr(this.g)}, ${jr(this.b)}${e===1?`)`:`, ${e})`}`}function Ar(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function jr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mr(e){return e=jr(e),(e<16?`0`:``)+e.toString(16)}function Nr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ir(e,t,n,r)}function Pr(e){if(e instanceof Ir)return new Ir(e.h,e.s,e.l,e.opacity);if(e instanceof rr||(e=xr(e)),!e)return new Ir;if(e instanceof Ir)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Ir(o,s,c,e.opacity)}function Fr(e,t,n,r){return arguments.length===1?Pr(e):new Ir(e,t,n,r??1)}function Ir(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}tr(Ir,Fr,nr(rr,{brighter(e){return e=e==null?ar:ar**+e,new Ir(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ir:ir**+e,new Ir(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,i=2*n-r;return new Er(zr(e>=240?e-240:e+120,i,r),zr(e,i,r),zr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ir(Lr(this.h),Rr(this.s),Rr(this.l),Ar(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(){let e=Ar(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Lr(this.h)}, ${Rr(this.s)*100}%, ${Rr(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Lr(e){return e=(e||0)%360,e<0?e+360:e}function Rr(e){return Math.max(0,Math.min(1,e||0))}function zr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Br=Math.PI/180,Vr=180/Math.PI,Hr=18,Ur=.96422,Wr=1,Gr=.82521,Kr=4/29,qr=6/29,Jr=3*qr*qr,Yr=qr*qr*qr;function Xr(e){if(e instanceof Qr)return new Qr(e.l,e.a,e.b,e.opacity);if(e instanceof ai)return oi(e);e instanceof Er||(e=wr(e));var t=ni(e.r),n=ni(e.g),r=ni(e.b),i=$r((.2225045*t+.7168786*n+.0606169*r)/Wr),a,o;return t===n&&n===r?a=o=i:(a=$r((.4360747*t+.3850649*n+.1430804*r)/Ur),o=$r((.0139322*t+.0971045*n+.7141733*r)/Gr)),new Qr(116*i-16,500*(a-i),200*(i-o),e.opacity)}function Zr(e,t,n,r){return arguments.length===1?Xr(e):new Qr(e,t,n,r??1)}function Qr(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}tr(Qr,Zr,nr(rr,{brighter(e){return new Qr(this.l+Hr*(e??1),this.a,this.b,this.opacity)},darker(e){return new Qr(this.l-Hr*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Ur*ei(t),e=Wr*ei(e),n=Gr*ei(n),new Er(ti(3.1338561*t-1.6168667*e-.4906146*n),ti(-.9787684*t+1.9161415*e+.033454*n),ti(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function $r(e){return e>Yr?e**(1/3):e/Jr+Kr}function ei(e){return e>qr?e*e*e:Jr*(e-Kr)}function ti(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function ni(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function ri(e){if(e instanceof ai)return new ai(e.h,e.c,e.l,e.opacity);if(e instanceof Qr||(e=Xr(e)),e.a===0&&e.b===0)return new ai(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Vr;return new ai(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function ii(e,t,n,r){return arguments.length===1?ri(e):new ai(e,t,n,r??1)}function ai(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function oi(e){if(isNaN(e.h))return new Qr(e.l,0,0,e.opacity);var t=e.h*Br;return new Qr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}tr(ai,ii,nr(rr,{brighter(e){return new ai(this.h,this.c,this.l+Hr*(e??1),this.opacity)},darker(e){return new ai(this.h,this.c,this.l-Hr*(e??1),this.opacity)},rgb(){return oi(this).rgb()}}));var si=-.14861,ci=1.78277,li=-.29227,ui=-.90649,di=1.97294,fi=di*ui,pi=di*ci,mi=ci*li-ui*si;function hi(e){if(e instanceof _i)return new _i(e.h,e.s,e.l,e.opacity);e instanceof Er||(e=wr(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(mi*r+fi*t-pi*n)/(mi+fi-pi),a=r-i,o=(di*(n-i)-li*a)/ui,s=Math.sqrt(o*o+a*a)/(di*i*(1-i)),c=s?Math.atan2(o,a)*Vr-120:NaN;return new _i(c<0?c+360:c,s,i,e.opacity)}function gi(e,t,n,r){return arguments.length===1?hi(e):new _i(e,t,n,r??1)}function _i(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}tr(_i,gi,nr(rr,{brighter(e){return e=e==null?ar:ar**+e,new _i(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ir:ir**+e,new _i(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Br,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Er(255*(t+n*(si*r+ci*i)),255*(t+n*(li*r+ui*i)),255*(t+di*r*n),this.opacity)}}));var vi=e=>()=>e;function yi(e,t){return function(n){return e+n*t}}function bi(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function xi(e,t){var n=t-e;return n?yi(e,n>180||n<-180?n-360*Math.round(n/360):n):vi(isNaN(e)?t:e)}function Si(e){return(e=+e)==1?Ci:function(t,n){return n-t?bi(t,n,e):vi(isNaN(t)?n:t)}}function Ci(e,t){var n=t-e;return n?yi(e,n):vi(isNaN(e)?t:e)}var wi=(function e(t){var n=Si(t);function r(e,t){var r=n((e=Tr(e)).r,(t=Tr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Ci(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Ti(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Ei(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Di(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=Ii(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Oi(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ki(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ai(e,t){var n={},r={},i;for(i in typeof e==`object`&&e||(e={}),typeof t==`object`&&t||(t={}),t)i in e?n[i]=Ii(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var ji=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mi=new RegExp(ji.source,`g`);function Ni(e){return function(){return e}}function Pi(e){return function(t){return e(t)+``}}function Fi(e,t){var n=ji.lastIndex=Mi.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=ji.exec(e))&&(i=Mi.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ki(r,i)})),n=Mi.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Pi(c[0].x):Ni(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Ii(e,t){var n=typeof t,r;return t==null||n===`boolean`?vi(t):(n===`number`?ki:n===`string`?(r=xr(t))?(t=r,wi):Fi:t instanceof xr?wi:t instanceof Date?Oi:Ei(t)?Ti:Array.isArray(t)?Di:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Ai:ki)(e,t)}var Li=180/Math.PI,Ri={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zi(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Li,skewX:Math.atan(c)*Li,scaleX:o,scaleY:s}}var Bi;function Vi(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Ri:zi(t.a,t.b,t.c,t.d,t.e,t.f)}function Hi(e){return e==null||(Bi||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Bi.setAttribute(`transform`,e),!(e=Bi.transform.baseVal.consolidate()))?Ri:(e=e.matrix,zi(e.a,e.b,e.c,e.d,e.e,e.f))}function Ui(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:ki(e,i)},{i:c-2,x:ki(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:ki(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:ki(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:ki(e,n)},{i:s-2,x:ki(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Wi=Ui(Vi,`px, `,`px)`,`deg)`),Gi=Ui(Hi,`, `,`)`,`)`),Ki=1e-12;function qi(e){return((e=Math.exp(e))+1/e)/2}function Ji(e){return((e=Math.exp(e))-1/e)/2}function Yi(e){return((e=Math.exp(2*e))-1)/(e+1)}var Xi=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Ki)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=qi(y),c=s/(n*g)*(i*Yi(t*r+y)-Ji(y));return[a+c*d,o+c*f,s*i/qi(t*r+y)]}}return m.duration=Math.abs(h)*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4);function Zi(e){return(function t(n){n=+n;function r(t,r){var i=e((t=gi(t)).h,(r=gi(r)).h),a=Ci(t.s,r.s),o=Ci(t.l,r.l),s=Ci(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}Zi(xi),Zi(Ci);var Qi=0,$i=0,ea=0,ta=1e3,na,ra,ia=0,z=0,B=0,aa=typeof performance==`object`&&performance.now?performance:Date,oa=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sa(){return z||=(oa(ca),aa.now()+B)}function ca(){z=0}function la(){this._call=this._time=this._next=null}la.prototype=ua.prototype={constructor:la,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?sa():+n)+(t==null?0:+t),!this._next&&ra!==this&&(ra?ra._next=this:na=this,ra=this),this._call=e,this._time=n,ha()},stop:function(){this._call&&(this._call=null,this._time=1/0,ha())}};function ua(e,t,n){var r=new la;return r.restart(e,t,n),r}function da(){sa(),++Qi;for(var e=na,t;e;)(t=z-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qi}function fa(){z=(ia=aa.now())+B,Qi=$i=0;try{da()}finally{Qi=0,ma(),z=0}}function pa(){var e=aa.now(),t=e-ia;t>ta&&(B-=t,ia=e)}function ma(){for(var e,t=na,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:na=n);ra=e,ha(r)}function ha(e){Qi||($i&&=clearTimeout($i),e-z>24?(e<1/0&&($i=setTimeout(fa,Math.ceil(e-aa.now()-B)+1)),ea&&=clearInterval(ea)):(ea||=(ia=aa.now(),setInterval(pa,ta)),Qi=1,oa(fa)))}function ga(e,t,n){var r=new la;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}function _a(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var va=3;(function e(t){t=+t;function n(e){return e**+t}return n.exponent=e,n})(va),(function e(t){t=+t;function n(e){return 1-(1-e)**t}return n.exponent=e,n})(va),(function e(t){t=+t;function n(e){return((e*=2)<=1?e**+t:2-(2-e)**t)/2}return n.exponent=e,n})(va);function ya(e){return(2**(-10*e)-.0009765625)*1.0009775171065494}var ba=4/11;1/ba/ba;var xa=1.70158;(function e(t){t=+t;function n(e){return(e=+e)*e*(t*(e-1)+e)}return n.overshoot=e,n})(xa),(function e(t){t=+t;function n(e){return--e*e*((e+1)*t+e)+1}return n.overshoot=e,n})(xa),(function e(t){t=+t;function n(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return n.overshoot=e,n})(xa);var Sa=2*Math.PI,Ca=1,wa=.3;(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Sa);function i(e){return t*ya(- --e)*Math.sin((r-e)/n)}return i.amplitude=function(t){return e(t,n*Sa)},i.period=function(n){return e(t,n)},i})(Ca,wa),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Sa);function i(e){return 1-t*ya(e=+e)*Math.sin((e+r)/n)}return i.amplitude=function(t){return e(t,n*Sa)},i.period=function(n){return e(t,n)},i})(Ca,wa),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Sa);function i(e){return((e=e*2-1)<0?t*ya(-e)*Math.sin((r-e)/n):2-t*ya(e)*Math.sin((r+e)/n))/2}return i.amplitude=function(t){return e(t,n*Sa)},i.period=function(n){return e(t,n)},i})(Ca,wa);var Ta=Me(`start`,`end`,`cancel`,`interrupt`),Ea=[],Da=0,Oa=1,ka=2,Aa=3,ja=4,Ma=5,Na=6;function Pa(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Ra(e,n,{name:t,index:r,group:i,on:Ta,tween:Ea,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Da})}function Fa(e,t){var n=La(e,t);if(n.state>Da)throw Error(`too late; already scheduled`);return n}function Ia(e,t){var n=La(e,t);if(n.state>Aa)throw Error(`too late; already running`);return n}function La(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Ra(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=ua(a,0,n.time);function a(e){n.state=Oa,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Oa)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===Aa)return ga(o);f.state===ja?(f.state=Na,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=Na,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(ga(function(){n.state===Aa&&(n.state=ja,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=ka,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===ka){for(n.state=Aa,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=Ma,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===Ma&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=Na,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function za(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>ka&&r.state<Ma,r.state=Na,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function Ba(e){return this.each(function(){za(this,e)})}function Va(e,t){var n,r;return function(){var i=Ia(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Ha(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Ia(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Ua(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=La(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Va:Ha)(n,e,t))}function Wa(e,t,n){var r=e._id;return e.each(function(){var e=Ia(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return La(e,r).value[t]}}function Ga(e,t){var n;return(typeof t==`number`?ki:t instanceof xr?wi:(n=xr(t))?(t=n,wi):Fi)(e,t)}function Ka(e){return function(){this.removeAttribute(e)}}function qa(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ja(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Ya(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Xa(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Za(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Qa(e,t){var n=ze(e),r=n===`transform`?Gi:Ga;return this.attrTween(e,typeof t==`function`?(n.local?Za:Xa)(n,r,Wa(this,`attr.`+e,t)):t==null?(n.local?qa:Ka)(n):(n.local?Ya:Ja)(n,r,t))}function $a(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function eo(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function to(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&eo(e,i)),n}return i._value=t,i}function no(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&$a(e,i)),n}return i._value=t,i}function ro(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 Error();var r=ze(e);return this.tween(n,(r.local?to:no)(r,t))}function io(e,t){return function(){Fa(this,e).delay=+t.apply(this,arguments)}}function ao(e,t){return t=+t,function(){Fa(this,e).delay=t}}function oo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?io:ao)(t,e)):La(this.node(),t).delay}function so(e,t){return function(){Ia(this,e).duration=+t.apply(this,arguments)}}function co(e,t){return t=+t,function(){Ia(this,e).duration=t}}function lo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?so:co)(t,e)):La(this.node(),t).duration}function uo(e,t){if(typeof t!=`function`)throw Error();return function(){Ia(this,e).ease=t}}function fo(e){var t=this._id;return arguments.length?this.each(uo(t,e)):La(this.node(),t).ease}function po(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Ia(this,e).ease=n}}function mo(e){if(typeof e!=`function`)throw Error();return this.each(po(this._id,e))}function ho(e){typeof e!=`function`&&(e=Ze(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new H(r,this._parents,this._name,this._id)}function go(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new H(o,this._parents,this._name,this._id)}function _o(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function vo(e,t,n){var r,i,a=_o(t)?Fa:Ia;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function yo(e,t){var n=this._id;return arguments.length<2?La(this.node(),n).on.on(e):this.each(vo(n,e,t))}function bo(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function xo(){return this.on(`end.remove`,bo(this._id))}function So(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=We(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Pa(l[f],t,n,f,l,La(u,n)));return new H(a,this._parents,t,n)}function Co(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Je(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=La(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Pa(p,t,n,h,f,m);a.push(f),o.push(u)}return new H(a,o,t,n)}var wo=Pn.prototype.constructor;function To(){return new wo(this._groups,this._parents)}function Eo(e,t){var n,r,i;return function(){var a=Vt(this,e),o=(this.style.removeProperty(e),Vt(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Do(e){return function(){this.style.removeProperty(e)}}function Oo(e,t,n){var r,i=n+``,a;return function(){var o=Vt(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function ko(e,t,n){var r,i,a;return function(){var o=Vt(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Vt(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Ao(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Ia(this,e),l=c.on,u=c.value[a]==null?s||=Do(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function jo(e,t,n){var r=(e+=``)==`transform`?Wi:Ga;return t==null?this.styleTween(e,Eo(e,r)).on(`end.style.`+e,Do(e)):typeof t==`function`?this.styleTween(e,ko(e,r,Wa(this,`style.`+e,t))).each(Ao(this._id,e)):this.styleTween(e,Oo(e,r,t),n).on(`end.style.`+e,null)}function Mo(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function No(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Mo(e,a,n)),r}return a._value=t,a}function Po(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 Error();return this.tween(r,No(e,t,n??``))}function Fo(e){return function(){this.textContent=e}}function Io(e){return function(){var t=e(this);this.textContent=t??``}}function Lo(e){return this.tween(`text`,typeof e==`function`?Io(Wa(this,`text`,e)):Fo(e==null?``:e+``))}function Ro(e){return function(t){this.textContent=e.call(this,t)}}function zo(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Ro(r)),t}return r._value=e,r}function Bo(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 Error();return this.tween(t,zo(e))}function Vo(){for(var e=this._name,t=this._id,n=Uo(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=La(c,t);Pa(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new H(r,this._parents,e,n)}function Ho(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Ia(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var V=0;function H(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Uo(){return++V}var Wo=Pn.prototype;H.prototype={constructor:H,select:So,selectAll:Co,selectChild:Wo.selectChild,selectChildren:Wo.selectChildren,filter:ho,merge:go,selection:To,transition:Vo,call:Wo.call,nodes:Wo.nodes,node:Wo.node,size:Wo.size,empty:Wo.empty,each:Wo.each,on:yo,attr:Qa,attrTween:ro,style:jo,styleTween:Po,text:Lo,textTween:Bo,remove:xo,tween:Ua,delay:oo,duration:lo,ease:fo,easeVarying:mo,end:Ho,[Symbol.iterator]:Wo[Symbol.iterator]};var Go={time:null,delay:0,duration:250,ease:_a};function Ko(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function qo(e){var t,n;e instanceof H?(t=e._id,e=e._name):(t=Uo(),(n=Go).time=sa(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Pa(c,e,t,l,o,n||Ko(c,t));return new H(r,this._parents,e,t)}Pn.prototype.interrupt=Ba,Pn.prototype.transition=qo;var Jo=e=>()=>e;function Yo(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function Xo(e,t,n){this.k=e,this.x=t,this.y=n}Xo.prototype={constructor:Xo,scale:function(e){return e===1?this:new Xo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xo(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 Zo=new Xo(1,0,0);Qo.prototype=Xo.prototype;function Qo(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Zo;return e.__zoom}function $o(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function ts(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function ns(){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 rs(){return this.__zoom||Zo}function is(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function as(){return navigator.maxTouchPoints||`ontouchstart`in this}function os(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function ss(){var e=ts,t=ns,n=os,r=is,i=as,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Xi,l=Me(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,rs).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,rs),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Zo.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Xo(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Xo(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Xo(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),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,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=In(this.that).datum();l.call(e,this.that,new Yo(e,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Vn(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],za(this),s.start();es(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=In(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Vn(t,i),l=t.clientX,u=t.clientY;Kn(t.view),$o(t),a.mouse=[c,this.__zoom.invert(c)],za(this),a.start();function d(e){if(es(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Vn(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),qn(e.view,a.moved),es(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Vn(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);es(r),s>0?In(this).transition().duration(s).call(x,d,c,r):In(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for($o(t),s=0;s<i;++s)c=r[s],l=Vn(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),za(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(es(e),s=0;s<a;++s)c=i[s],l=Vn(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for($o(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Vn(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=In(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Jo(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Jo(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Jo(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Jo([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var cs={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.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 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.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},ls=[[-1/0,-1/0],[1/0,1/0]],us=[`Enter`,` `,`Escape`],ds={"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`},fs;(function(e){e.Strict=`strict`,e.Loose=`loose`})(fs||={});var ps;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(ps||={});var ms;(function(e){e.Partial=`partial`,e.Full=`full`})(ms||={});var hs={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},gs;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(gs||={});var _s;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(_s||={});var U;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(U||={});var vs={[U.Left]:U.Right,[U.Right]:U.Left,[U.Top]:U.Bottom,[U.Bottom]:U.Top},ys=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,bs=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),xs=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Ss=(e,t=[0,0])=>{let{width:n,height:r}=nc(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Cs=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):xs(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,Is(e,Bs(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Rs(r):{x:0,y:0,width:0,height:0}},ws=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=Is(n,Bs(e)),r=!0)}),r?Rs(n):{x:0,y:0,width:0,height:0}},Ts=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=Hs(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},Es=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function Ds(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=nc(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function Os({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=$s(ws(Ds(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function ks({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,cs.error005());else{let{width:e,height:t}=nc(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&tc(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=tc(d)?Ms(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,cs.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function As({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=Es(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var js=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ms=(e={x:0,y:0},t,n)=>({x:js(e.x,t[0][0],t[1][0]-(n?.width??0)),y:js(e.y,t[0][1],t[1][1]-(n?.height??0))});function Ns(e,t,n){let{width:r,height:i}=nc(n),{x:a,y:o}=n.internals.positionAbsolute;return Ms(e,[[a,o],[a+r,o+i]],t)}var Ps=(e,t,n)=>e<t?js(Math.abs(e-t),1,t)/t:e>n?-js(Math.abs(e-n),1,t)/t:0,Fs=(e,t,n=15,r=40)=>[Ps(e.x,r,t.width-r)*n,Ps(e.y,r,t.height-r)*n],Is=(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)}),Ls=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Rs=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),zs=(e,t=[0,0])=>{let{x:n,y:r}=xs(e)?e.internals.positionAbsolute:Ss(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Bs=(e,t=[0,0])=>{let{x:n,y:r}=xs(e)?e.internals.positionAbsolute:Ss(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Vs=(e,t)=>Rs(Is(Ls(e),Ls(t))),Hs=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},Us=(e,t)=>Hs(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Ws=e=>Gs(e.width)&&Gs(e.height)&&Gs(e.x)&&Gs(e.y),Gs=e=>!isNaN(e)&&isFinite(e),Ks=(e,t)=>(e,t)=>{},qs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Js=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?qs(s,o):s},Ys=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Xs(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Zs(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Xs(e,n),i=Xs(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Xs(e.top??e.y??0,n),i=Xs(e.bottom??e.y??0,n),a=Xs(e.left??e.x??0,t),o=Xs(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Qs(e,t,n,r,i,a){let{x:o,y:s}=Ys(e,[t,n,r]),{x:c,y:l}=Ys({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var $s=(e,t,n,r,i,a)=>{let o=Zs(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=js(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Qs(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},ec=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function tc(e){return e!=null&&e!==`parent`}function nc(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function rc(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function ic(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function ac(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function oc(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function sc(e){return{...ds,...e||{}}}function cc(e){return e===null?null:e?`valid`:`invalid`}function lc(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=hc(e),s=Js({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?qs(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var uc=e=>({width:e.offsetWidth,height:e.offsetHeight}),dc=e=>e?.getRootNode?.()||window?.document,fc=[`INPUT`,`SELECT`,`TEXTAREA`];function pc(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?fc.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var mc=e=>`clientX`in e,hc=(e,t)=>{let n=mc(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},gc=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...uc(t)}})};function _c({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function vc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function yc({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case U.Left:return[t-vc(t-r,a),n];case U.Right:return[t+vc(r-t,a),n];case U.Top:return[t,n-vc(n-i,a)];case U.Bottom:return[t,n+vc(i-n,a)]}}function bc({sourceX:e,sourceY:t,sourcePosition:n=U.Bottom,targetX:r,targetY:i,targetPosition:a=U.Top,curvature:o=.25}){let[s,c]=yc({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=yc({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=_c({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function xc({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function Sc({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function Cc({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=Is(Bs(e),Bs(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Us({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Rs(a))>0}var wc=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Tc=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),Ec=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,cs.error006()),t;let r=n.getEdgeId||wc,i;return i=ys(e)?{...e}:{...e,id:r(e)},Tc(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function Dc({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=xc({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var Oc={[U.Left]:{x:-1,y:0},[U.Right]:{x:1,y:0},[U.Top]:{x:0,y:-1},[U.Bottom]:{x:0,y:1}},kc=({source:e,sourcePosition:t=U.Bottom,target:n})=>t===U.Left||t===U.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},Ac=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),jc=(e,t,n)=>e.x===t.x&&t.x===n.x&&(t.y-e.y)*(n.y-t.y)>=0||e.y===t.y&&t.y===n.y&&(t.x-e.x)*(n.x-t.x)>=0;function Mc({source:e,sourcePosition:t=U.Bottom,target:n,targetPosition:r=U.Top,center:i,offset:a,stepPosition:o}){let s=Oc[t],c=Oc[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=kc({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=xc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y},C=[];for(let t of[e,x,...m,S,n]){let[e,n]=C.slice(-2);n&&jc(e,n,t)&&C.pop(),C.push(t)}return[C,h,g,y,b]}function Nc(e,t,n,r){let i=Math.min(Ac(e,t)/2,Ac(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function Pc({sourceX:e,sourceY:t,sourcePosition:n=U.Bottom,targetX:r,targetY:i,targetPosition:a=U.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=Mc({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=Nc(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function Fc(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Ic(e){let{sourceNode:t,targetNode:n}=e;if(!Fc(t)||!Fc(n))return null;let r=t.internals.handleBounds||Lc(t.handles),i=n.internals.handleBounds||Lc(n.handles),a=zc(r?.source??[],e.sourceHandle),o=zc(e.connectionMode===fs.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,cs.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||U.Bottom,c=o?.position||U.Top,l=Rc(t,a,s),u=Rc(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function Lc(e){if(!e)return null;let t=[],n=[];for(let 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 Rc(e,t,n=U.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??nc(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case U.Top:return{x:i+o/2,y:a};case U.Right:return{x:i+o,y:a+s/2};case U.Bottom:return{x:i+o/2,y:a+s};case U.Left:return{x:i,y:a+s/2}}}function zc(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function Bc(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Vc(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=Bc(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var Hc=1e3,Uc=10,Wc={nodeOrigin:[0,0],nodeExtent:ls,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Gc={...Wc,checkEquality:!0};function Kc(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function qc(e,t,n){let r=Kc(Wc,n);for(let n of e.values())if(n.parentId)Qc(n,e,t,r);else{let e=Ms(Ss(n,r.nodeOrigin),tc(n.extent)?n.extent:r.nodeExtent,nc(n));n.internals.positionAbsolute=e}}function Jc(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function Yc(e){return e===`manual`}function Xc(e,t,n,r={}){let i=Kc(Gc,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!Yc(i.zIndexMode)?Hc:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=Ms(Ss(u,i.nodeOrigin),tc(u.extent)?u.extent:i.nodeExtent,nc(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Jc(u,e),z:$c(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}e.measured!==void 0&&e.measured.width!==void 0&&e.measured.height!==void 0||e.hidden||(c=!1),u.parentId&&Qc(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Zc(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Qc(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=Kc(Wc,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Zc(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*Uc),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=el(e,u,o,s,a&&!Yc(c)?Hc:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function $c(e,t,n){let r=Gs(e.zIndex)?e.zIndex:0;return Yc(n)?r:r+(e.selected?t:0)}function el(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=nc(e),l=Ss(e,n),u=tc(e.extent)?Ms(l,e.extent,c):l,d=Ms({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Ns(d,c,t));let f=$c(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function tl(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Vs(a.get(n.parentId)?.expandedRect??zs(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=nc(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function nl(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=uc(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=tc(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=Ns(h,s,n))}else m&&(h=Ms(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:gc(`source`,r.nodeElement,p,d,e.id),target:gc(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&Qc(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:zs(g,i)}))}}if(f.length>0){let e=tl(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function rl({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function il(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function al(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;il(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),il(`target`,s,c,e,i,o),t.set(r.id,r)}}function ol(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:ol(n,t):!1}function sl(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function cl(e,t,n,r,i){let a=new Map;for(let[o,s]of e)if((i?s.id===r:s.selected||s.id===r)&&(i||!s.parentId||!ol(s,e))&&(s.draggable||t&&s.draggable===void 0)){let t=e.get(o);t&&a.set(o,{id:o,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return a}function ll({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function ul({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=qs(a,t);return{x:o.x-a.x,y:o.y-a.y}}function dl({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=In(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?Ls(ws(s)):null,x=v&&l?ul({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:qs(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=ks({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=ll({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=Fs(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0;let v=!!b&&!o&&!i.get(b)?.selected;m&&y||o||!b||i.get(b)?.selected||_(),y&&m&&b&&e?.(b);let x=lc(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=x,s=cl(i,c,x,b,v),s.size>0&&(n||h||!b&&g)){let[e,t]=ll({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=er().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=lc(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=hc(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=lc(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=hc(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=hc(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p)p&&s.size>0&&t().updateNodePositions(s,!1);else if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=ll({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!sl(t,`.${g}`,v))&&(!_||sl(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function fl(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Us(i,zs(e))>0&&r.push(e);return r}var pl=250;function ml(e,t,n,r){let i=[],a=1/0,o=fl(e,n,t+pl);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=Rc(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function hl(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...Rc(o,c,c.position,!0)}:c}function gl(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function _l(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var vl=()=>!0;function yl(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=vl,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=dc(e.target),E=0,D,{x:O,y:k}=hc(e),A=gl(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let ee=hl(i,A,r,c,t);if(!ee)return;let N=hc(e,j),te=!1,ne=null,re=!1,ie=null;function ae(){if(!u||!j)return;let[e,t]=Fs(N,j,S);f({x:e,y:t}),E=requestAnimationFrame(ae)}let oe={...ee,nodeId:i,type:A,position:ee.position},se=c.get(i),ce={inProgress:!0,isValid:null,from:Rc(se,oe,U.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:se,to:N,toHandle:null,toPosition:vs[oe.position],toNode:null,pointer:N};function le(){M=!0,y(ce),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&le();function ue(e){if(!M){let{x:t,y:n}=hc(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;le()}if(!x()||!oe){de(e);return}let a=b();N=hc(e,j),D=ml(Js(N,a,!1,[1,1]),n,c,oe),te||=(ae(),!0);let s=bl(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});ie=s.handleDomNode,ne=s.connection,re=_l(!!D,s.isValid);let u=c.get(i),f=u?Rc(u,oe,U.Left,!0):ce.from,p={...ce,from:f,isValid:re,to:s.toHandle&&re?Ys({x:s.toHandle.x,y:s.toHandle.y},a):N,toHandle:s.toHandle,toPosition:re&&s.toHandle?s.toHandle.position:vs[oe.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:N};y(p),ce=p}function de(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||ie)&&ne&&re&&h?.(ne);let{inProgress:t,...n}=ce,r={...n,toPosition:ce.toHandle?ce.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),te=!1,re=!1,ne=null,ie=null,T.removeEventListener(`mousemove`,ue),T.removeEventListener(`mouseup`,de),T.removeEventListener(`touchmove`,ue),T.removeEventListener(`touchend`,de)}}T.addEventListener(`mousemove`,ue),T.addEventListener(`mouseup`,de),T.addEventListener(`touchmove`,ue),T.addEventListener(`touchend`,de)}function bl(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=vl,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=hc(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=gl(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===fs.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=hl(t,e,a,u,n,!0)}return _}var xl={onPointerDown:yl,isValid:bl};function Sl({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=In(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&ec()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=ss().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:Vn}}var Cl=e=>({x:e.x,y:e.y,zoom:e.k}),wl=({x:e,y:t,zoom:n})=>Zo.translate(e,t).scale(n),Tl=(e,t)=>e.target.closest(`.${t}`),El=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Dl=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ol=(e,t=0,n=Dl,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},kl=e=>{let t=e.ctrlKey&&ec()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Al({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Tl(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=Vn(u),t=d*2**kl(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===ps.Vertical?0:u.deltaX*f,m=i===ps.Horizontal?0:u.deltaY*f;!ec()&&u.shiftKey&&i!==ps.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=Cl(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function jl({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=Tl(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function Ml({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Cl(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function Nl({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&El(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,Cl(a.transform))}}function Pl({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&El(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=Cl(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function Fl({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(Tl(f,`${u}-flow__node`)||Tl(f,`${u}-flow__edge`)||Tl(f,`${u}-flow__selection`)||Tl(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||Tl(f,c)&&h||Tl(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function Il({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]],f=typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t?.contentRect&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null;f?.observe(e);let p=ss().extent(()=>d).scaleExtent([t,n]).translateExtent(r),m=In(e).call(p);b({x:i.x,y:i.y,zoom:js(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let h=m.on(`wheel.zoom`),g=m.on(`dblclick.zoom`);p.wheelDelta(kl);async function _(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?Ii:Xi).transform(Ol(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function v({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:f,preventScrolling:_,zoomOnPinch:v,zoomOnScroll:y,zoomOnDoubleClick:b,panActivationKeyPressed:x=!1,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&p.on(`zoom`,null);let O=i&&!S&&!r;p.clickDistance(D?1/0:!Gs(E)||E<0?0:E);let k=O?Al({zoomPanValues:l,noWheelClassName:e,d3Selection:m,d3Zoom:p,panOnScrollMode:d,panOnScrollSpeed:f,zoomOnPinch:v,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):jl({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:h});m.on(`wheel.zoom`,k,{passive:!1});let A=Ml({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});p.on(`start`,A);let j=Nl({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});p.on(`zoom`,j);let M=Pl({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});p.on(`end`,M);let ee=Fl({panActivationKeyPressed:x,zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:y,panOnScroll:i,zoomOnDoubleClick:b,zoomOnPinch:v,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});p.filter(ee),b?m.on(`dblclick.zoom`,g):m.on(`dblclick.zoom`,null)}function y(){p.on(`zoom`,null),f?.disconnect()}async function b(e,t,n){let r=wl(e),i=p?.constrain()(r,t,n);return i&&await _(i),i}async function x(e,t){let n=wl(e);return await _(n,t),n}function S(e){if(m){let t=wl(e),n=m.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&p?.transform(m,t,null,{sync:!0})}}function C(){let e=m?Qo(m.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function w(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?Ii:Xi).scaleTo(Ol(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function T(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?Ii:Xi).scaleBy(Ol(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function E(e){p?.scaleExtent(e)}function D(e){p?.translateExtent(e)}function O(e){let t=!Gs(e)||e<0?0:e;p?.clickDistance(t)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:C,scaleTo:w,scaleBy:T,setScaleExtent:E,setTranslateExtent:D,syncViewport:S,setClickDistance:O}}var Ll;(function(e){e.Line=`line`,e.Handle=`handle`})(Ll||={});function Rl({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function zl(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function Bl(e,t){return Math.max(0,t-e)}function Vl(e,t){return Math.max(0,e-t)}function Hl(e,t,n){return Math.max(0,t-e,e-n)}function Ul(e,t){return e?!t:t}function Wl(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=Hl(E,h,g),j=Hl(D,_,v);if(o){let e=0,t=0;c&&w<0?e=Bl(y+w+O,o[0][0]):!c&&w>0&&(e=Vl(y+E+O,o[1][0])),l&&T<0?t=Bl(b+T+k,o[0][1]):!l&&T>0&&(t=Vl(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=Vl(y+w,s[0][0]):!c&&w<0&&(e=Bl(y+E,s[1][0])),l&&T>0?t=Vl(b+T,s[0][1]):!l&&T<0&&(t=Bl(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=Hl(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?Vl(b+k+E/C,o[1][1])*C:Bl(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?Bl(b+E/C,s[1][1])*C:Vl(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=Hl(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?Vl(y+D*C+O,o[1][0])/C:Bl(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?Bl(y+D*C,s[1][0])/C:Vl(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(Ul(c,l)?-w:w)/C:w=(Ul(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,ee=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+ee}}var Gl={width:0,height:0,x:0,y:0},Kl={...Gl,pointerX:0,pointerY:0,aspectRatio:1};function ql(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function Jl({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=In(e),o={controlDirection:zl(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...Gl},h={...Kl};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:zl(e)};let g,_=null,v=[],y,b,x,S=er().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=lc(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=tc(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=ql(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=lc(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:O,y:k}=Wl(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),A=E!==S,j=D!==C,M=O!==u&&A,ee=k!==f&&j;if(!M&&!ee&&!A&&!j)return;let N={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((M||ee||T[0]===1||T[1]===1)&&(w.x=M?O:m.x,w.y=ee?k:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=O-u,t=k-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((A||j)&&(w.width=A&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=j&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let te=Rl({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),ne={...m,direction:te};p?.(e,ne)===!1?(m=N.prevValues,h.x=N.startX,h.y=N.startY,v.forEach((e,t)=>{e.position=N.childNodes[t].position})):(d?.(e,ne),r(w,l))}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var Yl=t((e=>{var t=x();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Xl=t(((e,t)=>{t.exports=Yl()})),Zl=t((e=>{var t=x(),n=Xl();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ql=e(t(((e,t)=>{t.exports=Zl()}))(),1),$l=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},eu=e=>e?$l(e):$l,{useDebugValue:tu}=O.default,{useSyncExternalStoreWithSelector:nu}=Ql.default,ru=e=>e;function iu(e,t=ru,n){let r=nu(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return tu(r),r}var au=(e,t)=>{let n=eu(e),r=(e,r=t)=>iu(n,e,r);return Object.assign(r,n),r},ou=(e,t)=>e?au(e,t):au;function W(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var su=T(),cu=(0,O.createContext)(null),lu=cu.Provider,uu=cs.error001(`react`);function G(e,t){let n=(0,O.useContext)(cu);if(n===null)throw Error(uu);return iu(n,e,t)}function du(){let e=(0,O.useContext)(cu);if(e===null)throw Error(uu);return(0,O.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var fu={display:`none`},pu={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},mu=`react-flow__node-desc`,hu=`react-flow__edge-desc`,gu=`react-flow__aria-live`,_u=e=>e.ariaLiveMessage,vu=e=>e.ariaLabelConfig;function yu({rfId:e}){let t=G(_u);return(0,P.jsx)(`div`,{id:`${gu}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:pu,children:t})}function bu({rfId:e,disableKeyboardA11y:t}){let n=G(vu);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{id:`${mu}-${e}`,style:fu,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,P.jsx)(`div`,{id:`${hu}-${e}`,style:fu,children:n[`edge.a11yDescription.default`]}),!t&&(0,P.jsx)(yu,{rfId:e})]})}var xu=(0,O.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,P.jsx)(`div`,{className:Ae([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});xu.displayName=`Panel`;var Su=`https://reactflow.dev?utm_source=attribution`;function Cu({proOptions:e,position:t=`bottom-right`}){return(0,O.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,P.jsx)(xu,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Su}`,children:(0,P.jsx)(`a`,{href:Su,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var wu=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},Tu=e=>e.id;function Eu(e,t){return W(e.selectedNodes.map(Tu),t.selectedNodes.map(Tu))&&W(e.selectedEdges.map(Tu),t.selectedEdges.map(Tu))}function Du({onSelectionChange:e}){let t=du(),{selectedNodes:n,selectedEdges:r}=G(wu,Eu);return(0,O.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var Ou=e=>!!e.onSelectionChangeHandlers;function ku({onSelectionChange:e}){let t=G(Ou);return e||t?(0,P.jsx)(Du,{onSelectionChange:e}):null}var Au=[0,0],ju={x:0,y:0,zoom:1},Mu=[...`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`.split(`.`),`rfId`],Nu=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}),Pu={translateExtent:ls,nodeOrigin:Au,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function Fu(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=G(Nu,W),l=du();(0,O.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=Pu,s()}),[]);let u=(0,O.useRef)(Pu);return(0,O.useEffect)(()=>{for(let s of Mu){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:sc(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},Mu.map(t=>e[t])),null}function Iu(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function Lu(e){let[t,n]=(0,O.useState)(e===`system`?null:e);return(0,O.useEffect)(()=>{if(e!==`system`){n(e);return}let t=Iu(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?Iu()?.matches?`dark`:`light`:t}var Ru=typeof document<`u`?document:null;function zu(e=null,t={target:Ru,actInsideInputWithModifier:!0}){let[n,r]=(0,O.useState)(!1),i=(0,O.useRef)(!1),a=(0,O.useRef)(new Set([])),[o,s]=(0,O.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
14
+ `)})},i()));continue}let s=me.exec(a);if(s){let e=`h${Math.min(6,s[1].length+t)}`;n.push((0,P.jsx)(e,{children:be(s[2])},i())),r++;continue}if(ge.test(a)){n.push((0,P.jsx)(`hr`,{},i())),r++;continue}if(_e.test(a)){let a=[];for(;r<e.length&&_e.test(e[r]);r++)a.push(_e.exec(e[r])[1]);n.push((0,P.jsx)(`blockquote`,{children:ve(a,t)},i()));continue}let c=F.test(a)?F:I.test(a)?I:null;if(c){let t=[];for(;r<e.length;r++){let n=e[r],i=c.exec(n);if(i)t.push(i[1]);else if(n.trim()!==``&&/^\s+\S/.test(n)&&t.length>0)t[t.length-1]+=` ${n.trim()}`;else break}let a=c===F?`ul`:`ol`;n.push((0,P.jsx)(a,{children:t.map((e,t)=>(0,P.jsx)(`li`,{children:be(e)},t))},i()));continue}let l=[];for(;r<e.length;r++){let t=e[r];if(t.trim()===``||he.test(t)||me.test(t)||F.test(t)||I.test(t)||_e.test(t)||ge.test(t))break;l.push(t.trim())}n.push((0,P.jsx)(`p`,{children:be(l.join(` `))},i()))}return n}var ye=/`([^`]+)`|\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|<(https?:\/\/[^>\s]+)>|\*\*(.+?)\*\*|__(.+?)__|\*([^*\s][^*]*?)\*|\b_([^_\s][^_]*?)_\b/g;function be(e){let t=[],n=0;for(let r of e.matchAll(ye)){r.index>n&&t.push(e.slice(n,r.index));let i=t.length,[,a,o,s,c,l,u,d,f]=r;a===void 0?o===void 0?c===void 0?l!==void 0||u!==void 0?t.push((0,P.jsx)(`strong`,{children:be(l??u)},i)):t.push((0,P.jsx)(`em`,{children:be(d??f)},i)):t.push((0,P.jsx)(xe,{href:c,children:c},i)):t.push((0,P.jsx)(xe,{href:s,children:be(o)},i)):t.push((0,P.jsx)(`code`,{children:a},i)),n=r.index+r[0].length}return n<e.length&&t.push(e.slice(n)),t}function xe({href:e,children:t}){return/^(https?:|mailto:|[./#]|[^:]*$)/i.test(e)?(0,P.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:t}):(0,P.jsx)(P.Fragment,{children:t})}var Se={find:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`circle`,{cx:`7`,cy:`7`,r:`4.5`}),(0,P.jsx)(`path`,{d:`M10.5 10.5 14 14`})]}),model:(0,P.jsx)(`path`,{d:`M2.5 3h6M5 3v10.5M5 8.25h7.5M5 13.5h7.5`}),teams:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`circle`,{cx:`5`,cy:`5`,r:`2`}),(0,P.jsx)(`circle`,{cx:`11`,cy:`5`,r:`2`}),(0,P.jsx)(`path`,{d:`M1.5 13.5v-1a3.5 3.5 0 0 1 7 0v1M7.5 13.5v-1a3.5 3.5 0 0 1 7 0v1`})]}),views:(0,P.jsx)(`path`,{d:`M2 2h5v5H2zM9 2h5v5H9zM2 9h5v5H2zM9 9h5v5H9z`}),back:(0,P.jsx)(`path`,{d:`M10 2.5 4.5 8l5.5 5.5`}),forward:(0,P.jsx)(`path`,{d:`M6 2.5 11.5 8 6 13.5`}),close:(0,P.jsx)(`path`,{d:`M3 3l10 10M13 3 3 13`}),plus:(0,P.jsx)(`path`,{d:`M8 3v10M3 8h10`}),minus:(0,P.jsx)(`path`,{d:`M3 8h10`}),copy:(0,P.jsx)(`path`,{d:`M5.5 5.5h8v8h-8zM2.5 10.5v-8h8`}),check:(0,P.jsx)(`path`,{d:`M2.5 8.5 6 12l7.5-8`}),recent:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`}),(0,P.jsx)(`path`,{d:`M8 4.5V8l2.5 2`})]}),revisions:(0,P.jsx)(`path`,{d:`M2.5 3v3.5H6M3 6.5A5.5 5.5 0 1 1 2.5 9M8 5v3l2 1.5`}),export:(0,P.jsx)(`path`,{d:`M8 2v8M4.5 6.5 8 10l3.5-3.5M2.5 11v2.5h11V11`}),layout:(0,P.jsx)(`path`,{d:`M2 4h4v8H2zM10 4h4v8h-4zM6 8h4`}),arrow:(0,P.jsx)(`path`,{d:`M2 8h11M9 4l4 4-4 4`}),person:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`circle`,{cx:`8`,cy:`5`,r:`2.5`}),(0,P.jsx)(`path`,{d:`M3 14v-1.5a5 5 0 0 1 10 0V14`})]}),system:(0,P.jsx)(`path`,{d:`M2 2h12v12H2zM5 5h6v6H5z`}),service:(0,P.jsx)(`path`,{d:`M8 1.5 14 5v6l-6 3.5L2 11V5z`}),component:(0,P.jsx)(`path`,{d:`M8 2l6 6-6 6-6-6z`}),datastore:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`ellipse`,{cx:`8`,cy:`4`,rx:`5`,ry:`2`}),(0,P.jsx)(`path`,{d:`M3 4v8c0 1.1 2.2 2 5 2s5-.9 5-2V4M3 8c0 1.1 2.2 2 5 2s5-.9 5-2`})]}),broker:(0,P.jsx)(`path`,{d:`M2 4.5h9.5M9 2l2.5 2.5L9 7M14 11.5H4.5M7 9l-2.5 2.5L7 14`}),deployment:(0,P.jsx)(`path`,{d:`M8 1.5 14 5v6l-6 3.5L2 11V5zM6.5 6.5h3v3h-3z`}),target:(0,P.jsx)(`path`,{d:`M2 6V2h4M10 2h4v4M14 10v4h-4M6 14H2v-4`}),dynamic:(0,P.jsx)(`path`,{d:`M4 2.5 13 8l-9 5.5z`}),play:(0,P.jsx)(`path`,{d:`M4 2.5 13 8l-9 5.5z`}),pause:(0,P.jsx)(`path`,{d:`M4.5 2.5v11M11.5 2.5v11`}),first:(0,P.jsx)(`path`,{d:`M3.5 2.5v11M13 2.5 6.5 8l6.5 5.5z`}),previous:(0,P.jsx)(`path`,{d:`M12 2.5 5 8l7 5.5z`}),next:(0,P.jsx)(`path`,{d:`M2.5 2.5 8 8l-5.5 5.5zM8.5 2.5 14 8l-5.5 5.5z`}),up:(0,P.jsx)(`path`,{d:`M8 14V3M4 7l4-4 4 4`}),down:(0,P.jsx)(`path`,{d:`M8 2v11M4 9l4 4 4-4`}),origin:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`circle`,{cx:`8`,cy:`8`,r:`5`}),(0,P.jsx)(`path`,{d:`M8 1v3M8 12v3M1 8h3M12 8h3`})]}),saved:(0,P.jsx)(`path`,{d:`M4 2h8v12l-4-3-4 3z`}),impact:(0,P.jsx)(`path`,{d:`M8 1.5v13M4 5.5l4-4 4 4M4 10.5l4 4 4-4`}),connect:(0,P.jsx)(`path`,{d:`M2 5h11M10 2l3 3-3 3M14 11H3M6 8l-3 3 3 3`}),open:(0,P.jsx)(`path`,{d:`M9.5 2.5h4v4M13.5 2.5 8 8M7 3.5H2.5v10h10V9`})};function L({name:e,className:t}){return(0,P.jsx)(`svg`,{className:t?`arc-icon ${t}`:`arc-icon`,viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,focusable:`false`,children:Se[e]})}var Ce={"◉":`person`,"▣":`system`,"▭":`service`,"◇":`component`,"⛁":`target`,"▶":`dynamic`},we={proposed:`Proposed`,accepted:`Accepted`,rejected:`Rejected`,deprecated:`Deprecated`,superseded:`Superseded`};function Te({status:e}){return(0,P.jsx)(`span`,{className:`arc-adr-status`,"data-status":e,children:we[e]})}function Ee({workspace:e,id:t,beside:n,onClose:r,onOpenAdr:i,onFocus:a,onOpenView:o}){let s=(0,O.useMemo)(()=>new Map(e.bundle.adrs.map(e=>[e.id,e])),[e]),c=s.get(t),l=`arc-reader${n?` arc-reader-beside`:``}`,u=(0,P.jsx)(`button`,{type:`button`,className:`arc-reader-close`,"aria-label":`Close ADR`,onClick:r,children:(0,P.jsx)(L,{name:`close`})});if(!c)return(0,P.jsx)(`article`,{className:l,"aria-label":`ADR`,children:(0,P.jsxs)(`header`,{className:`arc-reader-head`,children:[u,(0,P.jsxs)(`p`,{className:`arc-empty`,children:[`No ADR `,t,` in this Workspace.`]})]})});let d=e=>(0,P.jsxs)(`button`,{type:`button`,className:`arc-link`,onClick:()=>i(e),children:[(0,P.jsx)(`code`,{children:e}),` `,s.get(e)?.title??``]},e),f=t=>{if(e.byId.has(t))return(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>a(t),children:e.name(t)},t);let n=e.bundle.targets.find(e=>e.id===t);return(0,P.jsx)(`span`,{title:t,children:n?`${n.name} (${n.kind})`:t},t)},p=t=>(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>o(t),children:e.title(t)??t},t),m=c.effectiveStatus!==c.status;return(0,P.jsxs)(`article`,{className:l,"aria-label":`ADR`,children:[(0,P.jsxs)(`header`,{className:`arc-reader-head`,children:[u,(0,P.jsx)(`h2`,{children:c.title}),(0,P.jsx)(`code`,{className:`arc-panel-id`,children:c.id})]}),(0,P.jsxs)(`div`,{className:`arc-reader-body`,children:[c.supersededBy.length>0&&(0,P.jsxs)(`p`,{className:`arc-reader-banner`,role:`status`,children:[`Superseded by `,Oe(c.supersededBy.map(d),` `)]}),(0,P.jsxs)(`dl`,{className:`arc-facts`,children:[(0,P.jsx)(`dt`,{children:`Status`}),(0,P.jsxs)(`dd`,{children:[(0,P.jsx)(Te,{status:c.effectiveStatus}),m&&(0,P.jsxs)(`span`,{className:`arc-muted`,children:[` (written as `,we[c.status],`)`]})]}),(0,P.jsx)(`dt`,{children:`Date`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(`time`,{dateTime:c.date,children:c.date})}),De(`Decision makers`,c.decisionMakers),De(`Consulted`,c.consulted),De(`Informed`,c.informed),De(`Tags`,c.tags),De(`Elements`,c.elements.map(f),` `),De(`Views`,c.views.map(p),` `),De(`Supersedes`,c.supersedes.map(d),` `),De(`Superseded by`,c.supersededBy.map(d),` `)]}),(0,P.jsx)(`section`,{className:`arc-markdown`,role:`region`,"aria-label":`Decision`,children:(0,P.jsx)(pe,{source:ke(c.body,c.title),shift:1})}),(0,P.jsx)(`p`,{className:`arc-muted arc-reader-source`,children:c.source.file})]})]})}function De(e,t,n=`, `){return t.length===0?null:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:Oe(t,n)})]})}var Oe=(e,t)=>e.flatMap((e,n)=>n===0?[e]:[t,e]);function ke(e,t){let n=/^\s*#\s+(.*?)\s*#*\s*(\n|$)/.exec(e);return n&&n[1]===t?e.slice(n[0].length):e}function Ae(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=Ae(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var je={value:()=>{}};function Me(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Ne(n)}function Ne(e){this._=e}function Pe(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Ne.prototype=Me.prototype={constructor:Ne,on:function(e,t){var n=this._,r=Pe(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Fe(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Ie(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ie(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ne(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Fe(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Ie(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=je,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Le=`http://www.w3.org/1999/xhtml`,Re={svg:`http://www.w3.org/2000/svg`,xhtml:Le,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function ze(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Re.hasOwnProperty(t)?{space:Re[t],local:e}:e}function Be(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Le&&t.documentElement.namespaceURI===Le?t.createElement(e):t.createElementNS(n,e)}}function Ve(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function He(e){var t=ze(e);return(t.local?Ve:Be)(t)}function Ue(){}function We(e){return e==null?Ue:function(){return this.querySelector(e)}}function Ge(e){typeof e!=`function`&&(e=We(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Nn(r,this._parents)}function Ke(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qe(){return[]}function Je(e){return e==null?qe:function(){return this.querySelectorAll(e)}}function Ye(e){return function(){return Ke(e.apply(this,arguments))}}function Xe(e){e=typeof e==`function`?Ye(e):Je(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Nn(r,i)}function Ze(e){return function(){return this.matches(e)}}function Qe(e){return function(t){return t.matches(e)}}var $e=Array.prototype.find;function et(e){return function(){return $e.call(this.children,e)}}function tt(){return this.firstElementChild}function nt(e){return this.select(e==null?tt:et(typeof e==`function`?e:Qe(e)))}var rt=Array.prototype.filter;function it(){return Array.from(this.children)}function at(e){return function(){return rt.call(this.children,e)}}function ot(e){return this.selectAll(e==null?it:at(typeof e==`function`?e:Qe(e)))}function st(e){typeof e!=`function`&&(e=Ze(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Nn(r,this._parents)}function ct(e){return Array(e.length)}function lt(){return new Nn(this._enter||this._groups.map(ct),this._parents)}function ut(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ut.prototype={constructor:ut,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 dt(e){return function(){return e}}function ft(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new ut(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function pt(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new ut(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function mt(e){return e.__data__}function ht(e,t){if(!arguments.length)return Array.from(this,mt);var n=t?pt:ft,r=this._parents,i=this._groups;typeof e!=`function`&&(e=dt(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=gt(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Nn(o,r),o._enter=s,o._exit=c,o}function gt(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function _t(){return new Nn(this._exit||this._groups.map(ct),this._parents)}function vt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function yt(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Nn(s,this._parents)}function bt(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function xt(e){e||=St;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Nn(i,this._parents).order()}function St(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ct(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wt(){return Array.from(this)}function Tt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Et(){let e=0;for(let t of this)++e;return e}function Dt(){return!this.node()}function Ot(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function kt(e){return function(){this.removeAttribute(e)}}function At(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jt(e,t){return function(){this.setAttribute(e,t)}}function Mt(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Nt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Pt(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 Ft(e,t){var n=ze(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?At:kt:typeof t==`function`?n.local?Pt:Nt:n.local?Mt:jt)(n,t))}function It(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Lt(e){return function(){this.style.removeProperty(e)}}function Rt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function zt(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Bt(e,t,n){return arguments.length>1?this.each((t==null?Lt:typeof t==`function`?zt:Rt)(e,t,n??``)):Vt(this.node(),e)}function Vt(e,t){return e.style.getPropertyValue(t)||It(e).getComputedStyle(e,null).getPropertyValue(t)}function Ht(e){return function(){delete this[e]}}function Ut(e,t){return function(){this[e]=t}}function Wt(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Gt(e,t){return arguments.length>1?this.each((t==null?Ht:typeof t==`function`?Wt:Ut)(e,t)):this.node()[e]}function Kt(e){return e.trim().split(/^|\s+/)}function R(e){return e.classList||new qt(e)}function qt(e){this._node=e,this._names=Kt(e.getAttribute(`class`)||``)}qt.prototype={add:function(e){this._names.indexOf(e)<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 Jt(e,t){for(var n=R(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Yt(e,t){for(var n=R(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Xt(e){return function(){Jt(this,e)}}function Zt(e){return function(){Yt(this,e)}}function Qt(e,t){return function(){(t.apply(this,arguments)?Jt:Yt)(this,e)}}function $t(e,t){var n=Kt(e+``);if(arguments.length<2){for(var r=R(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Qt:t?Xt:Zt)(n,t))}function en(){this.textContent=``}function tn(e){return function(){this.textContent=e}}function nn(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function rn(e){return arguments.length?this.each(e==null?en:(typeof e==`function`?nn:tn)(e)):this.node().textContent}function an(){this.innerHTML=``}function on(e){return function(){this.innerHTML=e}}function sn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function cn(e){return arguments.length?this.each(e==null?an:(typeof e==`function`?sn:on)(e)):this.node().innerHTML}function ln(){this.nextSibling&&this.parentNode.appendChild(this)}function un(){return this.each(ln)}function dn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function fn(){return this.each(dn)}function pn(e){var t=typeof e==`function`?e:He(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function mn(){return null}function hn(e,t){var n=typeof e==`function`?e:He(e),r=t==null?mn:typeof t==`function`?t:We(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function gn(){var e=this.parentNode;e&&e.removeChild(this)}function _n(){return this.each(gn)}function vn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bn(e){return this.select(e?yn:vn)}function xn(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Sn(e){return function(t){e.call(this,t,this.__data__)}}function Cn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function wn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Tn(e,t,n){return function(){var r=this.__on,i,a=Sn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function En(e,t,n){var r=Cn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?Tn:wn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function Dn(e,t,n){var r=It(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function On(e,t){return function(){return Dn(this,e,t)}}function kn(e,t){return function(){return Dn(this,e,t.apply(this,arguments))}}function An(e,t){return this.each((typeof t==`function`?kn:On)(e,t))}function*jn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Mn=[null];function Nn(e,t){this._groups=e,this._parents=t}function Pn(){return new Nn([[document.documentElement]],Mn)}function Fn(){return this}Nn.prototype=Pn.prototype={constructor:Nn,select:Ge,selectAll:Xe,selectChild:nt,selectChildren:ot,filter:st,data:ht,enter:lt,exit:_t,join:vt,merge:yt,selection:Fn,order:bt,sort:xt,call:Ct,nodes:wt,node:Tt,size:Et,empty:Dt,each:Ot,attr:Ft,style:Bt,property:Gt,classed:$t,text:rn,html:cn,raise:un,lower:fn,append:pn,insert:hn,remove:_n,clone:bn,datum:xn,on:En,dispatch:An,[Symbol.iterator]:jn};function In(e){return typeof e==`string`?new Nn([[document.querySelector(e)]],[document.documentElement]):new Nn([[e]],Mn)}var Ln=0;function Rn(){return new zn}function zn(){this._=`@`+(++Ln).toString(36)}zn.prototype=Rn.prototype={constructor:zn,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function Bn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Vn(e,t){if(e=Bn(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 i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Hn={passive:!1},Un={capture:!0,passive:!1};function Wn(e){e.stopImmediatePropagation()}function Gn(e){e.preventDefault(),e.stopImmediatePropagation()}function Kn(e){var t=e.document.documentElement,n=In(e).on(`dragstart.drag`,Gn,Un);`onselectstart`in t?n.on(`selectstart.drag`,Gn,Un):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function qn(e,t){var n=e.document.documentElement,r=In(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,Gn,Un),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Jn=e=>()=>e;function Yn(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){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:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Yn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Xn(e){return!e.ctrlKey&&!e.button}function Zn(){return this.parentNode}function Qn(e,t){return t??{x:e.x,y:e.y}}function $n(){return navigator.maxTouchPoints||`ontouchstart`in this}function er(){var e=Xn,t=Zn,n=Qn,r=$n,i={},a=Me(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Hn).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(In(n.view).on(`mousemove.drag`,m,Un).on(`mouseup.drag`,h,Un),Kn(n.view),Wn(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(Gn(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){In(e.view).on(`mousemove.drag mouseup.drag`,null),qn(e.view,l),Gn(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Wn(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(Gn(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Wn(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Vn(l||r,t),p,m,h;if((h=n.call(e,new Yn(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Vn(l||a,t),_=o}u.call(r,e,new Yn(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Jn(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:Jn(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:Jn(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:Jn(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function tr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nr(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function rr(){}var ir=.7,ar=1/ir,or=`\\s*([+-]?\\d+)\\s*`,sr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,cr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,lr=/^#([0-9a-f]{3,8})$/,ur=RegExp(`^rgb\\(${or},${or},${or}\\)$`),dr=RegExp(`^rgb\\(${cr},${cr},${cr}\\)$`),fr=RegExp(`^rgba\\(${or},${or},${or},${sr}\\)$`),pr=RegExp(`^rgba\\(${cr},${cr},${cr},${sr}\\)$`),mr=RegExp(`^hsl\\(${sr},${cr},${cr}\\)$`),hr=RegExp(`^hsla\\(${sr},${cr},${cr},${sr}\\)$`),gr={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};tr(rr,xr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_r,formatHex:_r,formatHex8:vr,formatHsl:yr,formatRgb:br,toString:br});function _r(){return this.rgb().formatHex()}function vr(){return this.rgb().formatHex8()}function yr(){return Pr(this).formatHsl()}function br(){return this.rgb().formatRgb()}function xr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=lr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Sr(t):n===3?new Er(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Cr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Cr(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=ur.exec(e))?new Er(t[1],t[2],t[3],1):(t=dr.exec(e))?new Er(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=fr.exec(e))?Cr(t[1],t[2],t[3],t[4]):(t=pr.exec(e))?Cr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=mr.exec(e))?Nr(t[1],t[2]/100,t[3]/100,1):(t=hr.exec(e))?Nr(t[1],t[2]/100,t[3]/100,t[4]):gr.hasOwnProperty(e)?Sr(gr[e]):e===`transparent`?new Er(NaN,NaN,NaN,0):null}function Sr(e){return new Er(e>>16&255,e>>8&255,e&255,1)}function Cr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Er(e,t,n,r)}function wr(e){return e instanceof rr||(e=xr(e)),e?(e=e.rgb(),new Er(e.r,e.g,e.b,e.opacity)):new Er}function Tr(e,t,n,r){return arguments.length===1?wr(e):new Er(e,t,n,r??1)}function Er(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}tr(Er,Tr,nr(rr,{brighter(e){return e=e==null?ar:ar**+e,new Er(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ir:ir**+e,new Er(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Er(jr(this.r),jr(this.g),jr(this.b),Ar(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:Dr,formatHex:Dr,formatHex8:Or,formatRgb:kr,toString:kr}));function Dr(){return`#${Mr(this.r)}${Mr(this.g)}${Mr(this.b)}`}function Or(){return`#${Mr(this.r)}${Mr(this.g)}${Mr(this.b)}${Mr((isNaN(this.opacity)?1:this.opacity)*255)}`}function kr(){let e=Ar(this.opacity);return`${e===1?`rgb(`:`rgba(`}${jr(this.r)}, ${jr(this.g)}, ${jr(this.b)}${e===1?`)`:`, ${e})`}`}function Ar(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function jr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mr(e){return e=jr(e),(e<16?`0`:``)+e.toString(16)}function Nr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ir(e,t,n,r)}function Pr(e){if(e instanceof Ir)return new Ir(e.h,e.s,e.l,e.opacity);if(e instanceof rr||(e=xr(e)),!e)return new Ir;if(e instanceof Ir)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Ir(o,s,c,e.opacity)}function Fr(e,t,n,r){return arguments.length===1?Pr(e):new Ir(e,t,n,r??1)}function Ir(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}tr(Ir,Fr,nr(rr,{brighter(e){return e=e==null?ar:ar**+e,new Ir(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ir:ir**+e,new Ir(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,i=2*n-r;return new Er(zr(e>=240?e-240:e+120,i,r),zr(e,i,r),zr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ir(Lr(this.h),Rr(this.s),Rr(this.l),Ar(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(){let e=Ar(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Lr(this.h)}, ${Rr(this.s)*100}%, ${Rr(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Lr(e){return e=(e||0)%360,e<0?e+360:e}function Rr(e){return Math.max(0,Math.min(1,e||0))}function zr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Br=Math.PI/180,Vr=180/Math.PI,Hr=18,Ur=.96422,Wr=1,Gr=.82521,Kr=4/29,qr=6/29,Jr=3*qr*qr,Yr=qr*qr*qr;function Xr(e){if(e instanceof Qr)return new Qr(e.l,e.a,e.b,e.opacity);if(e instanceof ai)return oi(e);e instanceof Er||(e=wr(e));var t=ni(e.r),n=ni(e.g),r=ni(e.b),i=$r((.2225045*t+.7168786*n+.0606169*r)/Wr),a,o;return t===n&&n===r?a=o=i:(a=$r((.4360747*t+.3850649*n+.1430804*r)/Ur),o=$r((.0139322*t+.0971045*n+.7141733*r)/Gr)),new Qr(116*i-16,500*(a-i),200*(i-o),e.opacity)}function Zr(e,t,n,r){return arguments.length===1?Xr(e):new Qr(e,t,n,r??1)}function Qr(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}tr(Qr,Zr,nr(rr,{brighter(e){return new Qr(this.l+Hr*(e??1),this.a,this.b,this.opacity)},darker(e){return new Qr(this.l-Hr*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Ur*ei(t),e=Wr*ei(e),n=Gr*ei(n),new Er(ti(3.1338561*t-1.6168667*e-.4906146*n),ti(-.9787684*t+1.9161415*e+.033454*n),ti(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function $r(e){return e>Yr?e**(1/3):e/Jr+Kr}function ei(e){return e>qr?e*e*e:Jr*(e-Kr)}function ti(e){return 255*(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055)}function ni(e){return(e/=255)<=.04045?e/12.92:((e+.055)/1.055)**2.4}function ri(e){if(e instanceof ai)return new ai(e.h,e.c,e.l,e.opacity);if(e instanceof Qr||(e=Xr(e)),e.a===0&&e.b===0)return new ai(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Vr;return new ai(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function ii(e,t,n,r){return arguments.length===1?ri(e):new ai(e,t,n,r??1)}function ai(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function oi(e){if(isNaN(e.h))return new Qr(e.l,0,0,e.opacity);var t=e.h*Br;return new Qr(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}tr(ai,ii,nr(rr,{brighter(e){return new ai(this.h,this.c,this.l+Hr*(e??1),this.opacity)},darker(e){return new ai(this.h,this.c,this.l-Hr*(e??1),this.opacity)},rgb(){return oi(this).rgb()}}));var si=-.14861,ci=1.78277,li=-.29227,ui=-.90649,di=1.97294,fi=di*ui,pi=di*ci,mi=ci*li-ui*si;function hi(e){if(e instanceof _i)return new _i(e.h,e.s,e.l,e.opacity);e instanceof Er||(e=wr(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(mi*r+fi*t-pi*n)/(mi+fi-pi),a=r-i,o=(di*(n-i)-li*a)/ui,s=Math.sqrt(o*o+a*a)/(di*i*(1-i)),c=s?Math.atan2(o,a)*Vr-120:NaN;return new _i(c<0?c+360:c,s,i,e.opacity)}function gi(e,t,n,r){return arguments.length===1?hi(e):new _i(e,t,n,r??1)}function _i(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}tr(_i,gi,nr(rr,{brighter(e){return e=e==null?ar:ar**+e,new _i(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ir:ir**+e,new _i(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Br,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Er(255*(t+n*(si*r+ci*i)),255*(t+n*(li*r+ui*i)),255*(t+di*r*n),this.opacity)}}));var vi=e=>()=>e;function yi(e,t){return function(n){return e+n*t}}function bi(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function xi(e,t){var n=t-e;return n?yi(e,n>180||n<-180?n-360*Math.round(n/360):n):vi(isNaN(e)?t:e)}function Si(e){return(e=+e)==1?Ci:function(t,n){return n-t?bi(t,n,e):vi(isNaN(t)?n:t)}}function Ci(e,t){var n=t-e;return n?yi(e,n):vi(isNaN(e)?t:e)}var wi=(function e(t){var n=Si(t);function r(e,t){var r=n((e=Tr(e)).r,(t=Tr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Ci(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Ti(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Ei(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Di(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=Ii(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Oi(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ki(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ai(e,t){var n={},r={},i;for(i in typeof e==`object`&&e||(e={}),typeof t==`object`&&t||(t={}),t)i in e?n[i]=Ii(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var ji=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Mi=new RegExp(ji.source,`g`);function Ni(e){return function(){return e}}function Pi(e){return function(t){return e(t)+``}}function Fi(e,t){var n=ji.lastIndex=Mi.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=ji.exec(e))&&(i=Mi.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ki(r,i)})),n=Mi.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Pi(c[0].x):Ni(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function Ii(e,t){var n=typeof t,r;return t==null||n===`boolean`?vi(t):(n===`number`?ki:n===`string`?(r=xr(t))?(t=r,wi):Fi:t instanceof xr?wi:t instanceof Date?Oi:Ei(t)?Ti:Array.isArray(t)?Di:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Ai:ki)(e,t)}var Li=180/Math.PI,Ri={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zi(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Li,skewX:Math.atan(c)*Li,scaleX:o,scaleY:s}}var Bi;function Vi(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Ri:zi(t.a,t.b,t.c,t.d,t.e,t.f)}function Hi(e){return e==null||(Bi||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Bi.setAttribute(`transform`,e),!(e=Bi.transform.baseVal.consolidate()))?Ri:(e=e.matrix,zi(e.a,e.b,e.c,e.d,e.e,e.f))}function Ui(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:ki(e,i)},{i:c-2,x:ki(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:ki(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:ki(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:ki(e,n)},{i:s-2,x:ki(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Wi=Ui(Vi,`px, `,`px)`,`deg)`),Gi=Ui(Hi,`, `,`)`,`)`),Ki=1e-12;function qi(e){return((e=Math.exp(e))+1/e)/2}function Ji(e){return((e=Math.exp(e))-1/e)/2}function Yi(e){return((e=Math.exp(2*e))-1)/(e+1)}var Xi=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<Ki)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=qi(y),c=s/(n*g)*(i*Yi(t*r+y)-Ji(y));return[a+c*d,o+c*f,s*i/qi(t*r+y)]}}return m.duration=Math.abs(h)*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4);function Zi(e){return(function t(n){n=+n;function r(t,r){var i=e((t=gi(t)).h,(r=gi(r)).h),a=Ci(t.s,r.s),o=Ci(t.l,r.l),s=Ci(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(e**+n),t.opacity=s(e),t+``}}return r.gamma=t,r})(1)}Zi(xi),Zi(Ci);var Qi=0,$i=0,ea=0,ta=1e3,na,ra,ia=0,z=0,B=0,aa=typeof performance==`object`&&performance.now?performance:Date,oa=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function sa(){return z||=(oa(ca),aa.now()+B)}function ca(){z=0}function la(){this._call=this._time=this._next=null}la.prototype=ua.prototype={constructor:la,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?sa():+n)+(t==null?0:+t),!this._next&&ra!==this&&(ra?ra._next=this:na=this,ra=this),this._call=e,this._time=n,ha()},stop:function(){this._call&&(this._call=null,this._time=1/0,ha())}};function ua(e,t,n){var r=new la;return r.restart(e,t,n),r}function da(){sa(),++Qi;for(var e=na,t;e;)(t=z-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qi}function fa(){z=(ia=aa.now())+B,Qi=$i=0;try{da()}finally{Qi=0,ma(),z=0}}function pa(){var e=aa.now(),t=e-ia;t>ta&&(B-=t,ia=e)}function ma(){for(var e,t=na,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:na=n);ra=e,ha(r)}function ha(e){Qi||($i&&=clearTimeout($i),e-z>24?(e<1/0&&($i=setTimeout(fa,Math.ceil(e-aa.now()-B)+1)),ea&&=clearInterval(ea)):(ea||=(ia=aa.now(),setInterval(pa,ta)),Qi=1,oa(fa)))}function ga(e,t,n){var r=new la;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}function _a(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var va=3;(function e(t){t=+t;function n(e){return e**+t}return n.exponent=e,n})(va),(function e(t){t=+t;function n(e){return 1-(1-e)**t}return n.exponent=e,n})(va),(function e(t){t=+t;function n(e){return((e*=2)<=1?e**+t:2-(2-e)**t)/2}return n.exponent=e,n})(va);function ya(e){return(2**(-10*e)-.0009765625)*1.0009775171065494}var ba=4/11;1/ba/ba;var xa=1.70158;(function e(t){t=+t;function n(e){return(e=+e)*e*(t*(e-1)+e)}return n.overshoot=e,n})(xa),(function e(t){t=+t;function n(e){return--e*e*((e+1)*t+e)+1}return n.overshoot=e,n})(xa),(function e(t){t=+t;function n(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return n.overshoot=e,n})(xa);var Sa=2*Math.PI,Ca=1,wa=.3;(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Sa);function i(e){return t*ya(- --e)*Math.sin((r-e)/n)}return i.amplitude=function(t){return e(t,n*Sa)},i.period=function(n){return e(t,n)},i})(Ca,wa),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Sa);function i(e){return 1-t*ya(e=+e)*Math.sin((e+r)/n)}return i.amplitude=function(t){return e(t,n*Sa)},i.period=function(n){return e(t,n)},i})(Ca,wa),(function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Sa);function i(e){return((e=e*2-1)<0?t*ya(-e)*Math.sin((r-e)/n):2-t*ya(e)*Math.sin((r+e)/n))/2}return i.amplitude=function(t){return e(t,n*Sa)},i.period=function(n){return e(t,n)},i})(Ca,wa);var Ta=Me(`start`,`end`,`cancel`,`interrupt`),Ea=[],Da=0,Oa=1,ka=2,Aa=3,ja=4,Ma=5,Na=6;function Pa(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Ra(e,n,{name:t,index:r,group:i,on:Ta,tween:Ea,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Da})}function Fa(e,t){var n=La(e,t);if(n.state>Da)throw Error(`too late; already scheduled`);return n}function Ia(e,t){var n=La(e,t);if(n.state>Aa)throw Error(`too late; already running`);return n}function La(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Ra(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=ua(a,0,n.time);function a(e){n.state=Oa,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Oa)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===Aa)return ga(o);f.state===ja?(f.state=Na,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=Na,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(ga(function(){n.state===Aa&&(n.state=ja,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=ka,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===ka){for(n.state=Aa,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=Ma,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===Ma&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=Na,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function za(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>ka&&r.state<Ma,r.state=Na,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function Ba(e){return this.each(function(){za(this,e)})}function Va(e,t){var n,r;return function(){var i=Ia(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Ha(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Ia(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Ua(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=La(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Va:Ha)(n,e,t))}function Wa(e,t,n){var r=e._id;return e.each(function(){var e=Ia(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return La(e,r).value[t]}}function Ga(e,t){var n;return(typeof t==`number`?ki:t instanceof xr?wi:(n=xr(t))?(t=n,wi):Fi)(e,t)}function Ka(e){return function(){this.removeAttribute(e)}}function qa(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ja(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Ya(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Xa(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Za(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Qa(e,t){var n=ze(e),r=n===`transform`?Gi:Ga;return this.attrTween(e,typeof t==`function`?(n.local?Za:Xa)(n,r,Wa(this,`attr.`+e,t)):t==null?(n.local?qa:Ka)(n):(n.local?Ya:Ja)(n,r,t))}function $a(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function eo(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function to(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&eo(e,i)),n}return i._value=t,i}function no(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&$a(e,i)),n}return i._value=t,i}function ro(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 Error();var r=ze(e);return this.tween(n,(r.local?to:no)(r,t))}function io(e,t){return function(){Fa(this,e).delay=+t.apply(this,arguments)}}function ao(e,t){return t=+t,function(){Fa(this,e).delay=t}}function oo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?io:ao)(t,e)):La(this.node(),t).delay}function so(e,t){return function(){Ia(this,e).duration=+t.apply(this,arguments)}}function co(e,t){return t=+t,function(){Ia(this,e).duration=t}}function lo(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?so:co)(t,e)):La(this.node(),t).duration}function uo(e,t){if(typeof t!=`function`)throw Error();return function(){Ia(this,e).ease=t}}function fo(e){var t=this._id;return arguments.length?this.each(uo(t,e)):La(this.node(),t).ease}function po(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Ia(this,e).ease=n}}function mo(e){if(typeof e!=`function`)throw Error();return this.each(po(this._id,e))}function ho(e){typeof e!=`function`&&(e=Ze(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new H(r,this._parents,this._name,this._id)}function go(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new H(o,this._parents,this._name,this._id)}function _o(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function vo(e,t,n){var r,i,a=_o(t)?Fa:Ia;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function yo(e,t){var n=this._id;return arguments.length<2?La(this.node(),n).on.on(e):this.each(vo(n,e,t))}function bo(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function xo(){return this.on(`end.remove`,bo(this._id))}function So(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=We(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Pa(l[f],t,n,f,l,La(u,n)));return new H(a,this._parents,t,n)}function Co(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Je(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=La(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Pa(p,t,n,h,f,m);a.push(f),o.push(u)}return new H(a,o,t,n)}var wo=Pn.prototype.constructor;function To(){return new wo(this._groups,this._parents)}function Eo(e,t){var n,r,i;return function(){var a=Vt(this,e),o=(this.style.removeProperty(e),Vt(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Do(e){return function(){this.style.removeProperty(e)}}function Oo(e,t,n){var r,i=n+``,a;return function(){var o=Vt(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function ko(e,t,n){var r,i,a;return function(){var o=Vt(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Vt(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Ao(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Ia(this,e),l=c.on,u=c.value[a]==null?s||=Do(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function jo(e,t,n){var r=(e+=``)==`transform`?Wi:Ga;return t==null?this.styleTween(e,Eo(e,r)).on(`end.style.`+e,Do(e)):typeof t==`function`?this.styleTween(e,ko(e,r,Wa(this,`style.`+e,t))).each(Ao(this._id,e)):this.styleTween(e,Oo(e,r,t),n).on(`end.style.`+e,null)}function Mo(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function No(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Mo(e,a,n)),r}return a._value=t,a}function Po(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 Error();return this.tween(r,No(e,t,n??``))}function Fo(e){return function(){this.textContent=e}}function Io(e){return function(){var t=e(this);this.textContent=t??``}}function Lo(e){return this.tween(`text`,typeof e==`function`?Io(Wa(this,`text`,e)):Fo(e==null?``:e+``))}function Ro(e){return function(t){this.textContent=e.call(this,t)}}function zo(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Ro(r)),t}return r._value=e,r}function Bo(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 Error();return this.tween(t,zo(e))}function Vo(){for(var e=this._name,t=this._id,n=Uo(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=La(c,t);Pa(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new H(r,this._parents,e,n)}function Ho(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Ia(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var V=0;function H(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Uo(){return++V}var Wo=Pn.prototype;H.prototype={constructor:H,select:So,selectAll:Co,selectChild:Wo.selectChild,selectChildren:Wo.selectChildren,filter:ho,merge:go,selection:To,transition:Vo,call:Wo.call,nodes:Wo.nodes,node:Wo.node,size:Wo.size,empty:Wo.empty,each:Wo.each,on:yo,attr:Qa,attrTween:ro,style:jo,styleTween:Po,text:Lo,textTween:Bo,remove:xo,tween:Ua,delay:oo,duration:lo,ease:fo,easeVarying:mo,end:Ho,[Symbol.iterator]:Wo[Symbol.iterator]};var Go={time:null,delay:0,duration:250,ease:_a};function Ko(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function qo(e){var t,n;e instanceof H?(t=e._id,e=e._name):(t=Uo(),(n=Go).time=sa(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Pa(c,e,t,l,o,n||Ko(c,t));return new H(r,this._parents,e,t)}Pn.prototype.interrupt=Ba,Pn.prototype.transition=qo;var Jo=e=>()=>e;function Yo(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:i}})}function Xo(e,t,n){this.k=e,this.x=t,this.y=n}Xo.prototype={constructor:Xo,scale:function(e){return e===1?this:new Xo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xo(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 Zo=new Xo(1,0,0);Qo.prototype=Xo.prototype;function Qo(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Zo;return e.__zoom}function $o(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function ts(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function ns(){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 rs(){return this.__zoom||Zo}function is(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function as(){return navigator.maxTouchPoints||`ontouchstart`in this}function os(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function ss(){var e=ts,t=ns,n=os,r=is,i=as,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Xi,l=Me(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,rs).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,rs),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(Zo.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new Xo(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new Xo(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new Xo(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),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,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=In(this.that).datum();l.call(e,this.that,new Yo(e,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Vn(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],za(this),s.start();es(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=In(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Vn(t,i),l=t.clientX,u=t.clientY;Kn(t.view),$o(t),a.mouse=[c,this.__zoom.invert(c)],za(this),a.start();function d(e){if(es(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Vn(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),qn(e.view,a.moved),es(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Vn(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);es(r),s>0?In(this).transition().duration(s).call(x,d,c,r):In(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for($o(t),s=0;s<i;++s)c=r[s],l=Vn(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),za(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(es(e),s=0;s<a;++s)c=i[s],l=Vn(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for($o(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Vn(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=In(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:Jo(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:Jo(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Jo(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:Jo([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var cs={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.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 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.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},ls=[[-1/0,-1/0],[1/0,1/0]],us=[`Enter`,` `,`Escape`],ds={"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`},fs;(function(e){e.Strict=`strict`,e.Loose=`loose`})(fs||={});var ps;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(ps||={});var ms;(function(e){e.Partial=`partial`,e.Full=`full`})(ms||={});var hs={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},gs;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(gs||={});var _s;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(_s||={});var U;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(U||={});var vs={[U.Left]:U.Right,[U.Right]:U.Left,[U.Top]:U.Bottom,[U.Bottom]:U.Top},ys=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,bs=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),xs=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Ss=(e,t=[0,0])=>{let{width:n,height:r}=nc(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Cs=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):xs(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,Is(e,Bs(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Rs(r):{x:0,y:0,width:0,height:0}},ws=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=Is(n,Bs(e)),r=!0)}),r?Rs(n):{x:0,y:0,width:0,height:0}},Ts=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=Hs(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},Es=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function Ds(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=nc(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function Os({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=$s(ws(Ds(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function ks({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,cs.error005());else{let{width:e,height:t}=nc(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&tc(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=tc(d)?Ms(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,cs.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function As({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=Es(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var js=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ms=(e={x:0,y:0},t,n)=>({x:js(e.x,t[0][0],t[1][0]-(n?.width??0)),y:js(e.y,t[0][1],t[1][1]-(n?.height??0))});function Ns(e,t,n){let{width:r,height:i}=nc(n),{x:a,y:o}=n.internals.positionAbsolute;return Ms(e,[[a,o],[a+r,o+i]],t)}var Ps=(e,t,n)=>e<t?js(Math.abs(e-t),1,t)/t:e>n?-js(Math.abs(e-n),1,t)/t:0,Fs=(e,t,n=15,r=40)=>[Ps(e.x,r,t.width-r)*n,Ps(e.y,r,t.height-r)*n],Is=(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)}),Ls=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Rs=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),zs=(e,t=[0,0])=>{let{x:n,y:r}=xs(e)?e.internals.positionAbsolute:Ss(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Bs=(e,t=[0,0])=>{let{x:n,y:r}=xs(e)?e.internals.positionAbsolute:Ss(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Vs=(e,t)=>Rs(Is(Ls(e),Ls(t))),Hs=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},Us=(e,t)=>Hs(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Ws=e=>Gs(e.width)&&Gs(e.height)&&Gs(e.x)&&Gs(e.y),Gs=e=>!isNaN(e)&&isFinite(e),Ks=(e,t)=>(e,t)=>{},qs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Js=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?qs(s,o):s},Ys=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Xs(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Zs(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Xs(e,n),i=Xs(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Xs(e.top??e.y??0,n),i=Xs(e.bottom??e.y??0,n),a=Xs(e.left??e.x??0,t),o=Xs(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Qs(e,t,n,r,i,a){let{x:o,y:s}=Ys(e,[t,n,r]),{x:c,y:l}=Ys({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var $s=(e,t,n,r,i,a)=>{let o=Zs(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=js(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Qs(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},ec=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function tc(e){return e!=null&&e!==`parent`}function nc(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function rc(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function ic(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function ac(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function oc(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function sc(e){return{...ds,...e||{}}}function cc(e){return e===null?null:e?`valid`:`invalid`}function lc(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=hc(e),s=Js({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?qs(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var uc=e=>({width:e.offsetWidth,height:e.offsetHeight}),dc=e=>e?.getRootNode?.()||window?.document,fc=[`INPUT`,`SELECT`,`TEXTAREA`];function pc(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?fc.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var mc=e=>`clientX`in e,hc=(e,t)=>{let n=mc(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},gc=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...uc(t)}})};function _c({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function vc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function yc({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case U.Left:return[t-vc(t-r,a),n];case U.Right:return[t+vc(r-t,a),n];case U.Top:return[t,n-vc(n-i,a)];case U.Bottom:return[t,n+vc(i-n,a)]}}function bc({sourceX:e,sourceY:t,sourcePosition:n=U.Bottom,targetX:r,targetY:i,targetPosition:a=U.Top,curvature:o=.25}){let[s,c]=yc({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=yc({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=_c({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function xc({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function Sc({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function Cc({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=Is(Bs(e),Bs(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Us({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Rs(a))>0}var wc=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Tc=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),Ec=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,cs.error006()),t;let r=n.getEdgeId||wc,i;return i=ys(e)?{...e}:{...e,id:r(e)},Tc(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function Dc({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=xc({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var Oc={[U.Left]:{x:-1,y:0},[U.Right]:{x:1,y:0},[U.Top]:{x:0,y:-1},[U.Bottom]:{x:0,y:1}},kc=({source:e,sourcePosition:t=U.Bottom,target:n})=>t===U.Left||t===U.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},Ac=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),jc=(e,t,n)=>e.x===t.x&&t.x===n.x&&(t.y-e.y)*(n.y-t.y)>=0||e.y===t.y&&t.y===n.y&&(t.x-e.x)*(n.x-t.x)>=0;function Mc({source:e,sourcePosition:t=U.Bottom,target:n,targetPosition:r=U.Top,center:i,offset:a,stepPosition:o}){let s=Oc[t],c=Oc[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=kc({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=xc({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y},C=[];for(let t of[e,x,...m,S,n]){let[e,n]=C.slice(-2);n&&jc(e,n,t)&&C.pop(),C.push(t)}return[C,h,g,y,b]}function Nc(e,t,n,r){let i=Math.min(Ac(e,t)/2,Ac(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function Pc({sourceX:e,sourceY:t,sourcePosition:n=U.Bottom,targetX:r,targetY:i,targetPosition:a=U.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=Mc({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=Nc(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function Fc(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Ic(e){let{sourceNode:t,targetNode:n}=e;if(!Fc(t)||!Fc(n))return null;let r=t.internals.handleBounds||Lc(t.handles),i=n.internals.handleBounds||Lc(n.handles),a=zc(r?.source??[],e.sourceHandle),o=zc(e.connectionMode===fs.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,cs.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||U.Bottom,c=o?.position||U.Top,l=Rc(t,a,s),u=Rc(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function Lc(e){if(!e)return null;let t=[],n=[];for(let 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 Rc(e,t,n=U.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??nc(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case U.Top:return{x:i+o/2,y:a};case U.Right:return{x:i+o,y:a+s/2};case U.Bottom:return{x:i+o/2,y:a+s};case U.Left:return{x:i,y:a+s/2}}}function zc(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function Bc(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function Vc(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=Bc(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var Hc=1e3,Uc=10,Wc={nodeOrigin:[0,0],nodeExtent:ls,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},Gc={...Wc,checkEquality:!0};function Kc(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function qc(e,t,n){let r=Kc(Wc,n);for(let n of e.values())if(n.parentId)Qc(n,e,t,r);else{let e=Ms(Ss(n,r.nodeOrigin),tc(n.extent)?n.extent:r.nodeExtent,nc(n));n.internals.positionAbsolute=e}}function Jc(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function Yc(e){return e===`manual`}function Xc(e,t,n,r={}){let i=Kc(Gc,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!Yc(i.zIndexMode)?Hc:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=Ms(Ss(u,i.nodeOrigin),tc(u.extent)?u.extent:i.nodeExtent,nc(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:Jc(u,e),z:$c(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}e.measured!==void 0&&e.measured.width!==void 0&&e.measured.height!==void 0||e.hidden||(c=!1),u.parentId&&Qc(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Zc(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Qc(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=Kc(Wc,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Zc(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*Uc),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=el(e,u,o,s,a&&!Yc(c)?Hc:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function $c(e,t,n){let r=Gs(e.zIndex)?e.zIndex:0;return Yc(n)?r:r+(e.selected?t:0)}function el(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=nc(e),l=Ss(e,n),u=tc(e.extent)?Ms(l,e.extent,c):l,d=Ms({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Ns(d,c,t));let f=$c(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function tl(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Vs(a.get(n.parentId)?.expandedRect??zs(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=nc(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function nl(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=uc(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=tc(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=Ns(h,s,n))}else m&&(h=Ms(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:gc(`source`,r.nodeElement,p,d,e.id),target:gc(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&Qc(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:zs(g,i)}))}}if(f.length>0){let e=tl(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function rl({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function il(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function al(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;il(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),il(`target`,s,c,e,i,o),t.set(r.id,r)}}function ol(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:ol(n,t):!1}function sl(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function cl(e,t,n,r,i){let a=new Map;for(let[o,s]of e)if((i?s.id===r:s.selected||s.id===r)&&(i||!s.parentId||!ol(s,e))&&(s.draggable||t&&s.draggable===void 0)){let t=e.get(o);t&&a.set(o,{id:o,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return a}function ll({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function ul({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=qs(a,t);return{x:o.x-a.x,y:o.y-a.y}}function dl({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=In(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?Ls(ws(s)):null,x=v&&l?ul({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:qs(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=ks({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=ll({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=Fs(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0;let v=!!b&&!o&&!i.get(b)?.selected;m&&y||o||!b||i.get(b)?.selected||_(),y&&m&&b&&e?.(b);let x=lc(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=x,s=cl(i,c,x,b,v),s.size>0&&(n||h||!b&&g)){let[e,t]=ll({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=er().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=lc(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=hc(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=lc(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=hc(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=hc(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p)p&&s.size>0&&t().updateNodePositions(s,!1);else if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=ll({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!sl(t,`.${g}`,v))&&(!_||sl(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function fl(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Us(i,zs(e))>0&&r.push(e);return r}var pl=250;function ml(e,t,n,r){let i=[],a=1/0,o=fl(e,n,t+pl);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=Rc(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function hl(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...Rc(o,c,c.position,!0)}:c}function gl(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function _l(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var vl=()=>!0;function yl(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=vl,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=dc(e.target),E=0,D,{x:O,y:k}=hc(e),A=gl(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let ee=hl(i,A,r,c,t);if(!ee)return;let te=hc(e,j),ne=!1,re=null,ie=!1,ae=null;function N(){if(!u||!j)return;let[e,t]=Fs(te,j,S);f({x:e,y:t}),E=requestAnimationFrame(N)}let oe={...ee,nodeId:i,type:A,position:ee.position},se=c.get(i),ce={inProgress:!0,isValid:null,from:Rc(se,oe,U.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:se,to:te,toHandle:null,toPosition:vs[oe.position],toNode:null,pointer:te};function le(){M=!0,y(ce),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&le();function ue(e){if(!M){let{x:t,y:n}=hc(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;le()}if(!x()||!oe){de(e);return}let a=b();te=hc(e,j),D=ml(Js(te,a,!1,[1,1]),n,c,oe),ne||=(N(),!0);let s=bl(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});ae=s.handleDomNode,re=s.connection,ie=_l(!!D,s.isValid);let u=c.get(i),f=u?Rc(u,oe,U.Left,!0):ce.from,p={...ce,from:f,isValid:ie,to:s.toHandle&&ie?Ys({x:s.toHandle.x,y:s.toHandle.y},a):te,toHandle:s.toHandle,toPosition:ie&&s.toHandle?s.toHandle.position:vs[oe.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:te};y(p),ce=p}function de(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||ae)&&re&&ie&&h?.(re);let{inProgress:t,...n}=ce,r={...n,toPosition:ce.toHandle?ce.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),ne=!1,ie=!1,re=null,ae=null,T.removeEventListener(`mousemove`,ue),T.removeEventListener(`mouseup`,de),T.removeEventListener(`touchmove`,ue),T.removeEventListener(`touchend`,de)}}T.addEventListener(`mousemove`,ue),T.addEventListener(`mouseup`,de),T.addEventListener(`touchmove`,ue),T.addEventListener(`touchend`,de)}function bl(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=vl,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=hc(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=gl(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===fs.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=hl(t,e,a,u,n,!0)}return _}var xl={onPointerDown:yl,isValid:bl};function Sl({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=In(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&ec()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=ss().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:Vn}}var Cl=e=>({x:e.x,y:e.y,zoom:e.k}),wl=({x:e,y:t,zoom:n})=>Zo.translate(e,t).scale(n),Tl=(e,t)=>e.target.closest(`.${t}`),El=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Dl=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ol=(e,t=0,n=Dl,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},kl=e=>{let t=e.ctrlKey&&ec()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Al({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Tl(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=Vn(u),t=d*2**kl(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===ps.Vertical?0:u.deltaX*f,m=i===ps.Horizontal?0:u.deltaY*f;!ec()&&u.shiftKey&&i!==ps.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=Cl(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function jl({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=Tl(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function Ml({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Cl(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function Nl({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&El(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,Cl(a.transform))}}function Pl({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&El(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=Cl(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function Fl({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(Tl(f,`${u}-flow__node`)||Tl(f,`${u}-flow__edge`)||Tl(f,`${u}-flow__selection`)||Tl(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||Tl(f,c)&&h||Tl(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function Il({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]],f=typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t?.contentRect&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null;f?.observe(e);let p=ss().extent(()=>d).scaleExtent([t,n]).translateExtent(r),m=In(e).call(p);b({x:i.x,y:i.y,zoom:js(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let h=m.on(`wheel.zoom`),g=m.on(`dblclick.zoom`);p.wheelDelta(kl);async function _(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?Ii:Xi).transform(Ol(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function v({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:f,preventScrolling:_,zoomOnPinch:v,zoomOnScroll:y,zoomOnDoubleClick:b,panActivationKeyPressed:x=!1,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&p.on(`zoom`,null);let O=i&&!S&&!r;p.clickDistance(D?1/0:!Gs(E)||E<0?0:E);let k=O?Al({zoomPanValues:l,noWheelClassName:e,d3Selection:m,d3Zoom:p,panOnScrollMode:d,panOnScrollSpeed:f,zoomOnPinch:v,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):jl({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:h});m.on(`wheel.zoom`,k,{passive:!1});let A=Ml({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});p.on(`start`,A);let j=Nl({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});p.on(`zoom`,j);let M=Pl({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});p.on(`end`,M);let ee=Fl({panActivationKeyPressed:x,zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:y,panOnScroll:i,zoomOnDoubleClick:b,zoomOnPinch:v,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});p.filter(ee),b?m.on(`dblclick.zoom`,g):m.on(`dblclick.zoom`,null)}function y(){p.on(`zoom`,null),f?.disconnect()}async function b(e,t,n){let r=wl(e),i=p?.constrain()(r,t,n);return i&&await _(i),i}async function x(e,t){let n=wl(e);return await _(n,t),n}function S(e){if(m){let t=wl(e),n=m.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&p?.transform(m,t,null,{sync:!0})}}function C(){let e=m?Qo(m.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function w(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?Ii:Xi).scaleTo(Ol(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function T(e,t){return m?new Promise(n=>{p?.interpolate(t?.interpolate===`linear`?Ii:Xi).scaleBy(Ol(m,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function E(e){p?.scaleExtent(e)}function D(e){p?.translateExtent(e)}function O(e){let t=!Gs(e)||e<0?0:e;p?.clickDistance(t)}return{update:v,destroy:y,setViewport:x,setViewportConstrained:b,getViewport:C,scaleTo:w,scaleBy:T,setScaleExtent:E,setTranslateExtent:D,syncViewport:S,setClickDistance:O}}var Ll;(function(e){e.Line=`line`,e.Handle=`handle`})(Ll||={});function Rl({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function zl(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function Bl(e,t){return Math.max(0,t-e)}function Vl(e,t){return Math.max(0,e-t)}function Hl(e,t,n){return Math.max(0,t-e,e-n)}function Ul(e,t){return e?!t:t}function Wl(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=Hl(E,h,g),j=Hl(D,_,v);if(o){let e=0,t=0;c&&w<0?e=Bl(y+w+O,o[0][0]):!c&&w>0&&(e=Vl(y+E+O,o[1][0])),l&&T<0?t=Bl(b+T+k,o[0][1]):!l&&T>0&&(t=Vl(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=Vl(y+w,s[0][0]):!c&&w<0&&(e=Bl(y+E,s[1][0])),l&&T>0?t=Vl(b+T,s[0][1]):!l&&T<0&&(t=Bl(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=Hl(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?Vl(b+k+E/C,o[1][1])*C:Bl(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?Bl(b+E/C,s[1][1])*C:Vl(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=Hl(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?Vl(y+D*C+O,o[1][0])/C:Bl(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?Bl(y+D*C,s[1][0])/C:Vl(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(Ul(c,l)?-w:w)/C:w=(Ul(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,ee=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+ee}}var Gl={width:0,height:0,x:0,y:0},Kl={...Gl,pointerX:0,pointerY:0,aspectRatio:1};function ql(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function Jl({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=In(e),o={controlDirection:zl(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...Gl},h={...Kl};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:zl(e)};let g,_=null,v=[],y,b,x,S=er().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=lc(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=tc(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=ql(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=lc(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:O,y:k}=Wl(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),A=E!==S,j=D!==C,M=O!==u&&A,ee=k!==f&&j;if(!M&&!ee&&!A&&!j)return;let te={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((M||ee||T[0]===1||T[1]===1)&&(w.x=M?O:m.x,w.y=ee?k:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=O-u,t=k-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((A||j)&&(w.width=A&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=j&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let ne=Rl({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),re={...m,direction:ne};p?.(e,re)===!1?(m=te.prevValues,h.x=te.startX,h.y=te.startY,v.forEach((e,t)=>{e.position=te.childNodes[t].position})):(d?.(e,re),r(w,l))}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var Yl=t((e=>{var t=x();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Xl=t(((e,t)=>{t.exports=Yl()})),Zl=t((e=>{var t=x(),n=Xl();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ql=e(t(((e,t)=>{t.exports=Zl()}))(),1),$l=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},eu=e=>e?$l(e):$l,{useDebugValue:tu}=O.default,{useSyncExternalStoreWithSelector:nu}=Ql.default,ru=e=>e;function iu(e,t=ru,n){let r=nu(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return tu(r),r}var au=(e,t)=>{let n=eu(e),r=(e,r=t)=>iu(n,e,r);return Object.assign(r,n),r},ou=(e,t)=>e?au(e,t):au;function W(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var su=T(),cu=(0,O.createContext)(null),lu=cu.Provider,uu=cs.error001(`react`);function G(e,t){let n=(0,O.useContext)(cu);if(n===null)throw Error(uu);return iu(n,e,t)}function du(){let e=(0,O.useContext)(cu);if(e===null)throw Error(uu);return(0,O.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var fu={display:`none`},pu={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},mu=`react-flow__node-desc`,hu=`react-flow__edge-desc`,gu=`react-flow__aria-live`,_u=e=>e.ariaLiveMessage,vu=e=>e.ariaLabelConfig;function yu({rfId:e}){let t=G(_u);return(0,P.jsx)(`div`,{id:`${gu}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:pu,children:t})}function bu({rfId:e,disableKeyboardA11y:t}){let n=G(vu);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{id:`${mu}-${e}`,style:fu,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,P.jsx)(`div`,{id:`${hu}-${e}`,style:fu,children:n[`edge.a11yDescription.default`]}),!t&&(0,P.jsx)(yu,{rfId:e})]})}var xu=(0,O.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,P.jsx)(`div`,{className:Ae([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});xu.displayName=`Panel`;var Su=`https://reactflow.dev?utm_source=attribution`;function Cu({proOptions:e,position:t=`bottom-right`}){return(0,O.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,P.jsx)(xu,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Su}`,children:(0,P.jsx)(`a`,{href:Su,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var wu=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},Tu=e=>e.id;function Eu(e,t){return W(e.selectedNodes.map(Tu),t.selectedNodes.map(Tu))&&W(e.selectedEdges.map(Tu),t.selectedEdges.map(Tu))}function Du({onSelectionChange:e}){let t=du(),{selectedNodes:n,selectedEdges:r}=G(wu,Eu);return(0,O.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var Ou=e=>!!e.onSelectionChangeHandlers;function ku({onSelectionChange:e}){let t=G(Ou);return e||t?(0,P.jsx)(Du,{onSelectionChange:e}):null}var Au=[0,0],ju={x:0,y:0,zoom:1},Mu=[...`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`.split(`.`),`rfId`],Nu=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}),Pu={translateExtent:ls,nodeOrigin:Au,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function Fu(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=G(Nu,W),l=du();(0,O.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=Pu,s()}),[]);let u=(0,O.useRef)(Pu);return(0,O.useEffect)(()=>{for(let s of Mu){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:sc(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},Mu.map(t=>e[t])),null}function Iu(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function Lu(e){let[t,n]=(0,O.useState)(e===`system`?null:e);return(0,O.useEffect)(()=>{if(e!==`system`){n(e);return}let t=Iu(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?Iu()?.matches?`dark`:`light`:t}var Ru=typeof document<`u`?document:null;function zu(e=null,t={target:Ru,actInsideInputWithModifier:!0}){let[n,r]=(0,O.useState)(!1),i=(0,O.useRef)(!1),a=(0,O.useRef)(new Set([])),[o,s]=(0,O.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
15
15
  `).replace(`
16
16
 
17
17
  `,`
18
18
  +`).split(`
19
- `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,O.useEffect)(()=>{let n=t?.target??Ru,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&pc(e))return!1;let n=Vu(e.code,s);if(a.current.add(e[n]),Bu(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=Vu(e.code,s);Bu(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function Bu(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function Vu(e,t){return t.includes(e)?`code`:`key`}var Hu=()=>{let e=du();return(0,O.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[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)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=$s(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return Js(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=Ys(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function Uu(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)Wu(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function Wu(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(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)}}function Gu(e,t){return Uu(e,t)}function Ku(e,t){return Uu(e,t)}function qu(e,t){return{id:e,type:`select`,selected:t}}function Ju(e,t=new Set){let n=[];for(let[r,i]of e){let e=t.has(r);(i.selected!==void 0||e)&&i.selected!==e&&n.push(qu(i.id,e))}return n}function Yu({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function Xu(e){return{id:e.id,type:`remove`}}var Zu=Ks(`React Flow`,`https://reactflow.dev/`);function Qu(e,t,n={}){return Ec(e,t,{...n,onError:n.onError??Zu})}var $u=e=>bs(e),K=e=>ys(e);function ed(e){return(0,O.forwardRef)(e)}var q=typeof window<`u`?O.useLayoutEffect:O.useEffect;function J(e){let[t,n]=(0,O.useState)(BigInt(0)),[r]=(0,O.useState)(()=>td(()=>n(e=>e+BigInt(1))));return q(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function td(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var nd=(0,O.createContext)(null);function rd({children:e}){let t=du(),n=J((0,O.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=Yu({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=J((0,O.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(Yu({items:s,lookup:o}))},[])),i=(0,O.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,P.jsx)(nd.Provider,{value:i,children:e})}function id(){let e=(0,O.useContext)(nd);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var ad=e=>!!e.panZoom;function od(){let e=Hu(),t=du(),n=id(),r=G(ad),i=(0,O.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=$u(e)?e:n.get(e.id),a=i.parentId?ic(i.position,i.measured,i.parentId,n,r):i.position;return zs({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height},i.parentId?void 0:r)},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&$u(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&K(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await As({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(Xu);o?.(f),c(e)}if(m){let e=d.map(Xu);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=Ws(e),o=i?e:a(e),s=r!==void 0;if(!o)return[];let{nodeOrigin:c}=t.getState();return(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let l=zs(s?r:a,c),u=Us(l,o);return n&&u>0||u>=l.width*l.height||u>=o.width*o.height})},isNodeIntersecting:(e,t,n=!0)=>{let r=Ws(e)?e:a(e);if(!r)return!1;let i=Us(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return Cs(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??oc();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,O.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var sd=e=>e.selected,cd=typeof window<`u`?window:void 0;function ld({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=du(),{deleteElements:r}=od(),i=zu(e,{actInsideInputWithModifier:!1}),a=zu(t,{target:cd});(0,O.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(sd),edges:e.filter(sd)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,O.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function ud(e){let t=du();(0,O.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=uc(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,cs.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t.disconnect()}}},[])}var dd={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},fd=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function pd({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=ps.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:_,onViewportChange:v,isControlledViewport:y,paneClickDistance:b,selectionOnDrag:x}){let S=du(),C=(0,O.useRef)(null),{userSelectionActive:w,lib:T,connectionInProgress:E}=G(fd,W),D=zu(p),k=(0,O.useRef)();ud(C);let A=(0,O.useCallback)(e=>{v?.({x:e[0],y:e[1],zoom:e[2]}),y||S.setState({transform:e})},[v,y]);return(0,O.useEffect)(()=>{if(C.current){k.current=Il({domNode:C.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>S.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=S.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=S.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=S.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=k.current.getViewport();return S.setState({panZoom:k.current,transform:[e,t,n],domNode:C.current.closest(`.react-flow`)}),()=>{k.current?.destroy()}}},[]),(0,O.useEffect)(()=>{k.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:_,userSelectionActive:w,noWheelClassName:g,lib:T,onTransformChange:A,connectionInProgress:E,selectionOnDrag:x,paneClickDistance:b})},[e,t,n,r,i,a,o,s,c,D,m,_,w,g,T,A,E,x,b]),(0,P.jsx)(`div`,{className:`react-flow__renderer`,ref:C,style:dd,children:h})}var md=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function hd(){let{userSelectionActive:e,userSelectionRect:t}=G(md,W);return e&&t?(0,P.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}var gd=(e,t)=>n=>{n.target===t.current&&e?.(n)},_d=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function vd({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ms.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,O.useRef)(0),_=du(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:S}=G(_d,W),C=y&&(e||v),w=(0,O.useRef)(null),T=(0,O.useRef)(),E=(0,O.useRef)(new Set),D=(0,O.useRef)(new Set),k=(0,O.useRef)(!1),A=(0,O.useRef)(!1),j=(0,O.useRef)({x:0,y:0}),M=(0,O.useRef)(!1),ee=e=>{if(A.current||k.current||_.getState().connection.inProgress){A.current=!1,k.current=!1;return}let{connectionClickStartHandle:t,connection:n,onClickConnectEnd:r,resetSelectedElements:i}=_.getState();if(t){let t=structuredClone(n);delete t.inProgress,t.toPosition=t.toHandle?t.toHandle.position:null,r?.(e.nativeEvent,t),_.setState({connectionClickStartHandle:null})}l?.(e),i(),_.setState({nodesSelectionActive:!1})},N=e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},te=d?e=>d(e):void 0,ne=e=>{A.current&&=(e.stopPropagation(),!1)},re=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=_.getState();if(T.current=i?.getBoundingClientRect(),!T.current)return;let s=n.target===w.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),A.current=!1;let{x:c,y:l}=hc(n.nativeEvent,T.current),u=Js({x:c,y:l},a);_.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function ie(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=Ys(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=E.current,g=D.current;E.current=new Set(Ts(a,m,i,n===ms.Partial,!0).map(e=>e.id)),D.current=new Set;let v=u?.selectable??!0;for(let e of E.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&D.current.add(e)}}ac(h,E.current)||c(Ju(a,E.current)),ac(g,D.current)||l(Ju(o,D.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function ae(){if(!i||!T.current)return;let[e,t]=Fs(j.current,T.current,S);x({x:e,y:t}).then(e=>{if(!A.current||!e){g.current=requestAnimationFrame(ae);return}let{x:t,y:n}=j.current;ie(t,n),g.current=requestAnimationFrame(ae)})}let oe=()=>{cancelAnimationFrame(g.current),g.current=0,M.current=!1};(0,O.useEffect)(()=>()=>oe(),[]);let se=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!T.current||!n)return;let{x:o,y:c}=hc(e.nativeEvent,T.current);j.current={x:o,y:c};let l=Ys({x:n.startX,y:n.startY},r);if(!A.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}A.current=!0,M.current||=(ae(),!0),ie(o,c)},ce=e=>{C?e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===w.current&&_.getState().userSelectionRect&&ee?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(c?.(e),_.setState({nodesSelectionActive:E.current.size>0})),oe()):e.target===w.current&&_.getState().connection.inProgress&&(k.current=!0)},le=e=>{e.target?.releasePointerCapture?.(e.pointerId),oe()},ue=r===!0||Array.isArray(r)&&r.includes(0);return(0,P.jsxs)(`div`,{className:Ae([`react-flow__pane`,{draggable:ue,dragging:b,selection:e}]),onClick:C?void 0:gd(ee,w),onContextMenu:gd(N,w),onWheel:gd(te,w),onPointerEnter:C?void 0:f,onPointerMove:C?se:p,onPointerUp:ce,onPointerCancel:C?le:void 0,onPointerDownCapture:C?re:void 0,onClickCapture:C?ne:void 0,onPointerLeave:m,ref:w,style:dd,children:[h,(0,P.jsx)(hd,{})]})}function yd({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);l?(t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):c?.(`012`,cs.error012(e))}function bd({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=du(),[c,l]=(0,O.useState)(!1),u=(0,O.useRef)();return(0,O.useEffect)(()=>{if(!t)return u.current=dl({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{yd({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,O.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var xd=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function Sd(){let e=du();return(0,O.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=xd(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=qs(t,i));let{position:a,positionAbsolute:s}=ks({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var Cd=(0,O.createContext)(null),wd=Cd.Provider;Cd.Consumer;var Td=()=>(0,O.useContext)(Cd),Ed=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Dd=(0,O.createContext)(null);function Od({children:e}){let t=G(Ed,W);return(0,P.jsx)(Dd.Provider,{value:t,children:e})}function kd(){let e=(0,O.useContext)(Dd);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var Ad={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},jd=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return Ad;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===fs.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function Md({type:e=`source`,position:t=U.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=du(),_=Td(),{connectOnClick:v,noPanClassName:y,rfId:b}=kd(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=G(jd(_,m,e),W);_||g.getState().onError?.(`010`,cs.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(Qu(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=mc(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();xl.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,P.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:Ae([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=dc(t.target),h=n||c,{connection:v,isValid:y}=xl.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var Nd=(0,O.memo)(ed(Md));function Pd({data:e,isConnectable:t,sourcePosition:n=U.Bottom}){return(0,P.jsxs)(P.Fragment,{children:[e?.label,(0,P.jsx)(Nd,{type:`source`,position:n,isConnectable:t})]})}function Fd({data:e,isConnectable:t,targetPosition:n=U.Top,sourcePosition:r=U.Bottom}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Nd,{type:`target`,position:n,isConnectable:t}),e?.label,(0,P.jsx)(Nd,{type:`source`,position:r,isConnectable:t})]})}function Id(){return null}function Ld({data:e,isConnectable:t,targetPosition:n=U.Top}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Nd,{type:`target`,position:n,isConnectable:t}),e?.label]})}var Rd={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},zd={input:Pd,default:Fd,output:Ld,group:Id};function Bd(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var Vd=e=>{let{width:t,height:n,x:r,y:i}=ws(e.nodeLookup,{filter:e=>!!e.selected});return{width:Gs(t)?t:null,height:Gs(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function Hd({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=du(),{width:i,height:a,transformString:o,userSelectionActive:s}=G(Vd,W),c=Sd(),l=(0,O.useRef)(null);(0,O.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(bd({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,P.jsx)(`div`,{className:Ae([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,P.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(Rd,e.key)&&(e.preventDefault(),c({direction:Rd[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var Ud=typeof window<`u`?window:void 0,Wd=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Gd({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:ee,disableKeyboardA11y:N,onViewportChange:te,isControlledViewport:ne}){let{nodesSelectionActive:re,userSelectionActive:ie}=G(Wd,W),ae=zu(l,{target:Ud}),oe=zu(h,{target:Ud}),se=oe||w,ce=oe||b,le=u&&se!==!0,ue=ae||ie||le;return ld({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,P.jsx)(pd,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ce,panActivationKeyPressed:oe,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!ae&&se,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:ee,onViewportChange:te,isControlledViewport:ne,paneClickDistance:s,selectionOnDrag:le,children:(0,P.jsxs)(vd,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:se,autoPanOnSelection:T,isSelecting:!!ue,selectionMode:d,selectionKeyPressed:ae,paneClickDistance:s,selectionOnDrag:le,children:[e,re&&(0,P.jsx)(Hd,{onSelectionContextMenu:j,noPanClassName:ee,disableKeyboardA11y:N})]})})}Gd.displayName=`FlowRenderer`;var Kd=(0,O.memo)(Gd),qd=e=>t=>e?Ts(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function Jd(e){return G((0,O.useCallback)(qd(e),[e]),W)}var Yd=e=>e.updateNodeInternals;function Xd(){let e=G(Yd),[t]=(0,O.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,O.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function Zd({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=du(),a=(0,O.useRef)(null),o=(0,O.useRef)(null),s=(0,O.useRef)(e.sourcePosition),c=(0,O.useRef)(e.targetPosition),l=(0,O.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,O.useEffect)(()=>{!a.current||e.hidden||u&&o.current===a.current||(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,O.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,O.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function Qd({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=G(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},W),S=y.type||`default`,C=g?.[S]||zd[S];C===void 0&&(v?.(`003`,cs.error003(S)),S=`default`,C=g?.default||zd.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=du(),k=rc(y),A=Zd({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=bd({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=Sd();if(y.hidden)return null;let ee=nc(y),N=Bd(y),te=T||w||t||n||r||i,ne=n?e=>n(e,{...b.userNode}):void 0,re=r?e=>r(e,{...b.userNode}):void 0,ie=i?e=>i(e,{...b.userNode}):void 0,ae=a?e=>a(e,{...b.userNode}):void 0,oe=o?e=>o(e,{...b.userNode}):void 0,se=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&yd({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},ce=t=>{if(!(pc(t.nativeEvent)||m)){if(us.includes(t.key)&&T){let n=t.key===`Escape`;yd({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(Rd,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:Rd[t.key],factor:t.shiftKey?4:1})}}},le=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(Ts(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+ee.width/2,y.position.y+ee.height/2,{zoom:t[2]}))};return(0,P.jsx)(`div`,{className:Ae([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:te?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...N},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ne,onMouseMove:re,onMouseLeave:ie,onContextMenu:ae,onClick:se,onDoubleClick:oe,onKeyDown:D?ce:void 0,tabIndex:D?0:void 0,onFocus:D?le:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${mu}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,P.jsx)(wd,{value:e,children:(0,P.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...ee})})})}var $d=(0,O.memo)(Qd),ef=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function tf(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=G(ef,W),a=Jd(e.onlyRenderVisibleElements),o=Xd();return(0,P.jsx)(`div`,{className:`react-flow__nodes`,style:dd,children:a.map(a=>(0,P.jsx)($d,{id:a,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:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}tf.displayName=`NodeRenderer`;var nf=(0,O.memo)(tf);function rf(e){return G((0,O.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&Cc({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),W)}var af=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,P.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},of=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,P.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},sf={[_s.Arrow]:af,[_s.ArrowClosed]:of};function cf(e){let t=du();return(0,O.useMemo)(()=>Object.prototype.hasOwnProperty.call(sf,e)?sf[e]:(t.getState().onError?.(`009`,cs.error009(e)),null),[e])}var lf=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=cf(t);return c?(0,P.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,P.jsx)(c,{color:n,strokeWidth:o})}):null},uf=({defaultColor:e,rfId:t})=>{let n=G(e=>e.edges),r=G(e=>e.defaultEdgeOptions),i=(0,O.useMemo)(()=>Vc(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,P.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,P.jsx)(`defs`,{children:i.map(e=>(0,P.jsx)(lf,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};uf.displayName=`MarkerDefinitions`;var df=(0,O.memo)(uf);function ff({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,O.useState)({x:1,y:0,width:0,height:0}),p=Ae([`react-flow__edge-textwrapper`,l]),m=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,P.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,P.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,P.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}ff.displayName=`EdgeText`;var pf=(0,O.memo)(ff);function mf({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`path`,{...u,d:e,fill:`none`,className:Ae([`react-flow__edge-path`,u.className])}),l?(0,P.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&Gs(t)&&Gs(n)?(0,P.jsx)(pf,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function hf({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===U.Left||e===U.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function gf({sourceX:e,sourceY:t,sourcePosition:n=U.Bottom,targetX:r,targetY:i,targetPosition:a=U.Top}){let[o,s]=hf({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=hf({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=_c({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function _f(e){return(0,O.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=gf({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,P.jsx)(mf,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var vf=_f({isInternal:!1}),yf=_f({isInternal:!0});vf.displayName=`SimpleBezierEdge`,yf.displayName=`SimpleBezierEdgeInternal`;function bf(e){return(0,O.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=U.Bottom,targetPosition:m=U.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=Pc({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),S=e.isInternal?void 0:t;return(0,P.jsx)(mf,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var xf=bf({isInternal:!1}),Sf=bf({isInternal:!0});xf.displayName=`SmoothStepEdge`,Sf.displayName=`SmoothStepEdgeInternal`;function Cf(e){return(0,O.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,P.jsx)(xf,{...n,id:r,pathOptions:(0,O.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var wf=Cf({isInternal:!1}),Tf=Cf({isInternal:!0});wf.displayName=`StepEdge`,Tf.displayName=`StepEdgeInternal`;function Ef(e){return(0,O.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=Dc({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,P.jsx)(mf,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var Df=Ef({isInternal:!1}),Of=Ef({isInternal:!0});Df.displayName=`StraightEdge`,Of.displayName=`StraightEdgeInternal`;function kf(e){return(0,O.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=U.Bottom,targetPosition:s=U.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=bc({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,P.jsx)(mf,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var Af=kf({isInternal:!1}),jf=kf({isInternal:!0});Af.displayName=`BezierEdge`,jf.displayName=`BezierEdgeInternal`;var Mf={default:jf,straight:Of,step:Tf,smoothstep:Sf,simplebezier:yf},Nf={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Pf=(e,t,n)=>n===U.Left?e-t:n===U.Right?e+t:e,Ff=(e,t,n)=>n===U.Top?e-t:n===U.Bottom?e+t:e,If=`react-flow__edgeupdater`;function Lf({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,P.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Ae([If,`${If}-${s}`]),cx:Pf(t,r,e),cy:Ff(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function Rf({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=du(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;xl.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,P.jsxs)(P.Fragment,{children:[(e===!0||e===`source`)&&(0,P.jsx)(Lf,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,P.jsx)(Lf,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function zf({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=G(t=>t.edgeLookup.get(e)),b=G(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||Mf[x];S===void 0&&(_?.(`011`,cs.error011(x)),x=`default`,S=h?.default||Mf.default);let C=!!(y.focusable||t&&y.focusable===void 0),w=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),T=!!(y.selectable||r&&y.selectable===void 0),E=(0,O.useRef)(null),[D,k]=(0,O.useState)(!1),[A,j]=(0,O.useState)(!1),M=du(),{zIndex:ee=y.zIndex,sourceX:N,sourceY:te,targetX:ne,targetY:re,sourcePosition:ie,targetPosition:ae}=G((0,O.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return Nf;let i=Ic({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=Sc({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||Nf,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex,_]),W),oe=(0,O.useMemo)(()=>y.markerStart?`url('#${Bc(y.markerStart,m)}')`:void 0,[y.markerStart,m]),se=(0,O.useMemo)(()=>y.markerEnd?`url('#${Bc(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||te===null||ne===null||re===null)return null;let ce=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=M.getState();T&&(M.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},le=a?e=>{a(e,{...y})}:void 0,ue=o?e=>{o(e,{...y})}:void 0,de=s?e=>{s(e,{...y})}:void 0,fe=c?e=>{c(e,{...y})}:void 0,pe=l?e=>{l(e,{...y})}:void 0;return(0,P.jsx)(`svg`,{style:{zIndex:ee},children:(0,P.jsxs)(`g`,{className:Ae([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:ce,onDoubleClick:le,onContextMenu:ue,onMouseEnter:de,onMouseMove:fe,onMouseLeave:pe,onKeyDown:C?t=>{if(!v&&us.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=M.getState();t.key===`Escape`?(E.current?.blur(),n({edges:[y]})):r([e])}}: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?`${hu}-${m}`:void 0,ref:E,...y.domAttributes,children:[!A&&(0,P.jsx)(S,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:T,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:N,sourceY:te,targetX:ne,targetY:re,sourcePosition:ie,targetPosition:ae,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:oe,markerEnd:se,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,P.jsx)(Rf,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:te,targetX:ne,targetY:re,sourcePosition:ie,targetPosition:ae,setUpdateHover:k,setReconnecting:j})]})})}var Bf=(0,O.memo)(zf),Vf=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Hf({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=G(Vf,W),b=rf(t);return(0,P.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,P.jsx)(df,{defaultColor:e,rfId:n}),b.map(e=>(0,P.jsx)(Bf,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}Hf.displayName=`EdgeRenderer`;var Uf=(0,O.memo)(Hf),Wf=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function Y({children:e}){let t=du(),n=(0,O.useRef)(null),[r]=(0,O.useState)(()=>t.getState().transform);return q(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=Wf(r)))};return r(),t.subscribe(r)},[t]),(0,P.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:Wf(r)},children:e})}function Gf(e){let t=od(),n=(0,O.useRef)(!1);(0,O.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var Kf=e=>e.panZoom?.syncViewport;function qf(e){let t=G(Kf),n=du();return(0,O.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Jf(e){return e.connection.inProgress?{...e.connection,to:Js(e.connection.to,e.transform)}:{...e.connection}}function Yf(e){return e?t=>e(Jf(t)):Jf}function Xf(e){return G(Yf(e),W)}var Zf=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Qf({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=G(Zf,W);return a&&i&&c?(0,P.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,P.jsx)(`g`,{className:Ae([`react-flow__connection`,cc(s)]),children:(0,P.jsx)($f,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var $f=({style:e,type:t=gs.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=Xf();if(!i)return;if(n)return(0,P.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:cc(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case gs.Bezier:[m]=bc(h);break;case gs.SimpleBezier:[m]=gf(h);break;case gs.Step:[m]=Pc({...h,borderRadius:0});break;case gs.SmoothStep:[m]=Pc(h);break;default:[m]=Dc(h)}return(0,P.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};$f.displayName=`ConnectionLine`;var ep={};function tp(e=ep){(0,O.useRef)(e),du(),(0,O.useEffect)(()=>{},[e])}function np(){du(),(0,O.useRef)(!1),(0,O.useEffect)(()=>{},[])}function rp({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:ee,zoomOnPinch:N,panOnScroll:te,panOnScrollSpeed:ne,panOnScrollMode:re,zoomOnDoubleClick:ie,panOnDrag:ae,autoPanOnSelection:oe,onPaneClick:se,onPaneMouseEnter:ce,onPaneMouseMove:le,onPaneMouseLeave:ue,onPaneScroll:de,onPaneContextMenu:fe,paneClickDistance:pe,nodeClickDistance:me,onEdgeContextMenu:he,onEdgeMouseEnter:F,onEdgeMouseMove:I,onEdgeMouseLeave:ge,reconnectRadius:_e,onReconnect:ve,onReconnectStart:ye,onReconnectEnd:be,noDragClassName:xe,noWheelClassName:Se,noPanClassName:L,disableKeyboardA11y:Ce,nodeExtent:we,rfId:Te,viewport:Ee,onViewportChange:De,nodesDraggable:Oe}){return tp(e),tp(t),np(),Gf(n),qf(Ee),(0,P.jsx)(Kd,{onPaneClick:se,onPaneMouseEnter:ce,onPaneMouseMove:le,onPaneMouseLeave:ue,onPaneContextMenu:fe,onPaneScroll:de,paneClickDistance:pe,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:ee,zoomOnPinch:N,zoomOnDoubleClick:ie,panOnScroll:te,panOnScrollSpeed:ne,panOnScrollMode:re,panOnDrag:ae,autoPanOnSelection:oe,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:xe,noWheelClassName:Se,noPanClassName:L,disableKeyboardA11y:Ce,onViewportChange:De,isControlledViewport:!!Ee,children:(0,P.jsxs)(Y,{children:[(0,P.jsx)(Uf,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ve,onReconnectStart:ye,onReconnectEnd:be,onlyRenderVisibleElements:T,onEdgeContextMenu:he,onEdgeMouseEnter:F,onEdgeMouseMove:I,onEdgeMouseLeave:ge,reconnectRadius:_e,defaultMarkerColor:M,noPanClassName:L,disableKeyboardA11y:Ce,rfId:Te}),(0,P.jsx)(Qf,{style:h,type:m,component:g,containerStyle:_}),(0,P.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,P.jsx)(nf,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:me,onlyRenderVisibleElements:T,noPanClassName:L,noDragClassName:xe,disableKeyboardA11y:Ce,nodeExtent:we,rfId:Te,nodesDraggable:Oe}),(0,P.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}rp.displayName=`GraphView`;var ip=(0,O.memo)(rp),ap=Ks(`React Flow`,`https://reactflow.dev/`),op=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??ls;al(h,g,_);let{nodesInitialized:x}=Xc(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=$s(ws(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:ls,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:fs.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:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...hs},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ap,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:ds,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},sp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>ou((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await Os({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...op({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=Xc(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();al(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=nl(e,n,r,i,a,o,l);d&&(qc(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=Rc(e,o.fromHandle,U.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=tl(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(Gu(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(Ku(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?i(e.map(e=>qu(e,!0))):(i(Ju(r,new Set([...e]))),a(Ju(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?a(e.map(e=>qu(e,!0))):(a(Ju(n,new Set([...e]))),i(Ju(r,new Set)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s)e.selected&&l.push(qu(e.id,!1));let u=[];for(let e of c)e.selected&&u.push(qu(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,qu(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,qu(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(Xc(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return rl({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...hs}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...op()})}},Object.is);function cp({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,O.useState)(()=>sp({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,P.jsx)(lu,{value:m,children:(0,P.jsx)(rd,{children:(0,P.jsx)(Od,{children:p})})})}function lp({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,O.useContext)(cu)?(0,P.jsx)(P.Fragment,{children:e}):(0,P.jsx)(cp,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var up={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function dp({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:k,onSelectionChange:A,onSelectionDragStart:j,onSelectionDrag:M,onSelectionDragStop:ee,onSelectionContextMenu:N,onSelectionStart:te,onSelectionEnd:ne,onBeforeDelete:re,connectionMode:ie,connectionLineType:ae=gs.Bezier,connectionLineStyle:oe,connectionLineComponent:se,connectionLineContainerStyle:ce,deleteKeyCode:le=`Backspace`,selectionKeyCode:ue=`Shift`,selectionOnDrag:de=!1,selectionMode:fe=ms.Full,panActivationKeyCode:pe=`Space`,multiSelectionKeyCode:me=ec()?`Meta`:`Control`,zoomActivationKeyCode:he=ec()?`Meta`:`Control`,snapToGrid:F,snapGrid:I,onlyRenderVisibleElements:ge=!1,selectNodesOnDrag:_e,nodesDraggable:ve,autoPanOnNodeFocus:ye,nodesConnectable:be,nodesFocusable:xe,nodeOrigin:Se=Au,edgesFocusable:L,edgesReconnectable:Ce,elementsSelectable:we=!0,defaultViewport:Te=ju,minZoom:Ee=.5,maxZoom:De=2,translateExtent:Oe=ls,preventScrolling:ke=!0,nodeExtent:je,defaultMarkerColor:Me=`#b1b1b7`,zoomOnScroll:Ne=!0,zoomOnPinch:Pe=!0,panOnScroll:Fe=!1,panOnScrollSpeed:Ie=.5,panOnScrollMode:Le=ps.Free,zoomOnDoubleClick:Re=!0,panOnDrag:ze=!0,onPaneClick:Be,onPaneMouseEnter:Ve,onPaneMouseMove:He,onPaneMouseLeave:Ue,onPaneScroll:We,onPaneContextMenu:Ge,paneClickDistance:Ke=1,nodeClickDistance:qe=0,children:Je,onReconnect:Ye,onReconnectStart:Xe,onReconnectEnd:Ze,onEdgeContextMenu:Qe,onEdgeDoubleClick:$e,onEdgeMouseEnter:et,onEdgeMouseMove:tt,onEdgeMouseLeave:nt,reconnectRadius:rt=10,onNodesChange:it,onEdgesChange:at,noDragClassName:ot=`nodrag`,noWheelClassName:st=`nowheel`,noPanClassName:ct=`nopan`,fitView:lt,fitViewOptions:ut,connectOnClick:dt,attributionPosition:ft,proOptions:pt,defaultEdgeOptions:mt,elevateNodesOnSelect:ht=!0,elevateEdgesOnSelect:gt=!1,disableKeyboardA11y:_t=!1,autoPanOnConnect:vt,autoPanOnNodeDrag:yt,autoPanOnSelection:bt=!0,autoPanSpeed:xt,connectionRadius:St,isValidConnection:Ct,onError:wt,style:Tt,id:Et,nodeDragThreshold:Dt,connectionDragThreshold:Ot,viewport:kt,onViewportChange:At,width:jt,height:Mt,colorMode:Nt=`light`,debug:Pt,onScroll:Ft,ariaLabelConfig:It,zIndexMode:Lt=`basic`,...Rt},zt){let Bt=Et||`1`,Vt=Lu(Nt),Ht=(0,O.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Ft?.(e)},[Ft]);return(0,P.jsx)(`div`,{"data-testid":`rf__wrapper`,...Rt,onScroll:Ht,style:{...Tt,...up},ref:zt,className:Ae([`react-flow`,i,Vt]),id:Et,role:`application`,children:(0,P.jsxs)(lp,{nodes:e,edges:t,width:jt,height:Mt,fitView:lt,fitViewOptions:ut,minZoom:Ee,maxZoom:De,nodeOrigin:Se,nodeExtent:je,zIndexMode:Lt,children:[(0,P.jsx)(Fu,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:ve,autoPanOnNodeFocus:ye,nodesConnectable:be,nodesFocusable:xe,edgesFocusable:L,edgesReconnectable:Ce,elementsSelectable:we,elevateNodesOnSelect:ht,elevateEdgesOnSelect:gt,minZoom:Ee,maxZoom:De,nodeExtent:je,onNodesChange:it,onEdgesChange:at,snapToGrid:F,snapGrid:I,connectionMode:ie,translateExtent:Oe,connectOnClick:dt,defaultEdgeOptions:mt,fitView:lt,fitViewOptions:ut,onNodesDelete:E,onEdgesDelete:D,onDelete:k,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:ee,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:ct,nodeOrigin:Se,rfId:Bt,autoPanOnConnect:vt,autoPanOnNodeDrag:yt,autoPanSpeed:xt,onError:wt,connectionRadius:St,isValidConnection:Ct,selectNodesOnDrag:_e,nodeDragThreshold:Dt,connectionDragThreshold:Ot,onBeforeDelete:re,debug:Pt,ariaLabelConfig:It,zIndexMode:Lt}),(0,P.jsx)(ip,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:ae,connectionLineStyle:oe,connectionLineComponent:se,connectionLineContainerStyle:ce,selectionKeyCode:ue,selectionOnDrag:de,selectionMode:fe,deleteKeyCode:le,multiSelectionKeyCode:me,panActivationKeyCode:pe,zoomActivationKeyCode:he,onlyRenderVisibleElements:ge,defaultViewport:Te,translateExtent:Oe,minZoom:Ee,maxZoom:De,preventScrolling:ke,zoomOnScroll:Ne,zoomOnPinch:Pe,zoomOnDoubleClick:Re,panOnScroll:Fe,panOnScrollSpeed:Ie,panOnScrollMode:Le,panOnDrag:ze,autoPanOnSelection:bt,onPaneClick:Be,onPaneMouseEnter:Ve,onPaneMouseMove:He,onPaneMouseLeave:Ue,onPaneScroll:We,onPaneContextMenu:Ge,paneClickDistance:Ke,nodeClickDistance:qe,onSelectionContextMenu:N,onSelectionStart:te,onSelectionEnd:ne,onReconnect:Ye,onReconnectStart:Xe,onReconnectEnd:Ze,onEdgeContextMenu:Qe,onEdgeDoubleClick:$e,onEdgeMouseEnter:et,onEdgeMouseMove:tt,onEdgeMouseLeave:nt,reconnectRadius:rt,defaultMarkerColor:Me,noDragClassName:ot,noWheelClassName:st,noPanClassName:ct,rfId:Bt,disableKeyboardA11y:_t,nodeExtent:je,viewport:kt,onViewportChange:At,nodesDraggable:ve}),(0,P.jsx)(ku,{onSelectionChange:A}),Je,(0,P.jsx)(Cu,{proOptions:pt,position:ft}),(0,P.jsx)(bu,{rfId:Bt,disableKeyboardA11y:_t})]})})}var fp=ed(dp),pp=e=>e.domNode?.querySelector(`.react-flow__edgelabel-renderer`);function mp({children:e}){let t=G(pp);return t?(0,su.createPortal)(e,t):null}cs.error014();function hp({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,P.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ae([`react-flow__background-pattern`,n,r])})}function gp({radius:e,className:t}){return(0,P.jsx)(`circle`,{cx:e,cy:e,r:e,className:Ae([`react-flow__background-pattern`,`dots`,t])})}var _p;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(_p||={});var vp={[_p.Dots]:1,[_p.Lines]:1,[_p.Cross]:6},yp=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function bp({id:e,variant:t=_p.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,O.useRef)(null),{transform:f,patternId:p}=G(yp,W),m=r||vp[t],h=t===_p.Dots,g=t===_p.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],b=Array.isArray(a)?a:[a,a],x=g?[y,y]:v,S=[b[0]*f[2]+x[0]/2,b[1]*f[2]+x[1]/2],C=`${p}${e||``}`;return(0,P.jsxs)(`svg`,{className:Ae([`react-flow__background`,l]),style:{...c,...dd,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,P.jsx)(`pattern`,{id:C,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${S[0]},-${S[1]})`,children:h?(0,P.jsx)(gp,{radius:y/2,className:u}):(0,P.jsx)(hp,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,P.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}bp.displayName=`Background`,(0,O.memo)(bp);function xp(){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,P.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function Sp(){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,P.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function Cp(){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,P.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function wp(){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,P.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function Tp(){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,P.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function Ep({children:e,className:t,...n}){return(0,P.jsx)(`button`,{type:`button`,className:Ae([`react-flow__controls-button`,t]),...n,children:e})}var Dp=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Op({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=du(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=G(Dp,W),{zoomIn:y,zoomOut:b,fitView:x}=od();return(0,P.jsxs)(xu,{className:Ae([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ep,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,P.jsx)(xp,{})}),(0,P.jsx)(Ep,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,P.jsx)(Sp,{})})]}),n&&(0,P.jsx)(Ep,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,P.jsx)(Cp,{})}),r&&(0,P.jsx)(Ep,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,P.jsx)(Tp,{}):(0,P.jsx)(wp,{})}),u]})}Op.displayName=`Controls`;var kp=(0,O.memo)(Op);function Ap({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,P.jsx)(`rect`,{className:Ae([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var jp=(0,O.memo)(Ap),Mp=e=>e.nodes.map(e=>e.id),Np=e=>e instanceof Function?e:()=>e;function Pp({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=jp,onClick:o}){let s=G(Mp,W),c=Np(t),l=Np(e),u=Np(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,P.jsx)(P.Fragment,{children:s.map(e=>(0,P.jsx)(Ip,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function Fp({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=G(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=nc(r);return{node:r,x:i,y:a,width:o,height:s}},W);return!l||l.hidden||!rc(l)?null:(0,P.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var Ip=(0,O.memo)(Fp),Lp=(0,O.memo)(Pp),Rp=200,zp=150,Bp=e=>!e.hidden,Vp=e=>{let 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]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?Vs(ws(e.nodeLookup,{filter:Bp}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Hp=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Up=(e,t)=>Hp(e.viewBB,t.viewBB)&&Hp(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,Wp=`react-flow__minimap-desc`;function Gp({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:b=5}){let x=du(),S=(0,O.useRef)(null),{boundingRect:C,panZoom:w,viewBB:T,rfId:E,translateExtent:D,flowWidth:k,flowHeight:A,ariaLabelConfig:j}=G(Vp,Up),M=e?.width??Rp,ee=e?.height??zp,N=C.width/M,te=C.height/ee,ne=Math.max(N,te),re=ne*M,ie=ne*ee,ae=b*ne,oe=C.x-(re-C.width)/2-ae,se=C.y-(ie-C.height)/2-ae,ce=re+ae*2,le=ie+ae*2,ue=`${Wp}-${E}`,de=(0,O.useRef)(0),fe=(0,O.useRef)();de.current=ne,(0,O.useEffect)(()=>{let e=x.getState().panZoom;if(S.current&&e)return fe.current=Sl({domNode:S.current,panZoom:e,getTransform:()=>x.getState().transform,getViewScale:()=>de.current}),()=>{fe.current?.destroy()}},[w]),(0,O.useEffect)(()=>{fe.current?.update({translateExtent:D,width:k,height:A,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,k,A]);let pe=p?e=>{let[t,n]=fe.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,me=(0,O.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),he=m?me:void 0,F=_??j[`minimap.ariaLabel`];return(0,P.jsx)(xu,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*ne: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 o==`number`?o:void 0},className:Ae([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,P.jsxs)(`svg`,{width:M,height:ee,viewBox:`${oe} ${se} ${ce} ${le}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":ue,ref:S,onClick:pe,children:[F&&(0,P.jsx)(`title`,{id:ue,children:F}),(0,P.jsx)(Lp,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,P.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${oe-ae},${se-ae}h${ce+ae*2}v${le+ae*2}h${-ce-ae*2}z
20
- M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}Gp.displayName=`MiniMap`;var Kp=(0,O.memo)(Gp),qp=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Jp={[Ll.Line]:`right`,[Ll.Handle]:`bottom-right`};function Yp({nodeId:e,position:t,variant:n=Ll.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=Td(),y=typeof e==`string`?e:v,b=du(),x=(0,O.useRef)(null),S=n===Ll.Handle,C=G((0,O.useCallback)(qp(S&&p),[S,p]),W),w=(0,O.useRef)(null),T=t??Jp[n];(0,O.useEffect)(()=>{if(x.current&&y)return w.current||=Jl({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=tl([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...ic({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),w.current.update({controlPosition:T,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{w.current?.destroy()}},[T,s,c,l,u,d,h,g,_,m]);let E=T.split(`-`);return(0,P.jsx)(`div`,{className:Ae([`react-flow__resize-control`,`nodrag`,...E,n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,O.memo)(Yp);function Xp(){return Zp(`(prefers-reduced-motion: reduce)`)}function Zp(e){let[t,n]=(0,O.useState)(()=>window.matchMedia(e).matches);return(0,O.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var Qp=1.15,$p=50;function em(){let e=G(e=>e.domNode),t=G(e=>e.minZoom),n=G(e=>e.maxZoom),{getViewport:r,setViewport:i}=od();return(0,O.useEffect)(()=>{if(!e)return;let a=a=>{if(!a.ctrlKey||a.deltaMode!==WheelEvent.DOM_DELTA_PIXEL||Math.abs(a.deltaY)<$p)return;a.preventDefault(),a.stopPropagation();let o=e.getBoundingClientRect(),s=a.clientX-o.left,c=a.clientY-o.top,{x:l,y:u,zoom:d}=r(),f=Math.min(n,Math.max(t,d*Qp**-Math.sign(a.deltaY)));i({x:s-(s-l)*f/d,y:c-(c-u)*f/d,zoom:f})};return e.addEventListener(`wheel`,a,{capture:!0,passive:!1}),()=>e.removeEventListener(`wheel`,a,{capture:!0})},[e,t,n,r,i]),null}function tm(e,t,n,r,i){let a=e.external?`EXT · `:``;if(e.kind===`deployment`&&i)return i;if(e.kind===`system`)return e.external?`${a}External System`:[`System`,r].filter(Boolean).join(` · `);if(e.kind===`service`||e.kind===`deployment`){let r=t?.kind===`service`&&t.type!==`app`?t.type:pm[e.kind];return a+[`${e.external?`External `:``}${r}`,n].filter(Boolean).join(` · `)}return[pm[e.kind],n].filter(Boolean).join(` · `)}function nm(e,t,n){let r=e.bundle.deployments.find(e=>e.service===n.element&&e.target===n.target&&e.environment===t);return r?.url?r.url.replace(/^https?:\/\//,``).replace(/\/$/,``):n.target===void 0?void 0:e.targets.get(n.target)?.name}var rm={person:`person`,system:`system`,service:`service`,component:`component`,deployment:`deployment`,target:`target`,datastore:`datastore`,broker:`broker`},im=40,am={origin:`origin`,upstream:`upstream`,downstream:`downstream`},om={origin:`origin`,upstream:`up`,downstream:`down`};function sm(e,t){if(t===void 0)return;let n=e.children(t);if(n.length===0)return;let r=n[0].kind===`service`?`Service`:n[0].kind===`component`?`Component`:`Element`;return`${n.length} ${r}${n.length===1?``:`s`}`}var cm=300,lm=.45,um=.6,dm=32,fm=400,pm={person:`Person`,system:`System`,service:`Service`,component:`Component`,target:`Deployment Target`,deployment:`Deployment`};function mm(e){return(0,P.jsx)(cp,{children:(0,P.jsx)(hm,{...e})})}function hm({workspace:e,laidOut:t,selected:n,open:r,fitKey:i,lensed:o,picks:s,ring:c,onSelect:l,onPick:u,onToggle:f,onOpenView:p,onSettled:m}){let{view:h,layout:g}=t,_=!Xp()&&h.nodes.length<=100,v=G(e=>e.transform[2]<lm),y=(0,O.useMemo)(()=>new Map(o?.nodes.map(e=>[e.id,e.mark])??[]),[o]),b=(0,O.useMemo)(()=>o?new Map(o.edges.map(e=>[`${e.from}>${e.to}`,e.lit===!0])):void 0,[o]),[x,S]=(0,O.useState)(null),C=(0,O.useMemo)(()=>g.edges.find(e=>`${e.from}>${e.to}`===x),[g,x]),w=(0,O.useCallback)((e,t)=>S(n=>t?e:n===e?null:n),[]),T=(0,O.useMemo)(()=>{let e=new Map(h.nodes.map(e=>[e.id,e])),t=n=>{let r=e.get(n)?.parent??null;return r===null?0:1+t(r)};return 1+Math.max(0,...h.nodes.map(e=>t(e.id)))},[h]),E=(0,O.useMemo)(()=>{let t=new Map(h.nodes.map(e=>[e.id,e])),i=new Set(h.nodes.map(e=>e.parent).filter(e=>e!==null)),o=e=>{let n=t.get(e)?.parent??null;return n===null?0:1+o(n)},l=e=>{let n=t.get(e);return n?.kind===`target`?1+(n.parent===null?0:l(n.parent)):0};return g.nodes.map(u=>{let m=t.get(u.id),g=e.byId.get(m.element??u.id),_=m.kind===`target`?e.targets.get(u.id):void 0,v=g&&`technology`in g?g.technology:null,b=t=>sm(e,t),x=h.kind!==`c1`&&h.kind!==`deployment`&&m.collapsed&&(m.kind===`system`||m.kind===`service`);return{id:u.id,type:`box`,position:{x:u.x,y:u.y},width:u.width,height:u.height,style:{width:u.width,height:u.height},measured:{width:u.width,height:u.height},zIndex:i.has(u.id)?o(u.id):T+1,selected:u.id===n,draggable:!1,connectable:!1,data:{node:m,type:g?.kind===`service`&&g.type!==`app`?g.type:void 0,sublabel:_?_.kind:tm(m,g,v,i.has(u.id)?void 0:b(g?.id),m.kind===`deployment`?nm(e,h.environment,m):void 0),team:e.teams.get(g?.owner??_?.owner??``),container:i.has(u.id),targetStep:m.kind===`target`?d(l(u.id)):void 0,twoLine:!i.has(u.id)&&u.height>a[m.kind].height,toggle:x?`expand`:r.includes(u.id)?`collapse`:null,onToggle:f,wayIn:g===void 0||e.wayIn(g.id)===void 0||e.wayIn(g.id)===h.id?null:h.id===`c1`&&g.kind===`system`?`landscape`:`own`,onOpenView:p,mark:y.get(u.id),ring:c,picked:s.includes(u.id),change:m.change,hover:C?u.id===C.from||u.id===C.to?`end`:`faded`:void 0}}})},[h,g,e,n,r,f,p,y,c,s,C,T]),D=(0,O.useMemo)(()=>_m(E.map(e=>e.data.type??e.data.node.kind)),[E]),k=(0,O.useMemo)(()=>new Map(h.edges.map(e=>[`${e.from}>${e.to}`,e.change])),[h]),A=(0,O.useMemo)(()=>{let e=new Map(h.nodes.map(e=>[e.id,e.name]));return new Map(h.edges.map(t=>[`${t.from}>${t.to}`,Em(e.get(t.from)??t.from,e.get(t.to)??t.to,t.relationships)]))},[h]),j=(0,O.useMemo)(()=>{let e=g.edges.map(e=>({id:`${e.from}>${e.to}`,source:e.from,target:e.to,type:`route`,markerEnd:{type:_s.ArrowClosed,width:16,height:16},selectable:!1,zIndex:T,data:{points:e.points,faded:n!==null&&e.from!==n&&e.to!==n,lit:C?e===C:b?.get(`${e.from}>${e.to}`),change:k.get(`${e.from}>${e.to}`),from:e.from,to:e.to,tooltip:A.get(`${e.from}>${e.to}`)??``,onHover:w}}));return C?[...e.filter(e=>e.data.lit!==!0),...e.filter(e=>e.data.lit===!0)]:e},[g,n,b,k,A,C,w,T]);return(0,P.jsxs)(fp,{className:[`arc-flow`,_?`arc-animate`:``,v?`arc-zoomed-out`:``].filter(Boolean).join(` `),nodes:E,edges:j,nodeTypes:km,edgeTypes:Am,minZoom:.05,maxZoom:2,zoomOnDoubleClick:!1,panOnScroll:!0,panOnScrollSpeed:1,panOnDrag:[0,1],elevateNodesOnSelect:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},onNodeClick:(e,t)=>e.shiftKey?u(t.id):l(t.id),onNodeDoubleClick:(e,t)=>p(t.id),onPaneClick:()=>l(null),children:[(0,P.jsx)(xu,{position:`bottom-left`,className:`arc-key-panel`,children:(0,P.jsx)(vm,{lens:o!==void 0,icons:D,scaled:h.nodes.some(e=>e.instances!==void 0)})}),h.nodes.length>im&&(0,P.jsx)(Kp,{position:`top-right`,className:`arc-minimap`,pannable:!0,zoomable:!0,ariaLabel:`Overview`,nodeStrokeWidth:0}),(0,P.jsx)(kp,{position:`bottom-right`,showInteractive:!1}),(0,P.jsx)(Sm,{laidOut:t,fitKey:i,selected:n,animate:_,onSettled:m}),(0,P.jsx)(Cm,{selected:n,animate:_,drawingWidth:g.width}),(0,P.jsx)(em,{})]})}var gm=[{kind:`person`,label:pm.person},{kind:`system`,label:pm.system},{kind:`service`,label:pm.service},{kind:`datastore`,label:`Datastore`},{kind:`broker`,label:`Broker`},{kind:`component`,label:pm.component},{kind:`deployment`,label:pm.deployment},{kind:`target`,label:pm.target}];function _m(e){let t=new Set(e);return gm.filter(e=>t.has(e.kind)).map(e=>({icon:rm[e.kind],label:e.label}))}function vm({lens:e,icons:t,scaled:n}){let[r,i]=(0,O.useState)(()=>ym());return(0,P.jsxs)(`details`,{className:`arc-key`,open:r,onToggle:e=>{let t=e.currentTarget.open;t!==r&&(i(t),bm(t))},children:[(0,P.jsx)(`summary`,{children:`Key`}),t.length>0&&(0,P.jsx)(`ul`,{className:`arc-key-icons`,"aria-label":`Icons`,children:t.map(({icon:e,label:t})=>(0,P.jsxs)(`li`,{"data-key-icon":e,children:[(0,P.jsx)(L,{name:e}),t]},e))}),(0,P.jsxs)(`ul`,{children:[(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-team`,"aria-hidden":`true`,children:(0,P.jsx)(`span`,{children:`COR`})}),`Left edge and code: owning Team`]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-way-in`,"aria-hidden":`true`}),`Arrow tile: goes a level down`]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-external`,"aria-hidden":`true`}),`Dashed: External`]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-broker`,"aria-hidden":`true`}),`Striped: broker`]}),n&&(0,P.jsxs)(`li`,{"data-testid":`key-scaled`,children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-stacked`,"aria-hidden":`true`}),`Stacked: scaled (×3 fixed, 2–10 autoscale)`]}),e&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-origin`,"aria-hidden":`true`}),`Lens origin`]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-up`,"aria-hidden":`true`}),`Upstream`,(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-down`,"aria-hidden":`true`}),`Downstream`]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-holds`,"aria-hidden":`true`,children:(0,P.jsx)(`span`,{})}),`Something inside is hit`]})]})]}),(0,P.jsx)(`p`,{className:`arc-key-gestures`,children:`+ shows what is inside, here · the arrow tile (or a double-click) goes a level down · Shift-click picks for export · / finds`})]})}function ym(){try{return window.localStorage.getItem(`archidocs.key`)===`open`}catch{return!1}}function bm(e){try{window.localStorage.setItem(`archidocs.key`,e?`open`:`closed`)}catch{}}function xm(e){return e-340>=e/2?e-340:e}function Sm({laidOut:e,fitKey:t,selected:n,animate:r,onSettled:i}){let{setViewport:a}=od(),o=G(e=>e.width),s=G(e=>e.height),c=(0,O.useRef)(!0),l=(0,O.useRef)(void 0),u=o>0&&s>0;return(0,O.useEffect)(()=>{if(!u)return;let{layout:d}=e,f=l.current!==t;l.current=t;let p=0;if(f){let e=n===null?o:xm(o),t=Math.min(1,(e-64)/Math.max(d.width,1),(s-64)/Math.max(d.height,1)),i=Math.max(um,t),l=n===null?void 0:d.nodes.find(e=>e.id===n),u=(e,t,n,r)=>t*i<=e-64?(e-t*i)/2:n===void 0?dm:Math.min(dm,Math.max(e-dm-t*i,e/2-(n+r/2)*i)),f=u(e,d.width,l?.x,l?.width??0),m=u(s,d.height,l?.y,l?.height??0);p=r&&!c.current?cm:0,c.current=!1,a({x:f,y:m,zoom:i},{duration:p})}let m=0,h=()=>{document.querySelectorAll(`path[data-edge-from]`).length>=d.edges.length?i(e):m=window.requestAnimationFrame(h)},g=window.setTimeout(h,p+(r?cm:0)+20);return()=>{window.clearTimeout(g),window.cancelAnimationFrame(m)}},[e,t,u]),null}function Cm({selected:e,animate:t,drawingWidth:n}){let{getInternalNode:r,getViewport:i,setViewport:a}=od(),o=G(e=>e.width);return(0,O.useEffect)(()=>{if(e===null||o===0)return;let s=window.setTimeout(()=>{let s=r(e);if(!s)return;let{x:c,y:l,zoom:u}=i(),d=s.internals.positionAbsolute.x*u+c,f=d+(s.measured.width??s.width??0)*u,p=xm(o)-dm,m=c+n*u-p;if(m>0&&c-m>=dm/2)return void a({x:c-m,y:l,zoom:u},{duration:t?cm:0});if(f<=p)return;let h=Math.min(f-p,Math.max(0,d-dm));h>0&&a({x:c-h,y:l,zoom:u},{duration:t?cm:0})},fm);return()=>window.clearTimeout(s)},[e]),null}var wm=(0,O.memo)(function({data:e,selected:t}){let{node:n,type:r,sublabel:i,team:a,container:o,targetStep:s,twoLine:c,toggle:l,onToggle:u,wayIn:d,onOpenView:f,mark:p,ring:m,picked:h,change:g,hover:_}=e,v=_?void 0:p,b=e=>e.stopPropagation(),x=l&&(0,P.jsx)(`button`,{type:`button`,className:`arc-toggle nodrag nopan`,"aria-label":`${l===`expand`?`Expand`:`Collapse`} ${n.name}`,title:l===`expand`?`Show what is inside ${n.name}, here`:`Close ${n.name}`,onClick:e=>{b(e),u(n.id,l===`expand`)},onDoubleClick:b,children:(0,P.jsx)(L,{name:l===`expand`?`plus`:`minus`})}),S=d&&(0,P.jsx)(`button`,{type:`button`,className:`arc-way-in nodrag nopan`,"aria-label":d===`landscape`?`Open ${n.name} on the C2 Landscape`:`Open ${n.name}'s View`,title:d===`landscape`?`Open the C2 Landscape at ${n.name}`:`Open ${n.name}'s own View`,onClick:e=>{b(e),f(n.id)},onDoubleClick:b,children:(0,P.jsx)(L,{name:`arrow`})}),C=[`arc-box`,`arc-${n.kind}`,r?`arc-t-${r}`:``,o?`arc-container`:``,s?`arc-target-step-${s}`:``,c?`arc-two-line`:``,n.external?`arc-external`:``,t?`arc-selected`:``,v?v.hit?`arc-hit`:`arc-dim`:``,v?.hit&&m?`arc-ringed`:``,v?.hit&&v.side&&(!o||n.collapsed)?`arc-side-${v.side}`:``,v?.hit&&n.collapsed?`arc-holds-hit`:``,h?`arc-picked`:``,g?`arc-${g}`:``,_===`end`?`arc-hover-end`:_===`faded`?`arc-dim`:``],w=n.instances===void 0?void 0:y(n.instances),T=v!==void 0&&!v.hit||g===`unchanged`||g===`removed`;return(0,P.jsxs)(P.Fragment,{children:[w!==void 0&&(0,P.jsx)(`div`,{className:[`arc-stack`,T?`arc-stack-faint`:``].filter(Boolean).join(` `),"data-testid":`stack`,"aria-hidden":`true`}),(0,P.jsxs)(`div`,{className:C.filter(Boolean).join(` `),style:a?{"--team":a.color}:void 0,"data-node":n.id,"data-parent":n.parent??``,"data-hit":v?String(v.hit):void 0,"data-distance":v?.distance,"data-picked":h?`true`:void 0,"data-change":g,"data-hover":_,"aria-selected":t?`true`:`false`,title:g&&g!==`unchanged`?`${n.name}: ${g===`changed`&&n.collapsed?`changed, or something inside changed`:g}`:v?.hit&&n.collapsed?`${n.name}: something inside is hit`:n.name,children:[(0,P.jsx)(Nd,{type:`target`,position:U.Left,isConnectable:!1,className:`arc-handle`}),(0,P.jsx)(Nd,{type:`source`,position:U.Right,isConnectable:!1,className:`arc-handle`}),(0,P.jsxs)(`div`,{className:`arc-box-head`,children:[x,(0,P.jsx)(L,{name:rm[r??n.kind],className:`arc-kind-glyph`}),(0,P.jsx)(`span`,{className:`arc-name`,"data-testid":`name`,children:n.name}),o&&(0,P.jsx)(`span`,{className:`arc-sublabel arc-csub`,"data-testid":`sublabel`,title:i,children:i}),w!==void 0&&(0,P.jsx)(`span`,{className:`arc-instances`,"data-testid":`instances`,title:typeof n.instances==`number`?`${n.instances} instances`:`Autoscales from ${w.replace(`–`,` to `)} instances`,children:w}),a&&(0,P.jsx)(`span`,{className:`arc-team`,"data-testid":`team`,title:`Owner: ${a.code}`,children:a.code}),o&&S]}),!o&&(0,P.jsxs)(`div`,{className:`arc-box-foot`,children:[(0,P.jsx)(`div`,{className:`arc-sublabel`,"data-testid":`sublabel`,title:i,children:i}),S]}),v?.distance!==void 0&&!(o&&!n.collapsed)&&(0,P.jsxs)(`span`,{className:`arc-badge arc-badge-${v.side??`distance`}`,children:[v.side&&(0,P.jsx)(L,{name:om[v.side],className:`arc-badge-icon`}),v.side&&v.side!==`origin`&&`${am[v.side]} `,v.side===`origin`&&am.origin,(0,P.jsx)(`span`,{className:v.side===`origin`?`arc-visually-hidden`:void 0,"data-testid":`distance`,"aria-label":`distance ${v.distance}`,children:v.distance})]}),v?.hit&&n.collapsed&&(0,P.jsx)(`span`,{className:`arc-holds`,"aria-hidden":`true`}),g===`added`&&(0,P.jsx)(`span`,{className:`arc-added-mark`,"data-testid":`added`,"aria-label":`added`,children:`+`}),g===`changed`&&(0,P.jsx)(`span`,{className:`arc-changed-mark`,"data-testid":`changed`,"aria-label":`changed`})]})]})});function Tm({data:e,markerEnd:t}){let n=e.points.map((e,t)=>`${t===0?`M`:`L`}${Om(e.x)} ${Om(e.y)}`).join(` `),{faded:r,lit:i,change:a,from:o,to:s,tooltip:c,onHover:l}=e,u=[`arc-edge`,(i===void 0?r:!i)?`arc-faded`:``,i?`arc-lit`:``,a?`arc-${a}`:``],d=(0,P.jsx)(`path`,{className:u.filter(Boolean).join(` `),d:n,markerEnd:t,fill:`none`,"data-edge-from":e.from,"data-edge-to":e.to,"data-lit":i===void 0?void 0:String(i),"data-change":a}),f=(0,P.jsx)(`path`,{className:`arc-edge-hit`,d:n,"data-edge-hit":`${o}>${s}`,onMouseEnter:()=>l(`${o}>${s}`,!0),onMouseLeave:()=>l(`${o}>${s}`,!1),children:(0,P.jsx)(`title`,{children:c})});if(a!==`added`&&a!==`changed`)return(0,P.jsxs)(P.Fragment,{children:[d,f]});let p=Dm(e.points);return(0,P.jsxs)(P.Fragment,{children:[d,f,a===`added`?(0,P.jsx)(`text`,{className:`arc-edge-added`,x:p.x,y:p.y,dy:`0.35em`,textAnchor:`middle`,"aria-hidden":`true`,children:`+`}):(0,P.jsx)(`circle`,{className:`arc-edge-changed`,cx:p.x,cy:p.y,r:4,"aria-hidden":`true`})]})}function Em(e,t,n){let r=n.map(e=>[e.description,e.technology&&`[${e.technology}]`].filter(Boolean).join(` `)).filter(Boolean);return[`${e} → ${t}`,...r].join(`
19
+ `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,O.useEffect)(()=>{let n=t?.target??Ru,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&pc(e))return!1;let n=Vu(e.code,s);if(a.current.add(e[n]),Bu(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=Vu(e.code,s);Bu(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function Bu(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function Vu(e,t){return t.includes(e)?`code`:`key`}var Hu=()=>{let e=du();return(0,O.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[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)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=$s(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return Js(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=Ys(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function Uu(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)Wu(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function Wu(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(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)}}function Gu(e,t){return Uu(e,t)}function Ku(e,t){return Uu(e,t)}function qu(e,t){return{id:e,type:`select`,selected:t}}function Ju(e,t=new Set){let n=[];for(let[r,i]of e){let e=t.has(r);(i.selected!==void 0||e)&&i.selected!==e&&n.push(qu(i.id,e))}return n}function Yu({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function Xu(e){return{id:e.id,type:`remove`}}var Zu=Ks(`React Flow`,`https://reactflow.dev/`);function Qu(e,t,n={}){return Ec(e,t,{...n,onError:n.onError??Zu})}var $u=e=>bs(e),K=e=>ys(e);function ed(e){return(0,O.forwardRef)(e)}var q=typeof window<`u`?O.useLayoutEffect:O.useEffect;function J(e){let[t,n]=(0,O.useState)(BigInt(0)),[r]=(0,O.useState)(()=>td(()=>n(e=>e+BigInt(1))));return q(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function td(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var nd=(0,O.createContext)(null);function rd({children:e}){let t=du(),n=J((0,O.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=Yu({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=J((0,O.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(Yu({items:s,lookup:o}))},[])),i=(0,O.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,P.jsx)(nd.Provider,{value:i,children:e})}function id(){let e=(0,O.useContext)(nd);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var ad=e=>!!e.panZoom;function od(){let e=Hu(),t=du(),n=id(),r=G(ad),i=(0,O.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=$u(e)?e:n.get(e.id),a=i.parentId?ic(i.position,i.measured,i.parentId,n,r):i.position;return zs({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height},i.parentId?void 0:r)},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&$u(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&K(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await As({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(Xu);o?.(f),c(e)}if(m){let e=d.map(Xu);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=Ws(e),o=i?e:a(e),s=r!==void 0;if(!o)return[];let{nodeOrigin:c}=t.getState();return(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let l=zs(s?r:a,c),u=Us(l,o);return n&&u>0||u>=l.width*l.height||u>=o.width*o.height})},isNodeIntersecting:(e,t,n=!0)=>{let r=Ws(e)?e:a(e);if(!r)return!1;let i=Us(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return Cs(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??oc();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,O.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var sd=e=>e.selected,cd=typeof window<`u`?window:void 0;function ld({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=du(),{deleteElements:r}=od(),i=zu(e,{actInsideInputWithModifier:!1}),a=zu(t,{target:cd});(0,O.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(sd),edges:e.filter(sd)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,O.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function ud(e){let t=du();(0,O.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=uc(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,cs.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t.disconnect()}}},[])}var dd={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},fd=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function pd({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=ps.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:_,onViewportChange:v,isControlledViewport:y,paneClickDistance:b,selectionOnDrag:x}){let S=du(),C=(0,O.useRef)(null),{userSelectionActive:w,lib:T,connectionInProgress:E}=G(fd,W),D=zu(p),k=(0,O.useRef)();ud(C);let A=(0,O.useCallback)(e=>{v?.({x:e[0],y:e[1],zoom:e[2]}),y||S.setState({transform:e})},[v,y]);return(0,O.useEffect)(()=>{if(C.current){k.current=Il({domNode:C.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>S.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=S.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=S.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=S.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=k.current.getViewport();return S.setState({panZoom:k.current,transform:[e,t,n],domNode:C.current.closest(`.react-flow`)}),()=>{k.current?.destroy()}}},[]),(0,O.useEffect)(()=>{k.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:_,userSelectionActive:w,noWheelClassName:g,lib:T,onTransformChange:A,connectionInProgress:E,selectionOnDrag:x,paneClickDistance:b})},[e,t,n,r,i,a,o,s,c,D,m,_,w,g,T,A,E,x,b]),(0,P.jsx)(`div`,{className:`react-flow__renderer`,ref:C,style:dd,children:h})}var md=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function hd(){let{userSelectionActive:e,userSelectionRect:t}=G(md,W);return e&&t?(0,P.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}var gd=(e,t)=>n=>{n.target===t.current&&e?.(n)},_d=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function vd({isSelecting:e,selectionKeyPressed:t,selectionMode:n=ms.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,O.useRef)(0),_=du(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:S}=G(_d,W),C=y&&(e||v),w=(0,O.useRef)(null),T=(0,O.useRef)(),E=(0,O.useRef)(new Set),D=(0,O.useRef)(new Set),k=(0,O.useRef)(!1),A=(0,O.useRef)(!1),j=(0,O.useRef)({x:0,y:0}),M=(0,O.useRef)(!1),ee=e=>{if(A.current||k.current||_.getState().connection.inProgress){A.current=!1,k.current=!1;return}let{connectionClickStartHandle:t,connection:n,onClickConnectEnd:r,resetSelectedElements:i}=_.getState();if(t){let t=structuredClone(n);delete t.inProgress,t.toPosition=t.toHandle?t.toHandle.position:null,r?.(e.nativeEvent,t),_.setState({connectionClickStartHandle:null})}l?.(e),i(),_.setState({nodesSelectionActive:!1})},te=e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},ne=d?e=>d(e):void 0,re=e=>{A.current&&=(e.stopPropagation(),!1)},ie=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=_.getState();if(T.current=i?.getBoundingClientRect(),!T.current)return;let s=n.target===w.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),A.current=!1;let{x:c,y:l}=hc(n.nativeEvent,T.current),u=Js({x:c,y:l},a);_.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function ae(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=Ys(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=E.current,g=D.current;E.current=new Set(Ts(a,m,i,n===ms.Partial,!0).map(e=>e.id)),D.current=new Set;let v=u?.selectable??!0;for(let e of E.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&D.current.add(e)}}ac(h,E.current)||c(Ju(a,E.current)),ac(g,D.current)||l(Ju(o,D.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function N(){if(!i||!T.current)return;let[e,t]=Fs(j.current,T.current,S);x({x:e,y:t}).then(e=>{if(!A.current||!e){g.current=requestAnimationFrame(N);return}let{x:t,y:n}=j.current;ae(t,n),g.current=requestAnimationFrame(N)})}let oe=()=>{cancelAnimationFrame(g.current),g.current=0,M.current=!1};(0,O.useEffect)(()=>()=>oe(),[]);let se=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!T.current||!n)return;let{x:o,y:c}=hc(e.nativeEvent,T.current);j.current={x:o,y:c};let l=Ys({x:n.startX,y:n.startY},r);if(!A.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}A.current=!0,M.current||=(N(),!0),ae(o,c)},ce=e=>{C?e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===w.current&&_.getState().userSelectionRect&&ee?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(c?.(e),_.setState({nodesSelectionActive:E.current.size>0})),oe()):e.target===w.current&&_.getState().connection.inProgress&&(k.current=!0)},le=e=>{e.target?.releasePointerCapture?.(e.pointerId),oe()},ue=r===!0||Array.isArray(r)&&r.includes(0);return(0,P.jsxs)(`div`,{className:Ae([`react-flow__pane`,{draggable:ue,dragging:b,selection:e}]),onClick:C?void 0:gd(ee,w),onContextMenu:gd(te,w),onWheel:gd(ne,w),onPointerEnter:C?void 0:f,onPointerMove:C?se:p,onPointerUp:ce,onPointerCancel:C?le:void 0,onPointerDownCapture:C?ie:void 0,onClickCapture:C?re:void 0,onPointerLeave:m,ref:w,style:dd,children:[h,(0,P.jsx)(hd,{})]})}function yd({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);l?(t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):c?.(`012`,cs.error012(e))}function bd({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=du(),[c,l]=(0,O.useState)(!1),u=(0,O.useRef)();return(0,O.useEffect)(()=>{if(!t)return u.current=dl({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{yd({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,O.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var xd=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function Sd(){let e=du();return(0,O.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=xd(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=qs(t,i));let{position:a,positionAbsolute:s}=ks({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var Cd=(0,O.createContext)(null),wd=Cd.Provider;Cd.Consumer;var Td=()=>(0,O.useContext)(Cd),Ed=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Dd=(0,O.createContext)(null);function Od({children:e}){let t=G(Ed,W);return(0,P.jsx)(Dd.Provider,{value:t,children:e})}function kd(){let e=(0,O.useContext)(Dd);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var Ad={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},jd=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return Ad;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===fs.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function Md({type:e=`source`,position:t=U.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=du(),_=Td(),{connectOnClick:v,noPanClassName:y,rfId:b}=kd(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=G(jd(_,m,e),W);_||g.getState().onError?.(`010`,cs.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(Qu(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=mc(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();xl.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,P.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:Ae([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=dc(t.target),h=n||c,{connection:v,isValid:y}=xl.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var Nd=(0,O.memo)(ed(Md));function Pd({data:e,isConnectable:t,sourcePosition:n=U.Bottom}){return(0,P.jsxs)(P.Fragment,{children:[e?.label,(0,P.jsx)(Nd,{type:`source`,position:n,isConnectable:t})]})}function Fd({data:e,isConnectable:t,targetPosition:n=U.Top,sourcePosition:r=U.Bottom}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Nd,{type:`target`,position:n,isConnectable:t}),e?.label,(0,P.jsx)(Nd,{type:`source`,position:r,isConnectable:t})]})}function Id(){return null}function Ld({data:e,isConnectable:t,targetPosition:n=U.Top}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Nd,{type:`target`,position:n,isConnectable:t}),e?.label]})}var Rd={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},zd={input:Pd,default:Fd,output:Ld,group:Id};function Bd(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var Vd=e=>{let{width:t,height:n,x:r,y:i}=ws(e.nodeLookup,{filter:e=>!!e.selected});return{width:Gs(t)?t:null,height:Gs(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function Hd({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=du(),{width:i,height:a,transformString:o,userSelectionActive:s}=G(Vd,W),c=Sd(),l=(0,O.useRef)(null);(0,O.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(bd({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,P.jsx)(`div`,{className:Ae([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,P.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(Rd,e.key)&&(e.preventDefault(),c({direction:Rd[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var Ud=typeof window<`u`?window:void 0,Wd=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Gd({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:ee,disableKeyboardA11y:te,onViewportChange:ne,isControlledViewport:re}){let{nodesSelectionActive:ie,userSelectionActive:ae}=G(Wd,W),N=zu(l,{target:Ud}),oe=zu(h,{target:Ud}),se=oe||w,ce=oe||b,le=u&&se!==!0,ue=N||ae||le;return ld({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,P.jsx)(pd,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ce,panActivationKeyPressed:oe,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!N&&se,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:ee,onViewportChange:ne,isControlledViewport:re,paneClickDistance:s,selectionOnDrag:le,children:(0,P.jsxs)(vd,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:se,autoPanOnSelection:T,isSelecting:!!ue,selectionMode:d,selectionKeyPressed:N,paneClickDistance:s,selectionOnDrag:le,children:[e,ie&&(0,P.jsx)(Hd,{onSelectionContextMenu:j,noPanClassName:ee,disableKeyboardA11y:te})]})})}Gd.displayName=`FlowRenderer`;var Kd=(0,O.memo)(Gd),qd=e=>t=>e?Ts(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function Jd(e){return G((0,O.useCallback)(qd(e),[e]),W)}var Yd=e=>e.updateNodeInternals;function Xd(){let e=G(Yd),[t]=(0,O.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,O.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function Zd({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=du(),a=(0,O.useRef)(null),o=(0,O.useRef)(null),s=(0,O.useRef)(e.sourcePosition),c=(0,O.useRef)(e.targetPosition),l=(0,O.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,O.useEffect)(()=>{!a.current||e.hidden||u&&o.current===a.current||(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,O.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,O.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function Qd({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=G(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},W),S=y.type||`default`,C=g?.[S]||zd[S];C===void 0&&(v?.(`003`,cs.error003(S)),S=`default`,C=g?.default||zd.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=du(),k=rc(y),A=Zd({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=bd({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=Sd();if(y.hidden)return null;let ee=nc(y),te=Bd(y),ne=T||w||t||n||r||i,re=n?e=>n(e,{...b.userNode}):void 0,ie=r?e=>r(e,{...b.userNode}):void 0,ae=i?e=>i(e,{...b.userNode}):void 0,N=a?e=>a(e,{...b.userNode}):void 0,oe=o?e=>o(e,{...b.userNode}):void 0,se=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&yd({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},ce=t=>{if(!(pc(t.nativeEvent)||m)){if(us.includes(t.key)&&T){let n=t.key===`Escape`;yd({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(Rd,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:Rd[t.key],factor:t.shiftKey?4:1})}}},le=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(Ts(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+ee.width/2,y.position.y+ee.height/2,{zoom:t[2]}))};return(0,P.jsx)(`div`,{className:Ae([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:ne?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...te},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:re,onMouseMove:ie,onMouseLeave:ae,onContextMenu:N,onClick:se,onDoubleClick:oe,onKeyDown:D?ce:void 0,tabIndex:D?0:void 0,onFocus:D?le:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${mu}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,P.jsx)(wd,{value:e,children:(0,P.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...ee})})})}var $d=(0,O.memo)(Qd),ef=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function tf(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=G(ef,W),a=Jd(e.onlyRenderVisibleElements),o=Xd();return(0,P.jsx)(`div`,{className:`react-flow__nodes`,style:dd,children:a.map(a=>(0,P.jsx)($d,{id:a,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:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}tf.displayName=`NodeRenderer`;var nf=(0,O.memo)(tf);function rf(e){return G((0,O.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&Cc({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),W)}var af=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,P.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},of=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,P.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},sf={[_s.Arrow]:af,[_s.ArrowClosed]:of};function cf(e){let t=du();return(0,O.useMemo)(()=>Object.prototype.hasOwnProperty.call(sf,e)?sf[e]:(t.getState().onError?.(`009`,cs.error009(e)),null),[e])}var lf=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=cf(t);return c?(0,P.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,P.jsx)(c,{color:n,strokeWidth:o})}):null},uf=({defaultColor:e,rfId:t})=>{let n=G(e=>e.edges),r=G(e=>e.defaultEdgeOptions),i=(0,O.useMemo)(()=>Vc(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,P.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,P.jsx)(`defs`,{children:i.map(e=>(0,P.jsx)(lf,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};uf.displayName=`MarkerDefinitions`;var df=(0,O.memo)(uf);function ff({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,O.useState)({x:1,y:0,width:0,height:0}),p=Ae([`react-flow__edge-textwrapper`,l]),m=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,P.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,P.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,P.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}ff.displayName=`EdgeText`;var pf=(0,O.memo)(ff);function mf({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`path`,{...u,d:e,fill:`none`,className:Ae([`react-flow__edge-path`,u.className])}),l?(0,P.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&Gs(t)&&Gs(n)?(0,P.jsx)(pf,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function hf({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===U.Left||e===U.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function gf({sourceX:e,sourceY:t,sourcePosition:n=U.Bottom,targetX:r,targetY:i,targetPosition:a=U.Top}){let[o,s]=hf({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=hf({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=_c({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function _f(e){return(0,O.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=gf({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,P.jsx)(mf,{id:x,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var vf=_f({isInternal:!1}),yf=_f({isInternal:!0});vf.displayName=`SimpleBezierEdge`,yf.displayName=`SimpleBezierEdgeInternal`;function bf(e){return(0,O.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=U.Bottom,targetPosition:m=U.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=Pc({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),S=e.isInternal?void 0:t;return(0,P.jsx)(mf,{id:S,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var xf=bf({isInternal:!1}),Sf=bf({isInternal:!0});xf.displayName=`SmoothStepEdge`,Sf.displayName=`SmoothStepEdgeInternal`;function Cf(e){return(0,O.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,P.jsx)(xf,{...n,id:r,pathOptions:(0,O.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var wf=Cf({isInternal:!1}),Tf=Cf({isInternal:!0});wf.displayName=`StepEdge`,Tf.displayName=`StepEdgeInternal`;function Ef(e){return(0,O.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=Dc({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,P.jsx)(mf,{id:y,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var Df=Ef({isInternal:!1}),Of=Ef({isInternal:!0});Df.displayName=`StraightEdge`,Of.displayName=`StraightEdgeInternal`;function kf(e){return(0,O.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=U.Bottom,targetPosition:s=U.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=bc({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,P.jsx)(mf,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var Af=kf({isInternal:!1}),jf=kf({isInternal:!0});Af.displayName=`BezierEdge`,jf.displayName=`BezierEdgeInternal`;var Mf={default:jf,straight:Of,step:Tf,smoothstep:Sf,simplebezier:yf},Nf={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Pf=(e,t,n)=>n===U.Left?e-t:n===U.Right?e+t:e,Ff=(e,t,n)=>n===U.Top?e-t:n===U.Bottom?e+t:e,If=`react-flow__edgeupdater`;function Lf({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,P.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Ae([If,`${If}-${s}`]),cx:Pf(t,r,e),cy:Ff(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function Rf({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=du(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;xl.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,P.jsxs)(P.Fragment,{children:[(e===!0||e===`source`)&&(0,P.jsx)(Lf,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,P.jsx)(Lf,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function zf({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=G(t=>t.edgeLookup.get(e)),b=G(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||Mf[x];S===void 0&&(_?.(`011`,cs.error011(x)),x=`default`,S=h?.default||Mf.default);let C=!!(y.focusable||t&&y.focusable===void 0),w=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),T=!!(y.selectable||r&&y.selectable===void 0),E=(0,O.useRef)(null),[D,k]=(0,O.useState)(!1),[A,j]=(0,O.useState)(!1),M=du(),{zIndex:ee=y.zIndex,sourceX:te,sourceY:ne,targetX:re,targetY:ie,sourcePosition:ae,targetPosition:N}=G((0,O.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return Nf;let i=Ic({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=Sc({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||Nf,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex,_]),W),oe=(0,O.useMemo)(()=>y.markerStart?`url('#${Bc(y.markerStart,m)}')`:void 0,[y.markerStart,m]),se=(0,O.useMemo)(()=>y.markerEnd?`url('#${Bc(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||te===null||ne===null||re===null||ie===null)return null;let ce=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=M.getState();T&&(M.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},le=a?e=>{a(e,{...y})}:void 0,ue=o?e=>{o(e,{...y})}:void 0,de=s?e=>{s(e,{...y})}:void 0,fe=c?e=>{c(e,{...y})}:void 0,pe=l?e=>{l(e,{...y})}:void 0;return(0,P.jsx)(`svg`,{style:{zIndex:ee},children:(0,P.jsxs)(`g`,{className:Ae([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:ce,onDoubleClick:le,onContextMenu:ue,onMouseEnter:de,onMouseMove:fe,onMouseLeave:pe,onKeyDown:C?t=>{if(!v&&us.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=M.getState();t.key===`Escape`?(E.current?.blur(),n({edges:[y]})):r([e])}}: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?`${hu}-${m}`:void 0,ref:E,...y.domAttributes,children:[!A&&(0,P.jsx)(S,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:T,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:te,sourceY:ne,targetX:re,targetY:ie,sourcePosition:ae,targetPosition:N,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:oe,markerEnd:se,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,P.jsx)(Rf,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:te,sourceY:ne,targetX:re,targetY:ie,sourcePosition:ae,targetPosition:N,setUpdateHover:k,setReconnecting:j})]})})}var Bf=(0,O.memo)(zf),Vf=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Hf({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=G(Vf,W),b=rf(t);return(0,P.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,P.jsx)(df,{defaultColor:e,rfId:n}),b.map(e=>(0,P.jsx)(Bf,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}Hf.displayName=`EdgeRenderer`;var Uf=(0,O.memo)(Hf),Wf=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function Y({children:e}){let t=du(),n=(0,O.useRef)(null),[r]=(0,O.useState)(()=>t.getState().transform);return q(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=Wf(r)))};return r(),t.subscribe(r)},[t]),(0,P.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:Wf(r)},children:e})}function Gf(e){let t=od(),n=(0,O.useRef)(!1);(0,O.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var Kf=e=>e.panZoom?.syncViewport;function qf(e){let t=G(Kf),n=du();return(0,O.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Jf(e){return e.connection.inProgress?{...e.connection,to:Js(e.connection.to,e.transform)}:{...e.connection}}function Yf(e){return e?t=>e(Jf(t)):Jf}function Xf(e){return G(Yf(e),W)}var Zf=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Qf({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=G(Zf,W);return a&&i&&c?(0,P.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,P.jsx)(`g`,{className:Ae([`react-flow__connection`,cc(s)]),children:(0,P.jsx)($f,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var $f=({style:e,type:t=gs.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=Xf();if(!i)return;if(n)return(0,P.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:cc(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case gs.Bezier:[m]=bc(h);break;case gs.SimpleBezier:[m]=gf(h);break;case gs.Step:[m]=Pc({...h,borderRadius:0});break;case gs.SmoothStep:[m]=Pc(h);break;default:[m]=Dc(h)}return(0,P.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};$f.displayName=`ConnectionLine`;var ep={};function tp(e=ep){(0,O.useRef)(e),du(),(0,O.useEffect)(()=>{},[e])}function np(){du(),(0,O.useRef)(!1),(0,O.useEffect)(()=>{},[])}function rp({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:ee,zoomOnPinch:te,panOnScroll:ne,panOnScrollSpeed:re,panOnScrollMode:ie,zoomOnDoubleClick:ae,panOnDrag:N,autoPanOnSelection:oe,onPaneClick:se,onPaneMouseEnter:ce,onPaneMouseMove:le,onPaneMouseLeave:ue,onPaneScroll:de,onPaneContextMenu:fe,paneClickDistance:pe,nodeClickDistance:me,onEdgeContextMenu:he,onEdgeMouseEnter:F,onEdgeMouseMove:I,onEdgeMouseLeave:ge,reconnectRadius:_e,onReconnect:ve,onReconnectStart:ye,onReconnectEnd:be,noDragClassName:xe,noWheelClassName:Se,noPanClassName:L,disableKeyboardA11y:Ce,nodeExtent:we,rfId:Te,viewport:Ee,onViewportChange:De,nodesDraggable:Oe}){return tp(e),tp(t),np(),Gf(n),qf(Ee),(0,P.jsx)(Kd,{onPaneClick:se,onPaneMouseEnter:ce,onPaneMouseMove:le,onPaneMouseLeave:ue,onPaneContextMenu:fe,onPaneScroll:de,paneClickDistance:pe,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:ee,zoomOnPinch:te,zoomOnDoubleClick:ae,panOnScroll:ne,panOnScrollSpeed:re,panOnScrollMode:ie,panOnDrag:N,autoPanOnSelection:oe,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:xe,noWheelClassName:Se,noPanClassName:L,disableKeyboardA11y:Ce,onViewportChange:De,isControlledViewport:!!Ee,children:(0,P.jsxs)(Y,{children:[(0,P.jsx)(Uf,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ve,onReconnectStart:ye,onReconnectEnd:be,onlyRenderVisibleElements:T,onEdgeContextMenu:he,onEdgeMouseEnter:F,onEdgeMouseMove:I,onEdgeMouseLeave:ge,reconnectRadius:_e,defaultMarkerColor:M,noPanClassName:L,disableKeyboardA11y:Ce,rfId:Te}),(0,P.jsx)(Qf,{style:h,type:m,component:g,containerStyle:_}),(0,P.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,P.jsx)(nf,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:me,onlyRenderVisibleElements:T,noPanClassName:L,noDragClassName:xe,disableKeyboardA11y:Ce,nodeExtent:we,rfId:Te,nodesDraggable:Oe}),(0,P.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}rp.displayName=`GraphView`;var ip=(0,O.memo)(rp),ap=Ks(`React Flow`,`https://reactflow.dev/`),op=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??ls;al(h,g,_);let{nodesInitialized:x}=Xc(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=$s(ws(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:ls,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:fs.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:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...hs},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ap,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:ds,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},sp=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>ou((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await Os({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...op({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=Xc(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();al(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=nl(e,n,r,i,a,o,l);d&&(qc(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=Rc(e,o.fromHandle,U.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=tl(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(Gu(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(Ku(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?i(e.map(e=>qu(e,!0))):(i(Ju(r,new Set([...e]))),a(Ju(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?a(e.map(e=>qu(e,!0))):(a(Ju(n,new Set([...e]))),i(Ju(r,new Set)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s)e.selected&&l.push(qu(e.id,!1));let u=[];for(let e of c)e.selected&&u.push(qu(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,qu(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,qu(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(Xc(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return rl({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...hs}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...op()})}},Object.is);function cp({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,O.useState)(()=>sp({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,P.jsx)(lu,{value:m,children:(0,P.jsx)(rd,{children:(0,P.jsx)(Od,{children:p})})})}function lp({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,O.useContext)(cu)?(0,P.jsx)(P.Fragment,{children:e}):(0,P.jsx)(cp,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var up={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function dp({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:k,onSelectionChange:A,onSelectionDragStart:j,onSelectionDrag:M,onSelectionDragStop:ee,onSelectionContextMenu:te,onSelectionStart:ne,onSelectionEnd:re,onBeforeDelete:ie,connectionMode:ae,connectionLineType:N=gs.Bezier,connectionLineStyle:oe,connectionLineComponent:se,connectionLineContainerStyle:ce,deleteKeyCode:le=`Backspace`,selectionKeyCode:ue=`Shift`,selectionOnDrag:de=!1,selectionMode:fe=ms.Full,panActivationKeyCode:pe=`Space`,multiSelectionKeyCode:me=ec()?`Meta`:`Control`,zoomActivationKeyCode:he=ec()?`Meta`:`Control`,snapToGrid:F,snapGrid:I,onlyRenderVisibleElements:ge=!1,selectNodesOnDrag:_e,nodesDraggable:ve,autoPanOnNodeFocus:ye,nodesConnectable:be,nodesFocusable:xe,nodeOrigin:Se=Au,edgesFocusable:L,edgesReconnectable:Ce,elementsSelectable:we=!0,defaultViewport:Te=ju,minZoom:Ee=.5,maxZoom:De=2,translateExtent:Oe=ls,preventScrolling:ke=!0,nodeExtent:je,defaultMarkerColor:Me=`#b1b1b7`,zoomOnScroll:Ne=!0,zoomOnPinch:Pe=!0,panOnScroll:Fe=!1,panOnScrollSpeed:Ie=.5,panOnScrollMode:Le=ps.Free,zoomOnDoubleClick:Re=!0,panOnDrag:ze=!0,onPaneClick:Be,onPaneMouseEnter:Ve,onPaneMouseMove:He,onPaneMouseLeave:Ue,onPaneScroll:We,onPaneContextMenu:Ge,paneClickDistance:Ke=1,nodeClickDistance:qe=0,children:Je,onReconnect:Ye,onReconnectStart:Xe,onReconnectEnd:Ze,onEdgeContextMenu:Qe,onEdgeDoubleClick:$e,onEdgeMouseEnter:et,onEdgeMouseMove:tt,onEdgeMouseLeave:nt,reconnectRadius:rt=10,onNodesChange:it,onEdgesChange:at,noDragClassName:ot=`nodrag`,noWheelClassName:st=`nowheel`,noPanClassName:ct=`nopan`,fitView:lt,fitViewOptions:ut,connectOnClick:dt,attributionPosition:ft,proOptions:pt,defaultEdgeOptions:mt,elevateNodesOnSelect:ht=!0,elevateEdgesOnSelect:gt=!1,disableKeyboardA11y:_t=!1,autoPanOnConnect:vt,autoPanOnNodeDrag:yt,autoPanOnSelection:bt=!0,autoPanSpeed:xt,connectionRadius:St,isValidConnection:Ct,onError:wt,style:Tt,id:Et,nodeDragThreshold:Dt,connectionDragThreshold:Ot,viewport:kt,onViewportChange:At,width:jt,height:Mt,colorMode:Nt=`light`,debug:Pt,onScroll:Ft,ariaLabelConfig:It,zIndexMode:Lt=`basic`,...Rt},zt){let Bt=Et||`1`,Vt=Lu(Nt),Ht=(0,O.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Ft?.(e)},[Ft]);return(0,P.jsx)(`div`,{"data-testid":`rf__wrapper`,...Rt,onScroll:Ht,style:{...Tt,...up},ref:zt,className:Ae([`react-flow`,i,Vt]),id:Et,role:`application`,children:(0,P.jsxs)(lp,{nodes:e,edges:t,width:jt,height:Mt,fitView:lt,fitViewOptions:ut,minZoom:Ee,maxZoom:De,nodeOrigin:Se,nodeExtent:je,zIndexMode:Lt,children:[(0,P.jsx)(Fu,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:ve,autoPanOnNodeFocus:ye,nodesConnectable:be,nodesFocusable:xe,edgesFocusable:L,edgesReconnectable:Ce,elementsSelectable:we,elevateNodesOnSelect:ht,elevateEdgesOnSelect:gt,minZoom:Ee,maxZoom:De,nodeExtent:je,onNodesChange:it,onEdgesChange:at,snapToGrid:F,snapGrid:I,connectionMode:ae,translateExtent:Oe,connectOnClick:dt,defaultEdgeOptions:mt,fitView:lt,fitViewOptions:ut,onNodesDelete:E,onEdgesDelete:D,onDelete:k,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:ee,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:ct,nodeOrigin:Se,rfId:Bt,autoPanOnConnect:vt,autoPanOnNodeDrag:yt,autoPanSpeed:xt,onError:wt,connectionRadius:St,isValidConnection:Ct,selectNodesOnDrag:_e,nodeDragThreshold:Dt,connectionDragThreshold:Ot,onBeforeDelete:ie,debug:Pt,ariaLabelConfig:It,zIndexMode:Lt}),(0,P.jsx)(ip,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:N,connectionLineStyle:oe,connectionLineComponent:se,connectionLineContainerStyle:ce,selectionKeyCode:ue,selectionOnDrag:de,selectionMode:fe,deleteKeyCode:le,multiSelectionKeyCode:me,panActivationKeyCode:pe,zoomActivationKeyCode:he,onlyRenderVisibleElements:ge,defaultViewport:Te,translateExtent:Oe,minZoom:Ee,maxZoom:De,preventScrolling:ke,zoomOnScroll:Ne,zoomOnPinch:Pe,zoomOnDoubleClick:Re,panOnScroll:Fe,panOnScrollSpeed:Ie,panOnScrollMode:Le,panOnDrag:ze,autoPanOnSelection:bt,onPaneClick:Be,onPaneMouseEnter:Ve,onPaneMouseMove:He,onPaneMouseLeave:Ue,onPaneScroll:We,onPaneContextMenu:Ge,paneClickDistance:Ke,nodeClickDistance:qe,onSelectionContextMenu:te,onSelectionStart:ne,onSelectionEnd:re,onReconnect:Ye,onReconnectStart:Xe,onReconnectEnd:Ze,onEdgeContextMenu:Qe,onEdgeDoubleClick:$e,onEdgeMouseEnter:et,onEdgeMouseMove:tt,onEdgeMouseLeave:nt,reconnectRadius:rt,defaultMarkerColor:Me,noDragClassName:ot,noWheelClassName:st,noPanClassName:ct,rfId:Bt,disableKeyboardA11y:_t,nodeExtent:je,viewport:kt,onViewportChange:At,nodesDraggable:ve}),(0,P.jsx)(ku,{onSelectionChange:A}),Je,(0,P.jsx)(Cu,{proOptions:pt,position:ft}),(0,P.jsx)(bu,{rfId:Bt,disableKeyboardA11y:_t})]})})}var fp=ed(dp),pp=e=>e.domNode?.querySelector(`.react-flow__edgelabel-renderer`);function mp({children:e}){let t=G(pp);return t?(0,su.createPortal)(e,t):null}cs.error014();function hp({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,P.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ae([`react-flow__background-pattern`,n,r])})}function gp({radius:e,className:t}){return(0,P.jsx)(`circle`,{cx:e,cy:e,r:e,className:Ae([`react-flow__background-pattern`,`dots`,t])})}var _p;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(_p||={});var vp={[_p.Dots]:1,[_p.Lines]:1,[_p.Cross]:6},yp=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function bp({id:e,variant:t=_p.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,O.useRef)(null),{transform:f,patternId:p}=G(yp,W),m=r||vp[t],h=t===_p.Dots,g=t===_p.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],b=Array.isArray(a)?a:[a,a],x=g?[y,y]:v,S=[b[0]*f[2]+x[0]/2,b[1]*f[2]+x[1]/2],C=`${p}${e||``}`;return(0,P.jsxs)(`svg`,{className:Ae([`react-flow__background`,l]),style:{...c,...dd,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,P.jsx)(`pattern`,{id:C,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${S[0]},-${S[1]})`,children:h?(0,P.jsx)(gp,{radius:y/2,className:u}):(0,P.jsx)(hp,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,P.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}bp.displayName=`Background`,(0,O.memo)(bp);function xp(){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,P.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function Sp(){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,P.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function Cp(){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,P.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function wp(){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,P.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function Tp(){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,P.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function Ep({children:e,className:t,...n}){return(0,P.jsx)(`button`,{type:`button`,className:Ae([`react-flow__controls-button`,t]),...n,children:e})}var Dp=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Op({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=du(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=G(Dp,W),{zoomIn:y,zoomOut:b,fitView:x}=od();return(0,P.jsxs)(xu,{className:Ae([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Ep,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,P.jsx)(xp,{})}),(0,P.jsx)(Ep,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,P.jsx)(Sp,{})})]}),n&&(0,P.jsx)(Ep,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,P.jsx)(Cp,{})}),r&&(0,P.jsx)(Ep,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,P.jsx)(Tp,{}):(0,P.jsx)(wp,{})}),u]})}Op.displayName=`Controls`;var kp=(0,O.memo)(Op);function Ap({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,P.jsx)(`rect`,{className:Ae([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var jp=(0,O.memo)(Ap),Mp=e=>e.nodes.map(e=>e.id),Np=e=>e instanceof Function?e:()=>e;function Pp({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=jp,onClick:o}){let s=G(Mp,W),c=Np(t),l=Np(e),u=Np(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,P.jsx)(P.Fragment,{children:s.map(e=>(0,P.jsx)(Ip,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function Fp({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=G(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=nc(r);return{node:r,x:i,y:a,width:o,height:s}},W);return!l||l.hidden||!rc(l)?null:(0,P.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var Ip=(0,O.memo)(Fp),Lp=(0,O.memo)(Pp),Rp=200,zp=150,Bp=e=>!e.hidden,Vp=e=>{let 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]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?Vs(ws(e.nodeLookup,{filter:Bp}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Hp=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Up=(e,t)=>Hp(e.viewBB,t.viewBB)&&Hp(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,Wp=`react-flow__minimap-desc`;function Gp({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:b=5}){let x=du(),S=(0,O.useRef)(null),{boundingRect:C,panZoom:w,viewBB:T,rfId:E,translateExtent:D,flowWidth:k,flowHeight:A,ariaLabelConfig:j}=G(Vp,Up),M=e?.width??Rp,ee=e?.height??zp,te=C.width/M,ne=C.height/ee,re=Math.max(te,ne),ie=re*M,ae=re*ee,N=b*re,oe=C.x-(ie-C.width)/2-N,se=C.y-(ae-C.height)/2-N,ce=ie+N*2,le=ae+N*2,ue=`${Wp}-${E}`,de=(0,O.useRef)(0),fe=(0,O.useRef)();de.current=re,(0,O.useEffect)(()=>{let e=x.getState().panZoom;if(S.current&&e)return fe.current=Sl({domNode:S.current,panZoom:e,getTransform:()=>x.getState().transform,getViewScale:()=>de.current}),()=>{fe.current?.destroy()}},[w]),(0,O.useEffect)(()=>{fe.current?.update({translateExtent:D,width:k,height:A,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,k,A]);let pe=p?e=>{let[t,n]=fe.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,me=(0,O.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),he=m?me:void 0,F=_??j[`minimap.ariaLabel`];return(0,P.jsx)(xu,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*re: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 o==`number`?o:void 0},className:Ae([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,P.jsxs)(`svg`,{width:M,height:ee,viewBox:`${oe} ${se} ${ce} ${le}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":ue,ref:S,onClick:pe,children:[F&&(0,P.jsx)(`title`,{id:ue,children:F}),(0,P.jsx)(Lp,{onClick:he,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,P.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${oe-N},${se-N}h${ce+N*2}v${le+N*2}h${-ce-N*2}z
20
+ M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}Gp.displayName=`MiniMap`;var Kp=(0,O.memo)(Gp),qp=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Jp={[Ll.Line]:`right`,[Ll.Handle]:`bottom-right`};function Yp({nodeId:e,position:t,variant:n=Ll.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=Td(),y=typeof e==`string`?e:v,b=du(),x=(0,O.useRef)(null),S=n===Ll.Handle,C=G((0,O.useCallback)(qp(S&&p),[S,p]),W),w=(0,O.useRef)(null),T=t??Jp[n];(0,O.useEffect)(()=>{if(x.current&&y)return w.current||=Jl({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=tl([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...ic({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),w.current.update({controlPosition:T,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{w.current?.destroy()}},[T,s,c,l,u,d,h,g,_,m]);let E=T.split(`-`);return(0,P.jsx)(`div`,{className:Ae([`react-flow__resize-control`,`nodrag`,...E,n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,O.memo)(Yp);function Xp(){return Zp(`(prefers-reduced-motion: reduce)`)}function Zp(e){let[t,n]=(0,O.useState)(()=>window.matchMedia(e).matches);return(0,O.useEffect)(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var Qp=1.15,$p=50;function em(){let e=G(e=>e.domNode),t=G(e=>e.minZoom),n=G(e=>e.maxZoom),{getViewport:r,setViewport:i}=od();return(0,O.useEffect)(()=>{if(!e)return;let a=a=>{if(!a.ctrlKey||a.deltaMode!==WheelEvent.DOM_DELTA_PIXEL||Math.abs(a.deltaY)<$p)return;a.preventDefault(),a.stopPropagation();let o=e.getBoundingClientRect(),s=a.clientX-o.left,c=a.clientY-o.top,{x:l,y:u,zoom:d}=r(),f=Math.min(n,Math.max(t,d*Qp**-Math.sign(a.deltaY)));i({x:s-(s-l)*f/d,y:c-(c-u)*f/d,zoom:f})};return e.addEventListener(`wheel`,a,{capture:!0,passive:!1}),()=>e.removeEventListener(`wheel`,a,{capture:!0})},[e,t,n,r,i]),null}function tm(e,t,n,r,i){let a=e.external?`EXT · `:``;if(e.kind===`deployment`&&i)return i;if(e.kind===`system`)return e.external?`${a}External System`:[`System`,r].filter(Boolean).join(` · `);if(e.kind===`service`||e.kind===`deployment`){let r=t?.kind===`service`&&t.type!==`app`?t.type:pm[e.kind];return a+[`${e.external?`External `:``}${r}`,n].filter(Boolean).join(` · `)}return[pm[e.kind],n].filter(Boolean).join(` · `)}function nm(e,t,n){let r=e.bundle.deployments.find(e=>e.service===n.element&&e.target===n.target&&e.environment===t);return r?.url?r.url.replace(/^https?:\/\//,``).replace(/\/$/,``):n.target===void 0?void 0:e.targets.get(n.target)?.name}var rm={person:`person`,system:`system`,service:`service`,component:`component`,deployment:`deployment`,target:`target`,datastore:`datastore`,broker:`broker`},im=40,am={origin:`origin`,upstream:`upstream`,downstream:`downstream`},om={origin:`origin`,upstream:`up`,downstream:`down`};function sm(e,t){if(t===void 0)return;let n=e.children(t);if(n.length===0)return;let r=n[0].kind===`service`?`Service`:n[0].kind===`component`?`Component`:`Element`;return`${n.length} ${r}${n.length===1?``:`s`}`}var cm=300,lm=.45,um=.6,dm=32,fm=400,pm={person:`Person`,system:`System`,service:`Service`,component:`Component`,target:`Deployment Target`,deployment:`Deployment`};function mm(e){return(0,P.jsx)(cp,{children:(0,P.jsx)(hm,{...e})})}function hm({workspace:e,laidOut:t,selected:n,selectedEdge:r,open:i,fitKey:o,lensed:s,picks:c,ring:l,onSelect:u,onSelectEdge:f,onPick:p,onToggle:m,onOpenView:h,onSettled:g}){let{view:_,layout:v}=t,y=!Xp()&&_.nodes.length<=100,b=G(e=>e.transform[2]<lm),x=(0,O.useMemo)(()=>new Map(s?.nodes.map(e=>[e.id,e.mark])??[]),[s]),S=(0,O.useMemo)(()=>s?new Map(s.edges.map(e=>[`${e.from}>${e.to}`,e.lit===!0])):void 0,[s]),[C,w]=(0,O.useState)(null),T=(0,O.useMemo)(()=>v.edges.find(e=>`${e.from}>${e.to}`===C),[v,C]),E=(0,O.useCallback)((e,t)=>w(n=>t?e:n===e?null:n),[]),D=(0,O.useMemo)(()=>{let e=new Map(_.nodes.map(e=>[e.id,e])),t=n=>{let r=e.get(n)?.parent??null;return r===null?0:1+t(r)};return 1+Math.max(0,..._.nodes.map(e=>t(e.id)))},[_]),k=(0,O.useMemo)(()=>{let t=new Map(_.nodes.map(e=>[e.id,e])),r=new Set(_.nodes.map(e=>e.parent).filter(e=>e!==null)),o=e=>{let n=t.get(e)?.parent??null;return n===null?0:1+o(n)},s=e=>{let n=t.get(e);return n?.kind===`target`?1+(n.parent===null?0:s(n.parent)):0};return v.nodes.map(u=>{let f=t.get(u.id),p=e.byId.get(f.element??u.id),g=f.kind===`target`?e.targets.get(u.id):void 0,v=p&&`technology`in p?p.technology:null,y=t=>sm(e,t),b=_.kind!==`c1`&&_.kind!==`deployment`&&f.collapsed&&(f.kind===`system`||f.kind===`service`);return{id:u.id,type:`box`,position:{x:u.x,y:u.y},width:u.width,height:u.height,style:{width:u.width,height:u.height},measured:{width:u.width,height:u.height},zIndex:r.has(u.id)?o(u.id):D+1,selected:u.id===n,draggable:!1,connectable:!1,data:{node:f,type:p?.kind===`service`&&p.type!==`app`?p.type:void 0,sublabel:g?g.kind:tm(f,p,v,r.has(u.id)?void 0:y(p?.id),f.kind===`deployment`?nm(e,_.environment,f):void 0),team:e.teams.get(p?.owner??g?.owner??``),container:r.has(u.id),targetStep:f.kind===`target`?d(s(u.id)):void 0,twoLine:!r.has(u.id)&&u.height>a[f.kind].height,toggle:b?`expand`:i.includes(u.id)?`collapse`:null,onToggle:m,wayIn:p===void 0||e.wayIn(p.id)===void 0||e.wayIn(p.id)===_.id?null:_.id===`c1`&&p.kind===`system`?`landscape`:`own`,onOpenView:h,mark:x.get(u.id),ring:l,picked:c.includes(u.id),change:f.change,hover:T?u.id===T.from||u.id===T.to?`end`:`faded`:void 0}}})},[_,v,e,n,i,m,h,x,l,c,T,D]),A=(0,O.useMemo)(()=>_m(k.map(e=>e.data.type??e.data.node.kind)),[k]),j=(0,O.useMemo)(()=>new Map(_.edges.map(e=>[`${e.from}>${e.to}`,e.change])),[_]),M=(0,O.useMemo)(()=>{let e=new Map(_.nodes.map(e=>[e.id,e.name]));return new Map(_.edges.map(t=>[`${t.from}>${t.to}`,Em(e.get(t.from)??t.from,e.get(t.to)??t.to,t.relationships)]))},[_]),ee=r?`${r.from}>${r.to}`:null,te=(0,O.useMemo)(()=>{let e=v.edges.map(e=>({id:`${e.from}>${e.to}`,source:e.from,target:e.to,type:`route`,markerEnd:{type:_s.ArrowClosed,width:16,height:16,orient:`auto`},selectable:!1,zIndex:D,data:{points:e.points,faded:ee===null?n!==null&&e.from!==n&&e.to!==n:`${e.from}>${e.to}`!==ee,picked:`${e.from}>${e.to}`===ee,lit:T?e===T:S?.get(`${e.from}>${e.to}`),change:j.get(`${e.from}>${e.to}`),from:e.from,to:e.to,tooltip:M.get(`${e.from}>${e.to}`)??``,onHover:E}}));return T?[...e.filter(e=>e.data.lit!==!0),...e.filter(e=>e.data.lit===!0)]:e},[v,n,ee,S,j,M,T,E,D]);return(0,P.jsxs)(fp,{className:[`arc-flow`,y?`arc-animate`:``,b?`arc-zoomed-out`:``].filter(Boolean).join(` `),nodes:k,edges:te,nodeTypes:km,edgeTypes:Am,minZoom:.05,maxZoom:2,zoomOnDoubleClick:!1,panOnScroll:!0,panOnScrollSpeed:1,panOnDrag:[0,1],elevateNodesOnSelect:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},onNodeClick:(e,t)=>e.shiftKey?p(t.id):u(t.id),onNodeDoubleClick:(e,t)=>h(t.id),onEdgeClick:(e,t)=>f({from:t.source,to:t.target}),onPaneClick:()=>u(null),children:[(0,P.jsx)(xu,{position:`bottom-left`,className:`arc-key-panel`,children:(0,P.jsx)(vm,{lens:s!==void 0,icons:A,scaled:_.nodes.some(e=>e.instances!==void 0)})}),_.nodes.length>im&&(0,P.jsx)(Kp,{position:`top-right`,className:`arc-minimap`,pannable:!0,zoomable:!0,ariaLabel:`Overview`,nodeStrokeWidth:0}),(0,P.jsx)(kp,{position:`bottom-right`,showInteractive:!1}),(0,P.jsx)(Sm,{laidOut:t,fitKey:o,selected:n??(r?`edge`:null),animate:y,onSettled:g}),(0,P.jsx)(Cm,{selected:n,animate:y,drawingWidth:v.width}),(0,P.jsx)(em,{})]})}var gm=[{kind:`person`,label:pm.person},{kind:`system`,label:pm.system},{kind:`service`,label:pm.service},{kind:`datastore`,label:`Datastore`},{kind:`broker`,label:`Broker`},{kind:`component`,label:pm.component},{kind:`deployment`,label:pm.deployment},{kind:`target`,label:pm.target}];function _m(e){let t=new Set(e);return gm.filter(e=>t.has(e.kind)).map(e=>({icon:rm[e.kind],label:e.label}))}function vm({lens:e,icons:t,scaled:n}){let[r,i]=(0,O.useState)(()=>ym());return(0,P.jsxs)(`details`,{className:`arc-key`,open:r,onToggle:e=>{let t=e.currentTarget.open;t!==r&&(i(t),bm(t))},children:[(0,P.jsx)(`summary`,{onClick:e=>{bm(!e.currentTarget.parentElement.open)},children:`Key`}),t.length>0&&(0,P.jsx)(`ul`,{className:`arc-key-icons`,"aria-label":`Icons`,children:t.map(({icon:e,label:t})=>(0,P.jsxs)(`li`,{"data-key-icon":e,children:[(0,P.jsx)(L,{name:e}),t]},e))}),(0,P.jsxs)(`ul`,{children:[(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-team`,"aria-hidden":`true`,children:(0,P.jsx)(`span`,{children:`COR`})}),`Left edge and code: owning Team`]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-way-in`,"aria-hidden":`true`}),`Arrow tile: goes a level down`]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-external`,"aria-hidden":`true`}),`Dashed: External`]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-broker`,"aria-hidden":`true`}),`Striped: broker`]}),n&&(0,P.jsxs)(`li`,{"data-testid":`key-scaled`,children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-stacked`,"aria-hidden":`true`}),`Stacked: scaled (×3 fixed, 2–10 autoscale)`]}),e&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-origin`,"aria-hidden":`true`}),`Lens origin`]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-up`,"aria-hidden":`true`}),`Upstream`,(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-down`,"aria-hidden":`true`}),`Downstream`]}),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-key-swatch arc-key-holds`,"aria-hidden":`true`,children:(0,P.jsx)(`span`,{})}),`Something inside is hit`]})]})]}),(0,P.jsx)(`p`,{className:`arc-key-gestures`,children:`+ shows what is inside, here · the arrow tile (or a double-click) goes a level down · Shift-click picks for export · / finds`})]})}function ym(){try{return window.localStorage.getItem(`archidocs.key`)===`open`}catch{return!1}}function bm(e){try{window.localStorage.setItem(`archidocs.key`,e?`open`:`closed`)}catch{}}function xm(e){return e-340>=e/2?e-340:e}function Sm({laidOut:e,fitKey:t,selected:n,animate:r,onSettled:i}){let{setViewport:a}=od(),o=G(e=>e.width),s=G(e=>e.height),c=(0,O.useRef)(!0),l=(0,O.useRef)(void 0),u=o>0&&s>0;return(0,O.useEffect)(()=>{if(!u)return;let{layout:d}=e,f=l.current!==t;l.current=t;let p=0;if(f){let e=n===null?o:xm(o),t=Math.min(1,(e-64)/Math.max(d.width,1),(s-64)/Math.max(d.height,1)),i=Math.max(um,t),l=n===null?void 0:d.nodes.find(e=>e.id===n),u=(e,t,n,r)=>t*i<=e-64?(e-t*i)/2:n===void 0?dm:Math.min(dm,Math.max(e-dm-t*i,e/2-(n+r/2)*i)),f=u(e,d.width,l?.x,l?.width??0),m=u(s,d.height,l?.y,l?.height??0);p=r&&!c.current?cm:0,c.current=!1,a({x:f,y:m,zoom:i},{duration:p})}let m=0,h=()=>{document.querySelectorAll(`path[data-edge-from]`).length>=d.edges.length?i(e):m=window.requestAnimationFrame(h)},g=window.setTimeout(h,p+(r?cm:0)+20);return()=>{window.clearTimeout(g),window.cancelAnimationFrame(m)}},[e,t,u]),null}function Cm({selected:e,animate:t,drawingWidth:n}){let{getInternalNode:r,getViewport:i,setViewport:a}=od(),o=G(e=>e.width);return(0,O.useEffect)(()=>{if(e===null||o===0)return;let s=window.setTimeout(()=>{let s=r(e);if(!s)return;let{x:c,y:l,zoom:u}=i(),d=s.internals.positionAbsolute.x*u+c,f=d+(s.measured.width??s.width??0)*u,p=xm(o)-dm,m=c+n*u-p;if(m>0&&c-m>=dm/2)return void a({x:c-m,y:l,zoom:u},{duration:t?cm:0});if(f<=p)return;let h=Math.min(f-p,Math.max(0,d-dm));h>0&&a({x:c-h,y:l,zoom:u},{duration:t?cm:0})},fm);return()=>window.clearTimeout(s)},[e]),null}var wm=(0,O.memo)(function({data:e,selected:t}){let{node:n,type:r,sublabel:i,team:a,container:o,targetStep:s,twoLine:c,toggle:l,onToggle:u,wayIn:d,onOpenView:f,mark:p,ring:m,picked:h,change:g,hover:_}=e,v=_?void 0:p,b=e=>e.stopPropagation(),x=l&&(0,P.jsx)(`button`,{type:`button`,className:`arc-toggle nodrag nopan`,"aria-label":`${l===`expand`?`Expand`:`Collapse`} ${n.name}`,title:l===`expand`?`Show what is inside ${n.name}, here`:`Close ${n.name}`,onClick:e=>{b(e),u(n.id,l===`expand`)},onDoubleClick:b,children:(0,P.jsx)(L,{name:l===`expand`?`plus`:`minus`})}),S=d&&(0,P.jsx)(`button`,{type:`button`,className:`arc-way-in nodrag nopan`,"aria-label":d===`landscape`?`Open ${n.name} on the C2 Landscape`:`Open ${n.name}'s View`,title:d===`landscape`?`Open the C2 Landscape at ${n.name}`:`Open ${n.name}'s own View`,onClick:e=>{b(e),f(n.id)},onDoubleClick:b,children:(0,P.jsx)(L,{name:`arrow`})}),C=[`arc-box`,`arc-${n.kind}`,r?`arc-t-${r}`:``,o?`arc-container`:``,s?`arc-target-step-${s}`:``,c?`arc-two-line`:``,n.external?`arc-external`:``,t?`arc-selected`:``,v?v.hit?`arc-hit`:`arc-dim`:``,v?.hit&&m?`arc-ringed`:``,v?.hit&&v.side&&(!o||n.collapsed)?`arc-side-${v.side}`:``,v?.hit&&n.collapsed?`arc-holds-hit`:``,h?`arc-picked`:``,g?`arc-${g}`:``,_===`end`?`arc-hover-end`:_===`faded`?`arc-dim`:``],w=n.instances===void 0?void 0:y(n.instances),T=v!==void 0&&!v.hit||g===`unchanged`||g===`removed`;return(0,P.jsxs)(P.Fragment,{children:[w!==void 0&&(0,P.jsx)(`div`,{className:[`arc-stack`,T?`arc-stack-faint`:``].filter(Boolean).join(` `),"data-testid":`stack`,"aria-hidden":`true`}),(0,P.jsxs)(`div`,{className:C.filter(Boolean).join(` `),style:a?{"--team":a.color}:void 0,"data-node":n.id,"data-parent":n.parent??``,"data-hit":v?String(v.hit):void 0,"data-distance":v?.distance,"data-picked":h?`true`:void 0,"data-change":g,"data-hover":_,"aria-selected":t?`true`:`false`,title:g&&g!==`unchanged`?`${n.name}: ${g===`changed`&&n.collapsed?`changed, or something inside changed`:g}`:v?.hit&&n.collapsed?`${n.name}: something inside is hit`:n.name,children:[(0,P.jsx)(Nd,{type:`target`,position:U.Left,isConnectable:!1,className:`arc-handle`}),(0,P.jsx)(Nd,{type:`source`,position:U.Right,isConnectable:!1,className:`arc-handle`}),(0,P.jsxs)(`div`,{className:`arc-box-head`,children:[x,(0,P.jsx)(L,{name:rm[r??n.kind],className:`arc-kind-glyph`}),(0,P.jsx)(`span`,{className:`arc-name`,"data-testid":`name`,children:n.name}),o&&(0,P.jsx)(`span`,{className:`arc-sublabel arc-csub`,"data-testid":`sublabel`,title:i,children:i}),w!==void 0&&(0,P.jsx)(`span`,{className:`arc-instances`,"data-testid":`instances`,title:typeof n.instances==`number`?`${n.instances} instances`:`Autoscales from ${w.replace(`–`,` to `)} instances`,children:w}),a&&(0,P.jsx)(`span`,{className:`arc-team`,"data-testid":`team`,title:`Owner: ${a.code}`,children:a.code}),o&&S]}),!o&&(0,P.jsxs)(`div`,{className:`arc-box-foot`,children:[(0,P.jsx)(`div`,{className:`arc-sublabel`,"data-testid":`sublabel`,title:i,children:i}),S]}),v?.distance!==void 0&&!(o&&!n.collapsed)&&(0,P.jsxs)(`span`,{className:`arc-badge arc-badge-${v.side??`distance`}`,children:[v.side&&(0,P.jsx)(L,{name:om[v.side],className:`arc-badge-icon`}),v.side&&v.side!==`origin`&&`${am[v.side]} `,v.side===`origin`&&am.origin,(0,P.jsx)(`span`,{className:v.side===`origin`?`arc-visually-hidden`:void 0,"data-testid":`distance`,"aria-label":`distance ${v.distance}`,children:v.distance})]}),v?.hit&&n.collapsed&&(0,P.jsx)(`span`,{className:`arc-holds`,"aria-hidden":`true`}),g===`added`&&(0,P.jsx)(`span`,{className:`arc-added-mark`,"data-testid":`added`,"aria-label":`added`,children:`+`}),g===`changed`&&(0,P.jsx)(`span`,{className:`arc-changed-mark`,"data-testid":`changed`,"aria-label":`changed`})]})]})});function Tm({data:e,markerEnd:t}){let n=e.points.map((e,t)=>`${t===0?`M`:`L`}${Om(e.x)} ${Om(e.y)}`).join(` `),{faded:r,picked:i,lit:a,change:o,from:s,to:c,tooltip:l,onHover:u}=e,d=[`arc-edge`,!i&&(a===void 0?r:!a)?`arc-faded`:``,a?`arc-lit`:``,i?`arc-edge-picked`:``,o?`arc-${o}`:``],f=(0,P.jsx)(`path`,{className:d.filter(Boolean).join(` `),d:n,markerEnd:t,fill:`none`,"data-edge-from":e.from,"data-edge-to":e.to,"data-lit":a===void 0?void 0:String(a),"data-change":o}),p=(0,P.jsx)(`path`,{className:`arc-edge-hit`,d:n,"data-edge-hit":`${s}>${c}`,onMouseEnter:()=>u(`${s}>${c}`,!0),onMouseLeave:()=>u(`${s}>${c}`,!1),children:(0,P.jsx)(`title`,{children:l})});if(o!==`added`&&o!==`changed`)return(0,P.jsxs)(P.Fragment,{children:[f,p]});let m=Dm(e.points);return(0,P.jsxs)(P.Fragment,{children:[f,p,o===`added`?(0,P.jsx)(`text`,{className:`arc-edge-added`,x:m.x,y:m.y,dy:`0.35em`,textAnchor:`middle`,"aria-hidden":`true`,children:`+`}):(0,P.jsx)(`circle`,{className:`arc-edge-changed`,cx:m.x,cy:m.y,r:4,"aria-hidden":`true`})]})}function Em(e,t,n){let r=n.map(e=>[e.description,e.technology&&`[${e.technology}]`].filter(Boolean).join(` `)).filter(Boolean);return[`${e} → ${t}`,...r].join(`
21
21
  `)}function Dm(e){let t=e.slice(1).map((t,n)=>Math.hypot(t.x-e[n].x,t.y-e[n].y)),n=t.reduce((e,t)=>e+t,0)/2;for(let r=0;r<t.length;r++){if(n<=t[r]&&t[r]>0){let i=n/t[r];return{x:e[r].x+i*(e[r+1].x-e[r].x),y:e[r].y+i*(e[r+1].y-e[r].y)}}n-=t[r]}return e[0]??{x:0,y:0}}var Om=e=>Math.round(e*100)/100,km={box:wm},Am={route:Tm},jm={header:60,firstRow:34,columnGap:40,labelPad:56,rowHeight:46,lineHeight:16,bar:10,nameSize:13,labelSize:12,subSize:11,headerPad:88,minColumn:116,margin:24};function Mm(e,{brokers:t=!1}={}){return e.steps.flatMap(e=>{let n={n:e.n,label:e.description,...e.via===void 0?{}:{via:e.via},...e.channel===void 0?{}:{channel:e.channel},...e.note===void 0?{}:{note:e.note},step:e},r=e.kind===`return`?`return`:e.interaction;return!t||e.kind!==`event`||e.via===void 0?[{...n,key:String(e.n),from:e.from,to:e.to,style:r}]:[{...n,key:`${e.n}a`,leg:`a`,from:e.from,to:e.via,style:r},{...n,key:`${e.n}b`,leg:`b`,from:e.via,to:e.to,style:r}]})}function Nm(e,{brokers:t=!1}={}){let n=[...e.participants];if(!t)return n;for(let t of e.steps)t.kind!==`event`||t.via===void 0||n.includes(t.via)||n.splice(n.indexOf(t.from)+1,0,t.via);return n}var Pm=(e,t)=>e.via===void 0||e.leg!==void 0?void 0:[`via `+t(e.via),...e.channel===void 0?[]:[e.channel]].join(` · `);function Fm(e,t){let n=jm,r=Mm(e,t),i=Nm(e,t),a=new Map(i.map((e,t)=>[e,t])),o=i.map(e=>Math.max(n.minColumn,h(t.name(e),n.nameSize,700)+n.headerPad)),s=r.map(e=>{let r=Pm(e,t.name);return Math.max(h(e.label,n.labelSize),r?h(r,n.subSize):0,e.note?h(e.note,n.subSize):0)}),c=i.map(()=>[]);r.forEach((e,t)=>{let[r,i]=[a.get(e.from),a.get(e.to)];r!==i&&c[Math.max(r,i)].push({left:Math.min(r,i),gap:s[t]+n.labelPad})});let l=[];i.forEach((e,t)=>{let r=t===0?n.margin+o[0]/2:l[t-1]+o[t-1]/2+o[t]/2+n.columnGap;for(let e of c[t])r=Math.max(r,l[e.left]+e.gap);l.push(r)});let u=i.map((e,t)=>({id:e,x:l[t],width:o[t]})),d=n.header+n.firstRow,f=r.map(e=>{let r=+!!Pm(e,t.name)+ +!!e.note,i={top:d,y:d+26,height:n.rowHeight+r*n.lineHeight};return d+=i.height,i}),p=new Map,m=[],g=new Map;r.forEach((e,t)=>g.set(e.from,f[t].y)),r.forEach((e,t)=>{let n=f[t].y;if(e.style===`return`){let t=p.get(e.from)?.pop();t&&m.push({participant:e.from,top:t.top,bottom:n,depth:t.depth})}else if(e.style===`sync`){let t=p.get(e.to)??[];t.push({top:n,depth:t.length}),p.set(e.to,t)}});for(let[e,t]of p)for(let n of t)m.push({participant:e,top:n.top,bottom:Math.max(n.top+18,g.get(e)??0),depth:n.depth});m.sort((e,t)=>e.top-t.top||e.participant.localeCompare(t.participant));let _=(e,t,r)=>{let i=l[a.get(e)],o=m.filter(n=>n.participant===e&&n.top<=t&&t<=n.bottom);if(o.length===0)return i;let s=Math.max(...o.map(e=>e.depth));return r===`left`?i-n.bar/2:i+n.bar/2+s*n.bar/2},v=r.map((e,t)=>{let{top:n,y:r,height:i}=f[t],o=l[a.get(e.to)]>l[a.get(e.from)];return{...e,top:n,y:r,height:i,x1:_(e.from,r,o?`right`:`left`),x2:_(e.to,r,o?`left`:`right`),labelWidth:s[t]}}),y=u.at(-1);return{columns:u,rows:v,activations:m,width:y?y.x+y.width/2+n.margin:2*n.margin,height:d+30}}var Im="a tag, a commit sha or its first 4 or more characters, or a date (`YYYY-MM-DD`) or time (ISO 8601, UTC unless it gives a zone)",Lm=5,Rm=/^(\d{4})-(\d{2})-(\d{2})$/,zm=/^(\d{4}-\d{2}-\d{2})[Tt ](\d{2}:\d{2})(:\d{2}(?:\.\d+)?)?([Zz]|[+-]\d{2}:?\d{2})?$/,Bm=/^[0-9a-f]{4,64}$/i,Vm=864e5;function Hm(e){if(Rm.exec(e)){let t=Date.parse(`${e}T00:00:00Z`);return Number.isNaN(t)||new Date(t).toISOString().slice(0,10)!==e?void 0:{start:t,end:t+Vm}}let t=zm.exec(e);if(!t)return;let[,n,r,i=`:00`,a=`Z`]=t,o=a.toUpperCase()===`Z`?`Z`:`${a.slice(0,3)}:${a.slice(-2)}`,s=Date.parse(`${n}T${r}${i}${o}`);if(!Number.isNaN(s)&&Hm(n))return Um(s)}var Um=e=>({start:e,end:e+1});function Wm(e,t){let n=e.find(e=>e.tags.includes(t));if(n)return{ok:!0,revision:n};let r=Hm(t);if(r){let t=e.find(e=>Date.parse(e.date)<r.end);return t?{ok:!0,revision:t}:Gm(e,e.at(-1))}if(Bm.test(t)){let n=t.toLowerCase(),r=e.filter(e=>e.sha.toLowerCase().startsWith(n));if(r.length===1)return{ok:!0,revision:r[0]};if(r.length>1)return{ok:!1,kind:`ambiguous`,count:r.length,candidates:r.slice(0,Lm)}}return Gm(e)}function Gm(e,t){return{ok:!1,kind:`not_found`,tags:e.flatMap(e=>e.tags).slice(0,Lm),...t?{first:t}:{}}}function Km(e,t){return e.filter(e=>t(e.changedIds))}function qm(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Jm(e,t=`|`){return e.map(e=>yh(e)).join(t)}function Ym(e,t){return typeof t==`bigint`?t.toString():t}var Xm=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Zm(e){return new Xm(e)}function Qm(e){return e==null}function $m(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function eh(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function th(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function nh(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function rh(e){return nh(e._zod.def)??e._zod.def.shape}function ih(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return th(this,t,e),e},enumerable:!0,configurable:!0})}function ah(e,t,n){t in e?th(e,t,n):e[t]=n}function oh(e,t,n,r){let i=rh(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?ih(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):ah(e,a,r?r(n.value,a):n.value))}}function sh(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?ih(e,n,()=>t[n]):ah(e,n,r.value))}}function ch(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function lh(e){return JSON.stringify(e)}function uh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var dh=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function fh(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ph=Zm(()=>{if(lg.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function mh(e){if(fh(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return fh(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function hh(e){return mh(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var gh=new Set([`string`,`number`,`symbol`]);function _h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function vh(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function X(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function yh(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function bh(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var xh={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Sh={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Ch(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return oh(i,e,wh(e,t)),vh(e,ch(n,{shape:i,checks:[]}))}function wh(e,t){let n=rh(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Th(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(wh(e,t)),a={};return oh(a,e,Reflect.ownKeys(rh(e)).filter(e=>!i.has(e))),vh(e,ch(n,{shape:a,checks:[]}))}function Eh(e,t){if(!mh(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=rh(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return vh(e,ch(e._zod.def,{shape:Dh(e,t)}))}function Dh(e,t){let n={};return oh(n,e,Reflect.ownKeys(rh(e))),sh(n,t),n}function Oh(e,t){if(!mh(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return vh(e,ch(e._zod.def,{shape:Dh(e,t)}))}function kh(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return oh(n,e,Reflect.ownKeys(rh(e))),oh(n,t,Reflect.ownKeys(rh(t))),vh(e,ch(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ah(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(wh(t,n)):void 0,o={};return oh(o,t,Reflect.ownKeys(rh(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),vh(t,ch(t._zod.def,{shape:o,checks:[]}))}function jh(e,t,n){let r=n?new Set(wh(t,n)):void 0,i={};return oh(i,t,Reflect.ownKeys(rh(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),vh(t,ch(t._zod.def,{shape:i}))}function Mh(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Nh(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ph(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Fh(e){return typeof e==`string`?e:e?.message}function Ih(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Lh(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Rh(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Fh(e.inst?._zod.def?.error?.(e))??Fh(a?.(e))??Fh(t?.error?.(e))??Fh(n.customError?.(e))??Fh(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var zh=/[\uD800-\uDBFF]/;function Bh(e){let t=e.length;if(!zh.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Vh(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Hh(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Uh(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Wh(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Jh(e,n,r.value)}}function Gh(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Kh(e,t,n){return Gh(e,t,n,!1)}function qh(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Gh(this,n,r(this))},set(e){Gh(this,n,e)}})}return t}function Jh(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Gh(this,t,n.bind(this))},set(e){Gh(this,t,e)}})}function Yh(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Xh,Zh=!1,Qh={configurable:!0,get(){Zh=!0}};function $h(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Xh!==e._zod?Xh=void 0:(Xh=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Qh);let e=Zh;Zh=!1;try{let r=n(this);return Zh?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Zh||=e,r}catch(n){throw delete this[t],Zh||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function eg(e,t,n,r){let i=Yh(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var tg=`~constantCatch`;function ng(e){let t=()=>e;return t[tg]=!0,t}var rg,ig={value:void 0,enumerable:!1},ag=`captureStackTrace`in Error?Error:null;function og(e){let t=ag;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return ag=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function Z(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){ig.value=new a(r);try{Object.defineProperty(n,"_zod",ig)}finally{ig.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Wh(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?og(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var sg=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},cg=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(rg=globalThis).__zod_globalConfig??(rg.__zod_globalConfig={});var lg=globalThis.__zod_globalConfig;function ug(e){return e&&Object.assign(lg,e),lg}function dg(){let e=this._zod;return e.message??=JSON.stringify(e.def,Ym,2),e.message}function fg(e){this._zod.message=e}var pg={get:dg,set:fg,enumerable:!0,configurable:!0},mg={value:void 0,enumerable:!1},hg=new WeakSet([Object.prototype,Error.prototype]),gg=Z(`$ZodError`,(e,t)=>{e.name=`$ZodError`,mg.value=t,Object.defineProperty(e,"issues",mg),mg.value=void 0,Object.defineProperty(e,"message",pg);let n=Object.getPrototypeOf(e);hg.has(n)||(hg.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function _g(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function vg(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?_g(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function yg(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function bg(e,t){return{callee:t?.callee??e,Err:t?.Err}}var xg=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new sg;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Rh(e,o,ug())));throw dh(n,a?.callee??t),n}return s.value};return t},Sg=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Rh(e,o,ug())));throw dh(n,a?.callee??t),n}return s.value};return t},Cg=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new sg;return a.issues.length?wg(e,a.issues,i):{success:!0,data:a.value}};function wg(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Rh(e,n,ug()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Tg=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?wg(e,a.issues,i):{success:!0,data:a.value}},Eg=Symbol.for(`zod.compile.invalid`),Dg=Symbol.for(`zod.compile.fallback`),Og=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Eg)return!0;if(r.definite===!0&&n===void 0)return!1}return kg(e,t,n)});function kg(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Dg]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new sg;return a.issues.length===0}var Ag=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},jg=e=>{let t=xg(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,bg(n,a))};return n},Mg=e=>{let t=xg(e),n=(e,r,i,a)=>t(e,r,i,bg(n,a));return n},Ng=e=>{let t=Sg(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,bg(n,a))};return n},Pg=e=>{let t=Sg(e),n=async(e,r,i,a)=>await t(e,r,i,bg(n,a));return n},Fg=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Cg(e)(t,n,i)},Ig=e=>(t,n,r)=>Cg(e)(t,n,r),Lg=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Tg(e)(t,n,i)},Rg=e=>async(t,n,r)=>Tg(e)(t,n,r),zg=/^[cC][0-9a-z]{6,}$/,Bg=/^[0-9a-z]+$/,Vg=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Hg=/^[0-9a-vA-V]{20}$/,Ug=/^[A-Za-z0-9]{27}$/,Wg=/^[a-zA-Z0-9_-]{21}$/;function Gg(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Kg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qg=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Jg=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Yg=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xg=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Zg(){return new RegExp(Xg,`u`)}var Qg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$g=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,e_=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,t_=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,n_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,r_=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,i_=/^https?$/,a_=/^\+[1-9]\d{6,14}$/,o_=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function s_(e){return RegExp(`^${e}$`)}var c_=s_(o_);function l_(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function u_(e){return RegExp(`^${l_(e)}$`)}function d_(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${l_({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${l_({precision:e.precision})}`:n;return RegExp(`^${o_}T(?:${r})$`)}var f_=/^[\s\S]{0,}$/,p_=/^-?\d+$/,m_=/^-?\d+(?:\.\d+)?$/,h_=/^(?:true|false)$/i,g_=/^[^A-Z]*$/,__=/^[^a-z]*$/,v_=Z(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),y_=e=>{let t=e.value;return!Qm(t)&&t.length!==void 0},b_={number:`number`,bigint:`bigint`,object:`date`},x_=Z(`$ZodCheckLessThan`,(e,t)=>{v_.init(e,t);let n=b_[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:b_[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),S_=Z(`$ZodCheckGreaterThan`,(e,t)=>{v_.init(e,t);let n=b_[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:b_[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),C_=Z(`$ZodCheckMultipleOf`,(e,t)=>{v_.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):eh(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),w_=Z(`$ZodCheckNumberFormat`,(e,t)=>{v_.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xh[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),T_=Z(`$ZodCheckMaxLength`,(e,t)=>{var n;v_.init(e,t),(n=e._zod.def).when??(n.when=y_),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Bh(r):i)<=t.maximum)return;let a=Vh(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),E_=Z(`$ZodCheckMinLength`,(e,t)=>{var n;v_.init(e,t),(n=e._zod.def).when??(n.when=y_),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Bh(r):i)>=t.minimum)return;let a=Vh(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),D_=Z(`$ZodCheckLengthEquals`,(e,t)=>{var n;v_.init(e,t),(n=e._zod.def).when??(n.when=y_),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Bh(r):i;if(a===t.length)return;let o=Vh(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),O_=Z(`$ZodCheckStringFormat`,(e,t)=>{var n,r;v_.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),k_=Z(`$ZodCheckRegex`,(e,t)=>{O_.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),A_=Z(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=g_,O_.init(e,t)}),j_=Z(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=__,O_.init(e,t)}),M_=Z(`$ZodCheckIncludes`,(e,t)=>{v_.init(e,t);let n=_h(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),N_=Z(`$ZodCheckStartsWith`,(e,t)=>{v_.init(e,t);let n=RegExp(`^${_h(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),P_=Z(`$ZodCheckEndsWith`,(e,t)=>{v_.init(e,t);let n=RegExp(`.*${_h(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),F_=Z(`$ZodCheckOverwrite`,(e,t)=>{v_.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),I_=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
22
22
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
23
23
  `)}\n};`)(...Object.values(this.closed))}},L_={major:4,minor:6,patch:7},R_=Z(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=L_;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Mh(t),a;for(let o of n){if(o._zod.def.when){if(Nh(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new sg;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Lh(t.issues,n,e),i||=Mh(t,n))});else{if(t.issues.length===n)continue;Lh(t.issues,n,e),i||=Mh(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Mh(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new sg;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new sg;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Kh(this,`~standard`,V_(this))},set"~standard"(e){Gh(this,`~standard`,e)}}),z_=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Rh(e,t,ug()))}:{value:e.value};async function B_(e,t){let n={async:!0};return z_(await e._zod.run({value:t,issues:[]},n),n)}function V_(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return z_(r,n)}catch{}return B_(e,t)},vendor:`zod`,version:1}}var H_=Z(`$ZodString`,(e,t)=>{R_.init(e,t),e._zod.pattern=t.pattern??f_,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),U_=Z(`$ZodStringFormat`,(e,t)=>{O_.init(e,t),H_.init(e,t)}),W_=Z(`$ZodGUID`,(e,t)=>{t.pattern??=qg,U_.init(e,t)}),G_=Z(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Jg(e)}else t.pattern??=Jg();U_.init(e,t)}),K_=Z(`$ZodEmail`,(e,t)=>{t.pattern??=Yg,U_.init(e,t)});function q_(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function J_(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?q_(e)||2:Y_(e,t)}function Y_(e,t){if(!t.normalize&&t.protocol?.source===i_.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var X_=/[\t\n\r]/g;function Z_(e){return e.replace(X_,``)}function Q_(e,t){return t.lastIndex=0,t.test(e.hostname)}function $_(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var ev=Z(`$ZodURL`,(e,t)=>{U_.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=J_(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Z_(r);return}t.hostname&&!Q_(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!$_(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Z_(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),tv=Z(`$ZodEmoji`,(e,t)=>{t.pattern??=Zg(),U_.init(e,t)}),nv=Z(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Wg:Gg(t.length),U_.init(e,t)}),rv=Z(`$ZodCUID`,(e,t)=>{t.pattern??=zg,U_.init(e,t)}),iv=Z(`$ZodCUID2`,(e,t)=>{t.pattern??=Bg,U_.init(e,t)}),av=Z(`$ZodULID`,(e,t)=>{t.pattern??=Vg,U_.init(e,t)}),ov=Z(`$ZodXID`,(e,t)=>{t.pattern??=Hg,U_.init(e,t)}),sv=Z(`$ZodKSUID`,(e,t)=>{t.pattern??=Ug,U_.init(e,t)}),cv=Z(`$ZodISODateTime`,(e,t)=>{t.pattern??=d_(t),U_.init(e,t)}),lv=Z(`$ZodISODate`,(e,t)=>{t.pattern??=c_,U_.init(e,t)}),uv=Z(`$ZodISOTime`,(e,t)=>{t.pattern??=u_(t),U_.init(e,t)}),dv=Z(`$ZodISODuration`,(e,t)=>{t.pattern??=Kg,U_.init(e,t)}),fv=Z(`$ZodIPv4`,(e,t)=>{t.pattern??=Qg,U_.init(e,t)}),pv=/^[0-9a-fA-F:.]+$/;function mv(e){return pv.test(e)?q_(`http://[${e}]`):!1}var hv=Z(`$ZodIPv6`,(e,t)=>{t.pattern??=$g,U_.init(e,t),e._zod.check=n=>{mv(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),gv=Z(`$ZodCIDRv4`,(e,t)=>{t.pattern??=e_,U_.init(e,t)});function _v(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:mv(n)}var vv=Z(`$ZodCIDRv6`,(e,t)=>{t.pattern??=t_,U_.init(e,t),e._zod.check=n=>{_v(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function yv(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var bv=/^[0-9a-zA-Z+/]*={0,2}$/,xv=Z(`$ZodBase64`,(e,t)=>{t.pattern??=bv,U_.init(e,t),e._zod.check=n=>{yv(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Sv=/^[A-Za-z0-9_-]*$/;function Cv(e){if(!Sv.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return yv(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var wv=Z(`$ZodBase64URL`,(e,t)=>{t.pattern??=Sv,U_.init(e,t),e._zod.check=n=>{Cv(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Tv=Z(`$ZodE164`,(e,t)=>{t.pattern??=a_,U_.init(e,t)});function Ev(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Dv=Z(`$ZodJWT`,(e,t)=>{U_.init(e,t),e._zod.check=n=>{Ev(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Ov=Z(`$ZodNumber`,(e,t)=>{R_.init(e,t),e._zod.pattern=m_,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),kv=Z(`$ZodNumberFormat`,(e,t)=>{w_.init(e,t),Ov.init(e,t)}),Av=Z(`$ZodBoolean`,(e,t)=>{R_.init(e,t),e._zod.pattern=h_,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),jv=Z(`$ZodUnknown`,(e,t)=>{R_.init(e,t),e._zod.parse=e=>e}),Mv=Z(`$ZodNever`,(e,t)=>{R_.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Nv(e,t){let n=Ih(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Ih(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Lh(n.issues,t,e),n}}return i(n,a)}}var Pv=e=>Array.isArray(e)?e.length:-1;function Fv(e,t,n){e.issues.length&&t.issues.push(...Ph(n,e.issues)),t.value[n]=e.value}var Iv=Z(`$ZodArray`,(e,t)=>{R_.init(e,t);let n=lg.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Fv(t,r,e)));else if(Fv(c,r,e),s&&c.issues.length!==0&&Mh(c))break}return o.length?Promise.all(o).then(()=>r):r},Nv(e,Pv)});function Lv(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Ph(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Rv=[];function zv(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Rv,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=bh(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Bv(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Mh(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Lv(e,n,i,t,d,f))):Lv(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Vv=Z(`$ZodObject`,(e,t)=>{R_.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Zm(()=>zv(t));$h(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||th(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=fh,o=t.catchall,s,c=lg.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Mh(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Lv(n,t,e,r,a,o))):Lv(s,t,e,r,a,o)}return o?Bv(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Hv=Z(`$ZodObjectJIT`,(e,t)=>{Vv.init(e,t);let n=e._zod.parse,r=Zm(()=>zv(t)),i=lg.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new I_([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
@@ -72,4 +72,4 @@ Error generating stack: `+e.message+`
72
72
 
73
73
  `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=fh,c=!lg.jitless,l=c&&ph.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Bv([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Uv(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Mh(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Rh(e,r,ug())))}),t)}var Wv=Z(`$ZodUnion`,(e,t)=>{R_.init(e,t),$h(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),$h(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),$h(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),$h(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>$m(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Uv(t,r,e,i)):Uv(o,r,e,i)}});function Gv(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Kv=Z(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Wv.init(e,t);let n=e._zod.parse;$h(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||th(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=nh(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Zm(()=>Gv(t));e._zod.parse=(i,a)=>{let o=i.value;if(!fh(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),qv=Z(`$ZodIntersection`,(e,t)=>{R_.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Yv(e,t,n)):Yv(e,i,a)}});function Jv(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(mh(e)&&mh(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Jv(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Jv(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Yv(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Jv(t.value,n.value);if(!c.valid){if(Mh(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Xv=Z(`$ZodRecord`,(e,t)=>{R_.init(e,t);let n=lg.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!mh(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Rh(e,i,ug())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Ph(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Ph(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&m_.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Rh(e,i,ug())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Ph(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Ph(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Zv=Z(`$ZodEnum`,(e,t)=>{R_.init(e,t);let n=qm(t.entries),r=new Set(n);e._zod.values=r,$h(e,`pattern`,e=>{let t=qm(e.def.entries).filter(e=>gh.has(typeof e));return RegExp(t.length?`^(${t.map(e=>_h(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Qv=Z(`$ZodLiteral`,(e,t)=>{R_.init(e,t);let n=new Set(t.values);e._zod.values=n,$h(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?_h(e):e?_h(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),$v=Z(`$ZodTransform`,(e,t)=>{R_.init(e,t),e._zod.optin=`optional`,lg.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new cg(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new sg;return n.value=i,n}});function ey(e,t){return e.value=t.issues.length?void 0:t.value,e}var ty=Z(`$ZodOptional`,(e,t)=>{R_.init(e,t),$h(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,$h(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),$h(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${$m(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>ey(e,t)):ey(e,r)}return t.innerType._zod.run(e,n)}}),ny=Z(`$ZodExactOptional`,(e,t)=>{ty.init(e,t),$h(e,`values`,e=>e.def.innerType._zod.values),$h(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ry=Z(`$ZodNullable`,(e,t)=>{R_.init(e,t),$h(e,`optin`,e=>e.def.innerType._zod.optin),$h(e,`optout`,e=>e.def.innerType._zod.optout),$h(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${$m(t.source)}|null)$`):void 0}),$h(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),iy=Z(`$ZodDefault`,(e,t)=>{R_.init(e,t),e._zod.optin=`defaulted`,$h(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ay(e,t)):ay(r,t)}});function ay(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var oy=Z(`$ZodPrefault`,(e,t)=>{R_.init(e,t),e._zod.optin=`defaulted`,$h(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),sy=Z(`$ZodNonOptional`,(e,t)=>{R_.init(e,t),$h(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>cy(t,e)):cy(i,e)}});function cy(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function ly(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Rh(e,r,ug()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var uy=Z(`$ZodCatch`,(e,t)=>{R_.init(e,t),$h(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),$h(e,`optout`,e=>e.def.innerType._zod.optout),$h(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>ly(e,r,t,n)):ly(e,r,t,n)}}),dy=Z(`$ZodPipe`,(e,t)=>{R_.init(e,t),$h(e,`values`,e=>e.def.in._zod.values),$h(e,`optin`,e=>e.def.in._zod.optin),$h(e,`optout`,e=>e.def.out._zod.optout),$h(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>fy(e,t.in,n)):fy(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>fy(e,t.out,n)):fy(r,t.out,n)}});function fy(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var py=Z(`$ZodReadonly`,(e,t)=>{R_.init(e,t),$h(e,`propValues`,e=>e.def.innerType._zod.propValues),$h(e,`values`,e=>e.def.innerType._zod.values),$h(e,`optin`,e=>e.def.innerType?._zod?.optin),$h(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(my):my(r)}});function my(e){return e.memo||(e.value=Object.freeze(e.value)),e}var hy=Z(`$ZodCustom`,(e,t)=>{v_.init(e,t),R_.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>gy(t,n,r,e));gy(i,n,r,e)}});function gy(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Uh(e))}}var _y=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},vy=`~memo`,yy=[];function by(e){return typeof e==`object`&&!!e}function xy(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Sy=new WeakMap,Cy=0,wy=1,Ty=2;function Ey(e,t,n){let r=Sy.get(e);if(r!==void 0)return r?Ty:Cy;if(t.has(e))return Ty;t.add(e);let i=Cy,a=e=>{if(i!==Ty&&e?._zod){let r=Ey(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Cy;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?wy:o.value?._zod?Ey(o.value,t,n):Cy;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=nh(c);s(e?o(e,!0):wy),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ey(r,t,!1):wy);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Dy(e,i)}function Dy(e,t){return t!==wy&&Sy.set(e,t===Ty),t}function Oy(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var ky,Ay=[],jy={alloc(e,t,n){let r=ky;if(!r)return n;ky=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ay.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Ny(n,e.value))throw new _y;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ey(e,new Set,!1);if(i===Cy)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Ty||r?n=!0:r=!0}let l=s.value;if(!by(l))return t(s,c);let u=c[vy];u||(u={buckets:new WeakMap,backEdges:void 0},c[vy]=u);let d;i===c?d=a:(d=Oy(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...xy(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;ky=d;let p=Ay.length,m=t(s,c);ky=void 0;let h=Ay.length>p?Ay.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?xy(e.issues):yy),e)):(h&&(h.issues=m.issues.length?xy(m.issues):yy),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function My(){return jy}function Ny(e,t){let n=e[vy]?.backEdges;return n!==void 0&&by(t)&&n.has(t)}var Py=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Hh(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${yh(e.values[0])}`:`Invalid option: expected one of ${Jm(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Jm(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Fy(){return{localeError:Py()}}var Iy,Ly=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ry(){return new Ly}(Iy=globalThis).__zod_globalRegistry??(Iy.__zod_globalRegistry=Ry());var zy=globalThis.__zod_globalRegistry;function By(e){return e.checks&&=[...e.checks],e}function Vy(e,t){return new e(By({type:`string`,...X(t)}))}function Hy(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...X(t)})}function Uy(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...X(t)})}function Wy(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...X(t)})}function Gy(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...X(t)})}function Ky(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...X(t)})}function qy(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...X(t)})}function Jy(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...X(t)})}function Yy(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...X(t)})}function Xy(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...X(t)})}function Zy(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...X(t)})}function Qy(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...X(t)})}function $y(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...X(t)})}function eb(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...X(t)})}function tb(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...X(t)})}function nb(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...X(t)})}function rb(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...X(t)})}function ib(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...X(t)})}function ab(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...X(t)})}function ob(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...X(t)})}function sb(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...X(t)})}function cb(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...X(t)})}function lb(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...X(t)})}function ub(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...X(t)})}function db(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...X(t)})}function fb(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...X(t)})}function pb(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...X(t)})}function mb(e,t){return new e(By({type:`number`,checks:[],...X(t)}))}function hb(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...X(t)})}function gb(e,t){return new e({type:`boolean`,...X(t)})}function _b(e){return new e({type:`unknown`})}function vb(e,t){return new e({type:`never`,...X(t)})}function yb(e,t){return new x_({check:`less_than`,...X(t),value:e,inclusive:!1})}function bb(e,t){return new x_({check:`less_than`,...X(t),value:e,inclusive:!0})}function xb(e,t){return new S_({check:`greater_than`,...X(t),value:e,inclusive:!1})}function Sb(e,t){return new S_({check:`greater_than`,...X(t),value:e,inclusive:!0})}function Cb(e,t){return new C_({check:`multiple_of`,...X(t),value:e})}function wb(e,t){return new T_({check:`max_length`,...X(t),maximum:e})}function Tb(e,t){return new E_({check:`min_length`,...X(t),minimum:e})}function Eb(e,t){return new D_({check:`length_equals`,...X(t),length:e})}function Db(e,t){return new k_({check:`string_format`,format:`regex`,...X(t),pattern:e})}function Ob(e){return new A_({check:`string_format`,format:`lowercase`,...X(e)})}function kb(e){return new j_({check:`string_format`,format:`uppercase`,...X(e)})}function Ab(e,t){return new M_({check:`string_format`,format:`includes`,...X(t),includes:e})}function jb(e,t){return new N_({check:`string_format`,format:`starts_with`,...X(t),prefix:e})}function Mb(e,t){return new P_({check:`string_format`,format:`ends_with`,...X(t),suffix:e})}function Nb(e){return new F_({check:`overwrite`,tx:e})}function Pb(e){return Nb(t=>t.normalize(e))}function Fb(){return Nb(e=>e.trim())}function Ib(){return Nb(e=>e.toLowerCase())}function Lb(){return Nb(e=>e.toUpperCase())}function Rb(){return Nb(e=>uh(e))}function zb(e,t,n){return new e({type:`array`,element:t,...X(n)})}function Bb(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...X(n)})}function Vb(e,t){let n=Hb(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Uh(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Uh(r))}},e(t.value,t)),t);return n}function Hb(e,t){let n=new v_({check:`custom`,...X(t)});return n._zod.check=e,n}function Ub(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&th(e,t,n[t]);return e}function Wb(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??zy,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Gb(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Kb(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Kb(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ub(o.schema,c),t.io===`input`&&nx(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function qb(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Jb(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${qb(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+qb(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
74
74
 
75
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Yb(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Yb(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Xb=new Set([`type`,`properties`,`required`,`additionalProperties`]),Zb=[`oneOf`,`anyOf`];function Qb(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function $b(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Xb.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Qb(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}th(n,r,e.length===1?e[0]:$b(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Qb(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function ex(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Xb)if(t in e)return;let n=t.filter(e=>Zb.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=$b(t);else{let e=n[0],i=Zb.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>$b([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ub(e,r))}function tx(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ub(i,s),Ub(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Yb(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])ex(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ub(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,th(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ix(t,`input`,e.processors),output:ix(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function nx(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return nx(r.element,n);if(r.type===`set`)return nx(r.valueType,n);if(r.type===`lazy`)return nx(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return nx(r.innerType,n);if(r.type===`intersection`)return nx(r.left,n)||nx(r.right,n);if(r.type===`record`||r.type===`map`)return nx(r.keyType,n)||nx(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:nx(r.in,n)||nx(r.out,n);if(r.type===`object`){for(let e in r.shape)if(nx(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(nx(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(nx(e,n))return!0;return!!(r.rest&&nx(r.rest,n))}return!1}var rx=(e,t={})=>n=>{let r=Wb({...n,processors:t});return Kb(e,r),Jb(r,e),tx(r,e)},ix=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Wb({...i??{},target:a,io:t,processors:n});return Kb(e,o),Jb(o,e),tx(o,e)},ax=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ox=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},sx=(e,t)=>{ax(e,`minimum`,t),ox(e,`maximum`,t)},cx=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},lx=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},ux=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},dx=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},fx=(e,t)=>ax(e,`minimum`,t.minimum),px=(e,t)=>ox(e,`maximum`,t.maximum),mx=e=>(t,n)=>{dx(t,n.format);let[r,i]=e[n.format];ax(t,`minimum`,r),ox(t,`maximum`,i)},hx={greater_than:(e,t)=>ax(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>ox(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>cx(e,t.value),number_format:mx(xh),bigint_format:mx(Sh),min_length:fx,max_length:px,length_equals:(e,t)=>sx(e,t.length),min_size:fx,max_size:px,size_equals:(e,t)=>sx(e,t.size),string_format:(e,t)=>{dx(e,t.format),t.pattern&&lx(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>ux(e,t.mime)};function gx(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)hx[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ax(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ax(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&ox(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&ox(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&cx(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ux(t,i.mime);for(let e of i.patterns??[])lx(t,e);return t}var _x={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},vx=new Map([[bv,n_],[Sv,r_]]),yx=e=>vx.get(e)??e,bx=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=gx(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=_x[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(yx);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},xx=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=gx(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Gb(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Sx=(e,t,n,r)=>{n.type=`boolean`},Cx=(e,t,n,r)=>{n.not={}},wx=(e,t,n,r)=>{let i=e._zod.def,a=qm(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Tx=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Gb(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Gb(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ex=(e,t,n,r)=>{Gb(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Dx=(e,t,n,r)=>{Gb(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ox=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=gx(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Kb(a.element,t,{...r,path:[...r.path,`items`]})};function kx(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?kx(t.out):t.type===`catch`?kx(t.innerType):e._zod.optin}var Ax=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Gb(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)th(i.properties,e,Kb(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?kx(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Kb(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},jx=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Kb(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Mx=(e,t,n,r)=>{let i=e._zod.def,a=Kb(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Kb(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Nx(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Nx(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Nx(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?m_:p_).source)),p}var Px=new WeakMap;function Fx(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Px.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Nx(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Ix=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=gx(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Kb(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)th(i.patternProperties,yx(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Kb(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Px.get(t);n||(n=[],Px.set(t,n),t.deferred.push(()=>Fx(t))),n.push(e)}i.additionalProperties=Kb(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&kx(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Lx=(e,t,n,r)=>{let i=e._zod.def,a=Kb(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Rx=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zx=Symbol();function Bx(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Gb(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),zx):JSON.parse(o)}var Vx=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Bx(i.defaultValue,e,t,n,r);o!==zx&&(n.default=o)},Hx=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Bx(i.defaultValue,e,t,n,r);o!==zx&&(n._prefault=o)},Ux=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Gb(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Wx=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Kb(o,t,r);let s=t.seen.get(e);s.ref=o},Gx=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Kx=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qx=new WeakSet([Object.prototype,Error.prototype]);function Jx(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Yx=Z(`ZodError`,(e,t)=>{gg.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);qx.has(n)||(qx.add(n),Jx(n,`format`,e=>t=>yg(e,t)),Jx(n,`flatten`,e=>t=>vg(e,t)),Jx(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ym,2)}),Jx(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ym,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Xx=xg(Yx),Zx=Sg(Yx),Qx=Cg(Yx),$x=Tg(Yx),eS=jg(Yx),tS=Mg(Yx),nS=Ng(Yx),rS=Pg(Yx),iS=Fg(Yx),aS=Ig(Yx),oS=Lg(Yx),sS=Rg(Yx);function cS(){lg.localeError||ug(Fy())}function lS(){lg.memoizer||ug({memoizer:My()})}var uS=Z(`ZodType`,(e,t)=>(cS(),R_.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ch(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return vh(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(jC(e,t))},superRefine(e,t){return this.check(MC(e,t))},overwrite(e){return this.check(Nb(e))},optional(){return pC(this)},exactOptional(){return hC(this)},nullable(){return _C(this)},nullish(){return pC(_C(this))},nonoptional(e){return CC(this,e)},array(){return $(this)},or(e){return $S([this,e])},and(e){return rC(this,e)},transform(e){return DC(this,dC(e))},default(e){return yC(this,e)},prefault(e){return xC(this,e)},catch(e){return TC(this,e)},pipe(e){return DC(this,e)},readonly(){return kC(this)},describe(e){let t=this.clone();return zy.add(t,{description:e}),t},meta(...e){if(e.length===0)return zy.get(this);let t=this.clone();return zy.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Kh(this,`~standard`,{...V_(this),jsonSchema:{input:ix(this,`input`),output:ix(this,`output`)}})},set"~standard"(e){Gh(this,`~standard`,e)},parse:function e(t,n){return Xx(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Zx(this,t,n,{callee:e})},safeParse(e,t){return Qx(this,e,t)},async safeParseAsync(e,t){return $x(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Gh(this,`spa`,e)},validate(e,t){return Og(this,e,t)},validateAsync(e,t){return Ag(this,e,t)},encode:function e(t,n){return eS(this,t,n,{callee:e})},decode:function e(t,n){return tS(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await nS(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await rS(this,t,n,{callee:e})},safeEncode(e,t){return iS(this,e,t)},safeDecode(e,t){return aS(this,e,t)},async safeEncodeAsync(e,t){return oS(this,e,t)},async safeDecodeAsync(e,t){return sS(this,e,t)},toJSONSchema(e){return rx(this,{})(e)},get description(){return zy.get(this)?.description},get _def(){return this._zod.def}}),dS=Z(`_ZodString`,(e,t)=>{H_.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bx(e,t,n,r)},qh({format:e=>gx(e).format??null,minLength:e=>gx(e).minimum??null,maxLength:e=>gx(e).maximum??null},{regex(...e){return this.check(Db(...e))},includes(...e){return this.check(Ab(...e))},startsWith(...e){return this.check(jb(...e))},endsWith(...e){return this.check(Mb(...e))},min(...e){return this.check(Tb(...e))},max(...e){return this.check(wb(...e))},length(...e){return this.check(Eb(...e))},nonempty(...e){return this.check(Tb(1,...e))},lowercase(e){return this.check(Ob(e))},uppercase(e){return this.check(kb(e))},trim(){return this.check(Fb())},normalize(...e){return this.check(Pb(...e))},toLowerCase(){return this.check(Ib())},toUpperCase(){return this.check(Lb())},slugify(){return this.check(Rb())}})),fS=Z(`ZodString`,(e,t)=>{H_.init(e,t),dS.init(e,t)},{email(e){return this.check(Hy(vS,e))},url(e){return this.check(Jy(xS,e))},jwt(e){return this.check(lb(LS,e))},emoji(e){return this.check(Yy(CS,e))},guid(e){return this.check(Uy(yS,e))},uuid(e){return this.check(Wy(bS,e))},uuidv4(e){return this.check(Gy(bS,e))},uuidv6(e){return this.check(Ky(bS,e))},uuidv7(e){return this.check(qy(bS,e))},nanoid(e){return this.check(Xy(wS,e))},cuid(e){return this.check(Zy(TS,e))},cuid2(e){return this.check(Qy(ES,e))},ulid(e){return this.check($y(DS,e))},base64(e){return this.check(ob(PS,e))},base64url(e){return this.check(sb(FS,e))},xid(e){return this.check(eb(OS,e))},ksuid(e){return this.check(tb(kS,e))},ipv4(e){return this.check(nb(AS,e))},ipv6(e){return this.check(rb(jS,e))},cidrv4(e){return this.check(ib(MS,e))},cidrv6(e){return this.check(ab(NS,e))},e164(e){return this.check(cb(IS,e))},datetime(e){return this.check(ub(mS,e))},date(e){return this.check(db(hS,e))},time(e){return this.check(fb(gS,e))},duration(e){return this.check(pb(_S,e))}});function Q(e){return Vy(fS,e)}var pS=Z(`ZodStringFormat`,(e,t)=>{U_.init(e,t),dS.init(e,t)}),mS=Z(`ZodISODateTime`,(e,t)=>{cv.init(e,t),pS.init(e,t)}),hS=Z(`ZodISODate`,(e,t)=>{lv.init(e,t),pS.init(e,t)}),gS=Z(`ZodISOTime`,(e,t)=>{uv.init(e,t),pS.init(e,t)}),_S=Z(`ZodISODuration`,(e,t)=>{dv.init(e,t),pS.init(e,t)}),vS=Z(`ZodEmail`,(e,t)=>{K_.init(e,t),pS.init(e,t)}),yS=Z(`ZodGUID`,(e,t)=>{W_.init(e,t),pS.init(e,t)}),bS=Z(`ZodUUID`,(e,t)=>{G_.init(e,t),pS.init(e,t)}),xS=Z(`ZodURL`,(e,t)=>{ev.init(e,t),pS.init(e,t)});function SS(e){return Jy(xS,e)}var CS=Z(`ZodEmoji`,(e,t)=>{tv.init(e,t),pS.init(e,t)}),wS=Z(`ZodNanoID`,(e,t)=>{nv.init(e,t),pS.init(e,t)}),TS=Z(`ZodCUID`,(e,t)=>{rv.init(e,t),pS.init(e,t)}),ES=Z(`ZodCUID2`,(e,t)=>{iv.init(e,t),pS.init(e,t)}),DS=Z(`ZodULID`,(e,t)=>{av.init(e,t),pS.init(e,t)}),OS=Z(`ZodXID`,(e,t)=>{ov.init(e,t),pS.init(e,t)}),kS=Z(`ZodKSUID`,(e,t)=>{sv.init(e,t),pS.init(e,t)}),AS=Z(`ZodIPv4`,(e,t)=>{fv.init(e,t),pS.init(e,t)}),jS=Z(`ZodIPv6`,(e,t)=>{hv.init(e,t),pS.init(e,t)}),MS=Z(`ZodCIDRv4`,(e,t)=>{gv.init(e,t),pS.init(e,t)}),NS=Z(`ZodCIDRv6`,(e,t)=>{vv.init(e,t),pS.init(e,t)}),PS=Z(`ZodBase64`,(e,t)=>{xv.init(e,t),pS.init(e,t)}),FS=Z(`ZodBase64URL`,(e,t)=>{wv.init(e,t),pS.init(e,t)}),IS=Z(`ZodE164`,(e,t)=>{Tv.init(e,t),pS.init(e,t)}),LS=Z(`ZodJWT`,(e,t)=>{Dv.init(e,t),pS.init(e,t)}),RS=Z(`ZodNumber`,(e,t)=>{Ov.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xx(e,t,n,r),e.isFinite=!0},qh({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=gx(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=gx(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=gx(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>gx(e).format??null},{gt(e,t){return this.check(xb(e,t))},gte(e,t){return this.check(Sb(e,t))},min(e,t){return this.check(Sb(e,t))},lt(e,t){return this.check(yb(e,t))},lte(e,t){return this.check(bb(e,t))},max(e,t){return this.check(bb(e,t))},int(e){return this.check(VS(e))},safe(e){return this.check(VS(e))},positive(e){return this.check(xb(0,e))},nonnegative(e){return this.check(Sb(0,e))},negative(e){return this.check(yb(0,e))},nonpositive(e){return this.check(bb(0,e))},multipleOf(e,t){return this.check(Cb(e,t))},step(e,t){return this.check(Cb(e,t))},finite(){return this}}));function zS(e){return mb(RS,e)}var BS=Z(`ZodNumberFormat`,(e,t)=>{kv.init(e,t),RS.init(e,t)});function VS(e){return hb(BS,e)}var HS=Z(`ZodBoolean`,(e,t)=>{Av.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sx(e,t,n,r)});function US(e){return gb(HS,e)}var WS=Z(`ZodUnknown`,(e,t)=>{jv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function GS(){return _b(WS)}var KS=Z(`ZodNever`,(e,t)=>{Mv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cx(e,t,n,r)});function qS(e){return vb(KS,e)}var JS=Z(`ZodArray`,(e,t)=>{lS(),Iv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ox(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Tb(e,t))},nonempty(e){return this.check(Tb(1,e))},max(e,t){return this.check(wb(e,t))},length(e,t){return this.check(Eb(e,t))},unwrap(){return this.element}});function $(e,t){return zb(JS,e,t)}var YS=Z(`ZodObject`,(e,t)=>{lS(),Hv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ax(e,t,n,r),eg(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return sC(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ch(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ch(this._zod.def,{catchall:GS()}))},loose(){return this.clone(ch(this._zod.def,{catchall:GS()}))},strict(){return this.clone(ch(this._zod.def,{catchall:qS()}))},strip(){return this.clone(ch(this._zod.def,{catchall:void 0}))},extend(e){return Eh(this,e)},safeExtend(e){return Oh(this,e)},merge(e){return kh(this,e)},pick(e){return Ch(this,e)},omit(e){return Th(this,e)},partial(...e){return Ah(fC,this,e[0])},exactPartial(...e){return Ah(mC,this,e[0],`exactPartial`)},required(...e){return jh(SC,this,e[0])}});function XS(e,t){return new YS({type:`object`,shape:e??{},...X(t)})}function ZS(e,t){return new YS({type:`object`,shape:e,catchall:qS(),...X(t)})}var QS=Z(`ZodUnion`,(e,t)=>{Wv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jx(e,t,n,r),e.options=t.options});function $S(e,t){return new QS({type:`union`,options:e,...X(t)})}var eC=Z(`ZodDiscriminatedUnion`,(e,t)=>{QS.init(e,t),Kv.init(e,t)});function tC(e,t,n){return new eC({type:`union`,options:t,discriminator:e,...X(n)})}var nC=Z(`ZodIntersection`,(e,t)=>{qv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mx(e,t,n,r)});function rC(e,t){return new nC({type:`intersection`,left:e,right:t})}var iC=Z(`ZodRecord`,(e,t)=>{lS(),Xv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ix(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function aC(e,t,n){return!t||!t._zod?new iC({type:`record`,keyType:Q(),valueType:e,...X(t)}):new iC({type:`record`,keyType:e,valueType:t,...X(n)})}var oC=Z(`ZodEnum`,(e,t)=>{Zv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wx(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new oC({...t,checks:[],...X(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new oC({...t,checks:[],...X(r),entries:i})}});function sC(e,t){return new oC({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...X(t)})}var cC=Z(`ZodLiteral`,(e,t)=>{Qv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tx(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function lC(e,t){return new cC({type:`literal`,values:Array.isArray(e)?e:[e],...X(t)})}var uC=Z(`ZodTransform`,(e,t)=>{lS(),$v.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dx(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new cg(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Uh(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Uh(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function dC(e){return new uC({type:`transform`,transform:e})}var fC=Z(`ZodOptional`,(e,t)=>{ty.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pC(e){return new fC({type:`optional`,innerType:e})}var mC=Z(`ZodExactOptional`,(e,t)=>{ny.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hC(e){return new mC({type:`optional`,innerType:e})}var gC=Z(`ZodNullable`,(e,t)=>{ry.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _C(e){return new gC({type:`nullable`,innerType:e})}var vC=Z(`ZodDefault`,(e,t)=>{iy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yC(e,t){return new vC({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():hh(t)}})}var bC=Z(`ZodPrefault`,(e,t)=>{oy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xC(e,t){return new bC({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():hh(t)}})}var SC=Z(`ZodNonOptional`,(e,t)=>{sy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function CC(e,t){return new SC({type:`nonoptional`,innerType:e,...X(t)})}var wC=Z(`ZodCatch`,(e,t)=>{uy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ux(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function TC(e,t){return new wC({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ng(t)})}var EC=Z(`ZodPipe`,(e,t)=>{dy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wx(e,t,n,r),e.in=t.in,e.out=t.out});function DC(e,t){return new EC({type:`pipe`,in:e,out:t})}var OC=Z(`ZodReadonly`,(e,t)=>{py.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kC(e){return new OC({type:`readonly`,innerType:e})}var AC=Z(`ZodCustom`,(e,t)=>{hy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ex(e,t,n,r)});function jC(e,t={}){return Bb(AC,e,t)}function MC(e,t){return Vb(e,t)}function NC(e){return db(hS,e)}var PC=Q().regex(/^[a-z0-9][a-z0-9-]*$/,`must be a lowercase slug (a-z, 0-9 and -)`),FC=ZS({label:Q().describe("The text of the link, such as `Runbook`."),url:SS().describe("The page the link opens. A full URL, such as `https://wiki.example.com/runbooks/web`.")}).meta({id:`Link`,title:`Link`,description:`A link to a page about the thing it is declared on, such as a runbook or a dashboard.`}),IC=ZS({name:Q().describe(`The Team's display name.`),description:Q().optional().describe(`A short description of the Team.`),links:$(FC).optional().describe(`Links to pages about the Team.`)}).describe(`A Team: a group that can own Elements and Deployment Targets. Its key is the Team's id.`),LC=ZS({name:Q().describe("The Environment's display name, such as `Production`."),description:Q().optional().describe(`A short description of the Environment.`)}).describe(`An Environment: a named stage that Services run in, such as prod or staging. Its key is the Environment's id.`);ZS({teams:aC(PC,IC).optional().describe("The Teams of the Workspace, keyed by id. Every `owner` in every Project names one of these ids."),environments:aC(PC,LC).optional().describe(`The Environments of the Workspace, keyed by id. Every Deployment in every Project names one of these ids.`)}).describe("`workspace.yaml`: the Teams and Environments that every Project in the Workspace shares."),ZS({id:PC.describe("The Project's id, unique in the Workspace. Other Projects write it as the prefix of a Qualified id, such as `payments:ledger`."),name:Q().describe(`The Project's display name.`),owner:PC.describe("The Team that owns the Project: the id of a Team in `workspace.yaml`. It is the Owner of every Element and Deployment Target in the Project that sets no `owner` of its own.")}).describe("`project.yaml`: marks its folder as a Project.");var RC=Q().regex(/^([a-z0-9][a-z0-9-]*:)?[a-z0-9][a-z0-9-]*$/,"must be an id, or `project:id` for one in another Project").describe("An id in this Project, or `project:id` for one in another Project."),zC=ZS({to:RC.describe("The provider: the Element this one depends on. An id in this Project, or `project:id` for an Element in another Project. It can't be a Person, this Element itself, or an ancestor or descendant of this Element."),id:PC.optional().describe(`An id for the Relationship, unique among the Project's Relationships. Needed only when several Relationships connect the same two Elements, so that a Dynamic View Step can name one.`),description:Q().optional().describe("What the consumer uses the provider for, as a verb phrase that reads from consumer to provider, such as `Reads prices from`."),technology:Q().optional().describe("How the consumer reaches the provider: a protocol, a driver or a format, such as `JSON/HTTPS`, `gRPC` or `SQL`."),interaction:sC([`sync`,`async`]).optional().describe("`sync`: a call that waits for an answer. `async`: an event or message that gets no reply, such as an event through a broker or a webhook. Default: `sync`."),via:RC.optional().describe("For an `async` Relationship only: the broker the events travel through. A Service with `type: broker`, as an id in this Project or `project:id`. Leave it out when there is no broker, as with a webhook."),channel:Q().optional().describe("For an `async` Relationship only: the topic or queue the events travel on, such as `orders.placed`."),tags:$(Q()).optional().describe(`Free-form labels for the Relationship.`)}).meta({id:`Relationship`,title:`Relationship`,description:"A Relationship: a dependency of the Element it is declared under (the consumer) on the Element `to` names (the provider). Declare it once, under the consumer."}),BC={name:Q().describe(`The Element's display name.`),description:Q().optional().describe(`What the Element is or does, in a sentence or two.`),owner:PC.optional().describe("The Team that owns the Element: the id of a Team in `workspace.yaml`. Set it only when it differs from the Project's; nothing is inherited from the parent Element. Default: the Project's `owner`."),tags:$(Q()).optional().describe("Free-form labels. A Saved View's `{tag}` selector picks Elements by them."),links:$(FC).optional().describe(`Links to pages about the Element, such as a runbook or a dashboard.`),relationships:$(zC).optional().describe(`The Relationships this Element is the consumer of: what it depends on. A Relationship is never declared under its provider.`)},VC=ZS({...BC}).meta({id:`Person`,title:`Person`,description:`A Person: a human or role that uses a System, such as a shopper or a support agent. A Person is only ever the consumer in a Relationship.`}),HC=ZS({...BC,technology:Q().optional().describe("What the Component is built with, such as `TypeScript module`. Shown under its name."),in:PC.optional().describe("The Service this Component belongs to, as an id in this Project. Required for a Component under the top-level `components` key, and not allowed for one nested under a Service's `components`.")}).meta({id:`Component`,title:`Component`,description:`A Component: a part inside a Service that is not deployed on its own.`}),UC=ZS({...BC,type:sC([`app`,`datastore`,`broker`]).optional().describe("What the Service is; each type is drawn differently. `app`: an application, the usual case. `datastore`: a database or other store. `broker`: a message broker that async Relationships run through, named by their `via`. Default: `app`."),technology:Q().optional().describe("What the Service is built with, such as `Go` or `PostgreSQL`. Shown under its name."),external:US().optional().describe("`true` for a Service run outside the organization, such as a payment provider's API. An External Service can't declare Components. Default: `false`."),in:PC.optional().describe("The System this Service belongs to, as an id in this Project. Only for a Service under the top-level `services` key, and not allowed for one nested under a System's `services`. Without it, a top-level Service stands outside any System."),components:aC(PC,HC).optional().describe(`The Components inside the Service, keyed by id.`)}).meta({id:`Service`,title:`Service`,description:`A Service: a deployable, addressable unit of software; the thing that has a URL and a Deployment.`}),WC=ZS({...BC,external:US().optional().describe("`true` for a System run outside the organization, such as a payment provider. Nothing inside an External System can declare Components. Default: `false`."),services:aC(PC,UC).optional().describe(`The Services in the System, keyed by id.`)}).meta({id:`System`,title:`System`,description:`A System: a named grouping of Services that together deliver a business capability. Systems do not nest.`}),GC={name:Q().describe(`The Deployment Target's display name.`),kind:Q().describe("What the Deployment Target is, in a short word you choose, printed as written in its header: prefer short forms such as `region`, `az`, `vnet`, `snet`, `vm`, `aks`, `ns` or `asp` over long names like `availability-zone` or `subnet`."),description:Q().optional().describe(`What the Deployment Target is, in a sentence or two.`),owner:PC.optional().describe("The Team that owns the Deployment Target: the id of a Team in `workspace.yaml`. Default: the Project's `owner`."),tags:$(Q()).optional().describe(`Free-form labels for the Deployment Target.`),links:$(FC).optional().describe(`Links to pages about the Deployment Target, such as a dashboard.`)},KC=ZS({...GC,get targets(){return aC(PC,KC).optional().describe(`The Deployment Targets inside this one, keyed by id, such as the clusters in a region.`)}}).meta({id:`Target`,title:`Deployment Target`,description:`A Deployment Target: a place Services run, such as a region, a cluster in it or a platform. Deployment Targets nest to any depth and are not Elements.`}),qC=ZS({name:Q().describe("What the endpoint is, such as `health` or `admin`."),url:SS().describe(`The endpoint's address. A full URL.`)}).describe(`A further named URL of the Service in this Environment.`),JC=zS({error:`must be a whole number of at least 1`}).int({error:`must be a whole number of at least 1`}).min(1,{error:`must be a whole number of at least 1`}),YC=$S([JC.describe("A fixed number of instances, such as `3`."),ZS({min:JC.describe(`The fewest instances the autoscaler runs.`),max:JC.describe("The most instances the autoscaler runs. At least `min`.")}).refine(e=>e.max>=e.min,{error:"`max` must be at least `min`",path:[`max`]}).describe("An autoscale range, such as `{ min: 2, max: 10 }`.")],{error:"must be a whole number of at least 1, or `{ min, max }` for an autoscale range"}).describe("How many interchangeable copies of the Service run on this Deployment Target: a whole number for a fixed count, such as `3`, or `{ min, max }` for an autoscale range, such as `{ min: 2, max: 10 }`. Use it for identical workers on one Target, such as an App Service plan running N instances. When where each copy runs matters, such as one per availability zone or VM, declare separate Deployments on separate Targets instead. Default: 1."),XC=ZS({service:RC.describe("The Service that runs: an id in this Project, or `project:id`. It must name a Service, not a System or a Component."),environment:PC.describe("The Environment it runs in: the id of an Environment in `workspace.yaml`."),target:RC.describe("The Deployment Target it runs on: an id in this Project, or `project:id` for one another Project declares."),url:SS().optional().describe("The Service's main URL in this Environment. A full URL, such as `https://cart.example.com`."),endpoints:$(qC).optional().describe(`Further named URLs of the Service in this Environment, such as a health check or an admin console.`),instances:YC.optional()}).describe(`A Deployment: one Service running in one Environment on one Deployment Target. The three together name it, so the same three can appear only once.`),ZC=$S([zS().int().min(0),lC(`all`)],{error:"must be a number of hops, or `all`"}).describe("A number of hops, or `all`."),QC=$S([lC(`shortest`),zS().int().min(1)],{error:"must be `shortest`, or a number of hops"}).describe("`shortest`, or n for every path of at most n hops. Default: `shortest`."),$C=ZS({element:RC.describe("The Element to start from: an id in this Project, or `project:id`."),with:sC([`children`,`descendants`]).optional().describe("Also selects what is inside the Element. `children`: the Elements directly inside it. `descendants`: everything inside it, at any depth."),upstream:ZC.optional().describe("Also selects the Elements upstream of it, those that depend on it: a number of hops, or `all` for every one of them."),downstream:ZC.optional().describe("Also selects the Elements downstream of it, those it depends on: a number of hops, or `all` for every one of them.")}).describe(`One Element, and optionally what is inside it and what is upstream or downstream of it.`),ew=ZS({team:PC.describe("The Team: the id of a Team in `workspace.yaml`.")}).describe(`Every Element a Team owns.`),tw=ZS({tag:Q().describe("The tag, as written in the Elements' `tags`.")}).describe(`Every Element that carries a tag.`),nw=ZS({from:RC.describe("One end of the paths: an id in this Project, or `project:id`."),to:RC.describe("The other end of the paths: an id in this Project, or `project:id`."),paths:QC.optional().describe("Which paths to take. `shortest`: the shortest paths, however long. A number n: every path of at most n hops. Default: `shortest`.")}).meta({id:`PathSelector`,title:`Path selector`,description:`The paths between two Elements, followed in both directions. As a selector it picks every Element on them; as a Lens it highlights them.`}),rw=$S([RC.describe("One Element, by its id: an id in this Project, or `project:id`."),$C,ew,tw,nw]).meta({id:`Selector`,title:`Selector`,description:"One entry of a Saved View's `include` or `exclude`: an id, or a map that picks several Elements at once."}),iw=$S([ZS({impact:RC.describe("The Element whose impact is highlighted: an id in this Project, or `project:id`."),direction:sC([`upstream`,`downstream`,`both`]).optional().describe("Which side to highlight. `upstream`: what depends on the Element. `downstream`: what it depends on. `both`: both sides. Default: `both`.")}).describe(`The Impact Lens: what is upstream or downstream of one Element, each node marked with how many hops away it is.`),ZS({team:PC.describe("The Team: the id of a Team in `workspace.yaml`.")}).describe(`The Team Lens: what one Team owns.`),ZS({path:nw}).describe(`The Path Lens: the paths between two Elements.`)]).meta({id:`Lens`,title:`Lens`,description:`The Lens the View opens with. A Lens highlights nodes and never changes which nodes the View shows.`}),aw={title:Q().describe(`The View's display title.`),description:Q().optional().describe(`What the View shows, or the question it answers.`),tags:$(Q()).optional().describe(`Free-form labels for the View.`),level:sC([`c1`,`c2`,`c3`,`deployment`]).describe("The level every selected Element is collapsed to. `c1`: Persons and Systems. `c2`: Services, grouped in their Systems. `c3`: Components, inside their Services. `deployment`: a Deployment View, which places Deployments on their Deployment Targets in one Environment and needs `environment`."),expand:$(RC).optional().describe("Elements to open one level deeper than `level`, showing their children. Each is an id in this Project, or `project:id`, and must be a node of the View that has children. A Deployment View ignores it."),collapse:$(RC).optional().describe("Elements to close, hiding everything inside them. Each is an id in this Project, or `project:id`, and must be a node of the View that has children. A Deployment View ignores it."),direction:sC([`TB`,`BT`,`LR`,`RL`]).optional().describe("The way the diagram runs. `TB`: top to bottom. `BT`: bottom to top. `LR`: left to right. `RL`: right to left. Default: `LR`, or `TB` for a Deployment View."),environment:PC.optional().describe("For a Deployment View (`level: deployment`), which must have it, and for no other View: the Environment shown, as the id of an Environment in `workspace.yaml`."),targets:$(RC).optional().describe("For a Deployment View (`level: deployment`) only: shows only the Deployments on these Deployment Targets and on the Targets inside them. Each is an id in this Project, or `project:id`. Default: every Deployment Target.")},ow=ZS({...aw,include:$(rw).optional().describe(`Selectors for the Elements to show. Default: every Element in the Workspace.`),exclude:$(rw).optional().describe("Selectors for the Elements to leave out of what `include` picked. An excluded Element takes everything inside it with it."),lens:iw.optional()}).describe("A structural Saved View: the Elements its selectors pick, drawn at one `level`. With `level: deployment` it is a Deployment View. Its key is the View's id, unique among the Project's Saved Views.");ZS({...aw,include:$(GS()).optional(),exclude:$(GS()).optional(),lens:GS().optional()});var sw=ZS({from:RC.describe("The Element the Step starts at: the consumer of a call, the Publisher of an event, or the sender of a reply. An id in this Project, or `project:id`."),to:RC.describe("The Element the Step reaches: the provider of a call, the Subscriber of an event, or the receiver of a reply. An id in this Project, or `project:id`."),relationship:RC.optional().describe("The `id` of the Relationship the Step takes, as an id in this Project or `project:id`. Needed only when several Relationships match the two Elements."),description:Q().optional().describe("The text on the Step's arrow. Default: the Relationship's `description`, or its `channel` for an event."),note:Q().optional().describe(`A note shown under the Step.`),return:US().optional().describe("`true` makes the Step the reply to a sync Relationship declared from `to` to `from`. An async Relationship has no reply. Default: `false`.")}).describe("A Step: one interaction of the scenario, which must follow a Relationship in the Model. It is a call from a consumer to its provider, an event from a Publisher to a Subscriber, or with `return: true` a reply."),cw=ZS({title:Q().describe(`The View's display title.`),description:Q().optional().describe(`What the scenario is.`),tags:$(Q()).optional().describe(`Free-form labels for the View.`),participants:$(RC).optional().describe("Elements that take part, in the order to draw them, each as an id in this Project or `project:id`. Participants not listed follow, in the order the Steps first use them. An Element and its own ancestor can't both take part. Default: the order the Steps first use them."),steps:$(sw).describe(`The Steps of the scenario, in order.`)}).describe(`A Dynamic View: one scenario as an ordered list of Steps, shown as a sequence chart. Its key is the View's id, unique among the Project's Saved Views.`),lw=ZS({structural:aC(PC,ow).optional().describe("Structural Views and Deployment Views, keyed by id. Other Projects name a View as `project:id`."),dynamic:aC(PC,cw).optional().describe("Dynamic Views, keyed by id. Other Projects name a View as `project:id`.")}).describe("The Project's Saved Views: `structural` ones, which include Deployment Views, and `dynamic` ones.");ZS({people:aC(PC,VC).optional().describe(`Persons, keyed by id. An id is unique in the Project across all its Elements and Deployment Targets.`),systems:aC(PC,WC).optional().describe("Systems, keyed by id, each with its Services nested under `services`."),services:aC(PC,UC).optional().describe("Services declared at the top level, keyed by id: those outside any System, and those that join a System with `in`."),components:aC(PC,HC).optional().describe("Components declared at the top level, keyed by id. Each names its Service with `in`."),targets:aC(PC,KC).optional().describe(`Deployment Targets, keyed by id and nested as they nest. Their ids share the Project's ids with its Elements.`),deployments:$(XC).optional().describe(`Deployments: which Service runs in which Environment on which Deployment Target, with its URLs.`),views:lw.optional()}).describe("A Project file: any `.yaml` file in a Project folder other than `project.yaml`."),Object.fromEntries(Object.entries({person:`people`,system:`systems`,service:`services`,component:`components`}).map(([e,t])=>[t,e]));var uw=aC(PC,GS()).optional();ZS({people:uw,systems:uw,services:uw,components:uw,targets:uw,deployments:$(GS()).optional(),views:ZS({structural:uw,dynamic:uw}).optional()}),ZS({...GC,targets:uw}),WC.extend({services:uw}),UC.extend({components:uw});var dw=sC([`proposed`,`accepted`,`rejected`,`deprecated`,`superseded`]),fw=Q().regex(/^([a-z0-9][a-z0-9-]*:)?\d{4}$/,"must be an ADR number (NNNN), or `project:NNNN` for one in another Project").describe("An ADR number in this Project, or `project:NNNN` for one in another Project."),pw=$(Q());ZS({status:dw.describe("Where the decision stands. `proposed`: awaiting acceptance in a pull request. `accepted`: in force. `rejected`: turned down, and kept for its reasoning. `deprecated`: no longer in force, with no ADR replacing it. `superseded`: never written by hand; it is derived once an accepted ADR lists this one in `supersedes`."),date:NC(`must be an ISO date (YYYY-MM-DD)`).describe("The date of the last status change, as `YYYY-MM-DD`."),"decision-makers":pw.optional().describe(`Who made the decision: people's names or Team ids. Not checked.`),consulted:pw.optional().describe(`Who was asked for input: people's names or Team ids. Not checked.`),informed:pw.optional().describe(`Who was told of the decision: people's names or Team ids. Not checked.`),tags:$(Q()).optional().describe(`Free-form labels for the ADR.`),elements:$(RC).optional().describe("The Elements and Deployment Targets the decision affects, each as an id in this Project or `project:id`."),views:$(RC).optional().describe("The Saved Views the decision affects, each as an id in this Project or `project:id`."),supersedes:$(fw).optional().describe("The ADRs this one replaces once it is accepted, each as a four-digit number in this Project or `project:NNNN`. Only an accepted or deprecated ADR can be superseded.")}).describe("An ADR's frontmatter. The ADR's title is the first `# ` heading of its body, not a field.");var mw=XS({file:Q(),line:zS().int()}),hw=XS({label:Q(),url:Q()}),gw={id:Q(),parent:Q().nullable(),name:Q(),description:Q().nullable(),owner:Q(),tags:$(Q()),links:$(hw)},_w=(e,t)=>{let{id:n,...r}=gw;return XS({id:n,kind:lC(e),...r,...t,source:mw})},vw=tC(`kind`,[_w(`person`,{}),_w(`system`,{external:US()}),_w(`service`,{type:sC([`app`,`datastore`,`broker`]),technology:Q().nullable(),external:US()}),_w(`component`,{technology:Q().nullable()})]),yw=XS({id:Q(),parent:Q().nullable(),name:Q(),kind:Q(),description:Q().nullable(),owner:Q(),tags:$(Q()),links:$(hw),source:mw}),bw=XS({service:Q(),environment:Q(),target:Q(),url:Q().nullable(),endpoints:$(XS({name:Q(),url:Q()})),instances:$S([zS(),XS({min:zS(),max:zS()})]).default(1),owner:Q(),source:mw}),xw=XS({id:Q().nullable(),from:Q(),to:Q(),description:Q().nullable(),technology:Q().nullable(),interaction:sC([`sync`,`async`]),via:Q().nullable(),channel:Q().nullable(),tags:$(Q()),source:mw}),Sw=Q(),Cw=$S([zS(),lC(`all`)]),ww=XS({from:Sw,to:Sw,paths:$S([lC(`shortest`),zS()]).optional()}),Tw=$S([Sw,XS({element:Sw,with:sC([`children`,`descendants`]).optional(),upstream:Cw.optional(),downstream:Cw.optional()}),XS({team:Q()}),XS({tag:Q()}),ww]),Ew=$S([XS({impact:Sw,direction:sC([`upstream`,`downstream`,`both`])}),XS({team:Q()}),XS({path:ww})]),Dw=XS({id:Q(),project:Q(),kind:lC(`structural`),title:Q(),description:Q().nullable(),tags:$(Q()),level:sC([`c1`,`c2`,`c3`,`deployment`]),include:$(Tw).nullable(),exclude:$(Tw),expand:$(Q()),collapse:$(Q()),direction:sC([`TB`,`BT`,`LR`,`RL`]).nullable(),lens:Ew.nullable(),environment:Q().nullable(),targets:$(Q()),source:mw}),Ow=XS({from:Q(),to:Q(),relationship:Q().nullable(),description:Q().nullable(),note:Q().nullable(),return:US()}),kw=tC(`kind`,[Dw,XS({id:Q(),project:Q(),kind:lC(`dynamic`),title:Q(),description:Q().nullable(),tags:$(Q()),participants:$(Q()).nullable(),steps:$(Ow),source:mw})]),Aw=XS({id:Q(),project:Q(),title:Q(),status:dw,effectiveStatus:dw,date:Q(),elements:$(Q()),views:$(Q()),supersedes:$(Q()),supersededBy:$(Q()),decisionMakers:$(Q()),consulted:$(Q()),informed:$(Q()),tags:$(Q()),body:Q(),source:mw}),jw=XS({schemaVersion:lC(1),commit:Q().nullable(),builtAt:Q().nullable(),teams:$(XS({id:Q(),name:Q(),description:Q().nullable(),links:$(hw),source:mw})),environments:$(XS({id:Q(),name:Q(),description:Q().nullable(),source:mw})),projects:$(XS({id:Q(),name:Q(),owner:Q(),folder:Q(),source:mw})),elements:$(vw),relationships:$(xw),targets:$(yw),deployments:$(bw),views:$(kw),adrs:$(Aw)}),Mw={};function Nw(e,t=Mw,n=1){if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e,i=r.schemaVersion;if(typeof i!=`number`||!Number.isInteger(i)||i>n)return;for(;i<n;){let e=t[i];if(!e)return;r={...e(r),schemaVersion:i+1},i++}let a=jw.safeParse(r);return a.success?a.data:void 0}function Pw(e,t=Mw){return Nw(e,t)}function Fw(e){if(typeof e!=`object`||!e)return;let{schemaVersion:t,revisions:n,preview:r}=e;if(t===1&&Array.isArray(n))return{schemaVersion:t,revisions:n,...typeof r?.baseSha==`string`?{preview:r}:{}}}function Iw(e){let t=e.endsWith(`/`)?e:`${e}/`,n=e=>`${t}${e}`;return{location:n,async read(e,t){let r=n(e),i={accept:`application/json`};t?.etag&&(i[`if-none-match`]=t.etag),t?.lastModified&&(i[`if-modified-since`]=t.lastModified);let a=await fetch(r,{headers:i,cache:`no-store`});if(a.status===304)return{kind:`not_modified`};if(a.status===404)return{kind:`missing`};if(!a.ok)throw Error(`${r} answered ${a.status} ${a.statusText}`.trim());let o=a.headers.get(`etag`),s=a.headers.get(`last-modified`);return{kind:`text`,text:await a.text(),validators:{...o?{etag:o}:{},...s?{lastModified:s}:{}}}}}}var Lw=(e,t)=>({ok:!1,code:`history_unavailable`,reason:e,message:t}),Rw=e=>e instanceof Error?e.message:String(e);function zw(e,t,n,r,i=()=>!0){let a;return async()=>{let o=Date.now();if(a&&o-a.at<n)return a.value;let s=await e.read(t,a?.validators);if(s.kind===`not_modified`){if(!a)throw Error(`${e.location(t)} answered "not modified" to a request with no validators.`);return a={...a,at:o},a.value}let c=r(s.kind===`text`?s.text:void 0);return i(c)&&(a={value:c,at:o,validators:s.kind===`text`?s.validators:{}}),c}}var Bw=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}};function Vw(e,{recheckMs:t,bundle:n=Hw,migrations:r=Mw}){let i=e.location(n),a=zw(e,n,t,e=>{if(e===void 0)throw Error(`${i} was not found.`);let t=Bw(e);if(!t.ok)throw Error(`${i} is not JSON.`);let n=Pw(t.value,r);if(!n)throw Error(`${i} is not a Workspace Bundle this version can read.`);return n}),o=zw(e,Gw,t,t=>{if(t===void 0)return{ok:!0,index:void 0};let n=Bw(t);if(!n.ok)return Lw(`index`,`The site has no readable Revision index (${Gw}): ${e.location(Gw)} is not JSON.`);let r=Fw(n.value);return r?{ok:!0,index:r}:Lw(`index`,`The site's ${Gw} holds no Revisions.`)},e=>e.ok),s=new Map,c=async t=>{let n=t.slice(0,7),i;try{i=await e.read(Kw(t))}catch(e){return Lw(`unreadable`,`The Bundle at ${n} can't be read from the site: ${Rw(e)}`)}if(i.kind!==`text`)return Lw(`missing`,`The Bundle at ${n} can't be read from the site: ${e.location(Kw(t))} was not found.`);let a=Bw(i.text);if(!a.ok)return Lw(`unreadable`,`The Bundle at ${n} can't be read from the site: ${e.location(Kw(t))} is not JSON.`);let o=Pw(a.value,r);return o?{ok:!0,bundle:o}:Lw(`unmigratable`,`The Bundle at ${n} has a schema this Archidocs can't read or migrate.`)};return{location:i,latest:a,async index(){try{return await o()}catch(e){return Lw(`index`,`The site has no readable Revision index (${Gw}): ${Rw(e)}`)}},bundle(e){if(e.bundle===!1)return Promise.resolve(Lw(`dropped`,`The Bundle at ${e.sha.slice(0,7)} (${e.date}) was not kept on this site.`));let t=s.get(e.sha);return t||(t=c(e.sha),s.set(e.sha,t),t.then(t=>!t.ok&&s.delete(e.sha))),t}}}var Hw=`workspace.bundle.json`,Uw=`site.json`,Ww=`bundles`,Gw=`${Ww}/index.json`,Kw=e=>`${Ww}/${qw(e)}`,qw=e=>`${e}.json`,Jw=[`upstream`,`downstream`,`both`],Yw=[`TB`,`BT`,`LR`,`RL`],Xw=`shortest`,Zw=`graph`,Qw=`1`,$w=e=>{let t=e.map(e=>`\`${e}\``);return t.length<2?t.join(``):`${t.slice(0,-1).join(`, `)} or ${t.at(-1)}`},eT=`#/view/`,tT={prefix:eT,syntax:`${eT}<view-id>`,does:"Opens the View with this id: `c2`, a Generated View such as `c2/payments:payments` or `deployment/prod`, or a Saved View's qualified id. An empty route opens the top-most View, the C1 Landscape `c1`."};Im.charAt(0).toUpperCase()+Im.slice(1),$w(Yw),$w(Jw),`${$w([Xw])}`,$w([Zw]),$w([Qw]);var nT=e=>e.startsWith(tT.prefix),rT={view:`c1`,open:[],closed:[],selected:null,direction:null,lens:null,picks:[],step:null,graph:!1,brokers:!1,at:null,vs:null,adr:null},iT=RegExp(`^${eT}([^?]*)(?:\\?(.*))?$`);function aT(e){let t=iT.exec(e);if(!t)return rT;let n=new URLSearchParams(t[2]??``),r=e=>n.get(e),i=e=>[...new Set((r(e)??``).split(`,`).filter(Boolean))],a=r(`dir`);return{view:decodeURIComponent(t[1])||rT.view,open:i(`open`),closed:i(`closed`),selected:r(`sel`)||null,direction:a!==null&&Yw.includes(a)?a:null,lens:sT(r),picks:i(`picks`),step:oT(r(`step`)),graph:r(`mode`)===Zw,brokers:r(`brokers`)===Qw,at:r(`at`)||null,vs:r(`vs`)||null,adr:r(`adr`)||null}}function oT(e){let t=Number(e);return e!==null&&Number.isInteger(t)&&t>0?t:null}function sT(e){let t=e(`impact`);if(t){let n=e(`way`);return{impact:t,direction:n!==null&&Jw.includes(n)?n:`both`}}let n=e(`team`);if(n)return{team:n};let[r,i]=[e(`from`),e(`to`)];if(r&&i){let t=Number(e(`paths`));return{path:{from:r,to:i,paths:Number.isInteger(t)&&t>0?t:Xw}}}return null}var cT=(e,t)=>`${e}=${t}`;function lT(e){if(`impact`in e)return[cT(`impact`,dT(e.impact)),cT(`way`,e.direction)];if(`team`in e)return[cT(`team`,dT(e.team))];let{from:t,to:n,paths:r}=e.path;return[cT(`from`,dT(t)),cT(`to`,dT(n)),...r!==void 0&&r!==Xw?[cT(`paths`,r)]:[]]}function uT(e){let t=[];return e.open.length>0&&t.push(cT(`open`,e.open.map(dT).join(`,`))),e.closed.length>0&&t.push(cT(`closed`,e.closed.map(dT).join(`,`))),e.selected!==null&&t.push(cT(`sel`,dT(e.selected))),e.direction!==null&&t.push(cT(`dir`,e.direction)),e.lens!==null&&t.push(...lT(e.lens)),e.picks.length>0&&t.push(cT(`picks`,e.picks.map(dT).join(`,`))),e.step!==null&&t.push(cT(`step`,e.step)),e.graph&&t.push(cT(`mode`,Zw)),e.brokers&&t.push(cT(`brokers`,Qw)),e.at!==null&&t.push(cT(`at`,dT(e.at))),e.vs!==null&&t.push(cT(`vs`,dT(e.vs))),e.adr!==null&&t.push(cT(`adr`,dT(e.adr))),`${tT.prefix}${dT(e.view)}${t.length>0?`?${t.join(`&`)}`:``}`}var dT=e=>encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%2F/gi,`/`).replace(/%40/gi,`@`),fT=(e,t=null,n=null,r)=>({view:e,open:[],closed:[],selected:t,direction:null,lens:n,picks:[],step:null,graph:!1,brokers:!1,at:r?.at??null,vs:r?.vs??null,adr:null}),pT=`archidocs:place`;function mT(e){for(let t of[`hashchange`,`popstate`,pT])window.addEventListener(t,e);return()=>{for(let t of[`hashchange`,`popstate`,pT])window.removeEventListener(t,e)}}var hT=()=>(0,O.useSyncExternalStore)(mT,()=>window.location.hash);function gT(){let e=hT();return(0,O.useMemo)(()=>aT(e),[e])}function _T(e,{replace:t=!1}={}){let n=uT(e);n!==window.location.hash&&(t?window.history.replaceState(null,``,n):window.history.pushState(null,``,n),window.dispatchEvent(new Event(pT)))}var vT,yT=0,bT=new Map;function xT(e,t){vT||(vT=new Worker(new URL(new URL(`layout.worker-ueOYAv7N.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),vT.onmessage=e=>{bT.get(e.data.request)?.(e.data),bT.delete(e.data.request)});let n=++yT;return new Promise(r=>{bT.set(n,r),vT.postMessage({request:n,view:e,direction:t})})}function ST(e,t){let[n,r]=(0,O.useState)({});return(0,O.useEffect)(()=>{if(!e)return;let n=!0;return xT(e,t).then(t=>{n&&r(`layout`in t?{laidOut:{view:e,layout:t.layout}}:{error:t.error})}),()=>{n=!1}},[e,t]),{laidOut:n.laidOut,error:n.error}}var CT=`modulepreload`,wT=function(e,t){return new URL(e,t).href},TT={},ET=function(e){return e.pathname.endsWith(`.css`)},DT=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},OT=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=wT(t,n);let r=s(t),i=ET(r);return DT(TT,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:CT,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function kT(e,t,n,r){let[i,{renderSvg:a}]=await Promise.all([xT(t,n),OT(()=>import(`./svg-DXIkkkSu.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)]);if(`error`in i)throw Error(i.error);let{bundle:o}=e;return jT(a({bundle:o,view:t,layout:i.layout,source:{workspace:e.workspaceName,commit:o.commit,date:o.builtAt}}),r)}async function AT(e,t,n,r){let{renderSequenceSvg:i}=await OT(async()=>{let{renderSequenceSvg:e}=await import(`./sequence-svg-BtEmwvN4.js`);return{renderSequenceSvg:e}},__vite__mapDeps([4,0,1,2,3]),import.meta.url),{bundle:a}=e;return jT(i({bundle:a,view:t,brokers:n,source:{workspace:e.workspaceName,commit:a.commit,date:a.builtAt}}),r)}async function jT(e,t){if(t===`svg`)return new Blob([e],{type:`image/svg+xml`});let[{renderPng:n},{default:r}]=await Promise.all([OT(()=>import(`./png-D-pNKY71.js`),__vite__mapDeps([5,3]),import.meta.url),OT(()=>import(`./index_bg-D3t31u3-.js`),[],import.meta.url)]),i=await n(e,fetch(r));return new Blob([i],{type:`image/png`})}var MT=(e,t,n=!1)=>`${e.replace(/[/:]/g,`-`)}${n?`-picks`:``}.${t}`;function NT(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.append(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}var PT=10,FT=()=>`archidocs:recent:${window.location.pathname.replace(/index\.html$/,``)}`;function IT(){try{let e=JSON.parse(window.localStorage.getItem(FT())??`[]`);return Array.isArray(e)?e.slice(0,PT):[]}catch{return[]}}function LT(e,t){let n=`${e.view}?${e.open.join(`,`)}|${e.closed.join(`,`)}`,r=[t,...[e.open.length>0?`${e.open.length} open`:``,e.closed.length>0?`${e.closed.length} closed`:``].filter(Boolean)].join(` · `),i=[{key:n,hash:uT(e),label:r},...IT().filter(e=>e.key!==n)].slice(0,PT);try{window.localStorage.setItem(FT(),JSON.stringify(i))}catch{}}var RT=class{revisions;preview;constructor(e,t){this.revisions=e,this.preview=t}previewBase(){return this.preview&&this.revisions.find(e=>e.sha===this.preview.baseSha)}compareLabel(e,t){let n=t===void 0||t.sha===this.preview?.headSha;return this.preview&&e.sha===this.preview.baseSha&&n?`${this.preview.base} → PR`:`${zT(e)} → ${t?zT(t):`latest`}`}find(e){return Wm(this.revisions,e)}previous(e){return this.revisions[this.revisions.indexOf(e)+1]}isLatest(e){return this.revisions[0]===e}},zT=e=>e.tags[0]??e.sha.slice(0,7),BT=e=>e.date.slice(0,10),VT=Vw(Iw(`./`),{recheckMs:1/0});async function HT(){let e=await VT.index();return e.ok&&e.index?new RT(e.index.revisions,e.index.preview):new RT([])}var UT={dropped:`this site no longer keeps its Bundle`,missing:`its Bundle is missing from this site`,unreadable:`its Bundle can't be read`,unmigratable:`its Bundle is from a schema this viewer can't read`,index:`this site's Revision index can't be read`},WT=class extends Error{code=`history_unavailable`;reason;constructor(e){super(UT[e]),this.reason=e}};async function GT(e){let t=await VT.bundle(e);if(!t.ok)throw new WT(t.reason);return t.bundle}async function KT(e,t,n,r){let i=(e,n)=>{if(e===null)return;let r=t.find(e);return r.ok?r.revision:{kind:`problem`,problem:r.kind===`ambiguous`?{kind:`ambiguous`,point:e,side:n,candidates:r.candidates}:{kind:`unknown`,point:e}}},a=i(n,`at`);if(a&&`kind`in a)return a;let o=i(r,`vs`);if(o&&`kind`in o)return o;let s=async t=>t===void 0?e:GT(t);try{let e=await s(a);try{let t=o===void 0?void 0:await s(o);return{kind:`ready`,times:{current:e,...t?{before:t}:{},...a?{at:a}:{},...o?{vs:o}:{}}}}catch(e){return qT(o,e)}}catch(e){return qT(a,e)}}function qT(e,t){if(!(t instanceof WT))throw t;return{kind:`problem`,problem:{kind:`unavailable`,revision:e,reason:t.message}}}function JT(e,t,n,r){let i=`${n??``}\n${r??``}`,a=n===null&&r===null,[o,s]=(0,O.useState)(),c=(0,O.useMemo)(()=>({kind:`ready`,times:{current:e}}),[e]);return(0,O.useEffect)(()=>{if(a)return;let o=!0;return KT(e,t,n,r).then(e=>{o&&s({key:i,state:e})}),()=>{o=!1}},[e,t,i]),a?{state:c,loading:!1}:o?.key===i?{state:o.state,loading:!1}:{state:o?.state.kind===`ready`?o.state:void 0,loading:!0}}function YT({problem:e,place:t}){let n=uT({...t,at:null,vs:null,selected:null});if(e.kind===`unknown`)return(0,P.jsxs)(`div`,{className:`arc-unavailable`,role:`alert`,children:[(0,P.jsxs)(`h1`,{children:[`No Revision “`,e.point,`”`]}),(0,P.jsxs)(`p`,{children:[`This site's history has no tag, commit or date called `,e.point,`.`]}),(0,P.jsx)(`a`,{href:n,children:`Back to latest`})]});if(e.kind===`ambiguous`)return(0,P.jsxs)(`div`,{className:`arc-unavailable`,role:`alert`,children:[(0,P.jsxs)(`h1`,{children:[`More than one Revision “`,e.point,`”`]}),(0,P.jsxs)(`p`,{children:[`The shas of these Revisions all start with `,e.point,`. Pick one:`]}),(0,P.jsx)(`ul`,{children:e.candidates.map(n=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`a`,{href:uT({...t,[e.side]:zT(n)}),children:[(0,P.jsx)(`code`,{children:n.sha.slice(0,7)}),` `,n.subject,` (`,BT(n),`)`]})},n.sha))}),(0,P.jsx)(`a`,{href:n,children:`Back to latest`})]});let{revision:r}=e,i=r.sha.slice(0,7);return(0,P.jsxs)(`div`,{className:`arc-unavailable`,role:`alert`,children:[(0,P.jsx)(`h1`,{children:(0,P.jsx)(`code`,{children:`history_unavailable`})}),(0,P.jsxs)(`p`,{children:[`This site can't show `,zT(r),` “`,r.subject,`” (`,BT(r),`): `,e.reason,`. It keeps full Bundles for the latest Revisions and every tag.`]}),(0,P.jsxs)(`p`,{children:[`On a checkout, run `,(0,P.jsxs)(`code`,{children:[`archidocs diff `,i,` HEAD`]}),`, or ask the MCP server with `,(0,P.jsxs)(`code`,{children:[`at: "`,i,`"`]}),`.`]}),(0,P.jsx)(`a`,{href:n,children:`Back to latest`})]})}function XT({revision:e,place:t}){return(0,P.jsxs)(`p`,{className:`arc-at`,role:`status`,"aria-label":`Past Revision`,children:[(0,P.jsxs)(`span`,{children:[`Viewing `,(0,P.jsx)(`strong`,{children:zT(e)}),` · `,e.subject,` · `,BT(e)]}),(0,P.jsx)(`a`,{href:uT({...t,at:null}),children:`Back to latest`})]})}var ZT={team:`Team`,environment:`Environment`,project:`Project`,element:`Element`,relationship:`Relationship`,target:`Deployment Target`,deployment:`Deployment`,view:`View`,adr:`ADR`},QT={added:`+`,removed:`−`,changed:`~`};function $T(e){let t=e.after??e.before;return(typeof t.name==`string`?t.name:typeof t.title==`string`?t.title:null)??e.id}function eE(e){let t=e.after??e.before;if(e.kind===`element`)return{element:e.id};if(e.kind===`relationship`)return{element:t.from};if(e.kind===`deployment`)return{element:t.service};if(e.kind===`adr`&&Array.isArray(t.elements)&&typeof t.elements[0]==`string`)return{element:t.elements[0]};if(e.kind===`view`)return{view:e.id}}function tE({changes:e,label:t,onElement:n,onView:r}){return(0,P.jsxs)(`aside`,{className:`arc-changes`,"aria-label":`Changes`,children:[(0,P.jsx)(`h2`,{children:`Changes`}),(0,P.jsxs)(`p`,{className:`arc-revision-meta`,children:[t,`: `,e.length===0?`nothing changed`:`${e.length} Change${e.length===1?``:`s`}`]}),(0,P.jsx)(`ul`,{children:e.map(e=>{let t=eE(e),i=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`arc-change-sign`,"aria-hidden":`true`,children:QT[e.type]}),(0,P.jsxs)(`span`,{children:[$T(e),(0,P.jsx)(`br`,{}),(0,P.jsxs)(`span`,{className:`arc-change-kind`,children:[ZT[e.kind],` `,e.type,e.fields.length>0?`: ${e.fields.join(`, `)}`:``]})]})]}),a=`arc-change arc-change-${e.type}`;return(0,P.jsx)(`li`,{children:t?(0,P.jsx)(`button`,{type:`button`,className:a,onClick:()=>`element`in t?n(t.element):r(t.view),children:i}):(0,P.jsx)(`span`,{className:a,children:i})},`${e.kind} ${e.id} ${e.type}`)})})]})}function nE({revision:e}){return(0,P.jsxs)(`span`,{children:[e.tags.map(e=>(0,P.jsx)(`span`,{className:`arc-tag`,children:e},e)),(0,P.jsx)(`code`,{children:e.sha.slice(0,7)}),` `,e.subject,(0,P.jsx)(`br`,{}),(0,P.jsxs)(`span`,{className:`arc-revision-meta`,children:[BT(e),` · `,e.author,` · +`,e.counts.added,` −`,e.counts.removed,` ~`,e.counts.changed,!e.bundle&&(0,P.jsx)(`span`,{className:`arc-dropped`,children:` · not kept`})]})]})}function rE({timeline:e,onAt:t,onVs:n}){let[r,i]=(0,O.useState)(!1),a=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!r)return;let e=e=>{(e instanceof KeyboardEvent?e.key===`Escape`:!a.current?.contains(e.target))&&i(!1)};return window.addEventListener(`keydown`,e),window.addEventListener(`pointerdown`,e),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`pointerdown`,e)}},[r]),e.revisions.length===0?null:(0,P.jsxs)(`div`,{className:`arc-menu-root`,ref:a,children:[(0,P.jsxs)(`button`,{type:`button`,className:`arc-tool arc-menu-button`,"aria-haspopup":`menu`,"aria-expanded":r,title:`Revisions`,onClick:()=>i(!r),children:[(0,P.jsx)(L,{name:`revisions`}),(0,P.jsx)(`span`,{className:`arc-tool-label`,children:`Revisions`})]}),r&&(0,P.jsx)(`div`,{className:`arc-menu arc-timeline`,role:`menu`,"aria-label":`Revisions`,children:(0,P.jsx)(`ol`,{children:e.revisions.map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(nE,{revision:e}),(0,P.jsxs)(`span`,{className:`arc-revision-actions`,children:[(0,P.jsx)(`button`,{type:`button`,disabled:!e.bundle,"aria-label":`Open ${zT(e)}`,onClick:()=>(i(!1),t(e)),children:`Open`}),(0,P.jsx)(`button`,{type:`button`,disabled:!e.bundle,"aria-label":`Compare from ${zT(e)}`,onClick:()=>(i(!1),n(e)),children:`Compare`})]})]},e.sha))})})]})}function iE({workspace:e,place:t,direction:n,compare:r,timeline:i,onCollapse:a,onDirection:o,onLens:s,onPicks:c,onTime:l,onExport:u,onSaveAsView:d}){let f=e.crumbs(t.view),p=Zp(sE),m=t=>e.byId.get(t)?.name??t;return(0,P.jsxs)(`header`,{className:`arc-location arc-plate`,children:[(0,P.jsxs)(`div`,{className:`arc-where`,children:[(0,P.jsxs)(`span`,{className:`arc-history-buttons`,children:[(0,P.jsx)(`button`,{type:`button`,className:`arc-tool arc-step`,"aria-label":`Back`,title:`Back`,onClick:()=>window.history.back(),children:(0,P.jsx)(L,{name:`back`})}),(0,P.jsx)(`button`,{type:`button`,className:`arc-tool arc-step`,"aria-label":`Forward`,title:`Forward`,onClick:()=>window.history.forward(),children:(0,P.jsx)(L,{name:`forward`})})]}),(0,P.jsx)(`nav`,{"aria-label":`Breadcrumbs`,children:(0,P.jsx)(`ol`,{className:`arc-crumbs`,children:f.map((e,n)=>{let r=n===f.length-1;return(0,P.jsx)(`li`,{"aria-current":r?`page`:void 0,children:r||e.view===void 0?(0,P.jsx)(`span`,{title:e.label,children:e.label}):(0,P.jsx)(`a`,{href:uT(fT(e.view,null,t.lens,t)),title:`Up to ${e.label}`,children:e.label})},`${n}:${e.label}`)})})}),(0,P.jsx)(lE,{workspace:e,place:t})]}),(0,P.jsx)(dE,{workspace:e,place:t}),(0,P.jsxs)(`div`,{className:`arc-tools`,children:[(0,P.jsx)(rE,{timeline:i,onAt:e=>l({at:i.isLatest(e)?null:zT(e)}),onVs:e=>l({vs:zT(e)})}),(0,P.jsx)(pE,{}),(0,P.jsxs)(`label`,{className:`arc-direction-label`,children:[(0,P.jsx)(`span`,{className:`arc-visually-hidden`,children:`Layout direction`}),(0,P.jsx)(`select`,{className:`arc-tool arc-direction`,"aria-label":`Direction`,title:`Layout direction: ${aE[n]}`,value:n,onChange:e=>o(e.target.value),children:Yw.map(e=>(0,P.jsx)(`option`,{value:e,children:p?oE[e]:aE[e]},e))})]}),(0,P.jsx)(mE,{}),(0,P.jsx)(cE,{picks:t.picks.length,onExport:u}),(0,P.jsx)(`button`,{type:`button`,className:`arc-tool arc-primary`,onClick:d,children:`Save as View`})]}),(t.open.length>0||r||t.lens||t.picks.length>0)&&(0,P.jsxs)(`div`,{className:`arc-state`,children:[t.open.length>0&&(0,P.jsxs)(`section`,{className:`arc-chips`,role:`region`,"aria-label":`Open boxes`,children:[t.open.map(e=>(0,P.jsxs)(`button`,{type:`button`,className:`arc-chip`,"aria-label":`Close ${m(e)}`,onClick:()=>a([e]),children:[m(e),(0,P.jsx)(`span`,{className:`arc-chip-x`,"aria-hidden":`true`})]},e)),(0,P.jsx)(`button`,{type:`button`,className:`arc-chip arc-chip-all`,onClick:()=>a(t.open),children:`Collapse all`})]}),r&&(0,P.jsx)(`section`,{className:`arc-chips`,role:`region`,"aria-label":`Compare`,children:(0,P.jsxs)(`span`,{className:`arc-chip arc-chip-lens`,children:[(0,P.jsx)(`span`,{className:`arc-lens-kind`,children:`Compare`}),` `,r,(0,P.jsx)(`button`,{type:`button`,className:`arc-chip-clear`,"aria-label":`Clear compare`,onClick:()=>l({vs:null}),children:(0,P.jsx)(`span`,{className:`arc-chip-x`,"aria-hidden":`true`})})]})}),t.lens&&(0,P.jsx)(fE,{workspace:e,lens:t.lens,onLens:s}),t.picks.length>0&&(0,P.jsx)(`section`,{className:`arc-chips`,role:`region`,"aria-label":`Picks`,children:(0,P.jsxs)(`button`,{type:`button`,className:`arc-chip arc-chip-picks`,"aria-label":`Clear ${t.picks.length} picked`,onClick:()=>c([]),children:[t.picks.length,` picked`,(0,P.jsx)(`span`,{className:`arc-chip-x`,"aria-hidden":`true`})]})})]})]})}var aE={LR:`Left → right`,RL:`Right → left`,TB:`Top → bottom`,BT:`Bottom → top`},oE={LR:`→`,RL:`←`,TB:`↓`,BT:`↑`},sE=`(max-width: 1279px)`;function cE({picks:e,onExport:t}){let[n,r]=(0,O.useState)(!1),i=uE(n,()=>r(!1)),a=[[`View as SVG`,`view`,`svg`],[`View as PNG`,`view`,`png`],...e>0?[[`Picks as SVG`,`picks`,`svg`],[`Picks as PNG`,`picks`,`png`]]:[]];return(0,P.jsxs)(`div`,{className:`arc-menu-root`,ref:i,children:[(0,P.jsxs)(`button`,{type:`button`,className:`arc-tool arc-menu-button`,"aria-haspopup":`menu`,"aria-expanded":n,title:`Export`,onClick:()=>r(!n),children:[(0,P.jsx)(L,{name:`export`}),(0,P.jsx)(`span`,{className:`arc-tool-label`,children:`Export`})]}),n&&(0,P.jsx)(`div`,{className:`arc-menu`,role:`menu`,"aria-label":`Export`,children:a.map(([e,n,i])=>(0,P.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{r(!1),t(n,i)},children:e},e))})]})}function lE({workspace:e,place:t}){let[n,r]=(0,O.useState)(!1),i=uE(n,()=>r(!1)),a=e.deeper(t.view);return a.length===0?null:(0,P.jsxs)(`div`,{className:`arc-menu-root arc-deeper`,ref:i,children:[(0,P.jsxs)(`button`,{type:`button`,className:`arc-tool arc-menu-button`,"aria-haspopup":`menu`,"aria-expanded":n,title:`Go a level deeper`,onClick:()=>r(!n),children:[(0,P.jsx)(L,{name:`down`}),(0,P.jsx)(`span`,{className:`arc-tool-label`,children:`Go deeper`})]}),n&&(0,P.jsx)(`div`,{className:`arc-menu arc-menu-start`,role:`menu`,"aria-label":`Go deeper`,children:a.map(e=>(0,P.jsx)(`a`,{role:`menuitem`,href:uT(fT(e.view,null,t.lens,t)),onClick:()=>r(!1),children:e.label},e.view))})]})}function uE(e,t){let n=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!e)return;let r=e=>{(e instanceof KeyboardEvent?e.key===`Escape`:!n.current?.contains(e.target))&&t()};return window.addEventListener(`keydown`,r),window.addEventListener(`pointerdown`,r),()=>{window.removeEventListener(`keydown`,r),window.removeEventListener(`pointerdown`,r)}},[e,t]),n}function dE({workspace:e,place:t}){let n=e.views.flatMap(t=>{let n=_(t.id);return n?.form===`deployment`?[{view:t.id,label:e.name(n.environment)}]:[]});return n.length===0?null:(0,P.jsxs)(`nav`,{className:`arc-deployments`,"aria-label":`Deployment Views`,children:[(0,P.jsx)(`span`,{className:`arc-deployments-label`,"aria-hidden":`true`,children:`Deployment:`}),n.map(e=>e.view===t.view?(0,P.jsx)(`a`,{href:uT(fT(e.view)),"aria-current":`page`,title:`Deployment View: ${e.label}`,className:`arc-deployment-link arc-current`,children:e.label},e.view):(0,P.jsx)(`a`,{href:uT(fT(e.view,null,t.lens)),title:`Deployment View: ${e.label}`,className:`arc-deployment-link`,children:e.label},e.view))]})}function fE({workspace:e,lens:t,onLens:n}){return(0,P.jsxs)(`section`,{className:`arc-chips arc-lens`,role:`region`,"aria-label":`Lens`,children:[(0,P.jsxs)(`span`,{className:`arc-chip arc-chip-lens`,children:[(0,P.jsx)(`span`,{className:`arc-lens-kind`,children:`impact`in t?`Impact`:`team`in t?`Team`:`Connect`}),l(e.bundle,t),(0,P.jsx)(`button`,{type:`button`,className:`arc-chip-clear`,"aria-label":`Clear lens`,onClick:()=>n(null),children:(0,P.jsx)(`span`,{className:`arc-chip-x`,"aria-hidden":`true`})})]}),`impact`in t&&(0,P.jsx)(`div`,{className:`arc-segmented`,role:`group`,"aria-label":`Impact direction`,children:[`upstream`,`both`,`downstream`].map(e=>(0,P.jsx)(`button`,{type:`button`,"aria-pressed":t.direction===e,onClick:()=>n({...t,direction:e}),children:e===`both`?`Both`:e===`upstream`?`Upstream`:`Downstream`},e))}),`path`in t&&(0,P.jsx)(`div`,{className:`arc-segmented`,role:`group`,"aria-label":`Paths`,children:[`shortest`,4].map(e=>(0,P.jsx)(`button`,{type:`button`,"aria-pressed":(t.path.paths??`shortest`)===e,onClick:()=>n({path:{...t.path,paths:e}}),children:e===`shortest`?`Shortest`:`All ≤ 4 hops`},e))})]})}function pE(){let[e,t]=(0,O.useState)(null),n=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!e)return;let r=e=>{(e instanceof KeyboardEvent?e.key===`Escape`:!n.current?.contains(e.target))&&t(null)};return window.addEventListener(`keydown`,r),window.addEventListener(`pointerdown`,r),()=>{window.removeEventListener(`keydown`,r),window.removeEventListener(`pointerdown`,r)}},[e]),(0,P.jsxs)(`div`,{className:`arc-menu-root`,ref:n,children:[(0,P.jsxs)(`button`,{type:`button`,className:`arc-tool arc-menu-button`,"aria-haspopup":`menu`,"aria-expanded":e!==null,title:`Recent`,onClick:()=>t(e?null:IT()),children:[(0,P.jsx)(L,{name:`recent`}),(0,P.jsx)(`span`,{className:`arc-tool-label`,children:`Recent`})]}),e&&(0,P.jsxs)(`div`,{className:`arc-menu`,role:`menu`,"aria-label":`Recent`,children:[e.length===0&&(0,P.jsx)(`p`,{className:`arc-menu-empty`,children:`Nothing yet`}),e.map(e=>(0,P.jsx)(`a`,{role:`menuitem`,href:e.hash,onClick:()=>t(null),children:e.label},e.key))]})]})}function mE(){let[e,t]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{if(!e)return;let n=window.setTimeout(()=>t(!1),1500);return()=>window.clearTimeout(n)},[e]),(0,P.jsxs)(`button`,{type:`button`,className:`arc-tool`,"aria-label":`Copy link`,title:`Copy link`,onClick:()=>{navigator.clipboard.writeText(window.location.href).then(()=>t(!0))},children:[(0,P.jsx)(L,{name:e?`check`:`copy`}),(0,P.jsx)(`span`,{className:`arc-tool-label`,children:e?`Copied`:`Copy link`})]})}var hE=.85,gE=44,_E=16,vE=300;function yE(e){return(0,P.jsx)(cp,{children:(0,P.jsx)(bE,{...e})})}function bE({workspace:e,layout:t,fitKey:n,selected:r,playing:i,reducedMotion:a,onSelect:o,onSettled:s}){let c=(0,O.useMemo)(()=>t.columns.map(e=>({id:e.id,type:`lifeline`,position:{x:e.x-e.width/2,y:0},width:e.width,height:t.height,style:{width:e.width,height:t.height,pointerEvents:`none`},draggable:!1,selectable:!1,connectable:!1,data:{column:e,height:t.height,activations:t.activations.filter(t=>t.participant===e.id)}})),[t]),l=(0,O.useMemo)(()=>t.rows.map(t=>({id:t.key,source:t.from,target:t.to,type:`message`,zIndex:1,selectable:!1,data:{row:t,via:Pm(t,t=>e.name(t)),selected:t.n===r,later:i&&r!==null&&t.n>r,onSelect:o}})),[t,e,r,i,o]);return(0,P.jsxs)(fp,{className:`arc-flow arc-seq`,nodes:c,edges:l,nodeTypes:DE,edgeTypes:OE,minZoom:hE,maxZoom:2,panOnScroll:!0,panOnScrollSpeed:1,panOnDrag:[0,1],zoomOnDoubleClick:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},children:[(0,P.jsx)(`svg`,{className:`arc-defs`,"aria-hidden":`true`,children:(0,P.jsxs)(`defs`,{children:[(0,P.jsx)(`marker`,{id:`arc-head-filled`,viewBox:`0 0 10 10`,refX:`10`,refY:`5`,markerWidth:`8`,markerHeight:`8`,orient:`auto-start-reverse`,children:(0,P.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,className:`arc-head`})}),(0,P.jsx)(`marker`,{id:`arc-head-open`,viewBox:`0 0 10 10`,refX:`10`,refY:`5`,markerWidth:`8`,markerHeight:`8`,orient:`auto-start-reverse`,children:(0,P.jsx)(`path`,{d:`M0,0 L10,5 L0,10`,className:`arc-head-open`})})]})}),(0,P.jsx)(wE,{workspace:e,layout:t}),(0,P.jsx)(xE,{layout:t,fitKey:n,selected:r,playing:i,reducedMotion:a,onSettled:s}),(0,P.jsx)(em,{})]})}function xE({layout:e,fitKey:t,selected:n,playing:r,reducedMotion:i,onSettled:a}){let{setViewport:o,getViewport:s}=od(),c=G(e=>e.width),l=G(e=>e.height),u=c>0&&l>0,d=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!u)return;o(CE(e,c,l)),d.current=t;let n=0,r=()=>{document.querySelectorAll(`[data-step-edge]`).length>=e.rows.length?a(t):n=window.requestAnimationFrame(r)};return n=window.requestAnimationFrame(r),()=>window.cancelAnimationFrame(n)},[t,u]),(0,O.useEffect)(()=>{if(!u||n===null||d.current!==t)return;let a=e.rows.filter(e=>e.n===n);if(a.length===0)return;let f=(a[0].y+a.at(-1).y)/2,p=a.flatMap(e=>[e.x1,e.x2]),m=(Math.min(...p)+Math.max(...p))/2,h=s(),g=SE(i),_=(e,t)=>e*h.zoom+h.x>=0&&e*h.zoom+h.x<=c&&t*h.zoom+h.y>=gE*h.zoom&&t*h.zoom+h.y<=l;if(r)o({x:c/2-m*h.zoom,y:l/2-f*h.zoom,zoom:h.zoom},g);else if(!p.every(e=>_(e,f))){let e=Math.max(...p)-Math.min(...p)<=c/h.zoom;o({x:e?c/2-m*h.zoom:48-Math.min(...p)*h.zoom,y:l/2-f*h.zoom,zoom:h.zoom},g)}},[n,r,t,u]),(0,P.jsx)(`div`,{className:`arc-seq-tools`,children:(0,P.jsx)(`button`,{type:`button`,className:`arc-action`,onClick:()=>void o(CE(e,c,l),SE(i)),children:`Fit whole chart`})})}var SE=e=>({duration:e?0:vE,interpolate:`linear`});function CE(e,t,n){let r=Math.max(hE,Math.min(1,(t-32)/e.width,(n-_E)/e.height));return{x:e.width*r<=t?(t-e.width*r)/2:_E,y:_E/2,zoom:r}}function wE({workspace:e,layout:t}){let[n,r,i]=G(e=>e.transform),a={transform:`translate(${n}px, ${Math.max(r,0)}px) scale(${i})`};return(0,P.jsx)(`div`,{className:`arc-seq-headers`,style:a,children:t.columns.map(t=>{let n=e.byId.get(t.id),r=n?e.teams.get(n.owner):void 0,i=n!==void 0&&`external`in n&&n.external;return(0,P.jsxs)(`div`,{className:i?`arc-seq-header arc-external`:`arc-seq-header`,"data-header":t.id,title:e.name(t.id),style:{left:t.x-t.width/2,width:t.width,height:gE},children:[r&&(0,P.jsx)(`span`,{className:`arc-stripe`,style:{background:r.color}}),(0,P.jsx)(`span`,{className:`arc-seq-name`,children:e.name(t.id)}),r&&(0,P.jsx)(`span`,{className:`arc-team`,children:r.code})]},t.id)})})}var TE=(0,O.memo)(function({data:e}){let{column:t,height:n,activations:r}=e,i=t.width/2;return(0,P.jsxs)(`div`,{className:`arc-lifeline`,"data-participant":t.id,style:{width:t.width,height:n},children:[(0,P.jsx)(Nd,{type:`target`,position:U.Top,isConnectable:!1,className:`arc-handle`}),(0,P.jsx)(Nd,{type:`source`,position:U.Top,isConnectable:!1,className:`arc-handle`}),(0,P.jsxs)(`svg`,{width:t.width,height:n,children:[(0,P.jsx)(`line`,{x1:i,y1:gE,x2:i,y2:n-10,className:`arc-lifeline-line`}),r.map(e=>(0,P.jsx)(`rect`,{className:`arc-activation`,x:i-jm.bar/2+e.depth*jm.bar/2,y:e.top-6,width:jm.bar,height:e.bottom-e.top+12},`${e.top}:${e.depth}`))]})]})});function EE({data:e}){let{row:t,via:n,selected:r,later:i,onSelect:a}=e,o=t.x2>=t.x1?1:-1,s=t.x1+o*14,c=t.x1+o*28,l=o>0?`start`:`end`,u=`M${t.x1} ${t.y} L${t.x2} ${t.y}`,d=[n,t.note].filter(e=>e!==void 0),f=[`arc-step`,r?`arc-step-selected`:``,i?`arc-step-later`:``].filter(Boolean).join(` `);return(0,P.jsxs)(`g`,{className:f,"data-step-edge":t.key,"data-step":t.n,"data-selected":r?`true`:`false`,"data-later":i?`true`:void 0,onClick:()=>a(t.n),children:[(0,P.jsx)(`title`,{children:`Step ${t.key}: ${t.label}`}),(0,P.jsx)(`path`,{className:`arc-step-hit`,d:u}),(0,P.jsx)(`path`,{className:`arc-step-line arc-step-${t.style}`,d:u,markerEnd:`url(#arc-head-${t.style===`sync`?`filled`:`open`})`}),(0,P.jsx)(`circle`,{className:`arc-step-badge`,cx:s,cy:t.y,r:9}),(0,P.jsx)(`text`,{className:`arc-step-number`,x:s,y:t.y+3.5,textAnchor:`middle`,children:t.key}),(0,P.jsx)(`text`,{className:`arc-step-label`,x:c,y:t.y-7,textAnchor:l,children:t.label}),d.map((e,n)=>(0,P.jsx)(`text`,{className:`arc-step-sub`,x:c,y:t.y+16+n*jm.lineHeight,textAnchor:l,children:e},n))]})}var DE={lifeline:TE},OE={message:EE};function kE(e,t,n){let r=new Map;for(let e of Mm(t,{brokers:n})){let[t,n]=e.style===`return`?[e.to,e.from]:[e.from,e.to],i=`${t}>${n}`,a=r.get(i)??{from:t,to:n,messages:[]};a.messages.push(e),r.set(i,a)}let i=Nm(t,{brokers:n}).map(t=>{let n=e.byId.get(t);return{id:t,kind:n?.kind??`service`,name:e.name(t),parent:null,collapsed:!1,external:n!==void 0&&`external`in n&&n.external}}),a=[...r.values()].map(e=>({from:e.from,to:e.to,relationships:[...new Set(e.messages.map(e=>e.step.relationship))]}));return{graph:{id:t.id,kind:`c2`,title:t.title,direction:`LR`,nodes:i,edges:a},pairs:[...r.values()]}}function AE(e){return(0,P.jsx)(cp,{children:(0,P.jsx)(jE,{...e})})}function jE({workspace:e,view:t,brokers:n,fitKey:r,selected:i,onSelect:a,onSettled:o}){let{graph:s,pairs:c}=(0,O.useMemo)(()=>kE(e,t,n),[e,t,n]),{laidOut:l,error:u}=ST(s),d=l?.view===s?l.layout:void 0,f=(0,O.useMemo)(()=>d?.nodes.map(t=>({id:t.id,type:`participant`,position:{x:t.x,y:t.y},width:t.width,height:t.height,style:{width:t.width,height:t.height},draggable:!1,connectable:!1,data:{name:e.name(t.id)}}))??[],[d,e]),p=(0,O.useMemo)(()=>{if(!d)return[];let e=new Map(c.map(e=>[`${e.from}>${e.to}`,e])),t=e=>e.messages[0].n;return d.edges.map(t=>({e:t,pair:e.get(`${t.from}>${t.to}`)})).sort((e,n)=>t(e.pair)-t(n.pair)).map(({e,pair:t})=>({id:`${e.from}>${e.to}`,source:e.from,target:e.to,type:`steps`,selectable:!1,markerEnd:{type:_s.ArrowClosed,width:16,height:16},data:{points:e.points,pair:t,selected:i,onSelect:a}}))},[d,c,i,a]);return u?(0,P.jsxs)(`p`,{className:`arc-error`,children:[`Layout failed: `,u]}):(0,P.jsxs)(fp,{className:`arc-flow arc-graph`,nodes:f,edges:p,panOnScroll:!0,panOnScrollSpeed:1,panOnDrag:[0,1],nodeTypes:FE,edgeTypes:IE,minZoom:.05,maxZoom:2,zoomOnDoubleClick:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},children:[(0,P.jsx)(kp,{showInteractive:!1}),d&&(0,P.jsx)(ME,{width:d.width,height:d.height,edges:d.edges.length,fitKey:r,onSettled:o}),(0,P.jsx)(em,{})]})}function ME({width:e,height:t,edges:n,fitKey:r,onSettled:i}){let{setViewport:a}=od(),o=G(e=>e.width),s=G(e=>e.height);return(0,O.useEffect)(()=>{if(o===0||s===0)return;let c=Math.min(1,(o-64)/Math.max(e,1),(s-64)/Math.max(t,1));a({x:(o-e*c)/2,y:(s-t*c)/2,zoom:c});let l=0,u=()=>{document.querySelectorAll(`path[data-edge-from]`).length>=n?i(r):l=window.requestAnimationFrame(u)};return l=window.requestAnimationFrame(u),()=>window.cancelAnimationFrame(l)},[e,t,r,o>0&&s>0]),null}var NE=(0,O.memo)(function({id:e,data:t}){return(0,P.jsxs)(`div`,{className:`arc-box arc-graph-node`,"data-graph-node":e,children:[(0,P.jsx)(Nd,{type:`target`,position:U.Left,isConnectable:!1,className:`arc-handle`}),(0,P.jsx)(Nd,{type:`source`,position:U.Right,isConnectable:!1,className:`arc-handle`}),(0,P.jsx)(`div`,{className:`arc-text`,children:(0,P.jsx)(`div`,{className:`arc-name`,children:t.name})})]})});function PE({data:e,markerEnd:t}){let{points:n,pair:r,selected:i,onSelect:a}=e,o=n.map((e,t)=>`${t===0?`M`:`L`}${e.x} ${e.y}`).join(` `),s=Math.floor((n.length-1)/2),[c,l]=[n[s],n[s+1]??n[s]],u=r.messages.some(e=>e.n===i);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`path`,{className:u?`arc-edge arc-lit`:`arc-edge`,d:o,fill:`none`,markerEnd:t,"data-edge-from":r.from,"data-edge-to":r.to}),(0,P.jsx)(mp,{children:(0,P.jsx)(`div`,{className:`arc-graph-steps nodrag nopan`,style:{transform:`translate(-50%, -50%) translate(${(c.x+l.x)/2}px, ${(c.y+l.y)/2}px)`},children:r.messages.map(e=>(0,P.jsx)(`button`,{type:`button`,className:`arc-graph-step arc-step-${e.style}`,"data-graph-step":e.key,"aria-pressed":e.n===i,title:e.label,onClick:()=>a(e.n),children:e.key},e.key))})})]})}var FE={participant:NE},IE={steps:PE},LE=1400,RE=e=>e.kind===`return`?`return`:e.interaction,zE={sync:`Sync call`,async:`Async`,return:`Return`};function BE({workspace:e,view:t,place:n,keys:r,onOpenStepView:i,onOpenView:a}){let o=t.steps,s=o.findIndex(e=>e.n===n.step),c=s<0?void 0:o[s],[l,u]=(0,O.useState)(!1),d=Xp(),f=(0,O.useCallback)(t=>e.name(t),[e]),p=(0,O.useMemo)(()=>Fm(t,{name:f,brokers:n.brokers}),[t,f,n.brokers]),m=`${t.id}|${n.brokers?`brokers`:`direct`}|${n.graph?`graph`:`sequence`}`,[h,g]=(0,O.useState)(),_=(0,O.useCallback)(e=>_T({...n,step:e},{replace:!0}),[n]),v=(0,O.useCallback)(e=>_(o[Math.max(0,Math.min(o.length-1,e))]?.n??null),[_,o]),y=(0,O.useCallback)(()=>v(s<0?0:s+1),[v,s]),b=(0,O.useCallback)(()=>v(s<0?0:s-1),[v,s]),x=(0,O.useCallback)(()=>{if(l)return u(!1);(s<0||s===o.length-1)&&v(0),u(o.length>1)},[l,s,o.length,v]);(0,O.useEffect)(()=>{if(!l)return;let e=window.setTimeout(()=>{let e=s+1;v(e),e>=o.length-1&&u(!1)},LE);return()=>window.clearTimeout(e)},[l,s,o.length,v]),(0,O.useEffect)(()=>{if(!r)return;let e=e=>{if(!(e.target instanceof HTMLElement&&(e.target.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(e.target.tagName))||e.metaKey||e.ctrlKey||e.altKey)){if(e.key===` `)x();else if(e.key===`j`||e.key===`ArrowDown`)y();else if(e.key===`k`||e.key===`ArrowUp`)b();else if(e.key===`Escape`)u(!1),_(null);else return;e.preventDefault()}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r,x,y,b,_]),(0,O.useEffect)(()=>{c&&document.querySelector(`.arc-outline [data-step="${c.n}"]`)?.scrollIntoView({block:`nearest`})},[c]);let S=h===m;return(0,P.jsxs)(`div`,{className:`arc-dynamic`,children:[(0,P.jsxs)(`aside`,{className:`arc-dyn-left`,"aria-label":`Walkthrough`,children:[(0,P.jsxs)(`div`,{className:`arc-transport`,role:`group`,"aria-label":`Transport`,children:[(0,P.jsxs)(`div`,{className:`arc-transport-buttons`,children:[(0,P.jsx)(`button`,{type:`button`,"aria-label":`First Step`,onClick:()=>v(0),children:(0,P.jsx)(L,{name:`first`})}),(0,P.jsx)(`button`,{type:`button`,"aria-label":`Previous Step`,onClick:b,children:(0,P.jsx)(L,{name:`previous`})}),(0,P.jsx)(`button`,{type:`button`,className:`arc-play`,"aria-label":l?`Pause`:`Play`,onClick:x,children:(0,P.jsx)(L,{name:l?`pause`:`play`})}),(0,P.jsx)(`button`,{type:`button`,"aria-label":`Next Step`,onClick:y,children:(0,P.jsx)(L,{name:`next`})})]}),(0,P.jsx)(`p`,{className:`arc-transport-count`,"aria-live":`polite`,children:c?`Step ${c.n} of ${o.length}`:`${o.length} Steps`}),(0,P.jsxs)(`div`,{className:`arc-progress`,role:`group`,"aria-label":`Progress`,children:[(0,P.jsx)(`span`,{className:`arc-progress-fill`,style:{width:`${o.length===0?0:(s+1)/o.length*100}%`}}),o.map(e=>(0,P.jsx)(`button`,{type:`button`,className:`arc-tick`,"aria-label":`Go to Step ${e.n}`,"aria-current":e.n===c?.n?`step`:void 0,onClick:()=>_(e.n)},e.n))]})]}),(0,P.jsx)(`ol`,{className:`arc-outline`,"aria-label":`Steps`,children:o.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,"data-step":t.n,"aria-current":t.n===c?.n?`step`:void 0,onClick:()=>_(t.n),children:[(0,P.jsx)(`span`,{className:`arc-outline-n`,children:t.n}),(0,P.jsxs)(`span`,{className:`arc-outline-text`,children:[(0,P.jsx)(`span`,{className:`arc-outline-label`,children:t.description}),(0,P.jsxs)(`span`,{className:`arc-outline-ends`,children:[e.name(t.from),` `,(0,P.jsx)(VE,{style:RE(t)}),` `,e.name(t.to)]})]})]})},t.n))})]}),(0,P.jsxs)(`section`,{className:`arc-dyn-main`,"aria-label":`Chart`,children:[(0,P.jsxs)(`header`,{className:`arc-location`,children:[(0,P.jsxs)(`div`,{className:`arc-dyn-title`,children:[(0,P.jsx)(`span`,{className:`arc-panel-kind`,children:`Dynamic View`}),(0,P.jsx)(`h1`,{children:t.title})]}),(0,P.jsxs)(`div`,{className:`arc-tools`,children:[(0,P.jsxs)(`label`,{className:`arc-check`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:n.brokers,onChange:e=>_T({...n,brokers:e.target.checked},{replace:!0})}),`Show brokers`]}),(0,P.jsx)(`div`,{className:`arc-segmented`,role:`group`,"aria-label":`Chart`,children:[`Sequence`,`Graph`].map(e=>(0,P.jsx)(`button`,{type:`button`,"aria-pressed":e===`Graph`===n.graph,onClick:()=>_T({...n,graph:e===`Graph`},{replace:!0}),children:e},e))}),(0,P.jsx)(pE,{}),(0,P.jsx)(mE,{}),(0,P.jsx)(cE,{picks:0,onExport:(r,i)=>void AT(e,t,n.brokers,i).then(e=>NT(e,MT(t.id,i)))})]})]}),(0,P.jsx)(`div`,{className:`arc-canvas`,"data-canvas":!0,"data-state":S?`ready`:`busy`,children:n.graph?(0,P.jsx)(AE,{workspace:e,view:t,brokers:n.brokers,fitKey:m,selected:c?.n??null,onSelect:_,onSettled:g},m):(0,P.jsx)(yE,{workspace:e,layout:p,fitKey:m,selected:c?.n??null,playing:l,reducedMotion:d,onSelect:_,onSettled:g},m)})]}),(0,P.jsx)(`aside`,{className:`arc-dyn-detail`,"aria-label":`Step detail`,children:c?(0,P.jsx)(UE,{workspace:e,view:t,step:c,onOpenStepView:i,onOpenView:a}):(0,P.jsx)(WE,{workspace:e,view:t})})]})}function VE({style:e}){return(0,P.jsx)(`span`,{className:`arc-glyph arc-step-${e}`,"aria-label":zE[e],role:`img`})}var HE={call:`Call`,return:`Return`,event:`Event`};function UE({workspace:e,view:t,step:n,onOpenStepView:r,onOpenView:i}){let a=n.relationship,s=e.byId.get(a.from)?.owner,c=s?e.teams.get(s):void 0,l=o(e.bundle,n.relationship).filter(e=>e.id!==t.id);return(0,P.jsxs)(`div`,{className:`arc-panel-body`,children:[(0,P.jsxs)(`h2`,{children:[`Step `,n.n]}),(0,P.jsx)(`p`,{className:`arc-panel-kind`,children:HE[n.kind]}),(0,P.jsx)(`p`,{className:`arc-description`,children:n.description}),(0,P.jsxs)(`p`,{className:`arc-outline-ends`,children:[e.name(n.from),` `,(0,P.jsx)(VE,{style:RE(n)}),` `,e.name(n.to)]}),n.note&&(0,P.jsx)(`p`,{className:`arc-note`,children:n.note}),(0,P.jsx)(`h3`,{children:`Relationship`}),(0,P.jsxs)(`dl`,{className:`arc-facts`,children:[(0,P.jsx)(`dt`,{children:`Id`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(`code`,{children:a.id??`${a.from} → ${a.to}`})}),a.description&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Description`}),(0,P.jsx)(`dd`,{children:a.description})]}),(0,P.jsx)(`dt`,{children:`Interaction`}),(0,P.jsx)(`dd`,{children:a.interaction}),a.technology&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Technology`}),(0,P.jsx)(`dd`,{children:a.technology})]}),a.via&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Via`}),(0,P.jsxs)(`dd`,{children:[e.name(a.via),a.channel&&` · ${a.channel}`]})]}),s&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Owner`}),(0,P.jsxs)(`dd`,{children:[(0,P.jsx)(`span`,{className:`arc-owner-code arc-code-tile`,style:{"--team":c?.color},children:c?.code}),` `,e.name(s)]})]})]}),(0,P.jsx)(`h3`,{id:`arc-open-in`,children:`Open in`}),(0,P.jsx)(`ul`,{className:`arc-view-links`,"aria-labelledby":`arc-open-in`,children:v(e.bundle,n).map(t=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>r(t,n),children:e.title(t)??t})},t))}),l.length>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`h3`,{id:`arc-also-in`,children:`Also in`}),(0,P.jsx)(`ul`,{className:`arc-view-links`,"aria-labelledby":`arc-also-in`,children:l.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>i(e.id),children:e.title})},e.id))})]})]})}function WE({workspace:e,view:t}){let n=e.description(t.id);return(0,P.jsxs)(`div`,{className:`arc-panel-body`,children:[(0,P.jsx)(`h2`,{children:t.title}),(0,P.jsx)(`p`,{className:`arc-panel-kind`,children:`Dynamic View`}),n&&(0,P.jsx)(`p`,{className:`arc-description`,children:n}),(0,P.jsxs)(`p`,{className:`arc-muted`,children:[t.steps.length,` Steps across `,t.participants.length,` participants. Press Space to play, J and K to step, Esc to clear.`]}),(0,P.jsx)(`h3`,{id:`arc-participants`,children:`Participants`}),(0,P.jsx)(`ul`,{"aria-labelledby":`arc-participants`,children:t.participants.map(t=>(0,P.jsx)(`li`,{children:e.name(t)},t))}),(0,P.jsx)(`h3`,{id:`arc-legend`,children:`Legend`}),(0,P.jsxs)(`ul`,{className:`arc-legend`,"aria-labelledby":`arc-legend`,children:[[`sync`,`async`,`return`].map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(VE,{style:e}),` `,zE[e]]},e)),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-legend-bar`,"aria-hidden":`true`}),` Busy with a sync call`]})]})]})}function GE(e,t={}){let n=t.element===void 0?void 0:KE(e,t.element);return e.adrs.flatMap(e=>{if(t.status!==void 0&&e.effectiveStatus!==t.status||t.tag!==void 0&&!e.tags.includes(t.tag))return[];if(!n)return[e];let r=e.elements.filter(e=>n.has(e));return r.length?[{...e,matchedVia:r}]:[]}).sort((e,t)=>JE(t.date,e.date)||JE(qE(t),qE(e))||JE(e.id,t.id))}function KE(e,t){let n=[...e.elements,...e.targets],r=new Set([t]);for(let e=!0;e;){e=!1;for(let t of n)t.parent!==null&&r.has(t.parent)&&!r.has(t.id)&&(e=!!r.add(t.id))}return r}var qE=e=>e.id.slice(e.id.indexOf(`:`)+1),JE=(e,t)=>e<t?-1:+(e>t);function YE(e,t,n){let r=new Map(e.targets.map(e=>[e.id,e]));return e.deployments.filter(e=>e.service===t&&(n===void 0||e.environment===n)).map(e=>({...e,targetPath:XE(r,e.target)}))}function XE(e,t){let n=[],r=new Set;for(let i=e.get(t);i&&!r.has(i.id);i=i.parent===null?void 0:e.get(i.parent))r.add(i.id),n.unshift({id:i.id,name:i.name,kind:i.kind});return n}function ZE(e,t){if(e.kind===`project`){let t=`${e.id}:`;return n=>n.some(n=>n===e.id||n.startsWith(t))}let n=new Set([e.id]);for(let r of t)if(e.kind===`team`)for(let t of[...r.elements,...r.targets,...r.projects])t.owner===e.id&&n.add(t.id);else{let e=!0;for(;e;){e=!1;for(let t of r.elements)t.parent!==null&&n.has(t.parent)&&!n.has(t.id)&&(n.add(t.id),e=!0)}}return e=>e.some(e=>n.has(e))}var QE=[`Overview`,`URLs`,`ADRs`,`Links`,`History`];function $E({workspace:e,id:t,onLens:r,onConnect:i,onFocus:a,onOpenView:o,onOpenAdr:s,onDeployed:c,timeline:l,comparison:u,onTime:d,onClose:f}){let[p,m]=(0,O.useState)(`Overview`),h=(0,O.useMemo)(()=>({ADRs:GE(e.bundle,{element:t}).length,Links:e.bundle.relationships.filter(e=>e.from===t||e.to===t).length}),[e,t]),g=e.byId.get(t);if(!g)return null;let _=e.teams.get(g.owner),v=`technology`in g?g.technology:null,y=(g.kind===`system`||g.kind===`service`)&&g.external?`External ${g.kind}`:g.kind[0].toUpperCase()+g.kind.slice(1);return(0,P.jsxs)(`aside`,{className:`arc-panel`,"aria-label":`Element`,children:[(0,P.jsxs)(`header`,{className:`arc-panel-head`,children:[(0,P.jsxs)(`div`,{className:`arc-panel-title`,children:[(0,P.jsx)(`h2`,{children:g.name}),(0,P.jsxs)(`p`,{className:`arc-panel-kind`,children:[y,` · `,(0,P.jsx)(`code`,{className:`arc-panel-id`,children:g.id})]}),(0,P.jsxs)(`button`,{type:`button`,className:`arc-owner`,"aria-label":`Team lens: ${e.name(g.owner)}`,style:{"--team":_?.color},onClick:()=>r({team:g.owner}),children:[(0,P.jsx)(`span`,{className:`arc-owner-code`,children:_?.code}),(0,P.jsx)(`span`,{className:`arc-owner-name`,children:e.name(g.owner)})]})]}),f&&(0,P.jsx)(`button`,{type:`button`,className:`arc-flyout-close`,"aria-label":`Close panel`,onClick:f,children:(0,P.jsx)(L,{name:`close`})})]}),(0,P.jsx)(`div`,{className:`arc-tabs`,role:`tablist`,"aria-label":`Element`,children:QE.map(e=>(0,P.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":p===e,onClick:()=>m(e),children:[e,h[e]!==void 0&&(0,P.jsxs)(`span`,{className:`arc-tab-count`,children:[` `,h[e]]})]},e))}),(0,P.jsxs)(`div`,{className:`arc-panel-body`,role:`tabpanel`,"aria-label":p,children:[p===`Overview`&&(0,P.jsxs)(P.Fragment,{children:[u&&(0,P.jsx)(aD,{comparison:u,id:t}),(g.description||v)&&(0,P.jsxs)(`p`,{className:`arc-description`,children:[g.description,v&&(0,P.jsxs)(`span`,{className:`arc-technology`,children:[` `,v]})]}),(0,P.jsxs)(`section`,{className:`arc-actions`,"aria-label":`Ask`,children:[(0,P.jsxs)(`button`,{type:`button`,className:`arc-action`,"aria-label":`Both ways impact`,onClick:()=>r({impact:t,direction:`both`}),children:[(0,P.jsx)(L,{name:`impact`}),`Upstream & downstream`]}),(0,P.jsxs)(`button`,{type:`button`,className:`arc-action`,title:`Lights the paths to the node you pick next, and picks every node on them`,onClick:()=>i(t),children:[(0,P.jsx)(L,{name:`connect`}),`Connect to…`]}),n(e.bundle,t)!==void 0&&(0,P.jsxs)(`button`,{type:`button`,className:`arc-action`,onClick:()=>o(t),children:[(0,P.jsx)(L,{name:`open`}),`Open its View`]})]}),g.kind===`service`&&(0,P.jsx)(eD,{workspace:e,id:t,onDeployed:c})]}),p===`URLs`&&(0,P.jsx)(tD,{workspace:e,id:t}),p===`ADRs`&&(0,P.jsx)(rD,{workspace:e,id:t,onOpen:s}),p===`Links`&&(0,P.jsx)(iD,{workspace:e,id:t,onFocus:a}),p===`History`&&(0,P.jsx)(oD,{workspace:e,id:t,timeline:l,onTime:d})]})]})}function eD({workspace:e,id:t,onDeployed:n}){let r=(0,O.useMemo)(()=>e.deployedIn(t),[e,t]);return(0,P.jsxs)(`section`,{className:`arc-actions`,role:`region`,"aria-label":`Where is it deployed?`,children:[(0,P.jsx)(`h3`,{children:`Where is it deployed?`}),r.length===0?(0,P.jsx)(`p`,{className:`arc-empty`,children:`Not deployed in any Environment.`}):(0,P.jsx)(`div`,{className:`arc-deployed`,children:r.map(e=>(0,P.jsx)(`button`,{type:`button`,className:`arc-action`,onClick:()=>n(e.view,e.nodes),children:e.label},e.environment))})]})}function tD({workspace:e,id:t}){let n=(0,O.useMemo)(()=>YE(e.bundle,t),[e,t]);if(n.length===0)return(0,P.jsx)(`p`,{className:`arc-empty`,children:`No Deployments.`});let r=e.bundle.environments.filter(e=>n.some(t=>t.environment===e.id));return(0,P.jsx)(P.Fragment,{children:r.map(e=>(0,P.jsxs)(`section`,{className:`arc-env`,role:`region`,"aria-label":e.name,children:[(0,P.jsx)(`h3`,{children:e.name}),(0,P.jsx)(`ul`,{children:n.filter(t=>t.environment===e.id).map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`div`,{className:`arc-target`,children:e.targetPath.map(e=>e.name).join(` › `)||e.target}),e.url?(0,P.jsx)(nD,{url:e.url}):(0,P.jsx)(`p`,{className:`arc-empty`,children:`No URL`}),e.endpoints.map(e=>(0,P.jsx)(nD,{name:e.name,url:e.url},e.name))]},e.target))})]},e.id))})}function nD({name:e,url:t}){let[n,r]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{if(!n)return;let e=window.setTimeout(()=>r(!1),1500);return()=>window.clearTimeout(e)},[n]),(0,P.jsxs)(`div`,{className:`arc-url`,children:[e&&(0,P.jsx)(`span`,{className:`arc-endpoint`,children:e}),(0,P.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,children:t}),(0,P.jsx)(`button`,{type:`button`,className:`arc-copy`,"aria-label":`Copy ${t}`,onClick:()=>void navigator.clipboard.writeText(t).then(()=>r(!0)),children:n?`Copied`:`Copy`})]})}function rD({workspace:e,id:t,onOpen:n}){let r=(0,O.useMemo)(()=>GE(e.bundle,{element:t}),[e,t]);return r.length===0?(0,P.jsx)(`p`,{className:`arc-empty`,children:`No ADRs link this Element or anything inside it.`}):(0,P.jsx)(`ul`,{className:`arc-adr-list`,children:r.map(e=>(0,P.jsx)(`li`,{"data-superseded":e.effectiveStatus===`superseded`?`true`:void 0,children:(0,P.jsxs)(`button`,{type:`button`,className:`arc-adr-row`,onClick:()=>n(e.id),children:[(0,P.jsx)(`code`,{className:`arc-adr-id`,children:e.id}),(0,P.jsx)(`span`,{className:`arc-adr-title`,children:e.title}),(0,P.jsx)(Te,{status:e.effectiveStatus}),(0,P.jsx)(`time`,{className:`arc-muted`,dateTime:e.date,children:e.date})]})},e.id))})}function iD({workspace:e,id:t,onFocus:n}){let r=(0,O.useMemo)(()=>i(e.bundle,t,`both`),[e,t]),a=e.bundle.relationships.filter(e=>e.from===t||e.to===t),o=t=>(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>n(t),children:e.name(t)}),s=(e,n)=>(0,P.jsxs)(`li`,{children:[e.from===t?`→ `:`← `,o(e.from===t?e.to:e.from),e.description&&(0,P.jsxs)(`span`,{className:`arc-muted`,children:[` `,e.description]}),e.technology&&(0,P.jsxs)(`span`,{className:`arc-muted`,children:[` · `,e.technology]})]},n),c=(e,t)=>(0,P.jsxs)(`section`,{role:`region`,"aria-label":e,children:[(0,P.jsx)(`h3`,{children:e}),!t?.length&&(0,P.jsx)(`p`,{className:`arc-empty`,children:`Nothing`}),(0,P.jsx)(`ul`,{children:t?.flatMap(e=>e.elements.map(t=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-distance-inline`,children:e.distance}),` `,o(t.id)]},t.id)))})]});return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`section`,{role:`region`,"aria-label":`Relationships`,children:[(0,P.jsx)(`h3`,{children:`Relationships`}),a.length===0&&(0,P.jsx)(`p`,{className:`arc-empty`,children:`None declared here`}),(0,P.jsx)(`ul`,{children:a.map(s)})]}),c(`Downstream`,r.downstream),c(`Upstream`,r.upstream)]})}function aD({comparison:e,id:t}){let n=e.changes.find(e=>e.kind===`element`&&e.id===t);if(!n)return null;let r=e=>e===void 0?`—`:JSON.stringify(e);return(0,P.jsxs)(`section`,{className:`arc-compared`,role:`region`,"aria-label":`Changed in this comparison`,children:[(0,P.jsx)(`h3`,{children:n.type===`changed`?`Changed, ${e.label}`:`${n.type===`added`?`Added`:`Removed`}, ${e.label}`}),n.type===`changed`&&(0,P.jsx)(`dl`,{className:`arc-fields`,children:n.fields.map(e=>(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsxs)(`dd`,{children:[r(n.before?.[e]),` → `,r(n.after?.[e])]})]},e))})]})}function oD({workspace:e,id:t,timeline:n,onTime:r}){let i=(0,O.useMemo)(()=>Km(n.revisions,ZE({kind:`element`,id:t},[e.bundle])),[e,t,n]);return n.revisions.length===0?(0,P.jsx)(`p`,{className:`arc-empty`,children:`This site has no history.`}):i.length===0?(0,P.jsx)(`p`,{className:`arc-empty`,children:`No Revision changed it.`}):(0,P.jsx)(`ul`,{className:`arc-history-list`,children:i.map(e=>{let t=n.previous(e),i=n.isLatest(e)?null:zT(e);return(0,P.jsxs)(`li`,{children:[(0,P.jsx)(nE,{revision:e}),t?(0,P.jsx)(`button`,{type:`button`,"aria-label":`Compare ${zT(t)} → ${zT(e)}`,onClick:()=>r({at:i,vs:zT(t)}),children:`Compare`}):(0,P.jsx)(`button`,{type:`button`,"aria-label":`Open ${zT(e)}`,onClick:()=>r({at:i,vs:null}),children:`Open`})]},e.sha)})})}function sD(e,t,n={}){let r=cD(t),i=new Map;for(let t of e.deployments){let e=i.get(t.service)??[];for(let n of[t.url,...t.endpoints.map(e=>e.url)])n&&e.push({environment:t.environment,target:t.target,url:n});i.set(t.service,e)}let a=new Map(e.teams.map(e=>[e.id,e.name])),o=e=>[...n.fields?.includes(`team`)?[e.owner,a.get(e.owner)??``]:[],...n.fields?.includes(`technology`)&&`technology`in e&&e.technology?[e.technology]:[]],s=[];for(let t of e.elements){if(n.kind&&t.kind!==n.kind)continue;let e=lD(r,t)??(dD(r,o(t).map(e=>e.toLowerCase()))===void 0?void 0:2),a=e===void 0?void 0:{element:t,rank:e};for(let e of i.get(t.id)??[]){let n=uD(r,e.url);n!==void 0&&(a===void 0||n<a.rank)&&(a={element:t,rank:n,deployment:e})}a&&s.push(a)}return s.sort((e,t)=>e.rank-t.rank||(e.element.id<t.element.id?-1:+(e.element.id>t.element.id)))}var cD=e=>e.trim().toLowerCase().replace(/\/+$/,``);function lD(e,t){return dD(e,[t.id,t.id.slice(t.id.indexOf(`:`)+1),t.name].map(e=>e.toLowerCase()))}function uD(e,t){let n=cD(t),r=n.replace(/^[a-z][a-z0-9+.-]*:\/\//,``),i=r.replace(/[/?#].*$/,``);return e===n||e===r||e===i?0:[n,r].some(t=>/^[/?#]/.test(e.slice(t.length))&&e.startsWith(t))?1:dD(e,[n,r])}function dD(e,t){if(t.some(t=>t===e))return 0;if(t.some(t=>t.startsWith(e)))return 1;if(t.some(t=>t.includes(e)))return 2}function fD(e,t,n){let r=u(e,t,n);return r?.kind===`dynamic`?void 0:r}function pD(e){let t=_(e);return t?.form===`focused`?t.element:void 0}var mD=(e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id),hD={person:`◉`,system:`▣`,service:`▭`,component:`◇`},gD=class{bundle;byId;targets;teams;views;childrenOf=new Map;viewIds;workspaceName;constructor(e,t=`Workspace`){this.bundle=e,this.workspaceName=t,this.byId=new Map(e.elements.map(e=>[e.id,e])),this.targets=new Map(e.targets.map(e=>[e.id,e])),this.teams=m(e),this.views=c(e),this.viewIds=new Set(this.views.map(e=>e.id));for(let t of e.elements){let e=this.childrenOf.get(t.parent)??[];e.push(t),this.childrenOf.set(t.parent,e)}for(let e of this.childrenOf.values())e.sort(mD)}children(e){return this.childrenOf.get(e)??[]}ancestors(e){let t=[];for(let n=this.byId.get(e)?.parent??null;n!==null&&!t.includes(n);n=this.byId.get(n)?.parent??null)t.unshift(n);return t}title(e){return this.views.find(t=>t.id===e)?.title}description(e){return this.bundle.views.find(t=>t.id===e)?.description??null}name(e){return this.byId.get(e)?.name??[...this.bundle.teams,...this.bundle.environments].find(t=>t.id===e)?.name??e}wayIn(e){let t=n(this.bundle,e);return t!==void 0&&pD(t)===e&&this.viewIds.has(t)?t:void 0}deeper(e){if(e===`c1`)return this.viewIds.has(`c2`)?[{label:`C2 Landscape`,view:`c2`}]:[];let t=_(e);return(t?.form===`landscape`?this.children(null).filter(e=>e.kind===`system`):t?.form===`focused`&&t.level===`c2`?this.children(t.element):[]).flatMap(e=>{let t=this.wayIn(e.id);return t===void 0?[]:[{label:e.name,view:t}]})}deployedIn(e){return this.bundle.environments.map(e=>({environment:e.id,label:e.name,view:r({form:`deployment`,environment:e.id})})).map(t=>({...t,nodes:fD(this.bundle,t.view,{lens:`none`})?.nodes.filter(t=>t.kind===`deployment`&&t.element===e).map(e=>e.id)??[]})).filter(e=>e.nodes.length>0)}crumbs(e){let t=this.bundle.views.find(t=>t.id===e);if(t)return[{label:`Saved`},{label:this.bundle.projects.find(e=>e.id===t.project)?.name??t.project},{label:t.title,view:e}];let n=[{label:`C1`,view:`c1`}];if(e===`c1`)return n;let i=_(e);if(i?.form===`deployment`)return[...n,{label:this.title(e)??e,view:e}];n.push({label:`C2 Landscape`,view:`c2`});let a=i?.form===`focused`?this.byId.get(i.element):void 0;if(!a)return n;let o=[...this.ancestors(a.id),a.id].map(e=>this.byId.get(e)).find(e=>e.kind===`system`);return o&&n.push({label:o.name,view:r({form:`focused`,level:`c2`,element:o.id})}),i?.form===`focused`&&i.level===`c3`&&n.push({label:a.name,view:e}),n}modelByKind(){let e=this.children(null);return[[`People`,e.filter(e=>e.kind===`person`)],[`Systems`,e.filter(e=>e.kind===`system`&&!e.external)],[`External Systems`,e.filter(e=>e.kind===`system`&&e.external)],[`Services`,e.filter(e=>e.kind===`service`)]].filter(([,e])=>e.length>0).map(([e,t])=>({key:`kind:${e}`,label:e,children:t.map(e=>this.elementRow(e,()=>!0))}))}modelByTeam(){return[...this.bundle.teams].sort(mD).map(e=>{let t=this.bundle.elements.filter(t=>t.owner===e.id&&(t.parent===null||this.byId.get(t.parent)?.owner!==e.id)).sort(mD);return{key:`team:${e.id}`,label:e.name,team:this.teams.get(e.id),children:t.map(t=>this.elementRow(t,t=>t.owner===e.id))}}).filter(e=>e.children.length>0)}elementRow(e,t){return{key:e.id,label:e.name,element:e.id,glyph:hD[e.kind],team:this.teams.get(e.owner),children:this.children(e.id).filter(t).map(e=>this.elementRow(e,t))}}viewsByKind(){return[{key:`views:landscapes`,label:`Landscapes`,children:this.landscapeRows()},...this.systemViewGroup(`Systems`,()=>!0),{key:`views:deployment`,label:`Deployment`,children:this.deploymentRows()},{key:`views:dynamic`,label:`Dynamic Views`,children:this.dynamicRows(()=>!0)},{key:`views:saved`,label:`Saved Views`,children:this.savedByProject()}].filter(e=>e.children.length>0)}viewsByTeam(){let e=[...this.bundle.teams].sort(mD).flatMap(e=>{let[t]=this.systemViewGroup(e.name,t=>t===e.id,e.id);return[{...t,children:[...t.children,...this.dynamicRows(t=>t===e.id,e.id),...this.savedRows(t=>t===e.id,e.id)]}]});return[{key:`views:workspace`,label:`Workspace`,children:[...this.landscapeRows(),...this.deploymentRows()]},...e].filter(e=>e.children.length>0)}landscapeRows(){return this.views.filter(e=>_(e.id)?.form===`landscape`).map(e=>({key:e.id,label:e.title,view:e.id,children:[]}))}savedByProject(){return[...this.bundle.projects].sort(mD).map(e=>({key:`views:saved:${e.id}`,label:e.name,children:this.savedRows(()=>!0,void 0,e.id)})).filter(e=>e.children.length>0)}savedRows(e,t,n){let r=new Map(this.bundle.projects.map(e=>[e.id,e.owner]));return this.bundle.views.filter(t=>t.kind===`structural`&&(n===void 0||t.project===n)&&e(r.get(t.project)??``)).filter(e=>fD(this.bundle,e.id,{lens:`none`})!==void 0).sort((e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id)).map(e=>({key:e.id,label:e.title,view:e.id,glyph:`◇`,team:t?this.teams.get(t):void 0,children:[]}))}deploymentRows(){return this.views.filter(e=>_(e.id)?.form===`deployment`).map(e=>({key:e.id,label:e.title,view:e.id,glyph:`⛁`,children:[]}))}dynamicRows(e,t){let n=new Map(this.bundle.projects.map(e=>[e.id,e.owner]));return this.bundle.views.filter(t=>t.kind===`dynamic`&&e(n.get(t.project)??``)).sort((e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id)).map(e=>({key:e.id,label:e.title,view:e.id,glyph:`▶`,team:t?this.teams.get(t):void 0,children:[]}))}systemViewGroup(e,t,n){let r=e=>({key:e.id,label:e.title,view:e.id,team:n?this.teams.get(n):void 0,children:[]}),i=e=>this.views.filter(n=>{let r=_(n.id);return r?.form===`focused`&&r.level===e&&t(this.byId.get(r.element)?.owner??``)}),a=i(`c3`),o=new Set,s=i(`c2`).map(e=>{let t=a.filter(t=>this.ancestors(pD(t.id)).includes(pD(e.id)));for(let e of t)o.add(e.id);return{...r(e),children:t.map(r)}}),c=a.filter(e=>!o.has(e.id)).map(r),l=[...s,...c].sort((e,t)=>e.label.localeCompare(t.label));return[{key:`views:${e}`,label:e,team:n?this.teams.get(n):void 0,children:l}]}},_D={Model:`model`,Teams:`teams`,Views:`views`};function vD({workspace:e,view:t,selected:n,home:r,onPickElement:i,onPickView:a,onPickTeam:o,finding:s,onFind:c,onOpenPanel:l}){let[u,d]=(0,O.useState)(null),[f,p]=(0,O.useState)({Model:`kind`,Views:`kind`}),[m,h]=(0,O.useState)(s);s!==m&&(h(s),s&&d(null)),(0,O.useEffect)(()=>{if(!u)return;let e=e=>e.key===`Escape`&&d(null);return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let g=(0,O.useMemo)(()=>u===`Model`?f.Model===`kind`?e.modelByKind():e.modelByTeam():u===`Views`?f.Views===`kind`?e.viewsByKind():e.viewsByTeam():[],[u,f,e]),_=e=>u===`Views`?e.view===t:e.element!==void 0&&e.element===(n??pD(t));return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`nav`,{className:`arc-rail`,"aria-label":`Rail`,children:[(0,P.jsx)(`a`,{className:`arc-logo-link`,href:r,"aria-label":`Archidocs home`,title:`Archidocs home`,children:(0,P.jsxs)(`svg`,{className:`arc-logo`,viewBox:`0 0 64 64`,"aria-hidden":`true`,focusable:`false`,children:[(0,P.jsx)(`path`,{className:`arc-logo-tile`,d:`M17 4H47A13 13 0 0 1 60 17V47A13 13 0 0 1 47 60H42V38A10 10 0 0 0 22 38V60H17A13 13 0 0 1 4 47V17A13 13 0 0 1 17 4Z`}),(0,P.jsx)(`path`,{className:`arc-logo-key`,d:`M26.5 12.5H37.5L35.5 21H28.5Z`})]})}),(0,P.jsxs)(`button`,{type:`button`,className:`arc-rail-button`,title:`Find ( / )`,"aria-label":`Find`,"aria-keyshortcuts":`/`,"aria-pressed":s,onClick:()=>(d(null),c()),children:[(0,P.jsx)(L,{name:`find`}),(0,P.jsx)(`span`,{className:`arc-rail-label`,"aria-hidden":`true`,children:`Find`})]}),[`Model`,`Teams`,`Views`].map(e=>(0,P.jsxs)(`button`,{type:`button`,className:`arc-rail-button`,title:e,"aria-label":e,"aria-expanded":u===e,onClick:()=>{u!==e&&l(),d(u===e?null:e)},children:[(0,P.jsx)(L,{name:_D[e]}),(0,P.jsx)(`span`,{className:`arc-rail-label`,"aria-hidden":`true`,children:e})]},e))]}),u===`Teams`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`arc-scrim`,onClick:()=>d(null)}),(0,P.jsxs)(`section`,{className:`arc-flyout`,role:`dialog`,"aria-label":`Teams`,children:[(0,P.jsxs)(`header`,{className:`arc-flyout-head`,children:[(0,P.jsx)(`h2`,{children:`Teams`}),(0,P.jsx)(yD,{onClose:()=>d(null)})]}),(0,P.jsx)(`ul`,{className:`arc-team-list`,children:[...e.bundle.teams].sort((e,t)=>e.name.localeCompare(t.name)).map(t=>{let n=e.teams.get(t.id);return(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:`arc-row-label`,onClick:()=>{d(null),o(t.id)},children:[(0,P.jsx)(`span`,{className:`arc-row-team`,style:{"--team":n?.color},children:n?.code}),` `,t.name]})},t.id)})})]})]}),u&&u!==`Teams`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`arc-scrim`,onClick:()=>d(null)}),(0,P.jsxs)(`section`,{className:`arc-flyout`,role:`dialog`,"aria-label":u,children:[(0,P.jsxs)(`header`,{className:`arc-flyout-head`,children:[(0,P.jsx)(`h2`,{children:u}),(0,P.jsx)(yD,{onClose:()=>d(null)})]}),(0,P.jsx)(`div`,{className:`arc-flyout-by`,children:(0,P.jsx)(`div`,{className:`arc-segmented`,role:`radiogroup`,"aria-label":`Group`,children:[`kind`,`team`].map(e=>(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`input`,{type:`radio`,name:`group-${u}`,checked:f[u]===e,onChange:()=>p({...f,[u]:e})}),(0,P.jsx)(`span`,{children:e===`kind`?`By kind`:`By Team`})]},e))})}),(0,P.jsx)(bD,{label:u,rows:g,isCurrent:_,onPick:e=>{d(null),e.view===void 0?e.element!==void 0&&i(e.element):a(e.view)}},`${u}:${f[u]}`)]})]})]})}function yD({onClose:e}){return(0,P.jsx)(`button`,{type:`button`,className:`arc-flyout-close`,"aria-label":`Close`,onClick:e,children:(0,P.jsx)(L,{name:`close`})})}function bD({label:e,rows:t,isCurrent:n,onPick:r}){let[i,a]=(0,O.useState)(()=>new Set(SD(t,n))),o=e=>a(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),s=(e,t)=>{let a=e.children.length>0?i.has(e.key):void 0,c=e.view!==void 0||e.element!==void 0;return(0,P.jsxs)(`li`,{role:`treeitem`,"aria-level":t,"aria-expanded":a,"aria-label":e.label,"aria-selected":n(e),children:[(0,P.jsxs)(`div`,{className:n(e)?`arc-row arc-current`:`arc-row`,style:{paddingLeft:8+(t-1)*14},children:[e.children.length>0?(0,P.jsx)(`button`,{type:`button`,className:a?`arc-disclosure arc-open`:`arc-disclosure`,"aria-label":`${a?`Collapse`:`Expand`} ${e.label}`,onClick:()=>o(e.key)}):(0,P.jsx)(`span`,{className:`arc-disclosure-space`}),xD(e)&&(0,P.jsx)(`span`,{className:`arc-vtag arc-vtag-${xD(e).toLowerCase()}`,children:xD(e)}),(0,P.jsxs)(`button`,{type:`button`,className:c?`arc-row-label`:`arc-row-label arc-group`,"aria-current":n(e)?`page`:void 0,onClick:()=>c?r(e):o(e.key),children:[e.view===void 0&&e.glyph&&Ce[e.glyph]&&(0,P.jsx)(L,{name:Ce[e.glyph],className:`arc-row-icon`}),e.label]}),e.children.length>0&&(0,P.jsx)(`span`,{className:`arc-count`,children:e.children.length}),e.team&&(0,P.jsx)(`span`,{className:`arc-row-team`,style:{"--team":e.team.color},children:e.team.code})]}),a&&(0,P.jsx)(`ul`,{role:`group`,children:e.children.map(e=>s(e,t+1))})]},e.key)};return(0,P.jsx)(`ul`,{className:`arc-tree`,role:`tree`,"aria-label":e,children:t.map(e=>s(e,1))})}function xD(e){if(e.view===void 0)return;if(e.glyph===`▶`)return`Dyn`;if(e.glyph===`◇`)return`Saved`;let t=_(e.view);if(e.glyph===`⛁`||t?.form===`deployment`)return`Env`;if(t?.form===`landscape`||t?.form===`focused`)return t.level.toUpperCase()}function SD(e,t,n=[]){for(let r of e){if(t(r))return n;let e=SD(r.children,t,[...n,r.key]);if(e.length>0)return e}return[]}var CD=30;function wD({workspace:e,prompt:t,onPick:n,onClose:r}){let[i,a]=(0,O.useState)(``),o=(0,O.useRef)(null),s=(0,O.useMemo)(()=>i.trim()?sD(e.bundle,i,{fields:[`team`,`technology`]}).slice(0,CD):[],[e,i]);return(0,O.useEffect)(()=>o.current?.focus(),[]),(0,O.useEffect)(()=>{let e=e=>e.key===`Escape`&&r();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`arc-scrim`,onClick:r}),(0,P.jsxs)(`section`,{className:`arc-flyout arc-find`,role:`dialog`,"aria-label":`Find`,children:[(0,P.jsxs)(`header`,{className:`arc-flyout-head`,children:[(0,P.jsx)(`h2`,{children:`Find`}),t&&(0,P.jsx)(`p`,{className:`arc-muted`,children:t}),(0,P.jsx)(yD,{onClose:r})]}),(0,P.jsx)(`input`,{ref:o,type:`search`,className:`arc-find-input`,placeholder:`Name, id, Team, technology or URL`,"aria-label":`Find`,"aria-controls":`arc-find-results`,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s[0]&&n(s[0].element.id)}}),(0,P.jsxs)(`ul`,{className:`arc-results`,id:`arc-find-results`,role:`listbox`,"aria-label":`Results`,children:[s.map(({element:t,deployment:r})=>{let i=e.teams.get(t.owner);return(0,P.jsxs)(`li`,{role:`option`,"aria-selected":`false`,tabIndex:-1,onClick:()=>n(t.id),onKeyDown:e=>e.key===`Enter`&&n(t.id),children:[(0,P.jsxs)(`span`,{className:`arc-result-name`,children:[(0,P.jsx)(L,{name:Ce[hD[t.kind]],className:`arc-row-icon`}),t.name]}),(0,P.jsx)(`code`,{className:`arc-muted`,children:t.id}),i&&(0,P.jsx)(`span`,{className:`arc-row-team`,style:{"--team":i.color},children:i.code}),r&&(0,P.jsxs)(`span`,{className:`arc-result-url`,children:[e.name(r.environment),` · `,r.url]})]},t.id)}),!i.trim()&&(0,P.jsx)(`li`,{className:`arc-empty`,children:`Start typing to see matching elements.`}),i.trim()&&s.length===0&&(0,P.jsx)(`li`,{className:`arc-empty`,children:`No matches`})]})]})]})}function TD(e){let t=Vw(Iw(`./`),{recheckMs:0}),n=async()=>{let n=await t.latest();return u(n,aT(window.location.hash).view)!==void 0&&(e(n),!0)};return window.__archidocsSwap=n,()=>{window.__archidocsSwap===n&&delete window.__archidocsSwap}}var ED=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`view`;function DD({workspace:e,screen:t,title:n,onClose:r}){let i=(0,O.useMemo)(()=>[...e.bundle.projects].sort((e,t)=>e.name.localeCompare(t.name)),[e]),a=e.bundle.views.find(e=>e.id===t.view)?.project,[o,c]=(0,O.useState)(a??i[0]?.id??``),[l,u]=(0,O.useState)(n),[d,f]=(0,O.useState)(ED(n)),p=(0,O.useMemo)(()=>{if(o)try{return s(e.bundle,t,{project:o,id:d||`view`,title:l||`View`})}catch(e){return{problem:e instanceof Error?e.message:String(e)}}},[e,t,o,d,l]);return(0,O.useEffect)(()=>{let e=e=>e.key===`Escape`&&r();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`arc-scrim`,onClick:r}),(0,P.jsxs)(`section`,{className:`arc-dialog`,role:`dialog`,"aria-label":`Save as View`,children:[(0,P.jsxs)(`header`,{className:`arc-flyout-head`,children:[(0,P.jsx)(`h2`,{children:`Save as View`}),(0,P.jsx)(`button`,{type:`button`,className:`arc-chip-clear`,"aria-label":`Close`,onClick:r,children:(0,P.jsx)(`span`,{className:`arc-chip-x`,"aria-hidden":`true`})})]}),(0,P.jsxs)(`div`,{className:`arc-form`,children:[(0,P.jsxs)(`label`,{children:[`Project`,(0,P.jsx)(`select`,{value:o,onChange:e=>c(e.target.value),children:i.map(e=>(0,P.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,P.jsxs)(`label`,{children:[`Id`,(0,P.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),spellCheck:!1})]}),(0,P.jsxs)(`label`,{children:[`Title`,(0,P.jsx)(`input`,{value:l,onChange:e=>u(e.target.value)})]})]}),p&&`problem`in p&&(0,P.jsx)(`p`,{className:`arc-snippet`,role:`alert`,children:p.problem}),p&&!(`problem`in p)&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(OD,{label:`YAML`,hint:`Add to a file in ${e.name(o)}`,text:p.yaml}),(0,P.jsx)(OD,{label:`upsert_view call`,hint:`Or ask an agent to make this MCP call`,text:JSON.stringify(p.call,null,2)})]})]})]})}function OD({label:e,hint:t,text:n}){let[r,i]=(0,O.useState)(!1);return(0,P.jsxs)(`div`,{className:`arc-snippet`,children:[(0,P.jsxs)(`div`,{className:`arc-snippet-head`,children:[(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`strong`,{children:e}),` `,(0,P.jsx)(`span`,{className:`arc-muted`,children:t})]}),(0,P.jsx)(`button`,{type:`button`,className:`arc-tool`,"aria-label":`Copy ${e}`,onClick:()=>void navigator.clipboard.writeText(n).then(()=>i(!0)),children:r?`Copied`:`Copy`})]}),(0,P.jsx)(`pre`,{"aria-label":e,children:n})]})}function kD(){let[e,t]=(0,O.useState)({});return(0,O.useEffect)(()=>{let e=fetch(`./${Uw}`).then(e=>e.ok?e.json():{}).then(e=>e.workspace).catch(()=>void 0);Promise.all([VT.latest(),HT(),e]).then(([e,n,r])=>{AD(n),t({latest:e,timeline:n,name:r})}).catch(e=>t({error:e instanceof Error?e.message:String(e)}))},[]),(0,O.useEffect)(()=>TD(e=>t(t=>t.latest?{...t,latest:e}:t)),[]),e}function AD(e){let t=e.previewBase();t&&!nT(window.location.hash)&&_T({...rT,view:`c2`,vs:zT(t)},{replace:!0})}function jD(){let{latest:e,timeline:t,name:n,error:r}=kD();return r?(0,P.jsx)(LD,{title:`Couldn't load the Workspace`,children:r}):!e||!t?(0,P.jsx)(LD,{title:`Loading the Workspace…`}):(0,P.jsx)(MD,{latest:e,timeline:t,name:n})}function MD({latest:e,timeline:t,name:n}){let r=gT(),{state:i,loading:a}=JT(e,t,r.at,r.vs),o=i?.kind===`ready`?i.times:void 0,s=o?.current,c=(0,O.useMemo)(()=>s?new gD(s,n):void 0,[s,n]),l=(0,O.useMemo)(()=>{if(!o?.before)return;let{before:e,current:n,vs:r,at:i}=o;return{before:e,after:n,changes:ne(e,n),label:t.compareLabel(r,i)}},[o,t]),u=(0,O.useMemo)(()=>l?new gD(N(l.before,l.after),n):c,[l,c,n]);return i?.kind===`problem`?(0,P.jsx)(YT,{problem:i.problem,place:r}):!u||!c?(0,P.jsx)(LD,{title:`Loading the Revision…`}):(0,P.jsx)(PD,{workspace:u,plain:c,comparison:l,timeline:t,at:o?.at,loading:a})}var ND=new WeakMap;function PD({workspace:e,plain:t,comparison:r,timeline:i,at:a,loading:o}){let s=gT(),c=`${s.open.join(`,`)}|${s.closed.join(`,`)}`,l={expand:s.open,collapse:s.closed},d=(0,O.useMemo)(()=>r?de(r.before,r.after,s.view,{...l,lens:`none`}):fD(e.bundle,s.view,{...l,lens:`none`}),[e,r,s.view,c]),f=(0,O.useMemo)(()=>{let e=u(t.bundle,s.view);return e?.kind===`dynamic`?e:void 0},[t,s.view]),m=s.direction??d?.direction,{laidOut:h,error:g}=ST(d,m),_=(0,O.useMemo)(()=>{let t=(d?.nodes??[]).filter(t=>!t.collapsed&&ID(e,s.view,t.id)&&e.children(t.id).length>0).map(e=>e.id);return[...new Set([...s.open,...t])]},[d,e,s.view,s.open]);d&&ND.set(d,`${s.view}|${c}|${s.at??``}|${s.vs??``}`);let v=h&&`${ND.get(h.view)??``}|${h.layout.direction}`,[y,b]=(0,O.useState)(),x=!o&&h!==void 0&&y===h&&h.view===d&&h.layout.direction===m,S=e.title(s.view),C=s.lens?JSON.stringify(s.lens):``,w=(0,O.useMemo)(()=>s.lens?fD(e.bundle,s.view,{...l,lens:s.lens}):void 0,[e,s.view,c,C]),[T,E]=(0,O.useState)(!1),[D,k]=(0,O.useState)(null);(0,O.useEffect)(()=>{document.title=S?`${S} · Archidocs`:`Archidocs`,S&&LT(s,S)},[uT(s),S]);let A=(0,O.useCallback)(t=>{let n=t&&`path`in t?fD(e.bundle,s.view,{expand:s.open,collapse:s.closed,lens:t})?.nodes.filter(e=>e.mark?.hit).map(e=>e.id)??[]:s.picks;_T({...s,lens:t,picks:n})},[s,e]),j=(0,O.useCallback)(e=>{let t=D;k(null),e!==t&&A({path:{from:t,to:e,paths:`shortest`}})},[D,A]),M=(0,O.useCallback)(e=>{if(D!==null&&e!==null)return j(e);_T({...s,selected:e},{replace:!0})},[s,D,j]),ee=(0,O.useCallback)(e=>_T({...s,picks:s.picks.includes(e)?s.picks.filter(t=>t!==e):[...s.picks,e]},{replace:!0}),[s]);(0,O.useEffect)(()=>{let e=e=>{let t=e.target instanceof HTMLElement&&(e.target.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(e.target.tagName));e.key===`/`&&!t&&!e.metaKey&&!e.ctrlKey&&!e.altKey?(e.preventDefault(),E(!0)):e.key===`Escape`&&!T&&(D===null?s.adr!==null&&_T({...s,adr:null},{replace:!0}):k(null))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[T,D,s]);let N=(0,O.useCallback)(e=>_T({...s,adr:e},{replace:!0}),[s]),te=(0,O.useCallback)(t=>{let n=n=>t.some(t=>n===t||e.ancestors(n).includes(t)),r=s.selected!==null&&e.ancestors(s.selected).some(e=>t.includes(e)),i=t.filter(t=>ID(e,s.view,t)&&!s.closed.includes(t));_T({...s,open:s.open.filter(e=>!n(e)),closed:[...s.closed,...i],selected:r?null:s.selected})},[s,e]),ne=(0,O.useCallback)((t,n)=>{if(n)return _T(ID(e,s.view,t)?{...s,closed:s.closed.filter(e=>e!==t)}:{...s,open:[...s.open,t]});te([t])},[s,e,te]),re=(0,O.useCallback)(t=>{let r=d?.nodes.find(e=>e.id===t)?.element??t;if(s.view===`c1`&&e.byId.get(r)?.kind===`system`)return _T(fT(`c2`,r,s.lens,s));let i=n(e.bundle,r);i!==void 0&&i!==s.view&&_T(fT(i,null,s.lens,s))},[s,e,d]),ie=(0,O.useCallback)(t=>{let r=FD(e,s,t);if(r)return _T({...s,...r,selected:t,adr:null},{replace:r.open.length===s.open.length&&r.closed.length===s.closed.length});let i=e.byId.get(t);_T(fT((i?.kind===`component`?n(e.bundle,i.parent):i?.kind===`person`?`c1`:n(e.bundle,t))??`c2`,t,s.lens,s))},[s,e]),ae=(0,O.useCallback)(e=>_T({...s,direction:e===d?.direction?null:e}),[s,d]),oe=(0,O.useCallback)(t=>_T(fT(t,null,fD(e.bundle,t,{lens:`own`})?.lens??s.lens,s)),[e,s]),[se,ce]=(0,O.useState)(!1),le=(0,O.useCallback)((t,n)=>{let r=w??d;r&&kT(e,t===`picks`?p(r,s.picks):r,m,n).then(e=>NT(e,MT(s.view,n,t===`picks`)))},[e,w,d,s.picks,s.view,m]),ue=(0,O.useCallback)((t,n)=>{let r=[n.relationship.from,n.relationship.to],i={open:[],closed:[]};for(let n of r)i=FD(e,{...fT(t),...i},n)??i;let a=new Set(fD(e.bundle,t,{expand:i.open,collapse:i.closed,lens:`none`})?.nodes.map(e=>e.id)??[]),o=[r[0],...e.ancestors(r[0]).reverse()].find(e=>a.has(e))??null;_T({...fT(t,null,null,s),...i,selected:o})},[e,s]),fe=(0,P.jsx)(vD,{workspace:e,view:s.view,selected:s.selected,home:uT({...rT,at:s.at,vs:s.vs}),onPickElement:ie,onPickView:oe,onPickTeam:e=>A({team:e}),finding:T,onFind:()=>E(!0),onOpenPanel:()=>E(!1)}),pe=s.selected===null?void 0:d?.nodes.find(e=>e.id===s.selected)?.element??s.selected,me=zD(pe!==void 0&&e.byId.has(pe)?pe:void 0);return f?(0,P.jsxs)(`div`,{className:`arc-app`,children:[fe,T&&(0,P.jsx)(wD,{workspace:e,onClose:()=>E(!1),onPick:e=>{E(!1),ie(e)}}),(0,P.jsx)(`main`,{className:`arc-main arc-main-dynamic`,children:(0,P.jsx)(BE,{workspace:t,view:f,place:s,keys:!T,onOpenStepView:ue,onOpenView:e=>_T(fT(e,null,null,s))})})]}):d?(0,P.jsxs)(`div`,{className:`arc-app`,children:[fe,T&&(0,P.jsx)(wD,{workspace:e,prompt:D===null?void 0:`Pick the node to connect ${e.name(D)} to`,onClose:()=>E(!1),onPick:e=>{E(!1),D===null?ie(e):j(e)}}),(0,P.jsxs)(`main`,{className:a?`arc-main arc-has-time`:`arc-main`,children:[(0,P.jsx)(iE,{workspace:e,place:s,direction:s.direction??d.direction,compare:r?.label,timeline:i,onCollapse:te,onDirection:ae,onLens:A,onPicks:e=>_T({...s,picks:e},{replace:!0}),onExport:le,onSaveAsView:()=>ce(!0),onTime:e=>_T({...s,...e})}),se&&(0,P.jsx)(DD,{workspace:e,screen:{view:s.view,open:s.open,closed:s.closed,lens:s.lens,picks:s.picks,direction:s.direction},title:S??d.title,onClose:()=>ce(!1)}),a&&(0,P.jsx)(XT,{revision:a,place:s}),D!==null&&(0,P.jsxs)(`p`,{className:`arc-banner`,role:`status`,children:[`Pick the node to connect `,e.name(D),` to: click it, or press / to find it. Escape cancels.`]}),(0,P.jsxs)(`div`,{className:`arc-stage`,children:[r&&(0,P.jsx)(tE,{changes:r.changes,label:r.label,onElement:ie,onView:e=>_T(fT(e,null,s.lens,s))}),(0,P.jsxs)(`div`,{className:`arc-canvas`,"data-canvas":!0,"data-state":x?`ready`:`busy`,children:[g&&(0,P.jsxs)(`p`,{className:`arc-error`,children:[`Layout failed: `,g]}),h&&(0,P.jsx)(mm,{workspace:e,laidOut:h,selected:s.selected,open:_,fitKey:v,lensed:w,picks:s.picks,ring:s.lens!==null&&`team`in s.lens,onSelect:M,onPick:ee,onToggle:ne,onOpenView:re,onSettled:b}),me!==void 0&&(0,P.jsx)($E,{workspace:e,id:me,timeline:i,comparison:r,onLens:A,onConnect:k,onFocus:ie,onOpenView:re,onOpenAdr:N,onTime:e=>_T({...s,...e}),onDeployed:(e,t)=>_T({...fT(e,null,null,s),picks:t}),onClose:()=>M(null)}),s.adr!==null&&(0,P.jsx)(Ee,{workspace:e,id:s.adr,beside:me!==void 0,onClose:()=>N(null),onOpenAdr:N,onFocus:ie,onOpenView:e=>_T(fT(e,null,s.lens,s))})]})]})]})]}):(0,P.jsx)(LD,{title:`No View ${s.view}`,children:(0,P.jsx)(`a`,{href:uT({...rT,at:s.at,vs:s.vs}),children:`Open the C1 Landscape`})})}function FD(e,t,n){let r=[...t.open],i=[...t.closed];for(let a of[...e.ancestors(n),n]){let o=fD(e.bundle,t.view,{expand:r,collapse:i,lens:`none`})?.nodes??[];if(o.some(e=>e.id===n))return{open:r,closed:i};a!==n&&o.some(e=>e.id===a)&&(i.includes(a)?i=i.filter(e=>e!==a):r.includes(a)||r.push(a))}}var ID=(e,t,n)=>t===`c2`&&e.byId.get(n)?.kind===`system`;function LD({title:e,children:t}){return(0,P.jsxs)(`div`,{className:`arc-message`,children:[(0,P.jsx)(`h1`,{children:e}),t&&(0,P.jsx)(`p`,{children:t})]})}var RD=250;function zD(e){let[t,n]=(0,O.useState)(e),[r,i]=(0,O.useState)(e);return e!==r&&(i(e),(e===void 0||r!==void 0)&&n(e)),(0,O.useEffect)(()=>{if(e===void 0||t===e)return;let r=window.setTimeout(()=>n(e),RD);return()=>window.clearTimeout(r)},[e,t]),t===e?e:void 0}var BD=class extends O.Component{state={};static getDerivedStateFromError(e){return{error:e}}render(){let{error:e}=this.state;return e?(0,P.jsxs)(`div`,{className:`arc-message`,role:`alert`,children:[(0,P.jsx)(`h1`,{children:`Something went wrong`}),(0,P.jsx)(`pre`,{className:`arc-crash`,children:`${e.stack??e.message}\n\n${navigator.userAgent}`})]}):this.props.children}};(0,k.createRoot)(document.getElementById(`root`)).render((0,P.jsx)(O.StrictMode,{children:(0,P.jsx)(BD,{children:(0,P.jsx)(jD,{})})}));export{Fm as n,Pm as r,jm as t};
75
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Yb(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Yb(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Xb=new Set([`type`,`properties`,`required`,`additionalProperties`]),Zb=[`oneOf`,`anyOf`];function Qb(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function $b(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Xb.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Qb(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}th(n,r,e.length===1?e[0]:$b(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Qb(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function ex(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Xb)if(t in e)return;let n=t.filter(e=>Zb.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=$b(t);else{let e=n[0],i=Zb.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>$b([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ub(e,r))}function tx(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ub(i,s),Ub(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Yb(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])ex(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ub(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,th(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ix(t,`input`,e.processors),output:ix(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function nx(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return nx(r.element,n);if(r.type===`set`)return nx(r.valueType,n);if(r.type===`lazy`)return nx(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return nx(r.innerType,n);if(r.type===`intersection`)return nx(r.left,n)||nx(r.right,n);if(r.type===`record`||r.type===`map`)return nx(r.keyType,n)||nx(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:nx(r.in,n)||nx(r.out,n);if(r.type===`object`){for(let e in r.shape)if(nx(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(nx(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(nx(e,n))return!0;return!!(r.rest&&nx(r.rest,n))}return!1}var rx=(e,t={})=>n=>{let r=Wb({...n,processors:t});return Kb(e,r),Jb(r,e),tx(r,e)},ix=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Wb({...i??{},target:a,io:t,processors:n});return Kb(e,o),Jb(o,e),tx(o,e)},ax=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ox=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},sx=(e,t)=>{ax(e,`minimum`,t),ox(e,`maximum`,t)},cx=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},lx=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},ux=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},dx=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},fx=(e,t)=>ax(e,`minimum`,t.minimum),px=(e,t)=>ox(e,`maximum`,t.maximum),mx=e=>(t,n)=>{dx(t,n.format);let[r,i]=e[n.format];ax(t,`minimum`,r),ox(t,`maximum`,i)},hx={greater_than:(e,t)=>ax(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>ox(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>cx(e,t.value),number_format:mx(xh),bigint_format:mx(Sh),min_length:fx,max_length:px,length_equals:(e,t)=>sx(e,t.length),min_size:fx,max_size:px,size_equals:(e,t)=>sx(e,t.size),string_format:(e,t)=>{dx(e,t.format),t.pattern&&lx(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>ux(e,t.mime)};function gx(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)hx[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&ax(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&ax(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&ox(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&ox(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&cx(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ux(t,i.mime);for(let e of i.patterns??[])lx(t,e);return t}var _x={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},vx=new Map([[bv,n_],[Sv,r_]]),yx=e=>vx.get(e)??e,bx=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=gx(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=_x[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(yx);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},xx=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=gx(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Gb(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Sx=(e,t,n,r)=>{n.type=`boolean`},Cx=(e,t,n,r)=>{n.not={}},wx=(e,t,n,r)=>{let i=e._zod.def,a=qm(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Tx=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Gb(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Gb(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Ex=(e,t,n,r)=>{Gb(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Dx=(e,t,n,r)=>{Gb(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ox=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=gx(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Kb(a.element,t,{...r,path:[...r.path,`items`]})};function kx(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?kx(t.out):t.type===`catch`?kx(t.innerType):e._zod.optin}var Ax=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Gb(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)th(i.properties,e,Kb(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?kx(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Kb(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},jx=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Kb(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Mx=(e,t,n,r)=>{let i=e._zod.def,a=Kb(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Kb(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Nx(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Nx(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Nx(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?m_:p_).source)),p}var Px=new WeakMap;function Fx(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Px.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Nx(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Ix=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=gx(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Kb(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)th(i.patternProperties,yx(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Kb(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Px.get(t);n||(n=[],Px.set(t,n),t.deferred.push(()=>Fx(t))),n.push(e)}i.additionalProperties=Kb(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&kx(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Lx=(e,t,n,r)=>{let i=e._zod.def,a=Kb(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Rx=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zx=Symbol();function Bx(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Gb(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),zx):JSON.parse(o)}var Vx=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Bx(i.defaultValue,e,t,n,r);o!==zx&&(n.default=o)},Hx=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Bx(i.defaultValue,e,t,n,r);o!==zx&&(n._prefault=o)},Ux=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Gb(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Wx=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Kb(o,t,r);let s=t.seen.get(e);s.ref=o},Gx=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Kx=(e,t,n,r)=>{let i=e._zod.def;Kb(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qx=new WeakSet([Object.prototype,Error.prototype]);function Jx(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Yx=Z(`ZodError`,(e,t)=>{gg.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);qx.has(n)||(qx.add(n),Jx(n,`format`,e=>t=>yg(e,t)),Jx(n,`flatten`,e=>t=>vg(e,t)),Jx(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ym,2)}),Jx(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ym,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Xx=xg(Yx),Zx=Sg(Yx),Qx=Cg(Yx),$x=Tg(Yx),eS=jg(Yx),tS=Mg(Yx),nS=Ng(Yx),rS=Pg(Yx),iS=Fg(Yx),aS=Ig(Yx),oS=Lg(Yx),sS=Rg(Yx);function cS(){lg.localeError||ug(Fy())}function lS(){lg.memoizer||ug({memoizer:My()})}var uS=Z(`ZodType`,(e,t)=>(cS(),R_.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ch(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return vh(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(jC(e,t))},superRefine(e,t){return this.check(MC(e,t))},overwrite(e){return this.check(Nb(e))},optional(){return pC(this)},exactOptional(){return hC(this)},nullable(){return _C(this)},nullish(){return pC(_C(this))},nonoptional(e){return CC(this,e)},array(){return $(this)},or(e){return $S([this,e])},and(e){return rC(this,e)},transform(e){return DC(this,dC(e))},default(e){return yC(this,e)},prefault(e){return xC(this,e)},catch(e){return TC(this,e)},pipe(e){return DC(this,e)},readonly(){return kC(this)},describe(e){let t=this.clone();return zy.add(t,{description:e}),t},meta(...e){if(e.length===0)return zy.get(this);let t=this.clone();return zy.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Kh(this,`~standard`,{...V_(this),jsonSchema:{input:ix(this,`input`),output:ix(this,`output`)}})},set"~standard"(e){Gh(this,`~standard`,e)},parse:function e(t,n){return Xx(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Zx(this,t,n,{callee:e})},safeParse(e,t){return Qx(this,e,t)},async safeParseAsync(e,t){return $x(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Gh(this,`spa`,e)},validate(e,t){return Og(this,e,t)},validateAsync(e,t){return Ag(this,e,t)},encode:function e(t,n){return eS(this,t,n,{callee:e})},decode:function e(t,n){return tS(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await nS(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await rS(this,t,n,{callee:e})},safeEncode(e,t){return iS(this,e,t)},safeDecode(e,t){return aS(this,e,t)},async safeEncodeAsync(e,t){return oS(this,e,t)},async safeDecodeAsync(e,t){return sS(this,e,t)},toJSONSchema(e){return rx(this,{})(e)},get description(){return zy.get(this)?.description},get _def(){return this._zod.def}}),dS=Z(`_ZodString`,(e,t)=>{H_.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bx(e,t,n,r)},qh({format:e=>gx(e).format??null,minLength:e=>gx(e).minimum??null,maxLength:e=>gx(e).maximum??null},{regex(...e){return this.check(Db(...e))},includes(...e){return this.check(Ab(...e))},startsWith(...e){return this.check(jb(...e))},endsWith(...e){return this.check(Mb(...e))},min(...e){return this.check(Tb(...e))},max(...e){return this.check(wb(...e))},length(...e){return this.check(Eb(...e))},nonempty(...e){return this.check(Tb(1,...e))},lowercase(e){return this.check(Ob(e))},uppercase(e){return this.check(kb(e))},trim(){return this.check(Fb())},normalize(...e){return this.check(Pb(...e))},toLowerCase(){return this.check(Ib())},toUpperCase(){return this.check(Lb())},slugify(){return this.check(Rb())}})),fS=Z(`ZodString`,(e,t)=>{H_.init(e,t),dS.init(e,t)},{email(e){return this.check(Hy(vS,e))},url(e){return this.check(Jy(xS,e))},jwt(e){return this.check(lb(LS,e))},emoji(e){return this.check(Yy(CS,e))},guid(e){return this.check(Uy(yS,e))},uuid(e){return this.check(Wy(bS,e))},uuidv4(e){return this.check(Gy(bS,e))},uuidv6(e){return this.check(Ky(bS,e))},uuidv7(e){return this.check(qy(bS,e))},nanoid(e){return this.check(Xy(wS,e))},cuid(e){return this.check(Zy(TS,e))},cuid2(e){return this.check(Qy(ES,e))},ulid(e){return this.check($y(DS,e))},base64(e){return this.check(ob(PS,e))},base64url(e){return this.check(sb(FS,e))},xid(e){return this.check(eb(OS,e))},ksuid(e){return this.check(tb(kS,e))},ipv4(e){return this.check(nb(AS,e))},ipv6(e){return this.check(rb(jS,e))},cidrv4(e){return this.check(ib(MS,e))},cidrv6(e){return this.check(ab(NS,e))},e164(e){return this.check(cb(IS,e))},datetime(e){return this.check(ub(mS,e))},date(e){return this.check(db(hS,e))},time(e){return this.check(fb(gS,e))},duration(e){return this.check(pb(_S,e))}});function Q(e){return Vy(fS,e)}var pS=Z(`ZodStringFormat`,(e,t)=>{U_.init(e,t),dS.init(e,t)}),mS=Z(`ZodISODateTime`,(e,t)=>{cv.init(e,t),pS.init(e,t)}),hS=Z(`ZodISODate`,(e,t)=>{lv.init(e,t),pS.init(e,t)}),gS=Z(`ZodISOTime`,(e,t)=>{uv.init(e,t),pS.init(e,t)}),_S=Z(`ZodISODuration`,(e,t)=>{dv.init(e,t),pS.init(e,t)}),vS=Z(`ZodEmail`,(e,t)=>{K_.init(e,t),pS.init(e,t)}),yS=Z(`ZodGUID`,(e,t)=>{W_.init(e,t),pS.init(e,t)}),bS=Z(`ZodUUID`,(e,t)=>{G_.init(e,t),pS.init(e,t)}),xS=Z(`ZodURL`,(e,t)=>{ev.init(e,t),pS.init(e,t)});function SS(e){return Jy(xS,e)}var CS=Z(`ZodEmoji`,(e,t)=>{tv.init(e,t),pS.init(e,t)}),wS=Z(`ZodNanoID`,(e,t)=>{nv.init(e,t),pS.init(e,t)}),TS=Z(`ZodCUID`,(e,t)=>{rv.init(e,t),pS.init(e,t)}),ES=Z(`ZodCUID2`,(e,t)=>{iv.init(e,t),pS.init(e,t)}),DS=Z(`ZodULID`,(e,t)=>{av.init(e,t),pS.init(e,t)}),OS=Z(`ZodXID`,(e,t)=>{ov.init(e,t),pS.init(e,t)}),kS=Z(`ZodKSUID`,(e,t)=>{sv.init(e,t),pS.init(e,t)}),AS=Z(`ZodIPv4`,(e,t)=>{fv.init(e,t),pS.init(e,t)}),jS=Z(`ZodIPv6`,(e,t)=>{hv.init(e,t),pS.init(e,t)}),MS=Z(`ZodCIDRv4`,(e,t)=>{gv.init(e,t),pS.init(e,t)}),NS=Z(`ZodCIDRv6`,(e,t)=>{vv.init(e,t),pS.init(e,t)}),PS=Z(`ZodBase64`,(e,t)=>{xv.init(e,t),pS.init(e,t)}),FS=Z(`ZodBase64URL`,(e,t)=>{wv.init(e,t),pS.init(e,t)}),IS=Z(`ZodE164`,(e,t)=>{Tv.init(e,t),pS.init(e,t)}),LS=Z(`ZodJWT`,(e,t)=>{Dv.init(e,t),pS.init(e,t)}),RS=Z(`ZodNumber`,(e,t)=>{Ov.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xx(e,t,n,r),e.isFinite=!0},qh({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=gx(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=gx(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=gx(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>gx(e).format??null},{gt(e,t){return this.check(xb(e,t))},gte(e,t){return this.check(Sb(e,t))},min(e,t){return this.check(Sb(e,t))},lt(e,t){return this.check(yb(e,t))},lte(e,t){return this.check(bb(e,t))},max(e,t){return this.check(bb(e,t))},int(e){return this.check(VS(e))},safe(e){return this.check(VS(e))},positive(e){return this.check(xb(0,e))},nonnegative(e){return this.check(Sb(0,e))},negative(e){return this.check(yb(0,e))},nonpositive(e){return this.check(bb(0,e))},multipleOf(e,t){return this.check(Cb(e,t))},step(e,t){return this.check(Cb(e,t))},finite(){return this}}));function zS(e){return mb(RS,e)}var BS=Z(`ZodNumberFormat`,(e,t)=>{kv.init(e,t),RS.init(e,t)});function VS(e){return hb(BS,e)}var HS=Z(`ZodBoolean`,(e,t)=>{Av.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sx(e,t,n,r)});function US(e){return gb(HS,e)}var WS=Z(`ZodUnknown`,(e,t)=>{jv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function GS(){return _b(WS)}var KS=Z(`ZodNever`,(e,t)=>{Mv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cx(e,t,n,r)});function qS(e){return vb(KS,e)}var JS=Z(`ZodArray`,(e,t)=>{lS(),Iv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ox(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Tb(e,t))},nonempty(e){return this.check(Tb(1,e))},max(e,t){return this.check(wb(e,t))},length(e,t){return this.check(Eb(e,t))},unwrap(){return this.element}});function $(e,t){return zb(JS,e,t)}var YS=Z(`ZodObject`,(e,t)=>{lS(),Hv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ax(e,t,n,r),eg(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return sC(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ch(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ch(this._zod.def,{catchall:GS()}))},loose(){return this.clone(ch(this._zod.def,{catchall:GS()}))},strict(){return this.clone(ch(this._zod.def,{catchall:qS()}))},strip(){return this.clone(ch(this._zod.def,{catchall:void 0}))},extend(e){return Eh(this,e)},safeExtend(e){return Oh(this,e)},merge(e){return kh(this,e)},pick(e){return Ch(this,e)},omit(e){return Th(this,e)},partial(...e){return Ah(fC,this,e[0])},exactPartial(...e){return Ah(mC,this,e[0],`exactPartial`)},required(...e){return jh(SC,this,e[0])}});function XS(e,t){return new YS({type:`object`,shape:e??{},...X(t)})}function ZS(e,t){return new YS({type:`object`,shape:e,catchall:qS(),...X(t)})}var QS=Z(`ZodUnion`,(e,t)=>{Wv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jx(e,t,n,r),e.options=t.options});function $S(e,t){return new QS({type:`union`,options:e,...X(t)})}var eC=Z(`ZodDiscriminatedUnion`,(e,t)=>{QS.init(e,t),Kv.init(e,t)});function tC(e,t,n){return new eC({type:`union`,options:t,discriminator:e,...X(n)})}var nC=Z(`ZodIntersection`,(e,t)=>{qv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mx(e,t,n,r)});function rC(e,t){return new nC({type:`intersection`,left:e,right:t})}var iC=Z(`ZodRecord`,(e,t)=>{lS(),Xv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ix(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function aC(e,t,n){return!t||!t._zod?new iC({type:`record`,keyType:Q(),valueType:e,...X(t)}):new iC({type:`record`,keyType:e,valueType:t,...X(n)})}var oC=Z(`ZodEnum`,(e,t)=>{Zv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wx(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new oC({...t,checks:[],...X(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new oC({...t,checks:[],...X(r),entries:i})}});function sC(e,t){return new oC({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...X(t)})}var cC=Z(`ZodLiteral`,(e,t)=>{Qv.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tx(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function lC(e,t){return new cC({type:`literal`,values:Array.isArray(e)?e:[e],...X(t)})}var uC=Z(`ZodTransform`,(e,t)=>{lS(),$v.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dx(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new cg(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Uh(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Uh(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function dC(e){return new uC({type:`transform`,transform:e})}var fC=Z(`ZodOptional`,(e,t)=>{ty.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pC(e){return new fC({type:`optional`,innerType:e})}var mC=Z(`ZodExactOptional`,(e,t)=>{ny.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hC(e){return new mC({type:`optional`,innerType:e})}var gC=Z(`ZodNullable`,(e,t)=>{ry.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _C(e){return new gC({type:`nullable`,innerType:e})}var vC=Z(`ZodDefault`,(e,t)=>{iy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yC(e,t){return new vC({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():hh(t)}})}var bC=Z(`ZodPrefault`,(e,t)=>{oy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xC(e,t){return new bC({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():hh(t)}})}var SC=Z(`ZodNonOptional`,(e,t)=>{sy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function CC(e,t){return new SC({type:`nonoptional`,innerType:e,...X(t)})}var wC=Z(`ZodCatch`,(e,t)=>{uy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ux(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function TC(e,t){return new wC({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ng(t)})}var EC=Z(`ZodPipe`,(e,t)=>{dy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wx(e,t,n,r),e.in=t.in,e.out=t.out});function DC(e,t){return new EC({type:`pipe`,in:e,out:t})}var OC=Z(`ZodReadonly`,(e,t)=>{py.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kC(e){return new OC({type:`readonly`,innerType:e})}var AC=Z(`ZodCustom`,(e,t)=>{hy.init(e,t),uS.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ex(e,t,n,r)});function jC(e,t={}){return Bb(AC,e,t)}function MC(e,t){return Vb(e,t)}function NC(e){return db(hS,e)}var PC=Q().regex(/^[a-z0-9][a-z0-9-]*$/,`must be a lowercase slug (a-z, 0-9 and -)`),FC=ZS({label:Q().describe("The text of the link, such as `Runbook`."),url:SS().describe("The page the link opens. A full URL, such as `https://wiki.example.com/runbooks/web`.")}).meta({id:`Link`,title:`Link`,description:`A link to a page about the thing it is declared on, such as a runbook or a dashboard.`}),IC=ZS({name:Q().describe(`The Team's display name.`),description:Q().optional().describe(`A short description of the Team.`),links:$(FC).optional().describe(`Links to pages about the Team.`)}).describe(`A Team: a group that can own Elements and Deployment Targets. Its key is the Team's id.`),LC=ZS({name:Q().describe("The Environment's display name, such as `Production`."),description:Q().optional().describe(`A short description of the Environment.`)}).describe(`An Environment: a named stage that Services run in, such as prod or staging. Its key is the Environment's id.`);ZS({teams:aC(PC,IC).optional().describe("The Teams of the Workspace, keyed by id. Every `owner` in every Project names one of these ids."),environments:aC(PC,LC).optional().describe(`The Environments of the Workspace, keyed by id. Every Deployment in every Project names one of these ids.`)}).describe("`workspace.yaml`: the Teams and Environments that every Project in the Workspace shares."),ZS({id:PC.describe("The Project's id, unique in the Workspace. Other Projects write it as the prefix of a Qualified id, such as `payments:ledger`."),name:Q().describe(`The Project's display name.`),owner:PC.describe("The Team that owns the Project: the id of a Team in `workspace.yaml`. It is the Owner of every Element and Deployment Target in the Project that sets no `owner` of its own.")}).describe("`project.yaml`: marks its folder as a Project.");var RC=Q().regex(/^([a-z0-9][a-z0-9-]*:)?[a-z0-9][a-z0-9-]*$/,"must be an id, or `project:id` for one in another Project").describe("An id in this Project, or `project:id` for one in another Project."),zC=ZS({to:RC.describe("The provider: the Element this one depends on. An id in this Project, or `project:id` for an Element in another Project. It can't be a Person, this Element itself, or an ancestor or descendant of this Element."),id:PC.optional().describe(`An id for the Relationship, unique among the Project's Relationships. Needed only when several Relationships connect the same two Elements, so that a Dynamic View Step can name one.`),description:Q().optional().describe("What the consumer uses the provider for, as a verb phrase that reads from consumer to provider, such as `Reads prices from`."),technology:Q().optional().describe("How the consumer reaches the provider: a protocol, a driver or a format, such as `JSON/HTTPS`, `gRPC` or `SQL`."),interaction:sC([`sync`,`async`]).optional().describe("`sync`: a call that waits for an answer. `async`: an event or message that gets no reply, such as an event through a broker or a webhook. Default: `sync`."),via:RC.optional().describe("For an `async` Relationship only: the broker the events travel through. A Service with `type: broker`, as an id in this Project or `project:id`. Leave it out when there is no broker, as with a webhook."),channel:Q().optional().describe("For an `async` Relationship only: the topic or queue the events travel on, such as `orders.placed`."),tags:$(Q()).optional().describe(`Free-form labels for the Relationship.`)}).meta({id:`Relationship`,title:`Relationship`,description:"A Relationship: a dependency of the Element it is declared under (the consumer) on the Element `to` names (the provider). Declare it once, under the consumer."}),BC=aC(Q().min(1),$S([Q(),zS(),US()])).describe("Free-form facts about the Element that the Model has no field for, such as `tier: 1` or `on-call: payments-oncall`. Keys are labels, shown as written; values are strings, numbers or booleans. Nothing in the Model reads them: they are shown in the viewer and returned by the MCP server."),VC=SS().describe(`The full URL of the source code repository the Element is built from. Shown as a link in the viewer.`),HC={name:Q().describe(`The Element's display name.`),description:Q().optional().describe(`What the Element is or does, in a sentence or two.`),owner:PC.optional().describe("The Team that owns the Element: the id of a Team in `workspace.yaml`. Set it only when it differs from the Project's; nothing is inherited from the parent Element. Default: the Project's `owner`."),tags:$(Q()).optional().describe("Free-form labels. A Saved View's `{tag}` selector picks Elements by them."),links:$(FC).optional().describe(`Links to pages about the Element, such as a runbook or a dashboard.`),metadata:BC.optional(),relationships:$(zC).optional().describe(`The Relationships this Element is the consumer of: what it depends on. A Relationship is never declared under its provider.`)},UC=ZS({...HC}).meta({id:`Person`,title:`Person`,description:`A Person: a human or role that uses a System, such as a shopper or a support agent. A Person is only ever the consumer in a Relationship.`}),WC=ZS({...HC,technology:Q().optional().describe("What the Component is built with, such as `TypeScript module`. Shown under its name."),repository:VC.optional(),in:PC.optional().describe("The Service this Component belongs to, as an id in this Project. Required for a Component under the top-level `components` key, and not allowed for one nested under a Service's `components`.")}).meta({id:`Component`,title:`Component`,description:`A Component: a part inside a Service that is not deployed on its own.`}),GC=ZS({...HC,type:sC([`app`,`datastore`,`broker`]).optional().describe("What the Service is; each type is drawn differently. `app`: an application, the usual case. `datastore`: a database or other store. `broker`: a message broker that async Relationships run through, named by their `via`. Default: `app`."),technology:Q().optional().describe("What the Service is built with, such as `Go` or `PostgreSQL`. Shown under its name."),repository:VC.optional(),external:US().optional().describe("`true` for a Service run outside the organization, such as a payment provider's API. An External Service can't declare Components. Default: `false`."),in:PC.optional().describe("The System this Service belongs to, as an id in this Project. Only for a Service under the top-level `services` key, and not allowed for one nested under a System's `services`. Without it, a top-level Service stands outside any System."),components:aC(PC,WC).optional().describe(`The Components inside the Service, keyed by id.`)}).meta({id:`Service`,title:`Service`,description:`A Service: a deployable, addressable unit of software; the thing that has a URL and a Deployment.`}),KC=ZS({...HC,external:US().optional().describe("`true` for a System run outside the organization, such as a payment provider. Nothing inside an External System can declare Components. Default: `false`."),repository:VC.optional(),services:aC(PC,GC).optional().describe(`The Services in the System, keyed by id.`)}).meta({id:`System`,title:`System`,description:`A System: a named grouping of Services that together deliver a business capability. Systems do not nest.`}),qC={name:Q().describe(`The Deployment Target's display name.`),kind:Q().describe("What the Deployment Target is, in a short word you choose, printed as written in its header: prefer short forms such as `region`, `az`, `vnet`, `snet`, `vm`, `aks`, `ns` or `asp` over long names like `availability-zone` or `subnet`."),description:Q().optional().describe(`What the Deployment Target is, in a sentence or two.`),owner:PC.optional().describe("The Team that owns the Deployment Target: the id of a Team in `workspace.yaml`. Default: the Project's `owner`."),tags:$(Q()).optional().describe(`Free-form labels for the Deployment Target.`),links:$(FC).optional().describe(`Links to pages about the Deployment Target, such as a dashboard.`)},JC=ZS({...qC,get targets(){return aC(PC,JC).optional().describe(`The Deployment Targets inside this one, keyed by id, such as the clusters in a region.`)}}).meta({id:`Target`,title:`Deployment Target`,description:`A Deployment Target: a place Services run, such as a region, a cluster in it or a platform. Deployment Targets nest to any depth and are not Elements.`}),YC=ZS({name:Q().describe("What the endpoint is, such as `health` or `admin`."),url:SS().describe(`The endpoint's address. A full URL.`)}).describe(`A further named URL of the Service in this Environment.`),XC=zS({error:`must be a whole number of at least 1`}).int({error:`must be a whole number of at least 1`}).min(1,{error:`must be a whole number of at least 1`}),ZC=$S([XC.describe("A fixed number of instances, such as `3`."),ZS({min:XC.describe(`The fewest instances the autoscaler runs.`),max:XC.describe("The most instances the autoscaler runs. At least `min`.")}).refine(e=>e.max>=e.min,{error:"`max` must be at least `min`",path:[`max`]}).describe("An autoscale range, such as `{ min: 2, max: 10 }`.")],{error:"must be a whole number of at least 1, or `{ min, max }` for an autoscale range"}).describe("How many interchangeable copies of the Service run on this Deployment Target: a whole number for a fixed count, such as `3`, or `{ min, max }` for an autoscale range, such as `{ min: 2, max: 10 }`. Use it for identical workers on one Target, such as an App Service plan running N instances. When where each copy runs matters, such as one per availability zone or VM, declare separate Deployments on separate Targets instead. Default: 1."),QC=ZS({service:RC.describe("The Service that runs: an id in this Project, or `project:id`. It must name a Service, not a System or a Component."),environment:PC.describe("The Environment it runs in: the id of an Environment in `workspace.yaml`."),target:RC.describe("The Deployment Target it runs on: an id in this Project, or `project:id` for one another Project declares."),url:SS().optional().describe("The Service's main URL in this Environment. A full URL, such as `https://cart.example.com`."),endpoints:$(YC).optional().describe(`Further named URLs of the Service in this Environment, such as a health check or an admin console.`),instances:ZC.optional()}).describe(`A Deployment: one Service running in one Environment on one Deployment Target. The three together name it, so the same three can appear only once.`),$C=$S([zS().int().min(0),lC(`all`)],{error:"must be a number of hops, or `all`"}).describe("A number of hops, or `all`."),ew=$S([lC(`shortest`),zS().int().min(1)],{error:"must be `shortest`, or a number of hops"}).describe("`shortest`, or n for every path of at most n hops. Default: `shortest`."),tw=ZS({element:RC.describe("The Element to start from: an id in this Project, or `project:id`."),with:sC([`children`,`descendants`]).optional().describe("Also selects what is inside the Element. `children`: the Elements directly inside it. `descendants`: everything inside it, at any depth."),upstream:$C.optional().describe("Also selects the Elements upstream of it, those that depend on it: a number of hops, or `all` for every one of them."),downstream:$C.optional().describe("Also selects the Elements downstream of it, those it depends on: a number of hops, or `all` for every one of them.")}).describe(`One Element, and optionally what is inside it and what is upstream or downstream of it.`),nw=ZS({team:PC.describe("The Team: the id of a Team in `workspace.yaml`.")}).describe(`Every Element a Team owns.`),rw=ZS({tag:Q().describe("The tag, as written in the Elements' `tags`.")}).describe(`Every Element that carries a tag.`),iw=ZS({from:RC.describe("One end of the paths: an id in this Project, or `project:id`."),to:RC.describe("The other end of the paths: an id in this Project, or `project:id`."),paths:ew.optional().describe("Which paths to take. `shortest`: the shortest paths, however long. A number n: every path of at most n hops. Default: `shortest`.")}).meta({id:`PathSelector`,title:`Path selector`,description:`The paths between two Elements, followed in both directions. As a selector it picks every Element on them; as a Lens it highlights them.`}),aw=$S([RC.describe("One Element, by its id: an id in this Project, or `project:id`."),tw,nw,rw,iw]).meta({id:`Selector`,title:`Selector`,description:"One entry of a Saved View's `include` or `exclude`: an id, or a map that picks several Elements at once."}),ow=$S([ZS({impact:RC.describe("The Element whose impact is highlighted: an id in this Project, or `project:id`."),direction:sC([`upstream`,`downstream`,`both`]).optional().describe("Which side to highlight. `upstream`: what depends on the Element. `downstream`: what it depends on. `both`: both sides. Default: `both`.")}).describe(`The Impact Lens: what is upstream or downstream of one Element, each node marked with how many hops away it is.`),ZS({team:PC.describe("The Team: the id of a Team in `workspace.yaml`.")}).describe(`The Team Lens: what one Team owns.`),ZS({path:iw}).describe(`The Path Lens: the paths between two Elements.`)]).meta({id:`Lens`,title:`Lens`,description:`The Lens the View opens with. A Lens highlights nodes and never changes which nodes the View shows.`}),sw={title:Q().describe(`The View's display title.`),description:Q().optional().describe(`What the View shows, or the question it answers.`),tags:$(Q()).optional().describe(`Free-form labels for the View.`),level:sC([`c1`,`c2`,`c3`,`deployment`]).describe("The level every selected Element is collapsed to. `c1`: Persons and Systems. `c2`: Services, grouped in their Systems. `c3`: Components, inside their Services. `deployment`: a Deployment View, which places Deployments on their Deployment Targets in one Environment and needs `environment`."),expand:$(RC).optional().describe("Elements to open one level deeper than `level`, showing their children. Each is an id in this Project, or `project:id`, and must be a node of the View that has children. A Deployment View ignores it."),collapse:$(RC).optional().describe("Elements to close, hiding everything inside them. Each is an id in this Project, or `project:id`, and must be a node of the View that has children. A Deployment View ignores it."),direction:sC([`TB`,`BT`,`LR`,`RL`]).optional().describe("The way the diagram runs. `TB`: top to bottom. `BT`: bottom to top. `LR`: left to right. `RL`: right to left. Default: `LR`, or `TB` for a Deployment View."),environment:PC.optional().describe("For a Deployment View (`level: deployment`), which must have it, and for no other View: the Environment shown, as the id of an Environment in `workspace.yaml`."),targets:$(RC).optional().describe("For a Deployment View (`level: deployment`) only: shows only the Deployments on these Deployment Targets and on the Targets inside them. Each is an id in this Project, or `project:id`. Default: every Deployment Target.")},cw=ZS({...sw,include:$(aw).optional().describe(`Selectors for the Elements to show. Default: every Element in the Workspace.`),exclude:$(aw).optional().describe("Selectors for the Elements to leave out of what `include` picked. An excluded Element takes everything inside it with it."),lens:ow.optional()}).describe("A structural Saved View: the Elements its selectors pick, drawn at one `level`. With `level: deployment` it is a Deployment View. Its key is the View's id, unique among the Project's Saved Views.");ZS({...sw,include:$(GS()).optional(),exclude:$(GS()).optional(),lens:GS().optional()});var lw=ZS({from:RC.describe("The Element the Step starts at: the consumer of a call, the Publisher of an event, or the sender of a reply. An id in this Project, or `project:id`."),to:RC.describe("The Element the Step reaches: the provider of a call, the Subscriber of an event, or the receiver of a reply. An id in this Project, or `project:id`."),relationship:RC.optional().describe("The `id` of the Relationship the Step takes, as an id in this Project or `project:id`. Needed only when several Relationships match the two Elements."),description:Q().optional().describe("The text on the Step's arrow. Default: the Relationship's `description`, or its `channel` for an event."),note:Q().optional().describe(`A note shown under the Step.`),return:US().optional().describe("`true` makes the Step the reply to a sync Relationship declared from `to` to `from`. An async Relationship has no reply. Default: `false`.")}).describe("A Step: one interaction of the scenario, which must follow a Relationship in the Model. It is a call from a consumer to its provider, an event from a Publisher to a Subscriber, or with `return: true` a reply."),uw=ZS({title:Q().describe(`The View's display title.`),description:Q().optional().describe(`What the scenario is.`),tags:$(Q()).optional().describe(`Free-form labels for the View.`),participants:$(RC).optional().describe("Elements that take part, in the order to draw them, each as an id in this Project or `project:id`. Participants not listed follow, in the order the Steps first use them. An Element and its own ancestor can't both take part. Default: the order the Steps first use them."),steps:$(lw).describe(`The Steps of the scenario, in order.`)}).describe(`A Dynamic View: one scenario as an ordered list of Steps, shown as a sequence chart. Its key is the View's id, unique among the Project's Saved Views.`),dw=ZS({structural:aC(PC,cw).optional().describe("Structural Views and Deployment Views, keyed by id. Other Projects name a View as `project:id`."),dynamic:aC(PC,uw).optional().describe("Dynamic Views, keyed by id. Other Projects name a View as `project:id`.")}).describe("The Project's Saved Views: `structural` ones, which include Deployment Views, and `dynamic` ones.");ZS({people:aC(PC,UC).optional().describe(`Persons, keyed by id. An id is unique in the Project across all its Elements and Deployment Targets.`),systems:aC(PC,KC).optional().describe("Systems, keyed by id, each with its Services nested under `services`."),services:aC(PC,GC).optional().describe("Services declared at the top level, keyed by id: those outside any System, and those that join a System with `in`."),components:aC(PC,WC).optional().describe("Components declared at the top level, keyed by id. Each names its Service with `in`."),targets:aC(PC,JC).optional().describe(`Deployment Targets, keyed by id and nested as they nest. Their ids share the Project's ids with its Elements.`),deployments:$(QC).optional().describe(`Deployments: which Service runs in which Environment on which Deployment Target, with its URLs.`),views:dw.optional()}).describe("A Project file: any `.yaml` file in a Project folder other than `project.yaml`."),Object.fromEntries(Object.entries({person:`people`,system:`systems`,service:`services`,component:`components`}).map(([e,t])=>[t,e]));var fw=aC(PC,GS()).optional();ZS({people:fw,systems:fw,services:fw,components:fw,targets:fw,deployments:$(GS()).optional(),views:ZS({structural:fw,dynamic:fw}).optional()}),ZS({...qC,targets:fw}),KC.extend({services:fw}),GC.extend({components:fw});var pw=sC([`proposed`,`accepted`,`rejected`,`deprecated`,`superseded`]),mw=Q().regex(/^([a-z0-9][a-z0-9-]*:)?\d{4}$/,"must be an ADR number (NNNN), or `project:NNNN` for one in another Project").describe("An ADR number in this Project, or `project:NNNN` for one in another Project."),hw=$(Q());ZS({status:pw.describe("Where the decision stands. `proposed`: awaiting acceptance in a pull request. `accepted`: in force. `rejected`: turned down, and kept for its reasoning. `deprecated`: no longer in force, with no ADR replacing it. `superseded`: never written by hand; it is derived once an accepted ADR lists this one in `supersedes`."),date:NC(`must be an ISO date (YYYY-MM-DD)`).describe("The date of the last status change, as `YYYY-MM-DD`."),"decision-makers":hw.optional().describe(`Who made the decision: people's names or Team ids. Not checked.`),consulted:hw.optional().describe(`Who was asked for input: people's names or Team ids. Not checked.`),informed:hw.optional().describe(`Who was told of the decision: people's names or Team ids. Not checked.`),tags:$(Q()).optional().describe(`Free-form labels for the ADR.`),elements:$(RC).optional().describe("The Elements and Deployment Targets the decision affects, each as an id in this Project or `project:id`."),views:$(RC).optional().describe("The Saved Views the decision affects, each as an id in this Project or `project:id`."),supersedes:$(mw).optional().describe("The ADRs this one replaces once it is accepted, each as a four-digit number in this Project or `project:NNNN`. Only an accepted or deprecated ADR can be superseded.")}).describe("An ADR's frontmatter. The ADR's title is the first `# ` heading of its body, not a field.");var gw=XS({file:Q(),line:zS().int()}),_w=XS({label:Q(),url:Q()}),vw={id:Q(),parent:Q().nullable(),name:Q(),description:Q().nullable(),owner:Q(),tags:$(Q()),links:$(_w),metadata:aC(Q(),Q())},yw=(e,t)=>{let{id:n,...r}=vw;return XS({id:n,kind:lC(e),...r,...t,source:gw})},bw=tC(`kind`,[yw(`person`,{}),yw(`system`,{external:US(),repository:Q().nullable()}),yw(`service`,{type:sC([`app`,`datastore`,`broker`]),technology:Q().nullable(),external:US(),repository:Q().nullable()}),yw(`component`,{technology:Q().nullable(),repository:Q().nullable()})]),xw=XS({id:Q(),parent:Q().nullable(),name:Q(),kind:Q(),description:Q().nullable(),owner:Q(),tags:$(Q()),links:$(_w),source:gw}),Sw=XS({service:Q(),environment:Q(),target:Q(),url:Q().nullable(),endpoints:$(XS({name:Q(),url:Q()})),instances:$S([zS(),XS({min:zS(),max:zS()})]).default(1),owner:Q(),source:gw}),Cw=XS({id:Q().nullable(),from:Q(),to:Q(),description:Q().nullable(),technology:Q().nullable(),interaction:sC([`sync`,`async`]),via:Q().nullable(),channel:Q().nullable(),tags:$(Q()),source:gw}),ww=Q(),Tw=$S([zS(),lC(`all`)]),Ew=XS({from:ww,to:ww,paths:$S([lC(`shortest`),zS()]).optional()}),Dw=$S([ww,XS({element:ww,with:sC([`children`,`descendants`]).optional(),upstream:Tw.optional(),downstream:Tw.optional()}),XS({team:Q()}),XS({tag:Q()}),Ew]),Ow=$S([XS({impact:ww,direction:sC([`upstream`,`downstream`,`both`])}),XS({team:Q()}),XS({path:Ew})]),kw=XS({id:Q(),project:Q(),kind:lC(`structural`),title:Q(),description:Q().nullable(),tags:$(Q()),level:sC([`c1`,`c2`,`c3`,`deployment`]),include:$(Dw).nullable(),exclude:$(Dw),expand:$(Q()),collapse:$(Q()),direction:sC([`TB`,`BT`,`LR`,`RL`]).nullable(),lens:Ow.nullable(),environment:Q().nullable(),targets:$(Q()),source:gw}),Aw=XS({from:Q(),to:Q(),relationship:Q().nullable(),description:Q().nullable(),note:Q().nullable(),return:US()}),jw=tC(`kind`,[kw,XS({id:Q(),project:Q(),kind:lC(`dynamic`),title:Q(),description:Q().nullable(),tags:$(Q()),participants:$(Q()).nullable(),steps:$(Aw),source:gw})]),Mw=XS({id:Q(),project:Q(),title:Q(),status:pw,effectiveStatus:pw,date:Q(),elements:$(Q()),views:$(Q()),supersedes:$(Q()),supersededBy:$(Q()),decisionMakers:$(Q()),consulted:$(Q()),informed:$(Q()),tags:$(Q()),body:Q(),source:gw}),Nw=XS({schemaVersion:lC(1),commit:Q().nullable(),builtAt:Q().nullable(),teams:$(XS({id:Q(),name:Q(),description:Q().nullable(),links:$(_w),source:gw})),environments:$(XS({id:Q(),name:Q(),description:Q().nullable(),source:gw})),projects:$(XS({id:Q(),name:Q(),owner:Q(),folder:Q(),source:gw})),elements:$(bw),relationships:$(Cw),targets:$(xw),deployments:$(Sw),views:$(jw),adrs:$(Mw)}),Pw={};function Fw(e,t=Pw,n=1){if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e,i=r.schemaVersion;if(typeof i!=`number`||!Number.isInteger(i)||i>n)return;for(;i<n;){let e=t[i];if(!e)return;r={...e(r),schemaVersion:i+1},i++}let a=Nw.safeParse(r);return a.success?a.data:void 0}function Iw(e,t=Pw){return Fw(e,t)}function Lw(e){if(typeof e!=`object`||!e)return;let{schemaVersion:t,revisions:n,preview:r}=e;if(t===1&&Array.isArray(n))return{schemaVersion:t,revisions:n,...typeof r?.baseSha==`string`?{preview:r}:{}}}function Rw(e){let t=e.endsWith(`/`)?e:`${e}/`,n=e=>`${t}${e}`;return{location:n,async read(e,t){let r=n(e),i={accept:`application/json`};t?.etag&&(i[`if-none-match`]=t.etag),t?.lastModified&&(i[`if-modified-since`]=t.lastModified);let a=await fetch(r,{headers:i,cache:`no-store`});if(a.status===304)return{kind:`not_modified`};if(a.status===404)return{kind:`missing`};if(!a.ok)throw Error(`${r} answered ${a.status} ${a.statusText}`.trim());let o=a.headers.get(`etag`),s=a.headers.get(`last-modified`);return{kind:`text`,text:await a.text(),validators:{...o?{etag:o}:{},...s?{lastModified:s}:{}}}}}}var zw=(e,t)=>({ok:!1,code:`history_unavailable`,reason:e,message:t}),Bw=e=>e instanceof Error?e.message:String(e);function Vw(e,t,n,r,i=()=>!0){let a;return async()=>{let o=Date.now();if(a&&o-a.at<n)return a.value;let s=await e.read(t,a?.validators);if(s.kind===`not_modified`){if(!a)throw Error(`${e.location(t)} answered "not modified" to a request with no validators.`);return a={...a,at:o},a.value}let c=r(s.kind===`text`?s.text:void 0);return i(c)&&(a={value:c,at:o,validators:s.kind===`text`?s.validators:{}}),c}}var Hw=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}};function Uw(e,{recheckMs:t,bundle:n=Ww,migrations:r=Pw}){let i=e.location(n),a=Vw(e,n,t,e=>{if(e===void 0)throw Error(`${i} was not found.`);let t=Hw(e);if(!t.ok)throw Error(`${i} is not JSON.`);let n=Iw(t.value,r);if(!n)throw Error(`${i} is not a Workspace Bundle this version can read.`);return n}),o=Vw(e,qw,t,t=>{if(t===void 0)return{ok:!0,index:void 0};let n=Hw(t);if(!n.ok)return zw(`index`,`The site has no readable Revision index (${qw}): ${e.location(qw)} is not JSON.`);let r=Lw(n.value);return r?{ok:!0,index:r}:zw(`index`,`The site's ${qw} holds no Revisions.`)},e=>e.ok),s=new Map,c=async t=>{let n=t.slice(0,7),i;try{i=await e.read(Jw(t))}catch(e){return zw(`unreadable`,`The Bundle at ${n} can't be read from the site: ${Bw(e)}`)}if(i.kind!==`text`)return zw(`missing`,`The Bundle at ${n} can't be read from the site: ${e.location(Jw(t))} was not found.`);let a=Hw(i.text);if(!a.ok)return zw(`unreadable`,`The Bundle at ${n} can't be read from the site: ${e.location(Jw(t))} is not JSON.`);let o=Iw(a.value,r);return o?{ok:!0,bundle:o}:zw(`unmigratable`,`The Bundle at ${n} has a schema this Archidocs can't read or migrate.`)};return{location:i,latest:a,async index(){try{return await o()}catch(e){return zw(`index`,`The site has no readable Revision index (${qw}): ${Bw(e)}`)}},bundle(e){if(e.bundle===!1)return Promise.resolve(zw(`dropped`,`The Bundle at ${e.sha.slice(0,7)} (${e.date}) was not kept on this site.`));let t=s.get(e.sha);return t||(t=c(e.sha),s.set(e.sha,t),t.then(t=>!t.ok&&s.delete(e.sha))),t}}}var Ww=`workspace.bundle.json`,Gw=`site.json`,Kw=`bundles`,qw=`${Kw}/index.json`,Jw=e=>`${Kw}/${Yw(e)}`,Yw=e=>`${e}.json`,Xw=[`upstream`,`downstream`,`both`],Zw=[`TB`,`BT`,`LR`,`RL`],Qw=`shortest`,$w=`graph`,eT=`1`,tT=e=>{let t=e.map(e=>`\`${e}\``);return t.length<2?t.join(``):`${t.slice(0,-1).join(`, `)} or ${t.at(-1)}`},nT=`#/view/`,rT={prefix:nT,syntax:`${nT}<view-id>`,does:"Opens the View with this id: `c2`, a Generated View such as `c2/payments:payments` or `deployment/prod`, or a Saved View's qualified id. An empty route opens the top-most View, the C1 Landscape `c1`."};Im.charAt(0).toUpperCase()+Im.slice(1),tT(Zw),tT(Xw),`${tT([Qw])}`,tT([$w]),tT([eT]);var iT=e=>e.startsWith(rT.prefix),aT={view:`c1`,open:[],closed:[],selected:null,edge:null,direction:null,lens:null,picks:[],step:null,graph:!1,brokers:!1,at:null,vs:null,adr:null},oT=RegExp(`^${nT}([^?]*)(?:\\?(.*))?$`);function sT(e){let t=oT.exec(e);if(!t)return aT;let n=new URLSearchParams(t[2]??``),r=e=>n.get(e),i=e=>[...new Set((r(e)??``).split(`,`).filter(Boolean))],a=r(`dir`);return{view:decodeURIComponent(t[1])||aT.view,open:i(`open`),closed:i(`closed`),selected:r(`sel`)||null,edge:r(`sel`)?null:cT(r(`rel`)),direction:a!==null&&Zw.includes(a)?a:null,lens:uT(r),picks:i(`picks`),step:lT(r(`step`)),graph:r(`mode`)===$w,brokers:r(`brokers`)===eT,at:r(`at`)||null,vs:r(`vs`)||null,adr:r(`adr`)||null}}function cT(e){let[t,n,...r]=(e??``).split(`,`);return t&&n&&r.length===0?{from:t,to:n}:null}function lT(e){let t=Number(e);return e!==null&&Number.isInteger(t)&&t>0?t:null}function uT(e){let t=e(`impact`);if(t){let n=e(`way`);return{impact:t,direction:n!==null&&Xw.includes(n)?n:`both`}}let n=e(`team`);if(n)return{team:n};let[r,i]=[e(`from`),e(`to`)];if(r&&i){let t=Number(e(`paths`));return{path:{from:r,to:i,paths:Number.isInteger(t)&&t>0?t:Qw}}}return null}var dT=(e,t)=>`${e}=${t}`;function fT(e){if(`impact`in e)return[dT(`impact`,mT(e.impact)),dT(`way`,e.direction)];if(`team`in e)return[dT(`team`,mT(e.team))];let{from:t,to:n,paths:r}=e.path;return[dT(`from`,mT(t)),dT(`to`,mT(n)),...r!==void 0&&r!==Qw?[dT(`paths`,r)]:[]]}function pT(e){let t=[];return e.open.length>0&&t.push(dT(`open`,e.open.map(mT).join(`,`))),e.closed.length>0&&t.push(dT(`closed`,e.closed.map(mT).join(`,`))),e.selected!==null&&t.push(dT(`sel`,mT(e.selected))),e.edge!==null&&e.selected===null&&t.push(dT(`rel`,`${mT(e.edge.from)},${mT(e.edge.to)}`)),e.direction!==null&&t.push(dT(`dir`,e.direction)),e.lens!==null&&t.push(...fT(e.lens)),e.picks.length>0&&t.push(dT(`picks`,e.picks.map(mT).join(`,`))),e.step!==null&&t.push(dT(`step`,e.step)),e.graph&&t.push(dT(`mode`,$w)),e.brokers&&t.push(dT(`brokers`,eT)),e.at!==null&&t.push(dT(`at`,mT(e.at))),e.vs!==null&&t.push(dT(`vs`,mT(e.vs))),e.adr!==null&&t.push(dT(`adr`,mT(e.adr))),`${rT.prefix}${mT(e.view)}${t.length>0?`?${t.join(`&`)}`:``}`}var mT=e=>encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%2F/gi,`/`).replace(/%40/gi,`@`),hT=(e,t=null,n=null,r)=>({view:e,open:[],closed:[],selected:t,edge:null,direction:null,lens:n,picks:[],step:null,graph:!1,brokers:!1,at:r?.at??null,vs:r?.vs??null,adr:null}),gT=`archidocs:place`;function _T(e){for(let t of[`hashchange`,`popstate`,gT])window.addEventListener(t,e);return()=>{for(let t of[`hashchange`,`popstate`,gT])window.removeEventListener(t,e)}}var vT=()=>(0,O.useSyncExternalStore)(_T,()=>window.location.hash);function yT(){let e=vT();return(0,O.useMemo)(()=>sT(e),[e])}function bT(e,{replace:t=!1}={}){let n=pT(e);n!==window.location.hash&&(t?window.history.replaceState(null,``,n):window.history.pushState(null,``,n),window.dispatchEvent(new Event(gT)))}var xT,ST=0,CT=new Map;function wT(e,t){xT||(xT=new Worker(new URL(new URL(`layout.worker-ueOYAv7N.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),xT.onmessage=e=>{CT.get(e.data.request)?.(e.data),CT.delete(e.data.request)});let n=++ST;return new Promise(r=>{CT.set(n,r),xT.postMessage({request:n,view:e,direction:t})})}function TT(e,t){let[n,r]=(0,O.useState)({});return(0,O.useEffect)(()=>{if(!e)return;let n=!0;return wT(e,t).then(t=>{n&&r(`layout`in t?{laidOut:{view:e,layout:t.layout}}:{error:t.error})}),()=>{n=!1}},[e,t]),{laidOut:n.laidOut,error:n.error}}var ET=`modulepreload`,DT=function(e,t){return new URL(e,t).href},OT={},kT=function(e){return e.pathname.endsWith(`.css`)},AT=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},jT=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=DT(t,n);let r=s(t),i=kT(r);return AT(OT,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:ET,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};async function MT(e,t,n,r){let[i,{renderSvg:a}]=await Promise.all([wT(t,n),jT(()=>import(`./svg-Cboa7QX_.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)]);if(`error`in i)throw Error(i.error);let{bundle:o}=e;return PT(a({bundle:o,view:t,layout:i.layout,source:{workspace:e.workspaceName,commit:o.commit,date:o.builtAt}}),r)}async function NT(e,t,n,r){let{renderSequenceSvg:i}=await jT(async()=>{let{renderSequenceSvg:e}=await import(`./sequence-svg-DDwcPtpC.js`);return{renderSequenceSvg:e}},__vite__mapDeps([4,0,1,2,3]),import.meta.url),{bundle:a}=e;return PT(i({bundle:a,view:t,brokers:n,source:{workspace:e.workspaceName,commit:a.commit,date:a.builtAt}}),r)}async function PT(e,t){if(t===`svg`)return new Blob([e],{type:`image/svg+xml`});let[{renderPng:n},{default:r}]=await Promise.all([jT(()=>import(`./png-D-pNKY71.js`),__vite__mapDeps([5,3]),import.meta.url),jT(()=>import(`./index_bg-D3t31u3-.js`),[],import.meta.url)]),i=await n(e,fetch(r));return new Blob([i],{type:`image/png`})}var FT=(e,t,n=!1)=>`${e.replace(/[/:]/g,`-`)}${n?`-picks`:``}.${t}`;function IT(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.append(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}var LT=10,RT=()=>`archidocs:recent:${window.location.pathname.replace(/index\.html$/,``)}`;function zT(){try{let e=JSON.parse(window.localStorage.getItem(RT())??`[]`);return Array.isArray(e)?e.slice(0,LT):[]}catch{return[]}}function BT(e,t){let n=`${e.view}?${e.open.join(`,`)}|${e.closed.join(`,`)}`,r=[t,...[e.open.length>0?`${e.open.length} open`:``,e.closed.length>0?`${e.closed.length} closed`:``].filter(Boolean)].join(` · `),i=[{key:n,hash:pT(e),label:r},...zT().filter(e=>e.key!==n)].slice(0,LT);try{window.localStorage.setItem(RT(),JSON.stringify(i))}catch{}}var VT=class{revisions;preview;constructor(e,t){this.revisions=e,this.preview=t}previewBase(){return this.preview&&this.revisions.find(e=>e.sha===this.preview.baseSha)}compareLabel(e,t){let n=t===void 0||t.sha===this.preview?.headSha;return this.preview&&e.sha===this.preview.baseSha&&n?`${this.preview.base} → PR`:`${HT(e)} → ${t?HT(t):`latest`}`}find(e){return Wm(this.revisions,e)}previous(e){return this.revisions[this.revisions.indexOf(e)+1]}isLatest(e){return this.revisions[0]===e}},HT=e=>e.tags[0]??e.sha.slice(0,7),UT=e=>e.date.slice(0,10),WT=Uw(Rw(`./`),{recheckMs:1/0});async function GT(){let e=await WT.index();return e.ok&&e.index?new VT(e.index.revisions,e.index.preview):new VT([])}var KT={dropped:`this site no longer keeps its Bundle`,missing:`its Bundle is missing from this site`,unreadable:`its Bundle can't be read`,unmigratable:`its Bundle is from a schema this viewer can't read`,index:`this site's Revision index can't be read`},qT=class extends Error{code=`history_unavailable`;reason;constructor(e){super(KT[e]),this.reason=e}};async function JT(e){let t=await WT.bundle(e);if(!t.ok)throw new qT(t.reason);return t.bundle}async function YT(e,t,n,r){let i=(e,n)=>{if(e===null)return;let r=t.find(e);return r.ok?r.revision:{kind:`problem`,problem:r.kind===`ambiguous`?{kind:`ambiguous`,point:e,side:n,candidates:r.candidates}:{kind:`unknown`,point:e}}},a=i(n,`at`);if(a&&`kind`in a)return a;let o=i(r,`vs`);if(o&&`kind`in o)return o;let s=async t=>t===void 0?e:JT(t);try{let e=await s(a);try{let t=o===void 0?void 0:await s(o);return{kind:`ready`,times:{current:e,...t?{before:t}:{},...a?{at:a}:{},...o?{vs:o}:{}}}}catch(e){return XT(o,e)}}catch(e){return XT(a,e)}}function XT(e,t){if(!(t instanceof qT))throw t;return{kind:`problem`,problem:{kind:`unavailable`,revision:e,reason:t.message}}}function ZT(e,t,n,r){let i=`${n??``}\n${r??``}`,a=n===null&&r===null,[o,s]=(0,O.useState)(),c=(0,O.useMemo)(()=>({kind:`ready`,times:{current:e}}),[e]);return(0,O.useEffect)(()=>{if(a)return;let o=!0;return YT(e,t,n,r).then(e=>{o&&s({key:i,state:e})}),()=>{o=!1}},[e,t,i]),a?{state:c,loading:!1}:o?.key===i?{state:o.state,loading:!1}:{state:o?.state.kind===`ready`?o.state:void 0,loading:!0}}function QT({problem:e,place:t}){let n=pT({...t,at:null,vs:null,selected:null});if(e.kind===`unknown`)return(0,P.jsxs)(`div`,{className:`arc-unavailable`,role:`alert`,children:[(0,P.jsxs)(`h1`,{children:[`No Revision “`,e.point,`”`]}),(0,P.jsxs)(`p`,{children:[`This site's history has no tag, commit or date called `,e.point,`.`]}),(0,P.jsx)(`a`,{href:n,children:`Back to latest`})]});if(e.kind===`ambiguous`)return(0,P.jsxs)(`div`,{className:`arc-unavailable`,role:`alert`,children:[(0,P.jsxs)(`h1`,{children:[`More than one Revision “`,e.point,`”`]}),(0,P.jsxs)(`p`,{children:[`The shas of these Revisions all start with `,e.point,`. Pick one:`]}),(0,P.jsx)(`ul`,{children:e.candidates.map(n=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`a`,{href:pT({...t,[e.side]:HT(n)}),children:[(0,P.jsx)(`code`,{children:n.sha.slice(0,7)}),` `,n.subject,` (`,UT(n),`)`]})},n.sha))}),(0,P.jsx)(`a`,{href:n,children:`Back to latest`})]});let{revision:r}=e,i=r.sha.slice(0,7);return(0,P.jsxs)(`div`,{className:`arc-unavailable`,role:`alert`,children:[(0,P.jsx)(`h1`,{children:(0,P.jsx)(`code`,{children:`history_unavailable`})}),(0,P.jsxs)(`p`,{children:[`This site can't show `,HT(r),` “`,r.subject,`” (`,UT(r),`): `,e.reason,`. It keeps full Bundles for the latest Revisions and every tag.`]}),(0,P.jsxs)(`p`,{children:[`On a checkout, run `,(0,P.jsxs)(`code`,{children:[`archidocs diff `,i,` HEAD`]}),`, or ask the MCP server with `,(0,P.jsxs)(`code`,{children:[`at: "`,i,`"`]}),`.`]}),(0,P.jsx)(`a`,{href:n,children:`Back to latest`})]})}function $T({revision:e,place:t}){return(0,P.jsxs)(`p`,{className:`arc-at`,role:`status`,"aria-label":`Past Revision`,children:[(0,P.jsxs)(`span`,{children:[`Viewing `,(0,P.jsx)(`strong`,{children:HT(e)}),` · `,e.subject,` · `,UT(e)]}),(0,P.jsx)(`a`,{href:pT({...t,at:null}),children:`Back to latest`})]})}var eE={team:`Team`,environment:`Environment`,project:`Project`,element:`Element`,relationship:`Relationship`,target:`Deployment Target`,deployment:`Deployment`,view:`View`,adr:`ADR`},tE={added:`+`,removed:`−`,changed:`~`};function nE(e){let t=e.after??e.before;return(typeof t.name==`string`?t.name:typeof t.title==`string`?t.title:null)??e.id}function rE(e){let t=e.after??e.before;if(e.kind===`element`)return{element:e.id};if(e.kind===`relationship`)return{element:t.from};if(e.kind===`deployment`)return{element:t.service};if(e.kind===`adr`&&Array.isArray(t.elements)&&typeof t.elements[0]==`string`)return{element:t.elements[0]};if(e.kind===`view`)return{view:e.id}}function iE({changes:e,label:t,onElement:n,onView:r}){return(0,P.jsxs)(`aside`,{className:`arc-changes`,"aria-label":`Changes`,children:[(0,P.jsx)(`h2`,{children:`Changes`}),(0,P.jsxs)(`p`,{className:`arc-revision-meta`,children:[t,`: `,e.length===0?`nothing changed`:`${e.length} Change${e.length===1?``:`s`}`]}),(0,P.jsx)(`ul`,{children:e.map(e=>{let t=rE(e),i=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:`arc-change-sign`,"aria-hidden":`true`,children:tE[e.type]}),(0,P.jsxs)(`span`,{children:[nE(e),(0,P.jsx)(`br`,{}),(0,P.jsxs)(`span`,{className:`arc-change-kind`,children:[eE[e.kind],` `,e.type,e.fields.length>0?`: ${e.fields.join(`, `)}`:``]})]})]}),a=`arc-change arc-change-${e.type}`;return(0,P.jsx)(`li`,{children:t?(0,P.jsx)(`button`,{type:`button`,className:a,onClick:()=>`element`in t?n(t.element):r(t.view),children:i}):(0,P.jsx)(`span`,{className:a,children:i})},`${e.kind} ${e.id} ${e.type}`)})})]})}function aE({revision:e}){return(0,P.jsxs)(`span`,{children:[e.tags.map(e=>(0,P.jsx)(`span`,{className:`arc-tag`,children:e},e)),(0,P.jsx)(`code`,{children:e.sha.slice(0,7)}),` `,e.subject,(0,P.jsx)(`br`,{}),(0,P.jsxs)(`span`,{className:`arc-revision-meta`,children:[UT(e),` · `,e.author,` · +`,e.counts.added,` −`,e.counts.removed,` ~`,e.counts.changed,!e.bundle&&(0,P.jsx)(`span`,{className:`arc-dropped`,children:` · not kept`})]})]})}function oE({timeline:e,onAt:t,onVs:n}){let[r,i]=(0,O.useState)(!1),a=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!r)return;let e=e=>{(e instanceof KeyboardEvent?e.key===`Escape`:!a.current?.contains(e.target))&&i(!1)};return window.addEventListener(`keydown`,e),window.addEventListener(`pointerdown`,e),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`pointerdown`,e)}},[r]),e.revisions.length===0?null:(0,P.jsxs)(`div`,{className:`arc-menu-root`,ref:a,children:[(0,P.jsxs)(`button`,{type:`button`,className:`arc-tool arc-menu-button`,"aria-haspopup":`menu`,"aria-expanded":r,title:`Revisions`,onClick:()=>i(!r),children:[(0,P.jsx)(L,{name:`revisions`}),(0,P.jsx)(`span`,{className:`arc-tool-label`,children:`Revisions`})]}),r&&(0,P.jsx)(`div`,{className:`arc-menu arc-timeline`,role:`menu`,"aria-label":`Revisions`,children:(0,P.jsx)(`ol`,{children:e.revisions.map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(aE,{revision:e}),(0,P.jsxs)(`span`,{className:`arc-revision-actions`,children:[(0,P.jsx)(`button`,{type:`button`,disabled:!e.bundle,"aria-label":`Open ${HT(e)}`,onClick:()=>(i(!1),t(e)),children:`Open`}),(0,P.jsx)(`button`,{type:`button`,disabled:!e.bundle,"aria-label":`Compare from ${HT(e)}`,onClick:()=>(i(!1),n(e)),children:`Compare`})]})]},e.sha))})})]})}function sE({workspace:e,place:t,direction:n,compare:r,timeline:i,onCollapse:a,onDirection:o,onLens:s,onPicks:c,onTime:l,onExport:u,onSaveAsView:d}){let f=e.crumbs(t.view),p=Zp(uE),m=t=>e.byId.get(t)?.name??t;return(0,P.jsxs)(`header`,{className:`arc-location arc-plate`,children:[(0,P.jsxs)(`div`,{className:`arc-where`,children:[(0,P.jsxs)(`span`,{className:`arc-history-buttons`,children:[(0,P.jsx)(`button`,{type:`button`,className:`arc-tool arc-step`,"aria-label":`Back`,title:`Back`,onClick:()=>window.history.back(),children:(0,P.jsx)(L,{name:`back`})}),(0,P.jsx)(`button`,{type:`button`,className:`arc-tool arc-step`,"aria-label":`Forward`,title:`Forward`,onClick:()=>window.history.forward(),children:(0,P.jsx)(L,{name:`forward`})})]}),(0,P.jsx)(`nav`,{"aria-label":`Breadcrumbs`,children:(0,P.jsx)(`ol`,{className:`arc-crumbs`,children:f.map((e,n)=>{let r=n===f.length-1;return(0,P.jsx)(`li`,{"aria-current":r?`page`:void 0,children:r||e.view===void 0?(0,P.jsx)(`span`,{title:e.label,children:e.label}):(0,P.jsx)(`a`,{href:pT(hT(e.view,null,t.lens,t)),title:`Up to ${e.label}`,children:e.label})},`${n}:${e.label}`)})})}),(0,P.jsx)(fE,{workspace:e,place:t})]}),(0,P.jsx)(mE,{workspace:e,place:t}),(0,P.jsxs)(`div`,{className:`arc-tools`,children:[(0,P.jsx)(oE,{timeline:i,onAt:e=>l({at:i.isLatest(e)?null:HT(e)}),onVs:e=>l({vs:HT(e)})}),(0,P.jsx)(gE,{}),(0,P.jsxs)(`label`,{className:`arc-direction-label`,children:[(0,P.jsx)(`span`,{className:`arc-visually-hidden`,children:`Layout direction`}),(0,P.jsx)(`select`,{className:`arc-tool arc-direction`,"aria-label":`Direction`,title:`Layout direction: ${cE[n]}`,value:n,onChange:e=>o(e.target.value),children:Zw.map(e=>(0,P.jsx)(`option`,{value:e,children:p?lE[e]:cE[e]},e))})]}),(0,P.jsx)(_E,{}),(0,P.jsx)(dE,{picks:t.picks.length,onExport:u}),(0,P.jsx)(`button`,{type:`button`,className:`arc-tool arc-primary`,onClick:d,children:`Save as View`})]}),(t.open.length>0||r||t.lens||t.picks.length>0)&&(0,P.jsxs)(`div`,{className:`arc-state`,children:[t.open.length>0&&(0,P.jsxs)(`section`,{className:`arc-chips`,role:`region`,"aria-label":`Open boxes`,children:[t.open.map(e=>(0,P.jsxs)(`button`,{type:`button`,className:`arc-chip`,"aria-label":`Close ${m(e)}`,onClick:()=>a([e]),children:[m(e),(0,P.jsx)(`span`,{className:`arc-chip-x`,"aria-hidden":`true`})]},e)),(0,P.jsx)(`button`,{type:`button`,className:`arc-chip arc-chip-all`,onClick:()=>a(t.open),children:`Collapse all`})]}),r&&(0,P.jsx)(`section`,{className:`arc-chips`,role:`region`,"aria-label":`Compare`,children:(0,P.jsxs)(`span`,{className:`arc-chip arc-chip-lens`,children:[(0,P.jsx)(`span`,{className:`arc-lens-kind`,children:`Compare`}),` `,r,(0,P.jsx)(`button`,{type:`button`,className:`arc-chip-clear`,"aria-label":`Clear compare`,onClick:()=>l({vs:null}),children:(0,P.jsx)(`span`,{className:`arc-chip-x`,"aria-hidden":`true`})})]})}),t.lens&&(0,P.jsx)(hE,{workspace:e,lens:t.lens,onLens:s}),t.picks.length>0&&(0,P.jsx)(`section`,{className:`arc-chips`,role:`region`,"aria-label":`Picks`,children:(0,P.jsxs)(`button`,{type:`button`,className:`arc-chip arc-chip-picks`,"aria-label":`Clear ${t.picks.length} picked`,onClick:()=>c([]),children:[t.picks.length,` picked`,(0,P.jsx)(`span`,{className:`arc-chip-x`,"aria-hidden":`true`})]})})]})]})}var cE={LR:`Left → right`,RL:`Right → left`,TB:`Top → bottom`,BT:`Bottom → top`},lE={LR:`→`,RL:`←`,TB:`↓`,BT:`↑`},uE=`(max-width: 1279px)`;function dE({picks:e,onExport:t}){let[n,r]=(0,O.useState)(!1),i=pE(n,()=>r(!1)),a=[[`View as SVG`,`view`,`svg`],[`View as PNG`,`view`,`png`],...e>0?[[`Picks as SVG`,`picks`,`svg`],[`Picks as PNG`,`picks`,`png`]]:[]];return(0,P.jsxs)(`div`,{className:`arc-menu-root`,ref:i,children:[(0,P.jsxs)(`button`,{type:`button`,className:`arc-tool arc-menu-button`,"aria-haspopup":`menu`,"aria-expanded":n,title:`Export`,onClick:()=>r(!n),children:[(0,P.jsx)(L,{name:`export`}),(0,P.jsx)(`span`,{className:`arc-tool-label`,children:`Export`})]}),n&&(0,P.jsx)(`div`,{className:`arc-menu`,role:`menu`,"aria-label":`Export`,children:a.map(([e,n,i])=>(0,P.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{r(!1),t(n,i)},children:e},e))})]})}function fE({workspace:e,place:t}){let[n,r]=(0,O.useState)(!1),i=pE(n,()=>r(!1)),a=e.deeper(t.view);return a.length===0?null:(0,P.jsxs)(`div`,{className:`arc-menu-root arc-deeper`,ref:i,children:[(0,P.jsxs)(`button`,{type:`button`,className:`arc-tool arc-menu-button`,"aria-haspopup":`menu`,"aria-expanded":n,title:`Go a level deeper`,onClick:()=>r(!n),children:[(0,P.jsx)(L,{name:`down`}),(0,P.jsx)(`span`,{className:`arc-tool-label`,children:`Go deeper`})]}),n&&(0,P.jsx)(`div`,{className:`arc-menu arc-menu-start`,role:`menu`,"aria-label":`Go deeper`,children:a.map(e=>(0,P.jsx)(`a`,{role:`menuitem`,href:pT(hT(e.view,null,t.lens,t)),onClick:()=>r(!1),children:e.label},e.view))})]})}function pE(e,t){let n=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!e)return;let r=e=>{(e instanceof KeyboardEvent?e.key===`Escape`:!n.current?.contains(e.target))&&t()};return window.addEventListener(`keydown`,r),window.addEventListener(`pointerdown`,r),()=>{window.removeEventListener(`keydown`,r),window.removeEventListener(`pointerdown`,r)}},[e,t]),n}function mE({workspace:e,place:t}){let n=e.views.flatMap(t=>{let n=_(t.id);return n?.form===`deployment`?[{view:t.id,label:e.name(n.environment)}]:[]});return n.length===0?null:(0,P.jsxs)(`nav`,{className:`arc-deployments`,"aria-label":`Deployment Views`,children:[(0,P.jsx)(`span`,{className:`arc-deployments-label`,"aria-hidden":`true`,children:`Deployment:`}),n.map(e=>e.view===t.view?(0,P.jsx)(`a`,{href:pT(hT(e.view)),"aria-current":`page`,title:`Deployment View: ${e.label}`,className:`arc-deployment-link arc-current`,children:e.label},e.view):(0,P.jsx)(`a`,{href:pT(hT(e.view,null,t.lens)),title:`Deployment View: ${e.label}`,className:`arc-deployment-link`,children:e.label},e.view))]})}function hE({workspace:e,lens:t,onLens:n}){return(0,P.jsxs)(`section`,{className:`arc-chips arc-lens`,role:`region`,"aria-label":`Lens`,children:[(0,P.jsxs)(`span`,{className:`arc-chip arc-chip-lens`,children:[(0,P.jsx)(`span`,{className:`arc-lens-kind`,children:`impact`in t?`Impact`:`team`in t?`Team`:`Connect`}),l(e.bundle,t),(0,P.jsx)(`button`,{type:`button`,className:`arc-chip-clear`,"aria-label":`Clear lens`,onClick:()=>n(null),children:(0,P.jsx)(`span`,{className:`arc-chip-x`,"aria-hidden":`true`})})]}),`impact`in t&&(0,P.jsx)(`div`,{className:`arc-segmented`,role:`group`,"aria-label":`Impact direction`,children:[`upstream`,`both`,`downstream`].map(e=>(0,P.jsx)(`button`,{type:`button`,"aria-pressed":t.direction===e,onClick:()=>n({...t,direction:e}),children:e===`both`?`Both`:e===`upstream`?`Upstream`:`Downstream`},e))}),`path`in t&&(0,P.jsx)(`div`,{className:`arc-segmented`,role:`group`,"aria-label":`Paths`,children:[`shortest`,4].map(e=>(0,P.jsx)(`button`,{type:`button`,"aria-pressed":(t.path.paths??`shortest`)===e,onClick:()=>n({path:{...t.path,paths:e}}),children:e===`shortest`?`Shortest`:`All ≤ 4 hops`},e))})]})}function gE(){let[e,t]=(0,O.useState)(null),n=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!e)return;let r=e=>{(e instanceof KeyboardEvent?e.key===`Escape`:!n.current?.contains(e.target))&&t(null)};return window.addEventListener(`keydown`,r),window.addEventListener(`pointerdown`,r),()=>{window.removeEventListener(`keydown`,r),window.removeEventListener(`pointerdown`,r)}},[e]),(0,P.jsxs)(`div`,{className:`arc-menu-root`,ref:n,children:[(0,P.jsxs)(`button`,{type:`button`,className:`arc-tool arc-menu-button`,"aria-haspopup":`menu`,"aria-expanded":e!==null,title:`Recent`,onClick:()=>t(e?null:zT()),children:[(0,P.jsx)(L,{name:`recent`}),(0,P.jsx)(`span`,{className:`arc-tool-label`,children:`Recent`})]}),e&&(0,P.jsxs)(`div`,{className:`arc-menu`,role:`menu`,"aria-label":`Recent`,children:[e.length===0&&(0,P.jsx)(`p`,{className:`arc-menu-empty`,children:`Nothing yet`}),e.map(e=>(0,P.jsx)(`a`,{role:`menuitem`,href:e.hash,onClick:()=>t(null),children:e.label},e.key))]})]})}function _E(){let[e,t]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{if(!e)return;let n=window.setTimeout(()=>t(!1),1500);return()=>window.clearTimeout(n)},[e]),(0,P.jsxs)(`button`,{type:`button`,className:`arc-tool`,"aria-label":`Copy link`,title:`Copy link`,onClick:()=>{navigator.clipboard.writeText(window.location.href).then(()=>t(!0))},children:[(0,P.jsx)(L,{name:e?`check`:`copy`}),(0,P.jsx)(`span`,{className:`arc-tool-label`,children:e?`Copied`:`Copy link`})]})}var vE=.85,yE=44,bE=16,xE=300;function SE(e){return(0,P.jsx)(cp,{children:(0,P.jsx)(CE,{...e})})}function CE({workspace:e,layout:t,fitKey:n,selected:r,playing:i,reducedMotion:a,onSelect:o,onSettled:s}){let c=(0,O.useMemo)(()=>t.columns.map(e=>({id:e.id,type:`lifeline`,position:{x:e.x-e.width/2,y:0},width:e.width,height:t.height,style:{width:e.width,height:t.height,pointerEvents:`none`},draggable:!1,selectable:!1,connectable:!1,data:{column:e,height:t.height,activations:t.activations.filter(t=>t.participant===e.id)}})),[t]),l=(0,O.useMemo)(()=>t.rows.map(t=>({id:t.key,source:t.from,target:t.to,type:`message`,zIndex:1,selectable:!1,data:{row:t,via:Pm(t,t=>e.name(t)),selected:t.n===r,later:i&&r!==null&&t.n>r,onSelect:o}})),[t,e,r,i,o]);return(0,P.jsxs)(fp,{className:`arc-flow arc-seq`,nodes:c,edges:l,nodeTypes:AE,edgeTypes:jE,minZoom:vE,maxZoom:2,panOnScroll:!0,panOnScrollSpeed:1,panOnDrag:[0,1],zoomOnDoubleClick:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},children:[(0,P.jsx)(`svg`,{className:`arc-defs`,"aria-hidden":`true`,children:(0,P.jsxs)(`defs`,{children:[(0,P.jsx)(`marker`,{id:`arc-head-filled`,viewBox:`0 0 10 10`,refX:`10`,refY:`5`,markerWidth:`8`,markerHeight:`8`,orient:`auto`,children:(0,P.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,className:`arc-head`})}),(0,P.jsx)(`marker`,{id:`arc-head-open`,viewBox:`0 0 10 10`,refX:`10`,refY:`5`,markerWidth:`8`,markerHeight:`8`,orient:`auto`,children:(0,P.jsx)(`path`,{d:`M0,0 L10,5 L0,10`,className:`arc-head-open`})})]})}),(0,P.jsx)(DE,{workspace:e,layout:t}),(0,P.jsx)(wE,{layout:t,fitKey:n,selected:r,playing:i,reducedMotion:a,onSettled:s}),(0,P.jsx)(em,{})]})}function wE({layout:e,fitKey:t,selected:n,playing:r,reducedMotion:i,onSettled:a}){let{setViewport:o,getViewport:s}=od(),c=G(e=>e.width),l=G(e=>e.height),u=c>0&&l>0,d=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!u)return;o(EE(e,c,l)),d.current=t;let n=0,r=()=>{document.querySelectorAll(`[data-step-edge]`).length>=e.rows.length?a(t):n=window.requestAnimationFrame(r)};return n=window.requestAnimationFrame(r),()=>window.cancelAnimationFrame(n)},[t,u]),(0,O.useEffect)(()=>{if(!u||n===null||d.current!==t)return;let a=e.rows.filter(e=>e.n===n);if(a.length===0)return;let f=(a[0].y+a.at(-1).y)/2,p=a.flatMap(e=>[e.x1,e.x2]),m=(Math.min(...p)+Math.max(...p))/2,h=s(),g=TE(i),_=(e,t)=>e*h.zoom+h.x>=0&&e*h.zoom+h.x<=c&&t*h.zoom+h.y>=yE*h.zoom&&t*h.zoom+h.y<=l;if(r)o({x:c/2-m*h.zoom,y:l/2-f*h.zoom,zoom:h.zoom},g);else if(!p.every(e=>_(e,f))){let e=Math.max(...p)-Math.min(...p)<=c/h.zoom;o({x:e?c/2-m*h.zoom:48-Math.min(...p)*h.zoom,y:l/2-f*h.zoom,zoom:h.zoom},g)}},[n,r,t,u]),(0,P.jsx)(`div`,{className:`arc-seq-tools`,children:(0,P.jsx)(`button`,{type:`button`,className:`arc-action`,onClick:()=>void o(EE(e,c,l),TE(i)),children:`Fit whole chart`})})}var TE=e=>({duration:e?0:xE,interpolate:`linear`});function EE(e,t,n){let r=Math.max(vE,Math.min(1,(t-32)/e.width,(n-bE)/e.height));return{x:e.width*r<=t?(t-e.width*r)/2:bE,y:bE/2,zoom:r}}function DE({workspace:e,layout:t}){let[n,r,i]=G(e=>e.transform),a={transform:`translate(${n}px, ${Math.max(r,0)}px) scale(${i})`};return(0,P.jsx)(`div`,{className:`arc-seq-headers`,style:a,children:t.columns.map(t=>{let n=e.byId.get(t.id),r=n?e.teams.get(n.owner):void 0,i=n!==void 0&&`external`in n&&n.external;return(0,P.jsxs)(`div`,{className:i?`arc-seq-header arc-external`:`arc-seq-header`,"data-header":t.id,title:e.name(t.id),style:{left:t.x-t.width/2,width:t.width,height:yE},children:[r&&(0,P.jsx)(`span`,{className:`arc-stripe`,style:{background:r.color}}),(0,P.jsx)(`span`,{className:`arc-seq-name`,children:e.name(t.id)}),r&&(0,P.jsx)(`span`,{className:`arc-team`,children:r.code})]},t.id)})})}var OE=(0,O.memo)(function({data:e}){let{column:t,height:n,activations:r}=e,i=t.width/2;return(0,P.jsxs)(`div`,{className:`arc-lifeline`,"data-participant":t.id,style:{width:t.width,height:n},children:[(0,P.jsx)(Nd,{type:`target`,position:U.Top,isConnectable:!1,className:`arc-handle`}),(0,P.jsx)(Nd,{type:`source`,position:U.Top,isConnectable:!1,className:`arc-handle`}),(0,P.jsxs)(`svg`,{width:t.width,height:n,children:[(0,P.jsx)(`line`,{x1:i,y1:yE,x2:i,y2:n-10,className:`arc-lifeline-line`}),r.map(e=>(0,P.jsx)(`rect`,{className:`arc-activation`,x:i-jm.bar/2+e.depth*jm.bar/2,y:e.top-6,width:jm.bar,height:e.bottom-e.top+12},`${e.top}:${e.depth}`))]})]})});function kE({data:e}){let{row:t,via:n,selected:r,later:i,onSelect:a}=e,o=t.x2>=t.x1?1:-1,s=t.x1+o*14,c=t.x1+o*28,l=o>0?`start`:`end`,u=`M${t.x1} ${t.y} L${t.x2} ${t.y}`,d=[n,t.note].filter(e=>e!==void 0),f=[`arc-step`,r?`arc-step-selected`:``,i?`arc-step-later`:``].filter(Boolean).join(` `);return(0,P.jsxs)(`g`,{className:f,"data-step-edge":t.key,"data-step":t.n,"data-selected":r?`true`:`false`,"data-later":i?`true`:void 0,onClick:()=>a(t.n),children:[(0,P.jsx)(`title`,{children:`Step ${t.key}: ${t.label}`}),(0,P.jsx)(`path`,{className:`arc-step-hit`,d:u}),(0,P.jsx)(`path`,{className:`arc-step-line arc-step-${t.style}`,d:u,markerEnd:`url(#arc-head-${t.style===`sync`?`filled`:`open`})`}),(0,P.jsx)(`circle`,{className:`arc-step-badge`,cx:s,cy:t.y,r:9}),(0,P.jsx)(`text`,{className:`arc-step-number`,x:s,y:t.y+3.5,textAnchor:`middle`,children:t.key}),(0,P.jsx)(`text`,{className:`arc-step-label`,x:c,y:t.y-7,textAnchor:l,children:t.label}),d.map((e,n)=>(0,P.jsx)(`text`,{className:`arc-step-sub`,x:c,y:t.y+16+n*jm.lineHeight,textAnchor:l,children:e},n))]})}var AE={lifeline:OE},jE={message:kE};function ME(e,t,n){let r=new Map;for(let e of Mm(t,{brokers:n})){let[t,n]=e.style===`return`?[e.to,e.from]:[e.from,e.to],i=`${t}>${n}`,a=r.get(i)??{from:t,to:n,messages:[]};a.messages.push(e),r.set(i,a)}let i=Nm(t,{brokers:n}).map(t=>{let n=e.byId.get(t);return{id:t,kind:n?.kind??`service`,name:e.name(t),parent:null,collapsed:!1,external:n!==void 0&&`external`in n&&n.external}}),a=[...r.values()].map(e=>({from:e.from,to:e.to,relationships:[...new Set(e.messages.map(e=>e.step.relationship))]}));return{graph:{id:t.id,kind:`c2`,title:t.title,direction:`LR`,nodes:i,edges:a},pairs:[...r.values()]}}function NE(e){return(0,P.jsx)(cp,{children:(0,P.jsx)(PE,{...e})})}function PE({workspace:e,view:t,brokers:n,fitKey:r,selected:i,onSelect:a,onSettled:o}){let{graph:s,pairs:c}=(0,O.useMemo)(()=>ME(e,t,n),[e,t,n]),{laidOut:l,error:u}=TT(s),d=l?.view===s?l.layout:void 0,f=(0,O.useMemo)(()=>d?.nodes.map(t=>({id:t.id,type:`participant`,position:{x:t.x,y:t.y},width:t.width,height:t.height,style:{width:t.width,height:t.height},draggable:!1,connectable:!1,data:{name:e.name(t.id)}}))??[],[d,e]),p=(0,O.useMemo)(()=>{if(!d)return[];let e=new Map(c.map(e=>[`${e.from}>${e.to}`,e])),t=e=>e.messages[0].n;return d.edges.map(t=>({e:t,pair:e.get(`${t.from}>${t.to}`)})).sort((e,n)=>t(e.pair)-t(n.pair)).map(({e,pair:t})=>({id:`${e.from}>${e.to}`,source:e.from,target:e.to,type:`steps`,selectable:!1,markerEnd:{type:_s.ArrowClosed,width:16,height:16},data:{points:e.points,pair:t,selected:i,onSelect:a}}))},[d,c,i,a]);return u?(0,P.jsxs)(`p`,{className:`arc-error`,children:[`Layout failed: `,u]}):(0,P.jsxs)(fp,{className:`arc-flow arc-graph`,nodes:f,edges:p,panOnScroll:!0,panOnScrollSpeed:1,panOnDrag:[0,1],nodeTypes:RE,edgeTypes:zE,minZoom:.05,maxZoom:2,zoomOnDoubleClick:!1,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},children:[(0,P.jsx)(kp,{showInteractive:!1}),d&&(0,P.jsx)(FE,{width:d.width,height:d.height,edges:d.edges.length,fitKey:r,onSettled:o}),(0,P.jsx)(em,{})]})}function FE({width:e,height:t,edges:n,fitKey:r,onSettled:i}){let{setViewport:a}=od(),o=G(e=>e.width),s=G(e=>e.height);return(0,O.useEffect)(()=>{if(o===0||s===0)return;let c=Math.min(1,(o-64)/Math.max(e,1),(s-64)/Math.max(t,1));a({x:(o-e*c)/2,y:(s-t*c)/2,zoom:c});let l=0,u=()=>{document.querySelectorAll(`path[data-edge-from]`).length>=n?i(r):l=window.requestAnimationFrame(u)};return l=window.requestAnimationFrame(u),()=>window.cancelAnimationFrame(l)},[e,t,r,o>0&&s>0]),null}var IE=(0,O.memo)(function({id:e,data:t}){return(0,P.jsxs)(`div`,{className:`arc-box arc-graph-node`,"data-graph-node":e,children:[(0,P.jsx)(Nd,{type:`target`,position:U.Left,isConnectable:!1,className:`arc-handle`}),(0,P.jsx)(Nd,{type:`source`,position:U.Right,isConnectable:!1,className:`arc-handle`}),(0,P.jsx)(`div`,{className:`arc-text`,children:(0,P.jsx)(`div`,{className:`arc-name`,children:t.name})})]})});function LE({data:e,markerEnd:t}){let{points:n,pair:r,selected:i,onSelect:a}=e,o=n.map((e,t)=>`${t===0?`M`:`L`}${e.x} ${e.y}`).join(` `),s=Math.floor((n.length-1)/2),[c,l]=[n[s],n[s+1]??n[s]],u=r.messages.some(e=>e.n===i);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`path`,{className:u?`arc-edge arc-lit`:`arc-edge`,d:o,fill:`none`,markerEnd:t,"data-edge-from":r.from,"data-edge-to":r.to}),(0,P.jsx)(mp,{children:(0,P.jsx)(`div`,{className:`arc-graph-steps nodrag nopan`,style:{transform:`translate(-50%, -50%) translate(${(c.x+l.x)/2}px, ${(c.y+l.y)/2}px)`},children:r.messages.map(e=>(0,P.jsx)(`button`,{type:`button`,className:`arc-graph-step arc-step-${e.style}`,"data-graph-step":e.key,"aria-pressed":e.n===i,title:e.label,onClick:()=>a(e.n),children:e.key},e.key))})})]})}var RE={participant:IE},zE={steps:LE},BE=1400,VE=e=>e.kind===`return`?`return`:e.interaction,HE={sync:`Sync call`,async:`Async`,return:`Return`};function UE({workspace:e,view:t,place:n,keys:r,onOpenStepView:i,onOpenView:a}){let o=t.steps,s=o.findIndex(e=>e.n===n.step),c=s<0?void 0:o[s],[l,u]=(0,O.useState)(!1),d=Xp(),f=(0,O.useCallback)(t=>e.name(t),[e]),p=(0,O.useMemo)(()=>Fm(t,{name:f,brokers:n.brokers}),[t,f,n.brokers]),m=`${t.id}|${n.brokers?`brokers`:`direct`}|${n.graph?`graph`:`sequence`}`,[h,g]=(0,O.useState)(),_=(0,O.useCallback)(e=>bT({...n,step:e},{replace:!0}),[n]),v=(0,O.useCallback)(e=>_(o[Math.max(0,Math.min(o.length-1,e))]?.n??null),[_,o]),y=(0,O.useCallback)(()=>v(s<0?0:s+1),[v,s]),b=(0,O.useCallback)(()=>v(s<0?0:s-1),[v,s]),x=(0,O.useCallback)(()=>{if(l)return u(!1);(s<0||s===o.length-1)&&v(0),u(o.length>1)},[l,s,o.length,v]);(0,O.useEffect)(()=>{if(!l)return;let e=window.setTimeout(()=>{let e=s+1;v(e),e>=o.length-1&&u(!1)},BE);return()=>window.clearTimeout(e)},[l,s,o.length,v]),(0,O.useEffect)(()=>{if(!r)return;let e=e=>{if(!(e.target instanceof HTMLElement&&(e.target.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(e.target.tagName))||e.metaKey||e.ctrlKey||e.altKey)){if(e.key===` `)x();else if(e.key===`j`||e.key===`ArrowDown`)y();else if(e.key===`k`||e.key===`ArrowUp`)b();else if(e.key===`Escape`)u(!1),_(null);else return;e.preventDefault()}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r,x,y,b,_]),(0,O.useEffect)(()=>{c&&document.querySelector(`.arc-outline [data-step="${c.n}"]`)?.scrollIntoView({block:`nearest`})},[c]);let S=h===m;return(0,P.jsxs)(`div`,{className:`arc-dynamic`,children:[(0,P.jsxs)(`aside`,{className:`arc-dyn-left`,"aria-label":`Walkthrough`,children:[(0,P.jsxs)(`div`,{className:`arc-transport`,role:`group`,"aria-label":`Transport`,children:[(0,P.jsxs)(`div`,{className:`arc-transport-buttons`,children:[(0,P.jsx)(`button`,{type:`button`,"aria-label":`First Step`,onClick:()=>v(0),children:(0,P.jsx)(L,{name:`first`})}),(0,P.jsx)(`button`,{type:`button`,"aria-label":`Previous Step`,onClick:b,children:(0,P.jsx)(L,{name:`previous`})}),(0,P.jsx)(`button`,{type:`button`,className:`arc-play`,"aria-label":l?`Pause`:`Play`,onClick:x,children:(0,P.jsx)(L,{name:l?`pause`:`play`})}),(0,P.jsx)(`button`,{type:`button`,"aria-label":`Next Step`,onClick:y,children:(0,P.jsx)(L,{name:`next`})})]}),(0,P.jsx)(`p`,{className:`arc-transport-count`,"aria-live":`polite`,children:c?`Step ${c.n} of ${o.length}`:`${o.length} Steps`}),(0,P.jsxs)(`div`,{className:`arc-progress`,role:`group`,"aria-label":`Progress`,children:[(0,P.jsx)(`span`,{className:`arc-progress-fill`,style:{width:`${o.length===0?0:(s+1)/o.length*100}%`}}),o.map(e=>(0,P.jsx)(`button`,{type:`button`,className:`arc-tick`,"aria-label":`Go to Step ${e.n}`,"aria-current":e.n===c?.n?`step`:void 0,onClick:()=>_(e.n)},e.n))]})]}),(0,P.jsx)(`ol`,{className:`arc-outline`,"aria-label":`Steps`,children:o.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,"data-step":t.n,"aria-current":t.n===c?.n?`step`:void 0,onClick:()=>_(t.n),children:[(0,P.jsx)(`span`,{className:`arc-outline-n`,children:t.n}),(0,P.jsxs)(`span`,{className:`arc-outline-text`,children:[(0,P.jsx)(`span`,{className:`arc-outline-label`,children:t.description}),(0,P.jsxs)(`span`,{className:`arc-outline-ends`,children:[e.name(t.from),` `,(0,P.jsx)(WE,{style:VE(t)}),` `,e.name(t.to)]})]})]})},t.n))})]}),(0,P.jsxs)(`section`,{className:`arc-dyn-main`,"aria-label":`Chart`,children:[(0,P.jsxs)(`header`,{className:`arc-location`,children:[(0,P.jsxs)(`div`,{className:`arc-dyn-title`,children:[(0,P.jsx)(`span`,{className:`arc-panel-kind`,children:`Dynamic View`}),(0,P.jsx)(`h1`,{children:t.title})]}),(0,P.jsxs)(`div`,{className:`arc-tools`,children:[(0,P.jsxs)(`label`,{className:`arc-check`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:n.brokers,onChange:e=>bT({...n,brokers:e.target.checked},{replace:!0})}),`Show brokers`]}),(0,P.jsx)(`div`,{className:`arc-segmented`,role:`group`,"aria-label":`Chart`,children:[`Sequence`,`Graph`].map(e=>(0,P.jsx)(`button`,{type:`button`,"aria-pressed":e===`Graph`===n.graph,onClick:()=>bT({...n,graph:e===`Graph`},{replace:!0}),children:e},e))}),(0,P.jsx)(gE,{}),(0,P.jsx)(_E,{}),(0,P.jsx)(dE,{picks:0,onExport:(r,i)=>void NT(e,t,n.brokers,i).then(e=>IT(e,FT(t.id,i)))})]})]}),(0,P.jsx)(`div`,{className:`arc-canvas`,"data-canvas":!0,"data-state":S?`ready`:`busy`,children:n.graph?(0,P.jsx)(NE,{workspace:e,view:t,brokers:n.brokers,fitKey:m,selected:c?.n??null,onSelect:_,onSettled:g},m):(0,P.jsx)(SE,{workspace:e,layout:p,fitKey:m,selected:c?.n??null,playing:l,reducedMotion:d,onSelect:_,onSettled:g},m)})]}),(0,P.jsx)(`aside`,{className:`arc-dyn-detail`,"aria-label":`Step detail`,children:c?(0,P.jsx)(KE,{workspace:e,view:t,step:c,onOpenStepView:i,onOpenView:a}):(0,P.jsx)(qE,{workspace:e,view:t})})]})}function WE({style:e}){return(0,P.jsx)(`span`,{className:`arc-glyph arc-step-${e}`,"aria-label":HE[e],role:`img`})}var GE={call:`Call`,return:`Return`,event:`Event`};function KE({workspace:e,view:t,step:n,onOpenStepView:r,onOpenView:i}){let a=n.relationship,s=e.byId.get(a.from)?.owner,c=s?e.teams.get(s):void 0,l=o(e.bundle,n.relationship).filter(e=>e.id!==t.id);return(0,P.jsxs)(`div`,{className:`arc-panel-body`,children:[(0,P.jsxs)(`h2`,{children:[`Step `,n.n]}),(0,P.jsx)(`p`,{className:`arc-panel-kind`,children:GE[n.kind]}),(0,P.jsx)(`p`,{className:`arc-description`,children:n.description}),(0,P.jsxs)(`p`,{className:`arc-outline-ends`,children:[e.name(n.from),` `,(0,P.jsx)(WE,{style:VE(n)}),` `,e.name(n.to)]}),n.note&&(0,P.jsx)(`p`,{className:`arc-note`,children:n.note}),(0,P.jsx)(`h3`,{children:`Relationship`}),(0,P.jsxs)(`dl`,{className:`arc-facts`,children:[(0,P.jsx)(`dt`,{children:`Id`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(`code`,{children:a.id??`${a.from} → ${a.to}`})}),a.description&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Description`}),(0,P.jsx)(`dd`,{children:a.description})]}),(0,P.jsx)(`dt`,{children:`Interaction`}),(0,P.jsx)(`dd`,{children:a.interaction}),a.technology&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Technology`}),(0,P.jsx)(`dd`,{children:a.technology})]}),a.via&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Via`}),(0,P.jsxs)(`dd`,{children:[e.name(a.via),a.channel&&` · ${a.channel}`]})]}),s&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Owner`}),(0,P.jsxs)(`dd`,{children:[(0,P.jsx)(`span`,{className:`arc-owner-code arc-code-tile`,style:{"--team":c?.color},children:c?.code}),` `,e.name(s)]})]})]}),(0,P.jsx)(`h3`,{id:`arc-open-in`,children:`Open in`}),(0,P.jsx)(`ul`,{className:`arc-view-links`,"aria-labelledby":`arc-open-in`,children:v(e.bundle,n).map(t=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>r(t,n),children:e.title(t)??t})},t))}),l.length>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`h3`,{id:`arc-also-in`,children:`Also in`}),(0,P.jsx)(`ul`,{className:`arc-view-links`,"aria-labelledby":`arc-also-in`,children:l.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>i(e.id),children:e.title})},e.id))})]})]})}function qE({workspace:e,view:t}){let n=e.description(t.id);return(0,P.jsxs)(`div`,{className:`arc-panel-body`,children:[(0,P.jsx)(`h2`,{children:t.title}),(0,P.jsx)(`p`,{className:`arc-panel-kind`,children:`Dynamic View`}),n&&(0,P.jsx)(`p`,{className:`arc-description`,children:n}),(0,P.jsxs)(`p`,{className:`arc-muted`,children:[t.steps.length,` Steps across `,t.participants.length,` participants. Press Space to play, J and K to step, Esc to clear.`]}),(0,P.jsx)(`h3`,{id:`arc-participants`,children:`Participants`}),(0,P.jsx)(`ul`,{"aria-labelledby":`arc-participants`,children:t.participants.map(t=>(0,P.jsx)(`li`,{children:e.name(t)},t))}),(0,P.jsx)(`h3`,{id:`arc-legend`,children:`Legend`}),(0,P.jsxs)(`ul`,{className:`arc-legend`,"aria-labelledby":`arc-legend`,children:[[`sync`,`async`,`return`].map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(WE,{style:e}),` `,HE[e]]},e)),(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-legend-bar`,"aria-hidden":`true`}),` Busy with a sync call`]})]})]})}function JE(e,t={}){let n=t.element===void 0?void 0:YE(e,t.element);return e.adrs.flatMap(e=>{if(t.status!==void 0&&e.effectiveStatus!==t.status||t.tag!==void 0&&!e.tags.includes(t.tag))return[];if(!n)return[e];let r=e.elements.filter(e=>n.has(e));return r.length?[{...e,matchedVia:r}]:[]}).sort((e,t)=>ZE(t.date,e.date)||ZE(XE(t),XE(e))||ZE(e.id,t.id))}function YE(e,t){let n=[...e.elements,...e.targets],r=new Set([t]);for(let e=!0;e;){e=!1;for(let t of n)t.parent!==null&&r.has(t.parent)&&!r.has(t.id)&&(e=!!r.add(t.id))}return r}var XE=e=>e.id.slice(e.id.indexOf(`:`)+1),ZE=(e,t)=>e<t?-1:+(e>t);function QE(e,t,n){let r=new Map(e.targets.map(e=>[e.id,e]));return e.deployments.filter(e=>e.service===t&&(n===void 0||e.environment===n)).map(e=>({...e,targetPath:$E(r,e.target)}))}function $E(e,t){let n=[],r=new Set;for(let i=e.get(t);i&&!r.has(i.id);i=i.parent===null?void 0:e.get(i.parent))r.add(i.id),n.unshift({id:i.id,name:i.name,kind:i.kind});return n}function eD(e,t){if(e.kind===`project`){let t=`${e.id}:`;return n=>n.some(n=>n===e.id||n.startsWith(t))}let n=new Set([e.id]);for(let r of t)if(e.kind===`team`)for(let t of[...r.elements,...r.targets,...r.projects])t.owner===e.id&&n.add(t.id);else{let e=!0;for(;e;){e=!1;for(let t of r.elements)t.parent!==null&&n.has(t.parent)&&!n.has(t.id)&&(n.add(t.id),e=!0)}}return e=>e.some(e=>n.has(e))}var tD=[`Overview`,`URLs`,`ADRs`,`Links`,`History`];function nD({workspace:e,id:t,onLens:r,onConnect:i,onFocus:a,onOpenView:o,onOpenAdr:s,onDeployed:c,timeline:l,comparison:u,onTime:d,onClose:f}){let[p,m]=(0,O.useState)(`Overview`),h=(0,O.useMemo)(()=>({ADRs:JE(e.bundle,{element:t}).length,Links:e.bundle.relationships.filter(e=>e.from===t||e.to===t).length}),[e,t]),g=e.byId.get(t);if(!g)return null;let _=e.teams.get(g.owner),v=`technology`in g?g.technology:null,y=`repository`in g?g.repository:null,b=Object.entries(g.metadata),x=v||y||g.links.length>0||g.tags.length>0,S=(g.kind===`system`||g.kind===`service`)&&g.external?`External ${g.kind}`:g.kind[0].toUpperCase()+g.kind.slice(1);return(0,P.jsxs)(`aside`,{className:`arc-panel`,"aria-label":`Element`,children:[(0,P.jsxs)(`header`,{className:`arc-panel-head`,children:[(0,P.jsxs)(`div`,{className:`arc-panel-title`,children:[(0,P.jsx)(`h2`,{children:g.name}),(0,P.jsxs)(`p`,{className:`arc-panel-kind`,children:[S,` · `,(0,P.jsx)(`code`,{className:`arc-panel-id`,children:g.id})]}),(0,P.jsxs)(`button`,{type:`button`,className:`arc-owner`,"aria-label":`Team lens: ${e.name(g.owner)}`,style:{"--team":_?.color},onClick:()=>r({team:g.owner}),children:[(0,P.jsx)(`span`,{className:`arc-owner-code`,children:_?.code}),(0,P.jsx)(`span`,{className:`arc-owner-name`,children:e.name(g.owner)})]})]}),f&&(0,P.jsx)(`button`,{type:`button`,className:`arc-flyout-close`,"aria-label":`Close panel`,onClick:f,children:(0,P.jsx)(L,{name:`close`})})]}),(0,P.jsx)(`div`,{className:`arc-tabs`,role:`tablist`,"aria-label":`Element`,children:tD.map(e=>(0,P.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":p===e,onClick:()=>m(e),children:[e,h[e]!==void 0&&(0,P.jsxs)(`span`,{className:`arc-tab-count`,children:[` `,h[e]]})]},e))}),(0,P.jsxs)(`div`,{className:`arc-panel-body`,role:`tabpanel`,"aria-label":p,children:[p===`Overview`&&(0,P.jsxs)(P.Fragment,{children:[u&&(0,P.jsx)(lD,{comparison:u,id:t}),g.description&&(0,P.jsx)(`section`,{className:`arc-markdown arc-description`,role:`region`,"aria-label":`Description`,children:(0,P.jsx)(pe,{source:g.description,shift:2})}),x&&(0,P.jsxs)(`dl`,{className:`arc-facts`,"aria-label":`Details`,children:[v&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Technology`}),(0,P.jsx)(`dd`,{children:v})]}),y&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Repository`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(`a`,{className:`arc-fact-link`,href:y,target:`_blank`,rel:`noreferrer`,children:rD(y)})})]}),g.links.length>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Links`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(`ul`,{className:`arc-fact-list`,children:g.links.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsx)(`a`,{className:`arc-fact-link`,href:e.url,target:`_blank`,rel:`noreferrer`,children:e.label})},e.url))})})]}),g.tags.length>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`Tags`}),(0,P.jsx)(`dd`,{children:g.tags.join(`, `)})]})]}),b.length>0&&(0,P.jsxs)(`section`,{role:`region`,"aria-label":`Metadata`,children:[(0,P.jsx)(`h3`,{children:`Metadata`}),(0,P.jsx)(`dl`,{className:`arc-facts`,children:b.map(([e,t])=>(0,P.jsxs)(O.Fragment,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]},e))})]}),(0,P.jsxs)(`section`,{className:`arc-actions`,"aria-label":`Ask`,children:[(0,P.jsxs)(`button`,{type:`button`,className:`arc-action`,"aria-label":`Both ways impact`,onClick:()=>r({impact:t,direction:`both`}),children:[(0,P.jsx)(L,{name:`impact`}),`Upstream & downstream`]}),(0,P.jsxs)(`button`,{type:`button`,className:`arc-action`,title:`Lights the paths to the node you pick next, and picks every node on them`,onClick:()=>i(t),children:[(0,P.jsx)(L,{name:`connect`}),`Connect to…`]}),n(e.bundle,t)!==void 0&&(0,P.jsxs)(`button`,{type:`button`,className:`arc-action`,onClick:()=>o(t),children:[(0,P.jsx)(L,{name:`open`}),`Open its View`]})]}),g.kind===`service`&&(0,P.jsx)(iD,{workspace:e,id:t,onDeployed:c})]}),p===`URLs`&&(0,P.jsx)(aD,{workspace:e,id:t}),p===`ADRs`&&(0,P.jsx)(sD,{workspace:e,id:t,onOpen:s}),p===`Links`&&(0,P.jsx)(cD,{workspace:e,id:t,onFocus:a}),p===`History`&&(0,P.jsx)(uD,{workspace:e,id:t,timeline:l,onTime:d})]})]})}function rD(e){return e.replace(/^[a-z+]+:\/\//i,``).replace(/\.git$/,``).replace(/\/$/,``)}function iD({workspace:e,id:t,onDeployed:n}){let r=(0,O.useMemo)(()=>e.deployedIn(t),[e,t]);return(0,P.jsxs)(`section`,{className:`arc-actions`,role:`region`,"aria-label":`Where is it deployed?`,children:[(0,P.jsx)(`h3`,{children:`Where is it deployed?`}),r.length===0?(0,P.jsx)(`p`,{className:`arc-empty`,children:`Not deployed in any Environment.`}):(0,P.jsx)(`div`,{className:`arc-deployed`,children:r.map(e=>(0,P.jsx)(`button`,{type:`button`,className:`arc-action`,onClick:()=>n(e.view,e.nodes),children:e.label},e.environment))})]})}function aD({workspace:e,id:t}){let n=(0,O.useMemo)(()=>QE(e.bundle,t),[e,t]);if(n.length===0)return(0,P.jsx)(`p`,{className:`arc-empty`,children:`No Deployments.`});let r=e.bundle.environments.filter(e=>n.some(t=>t.environment===e.id));return(0,P.jsx)(P.Fragment,{children:r.map(e=>(0,P.jsxs)(`section`,{className:`arc-env`,role:`region`,"aria-label":e.name,children:[(0,P.jsx)(`h3`,{children:e.name}),(0,P.jsx)(`ul`,{children:n.filter(t=>t.environment===e.id).map(e=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`div`,{className:`arc-target`,children:e.targetPath.map(e=>e.name).join(` › `)||e.target}),e.url?(0,P.jsx)(oD,{url:e.url}):(0,P.jsx)(`p`,{className:`arc-empty`,children:`No URL`}),e.endpoints.map(e=>(0,P.jsx)(oD,{name:e.name,url:e.url},e.name))]},e.target))})]},e.id))})}function oD({name:e,url:t}){let[n,r]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{if(!n)return;let e=window.setTimeout(()=>r(!1),1500);return()=>window.clearTimeout(e)},[n]),(0,P.jsxs)(`div`,{className:`arc-url`,children:[e&&(0,P.jsx)(`span`,{className:`arc-endpoint`,children:e}),(0,P.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,children:t}),(0,P.jsx)(`button`,{type:`button`,className:`arc-copy`,"aria-label":`Copy ${t}`,onClick:()=>void navigator.clipboard.writeText(t).then(()=>r(!0)),children:n?`Copied`:`Copy`})]})}function sD({workspace:e,id:t,onOpen:n}){let r=(0,O.useMemo)(()=>JE(e.bundle,{element:t}),[e,t]);return r.length===0?(0,P.jsx)(`p`,{className:`arc-empty`,children:`No ADRs link this Element or anything inside it.`}):(0,P.jsx)(`ul`,{className:`arc-adr-list`,children:r.map(e=>(0,P.jsx)(`li`,{"data-superseded":e.effectiveStatus===`superseded`?`true`:void 0,children:(0,P.jsxs)(`button`,{type:`button`,className:`arc-adr-row`,onClick:()=>n(e.id),children:[(0,P.jsx)(`code`,{className:`arc-adr-id`,children:e.id}),(0,P.jsx)(`span`,{className:`arc-adr-title`,children:e.title}),(0,P.jsx)(Te,{status:e.effectiveStatus}),(0,P.jsx)(`time`,{className:`arc-muted`,dateTime:e.date,children:e.date})]})},e.id))})}function cD({workspace:e,id:t,onFocus:n}){let r=(0,O.useMemo)(()=>i(e.bundle,t,`both`),[e,t]),a=e.bundle.relationships.filter(e=>e.from===t||e.to===t),o=t=>(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>n(t),children:e.name(t)}),s=(e,n)=>(0,P.jsxs)(`li`,{className:`arc-link-row`,children:[(0,P.jsx)(`span`,{"aria-label":e.from===t?`to`:`from`,children:e.from===t?`→`:`←`}),o(e.from===t?e.to:e.from),(e.description||e.technology)&&(0,P.jsxs)(`span`,{className:`arc-muted arc-link-what`,children:[e.description,e.description&&e.technology&&` · `,e.technology]})]},n),c=(e,t)=>(0,P.jsxs)(`section`,{role:`region`,"aria-label":e,children:[(0,P.jsx)(`h3`,{children:e}),!t?.length&&(0,P.jsx)(`p`,{className:`arc-empty`,children:`Nothing`}),(0,P.jsx)(`ul`,{children:t?.flatMap(e=>e.elements.map(t=>(0,P.jsxs)(`li`,{children:[(0,P.jsx)(`span`,{className:`arc-distance-inline`,children:e.distance}),` `,o(t.id)]},t.id)))})]});return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`section`,{role:`region`,"aria-label":`Relationships`,children:[(0,P.jsx)(`h3`,{children:`Relationships`}),a.length===0&&(0,P.jsx)(`p`,{className:`arc-empty`,children:`None declared here`}),(0,P.jsx)(`ul`,{children:a.map(s)})]}),c(`Downstream`,r.downstream),c(`Upstream`,r.upstream)]})}function lD({comparison:e,id:t}){let n=e.changes.find(e=>e.kind===`element`&&e.id===t);if(!n)return null;let r=e=>e===void 0?`—`:JSON.stringify(e);return(0,P.jsxs)(`section`,{className:`arc-compared`,role:`region`,"aria-label":`Changed in this comparison`,children:[(0,P.jsx)(`h3`,{children:n.type===`changed`?`Changed, ${e.label}`:`${n.type===`added`?`Added`:`Removed`}, ${e.label}`}),n.type===`changed`&&(0,P.jsx)(`dl`,{className:`arc-fields`,children:n.fields.map(e=>(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsxs)(`dd`,{children:[r(n.before?.[e]),` → `,r(n.after?.[e])]})]},e))})]})}function uD({workspace:e,id:t,timeline:n,onTime:r}){let i=(0,O.useMemo)(()=>Km(n.revisions,eD({kind:`element`,id:t},[e.bundle])),[e,t,n]);return n.revisions.length===0?(0,P.jsx)(`p`,{className:`arc-empty`,children:`This site has no history.`}):i.length===0?(0,P.jsx)(`p`,{className:`arc-empty`,children:`No Revision changed it.`}):(0,P.jsx)(`ul`,{className:`arc-history-list`,children:i.map(e=>{let t=n.previous(e),i=n.isLatest(e)?null:HT(e);return(0,P.jsxs)(`li`,{children:[(0,P.jsx)(aE,{revision:e}),t?(0,P.jsx)(`button`,{type:`button`,"aria-label":`Compare ${HT(t)} → ${HT(e)}`,onClick:()=>r({at:i,vs:HT(t)}),children:`Compare`}):(0,P.jsx)(`button`,{type:`button`,"aria-label":`Open ${HT(e)}`,onClick:()=>r({at:i,vs:null}),children:`Open`})]},e.sha)})})}var dD={added:`Added in this comparison`,removed:`Removed in this comparison`,changed:`Changed in this comparison`};function fD({workspace:e,edge:t,fromName:n,toName:r,onSelectNode:i,onFocus:a,onClose:o}){let s=t.relationships.length,c=s===1&&t.relationships[0].from===t.from&&t.relationships[0].to===t.to;return(0,P.jsxs)(`aside`,{className:`arc-panel arc-rel-panel`,"aria-label":`Relationship`,children:[(0,P.jsxs)(`header`,{className:`arc-panel-head`,children:[(0,P.jsxs)(`div`,{className:`arc-panel-title`,children:[(0,P.jsxs)(`h2`,{className:`arc-rel-title`,children:[(0,P.jsx)(`button`,{type:`button`,className:`arc-rel-end`,title:`Select ${n}`,onClick:()=>i(t.from),children:n}),(0,P.jsx)(L,{name:`arrow`,className:`arc-rel-arrow`}),(0,P.jsx)(`button`,{type:`button`,className:`arc-rel-end`,title:`Select ${r}`,onClick:()=>i(t.to),children:r})]}),(0,P.jsxs)(`p`,{className:`arc-panel-kind`,children:[`Relationship`,s===1?``:` · ${s} declared`]})]}),(0,P.jsx)(`button`,{type:`button`,className:`arc-flyout-close`,"aria-label":`Close panel`,onClick:o,children:(0,P.jsx)(L,{name:`close`})})]}),(0,P.jsxs)(`div`,{className:`arc-panel-body`,children:[t.change&&t.change!==`unchanged`&&(0,P.jsx)(`p`,{className:`arc-rel-change arc-${t.change}`,children:dD[t.change]}),!c&&s>0&&(0,P.jsx)(`p`,{className:`arc-muted arc-rel-note`,children:`This edge stands for every Relationship between what these two boxes hold.`}),s===0&&(0,P.jsx)(`p`,{className:`arc-empty`,children:`No Relationships are declared beneath this edge.`}),(0,P.jsx)(`ul`,{className:`arc-rel-list`,children:t.relationships.map((t,n)=>(0,P.jsx)(`li`,{children:(0,P.jsx)(pD,{workspace:e,relationship:t,showEnds:!c,onFocus:a})},t.id??`${t.source.file}:${t.source.line}:${n}`))})]})]})}function pD({workspace:e,relationship:t,showEnds:n,onFocus:r}){let i=t=>(0,P.jsx)(`button`,{type:`button`,className:`arc-link`,onClick:()=>r(t),children:e.name(t)});return(0,P.jsxs)(`section`,{className:`arc-rel`,role:`region`,"aria-label":`${e.name(t.from)} to ${e.name(t.to)}`,children:[n&&(0,P.jsxs)(`h3`,{className:`arc-rel-ends`,children:[i(t.from),(0,P.jsx)(`span`,{"aria-label":`to`,children:`→`}),i(t.to)]}),t.description?(0,P.jsx)(`p`,{className:`arc-description`,children:t.description}):(0,P.jsx)(`p`,{className:`arc-empty`,children:`No description.`}),(0,P.jsxs)(`dl`,{className:`arc-facts`,children:[t.technology&&(0,P.jsx)(mD,{term:`Technology`,children:t.technology}),(0,P.jsx)(mD,{term:`Interaction`,children:t.interaction===`async`?`Asynchronous`:`Synchronous`}),t.via&&(0,P.jsx)(mD,{term:`Via`,children:i(t.via)}),t.channel&&(0,P.jsx)(mD,{term:`Channel`,children:(0,P.jsx)(`code`,{children:t.channel})}),t.tags.length>0&&(0,P.jsx)(mD,{term:`Tags`,children:(0,P.jsx)(`span`,{className:`arc-rel-tags`,children:t.tags.map(e=>(0,P.jsx)(`span`,{className:`arc-rel-tag`,children:e},e))})}),t.id&&(0,P.jsx)(mD,{term:`Id`,children:(0,P.jsx)(`code`,{className:`arc-panel-id`,children:t.id})}),(0,P.jsx)(mD,{term:`Declared in`,children:(0,P.jsxs)(`code`,{className:`arc-panel-id`,children:[t.source.file,`:`,t.source.line]})})]})]})}function mD({term:e,children:t}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:e}),(0,P.jsx)(`dd`,{children:t})]})}function hD(e,t,n={}){let r=gD(t),i=new Map;for(let t of e.deployments){let e=i.get(t.service)??[];for(let n of[t.url,...t.endpoints.map(e=>e.url)])n&&e.push({environment:t.environment,target:t.target,url:n});i.set(t.service,e)}let a=new Map(e.teams.map(e=>[e.id,e.name])),o=e=>[...n.fields?.includes(`team`)?[e.owner,a.get(e.owner)??``]:[],...n.fields?.includes(`technology`)&&`technology`in e&&e.technology?[e.technology]:[]],s=[];for(let t of e.elements){if(n.kind&&t.kind!==n.kind)continue;let e=_D(r,t)??(yD(r,o(t).map(e=>e.toLowerCase()))===void 0?void 0:2),a=e===void 0?void 0:{element:t,rank:e};for(let e of i.get(t.id)??[]){let n=vD(r,e.url);n!==void 0&&(a===void 0||n<a.rank)&&(a={element:t,rank:n,deployment:e})}a&&s.push(a)}return s.sort((e,t)=>e.rank-t.rank||(e.element.id<t.element.id?-1:+(e.element.id>t.element.id)))}var gD=e=>e.trim().toLowerCase().replace(/\/+$/,``);function _D(e,t){return yD(e,[t.id,t.id.slice(t.id.indexOf(`:`)+1),t.name].map(e=>e.toLowerCase()))}function vD(e,t){let n=gD(t),r=n.replace(/^[a-z][a-z0-9+.-]*:\/\//,``),i=r.replace(/[/?#].*$/,``);return e===n||e===r||e===i?0:[n,r].some(t=>/^[/?#]/.test(e.slice(t.length))&&e.startsWith(t))?1:yD(e,[n,r])}function yD(e,t){if(t.some(t=>t===e))return 0;if(t.some(t=>t.startsWith(e)))return 1;if(t.some(t=>t.includes(e)))return 2}function bD(e,t,n){let r=u(e,t,n);return r?.kind===`dynamic`?void 0:r}function xD(e){let t=_(e);return t?.form===`focused`?t.element:void 0}var SD=(e,t)=>e.name.localeCompare(t.name)||e.id.localeCompare(t.id),CD={person:`◉`,system:`▣`,service:`▭`,component:`◇`},wD=class{bundle;byId;targets;teams;views;childrenOf=new Map;viewIds;workspaceName;constructor(e,t=`Workspace`){this.bundle=e,this.workspaceName=t,this.byId=new Map(e.elements.map(e=>[e.id,e])),this.targets=new Map(e.targets.map(e=>[e.id,e])),this.teams=m(e),this.views=c(e),this.viewIds=new Set(this.views.map(e=>e.id));for(let t of e.elements){let e=this.childrenOf.get(t.parent)??[];e.push(t),this.childrenOf.set(t.parent,e)}for(let e of this.childrenOf.values())e.sort(SD)}children(e){return this.childrenOf.get(e)??[]}ancestors(e){let t=[];for(let n=this.byId.get(e)?.parent??null;n!==null&&!t.includes(n);n=this.byId.get(n)?.parent??null)t.unshift(n);return t}title(e){return this.views.find(t=>t.id===e)?.title}description(e){return this.bundle.views.find(t=>t.id===e)?.description??null}name(e){return this.byId.get(e)?.name??[...this.bundle.teams,...this.bundle.environments].find(t=>t.id===e)?.name??e}wayIn(e){let t=n(this.bundle,e);return t!==void 0&&xD(t)===e&&this.viewIds.has(t)?t:void 0}deeper(e){if(e===`c1`)return this.viewIds.has(`c2`)?[{label:`C2 Landscape`,view:`c2`}]:[];let t=_(e);return(t?.form===`landscape`?this.children(null).filter(e=>e.kind===`system`):t?.form===`focused`&&t.level===`c2`?this.children(t.element):[]).flatMap(e=>{let t=this.wayIn(e.id);return t===void 0?[]:[{label:e.name,view:t}]})}deployedIn(e){return this.bundle.environments.map(e=>({environment:e.id,label:e.name,view:r({form:`deployment`,environment:e.id})})).map(t=>({...t,nodes:bD(this.bundle,t.view,{lens:`none`})?.nodes.filter(t=>t.kind===`deployment`&&t.element===e).map(e=>e.id)??[]})).filter(e=>e.nodes.length>0)}crumbs(e){let t=this.bundle.views.find(t=>t.id===e);if(t)return[{label:`Saved`},{label:this.bundle.projects.find(e=>e.id===t.project)?.name??t.project},{label:t.title,view:e}];let n=[{label:`C1`,view:`c1`}];if(e===`c1`)return n;let i=_(e);if(i?.form===`deployment`)return[...n,{label:this.title(e)??e,view:e}];n.push({label:`C2 Landscape`,view:`c2`});let a=i?.form===`focused`?this.byId.get(i.element):void 0;if(!a)return n;let o=[...this.ancestors(a.id),a.id].map(e=>this.byId.get(e)).find(e=>e.kind===`system`);return o&&n.push({label:o.name,view:r({form:`focused`,level:`c2`,element:o.id})}),i?.form===`focused`&&i.level===`c3`&&n.push({label:a.name,view:e}),n}modelByKind(){let e=this.children(null);return[[`People`,e.filter(e=>e.kind===`person`)],[`Systems`,e.filter(e=>e.kind===`system`&&!e.external)],[`External Systems`,e.filter(e=>e.kind===`system`&&e.external)],[`Services`,e.filter(e=>e.kind===`service`)]].filter(([,e])=>e.length>0).map(([e,t])=>({key:`kind:${e}`,label:e,children:t.map(e=>this.elementRow(e,()=>!0))}))}modelByTeam(){return[...this.bundle.teams].sort(SD).map(e=>{let t=this.bundle.elements.filter(t=>t.owner===e.id&&(t.parent===null||this.byId.get(t.parent)?.owner!==e.id)).sort(SD);return{key:`team:${e.id}`,label:e.name,team:this.teams.get(e.id),children:t.map(t=>this.elementRow(t,t=>t.owner===e.id))}}).filter(e=>e.children.length>0)}elementRow(e,t){return{key:e.id,label:e.name,element:e.id,glyph:CD[e.kind],team:this.teams.get(e.owner),children:this.children(e.id).filter(t).map(e=>this.elementRow(e,t))}}viewsByKind(){return[{key:`views:landscapes`,label:`Landscapes`,children:this.landscapeRows()},...this.systemViewGroup(`Systems`,()=>!0),{key:`views:deployment`,label:`Deployment`,children:this.deploymentRows()},{key:`views:dynamic`,label:`Dynamic Views`,children:this.dynamicRows(()=>!0)},{key:`views:saved`,label:`Saved Views`,children:this.savedByProject()}].filter(e=>e.children.length>0)}viewsByTeam(){let e=[...this.bundle.teams].sort(SD).flatMap(e=>{let[t]=this.systemViewGroup(e.name,t=>t===e.id,e.id);return[{...t,children:[...t.children,...this.dynamicRows(t=>t===e.id,e.id),...this.savedRows(t=>t===e.id,e.id)]}]});return[{key:`views:workspace`,label:`Workspace`,children:[...this.landscapeRows(),...this.deploymentRows()]},...e].filter(e=>e.children.length>0)}landscapeRows(){return this.views.filter(e=>_(e.id)?.form===`landscape`).map(e=>({key:e.id,label:e.title,view:e.id,children:[]}))}savedByProject(){return[...this.bundle.projects].sort(SD).map(e=>({key:`views:saved:${e.id}`,label:e.name,children:this.savedRows(()=>!0,void 0,e.id)})).filter(e=>e.children.length>0)}savedRows(e,t,n){let r=new Map(this.bundle.projects.map(e=>[e.id,e.owner]));return this.bundle.views.filter(t=>t.kind===`structural`&&(n===void 0||t.project===n)&&e(r.get(t.project)??``)).filter(e=>bD(this.bundle,e.id,{lens:`none`})!==void 0).sort((e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id)).map(e=>({key:e.id,label:e.title,view:e.id,glyph:`◇`,team:t?this.teams.get(t):void 0,children:[]}))}deploymentRows(){return this.views.filter(e=>_(e.id)?.form===`deployment`).map(e=>({key:e.id,label:e.title,view:e.id,glyph:`⛁`,children:[]}))}dynamicRows(e,t){let n=new Map(this.bundle.projects.map(e=>[e.id,e.owner]));return this.bundle.views.filter(t=>t.kind===`dynamic`&&e(n.get(t.project)??``)).sort((e,t)=>e.title.localeCompare(t.title)||e.id.localeCompare(t.id)).map(e=>({key:e.id,label:e.title,view:e.id,glyph:`▶`,team:t?this.teams.get(t):void 0,children:[]}))}systemViewGroup(e,t,n){let r=e=>({key:e.id,label:e.title,view:e.id,team:n?this.teams.get(n):void 0,children:[]}),i=e=>this.views.filter(n=>{let r=_(n.id);return r?.form===`focused`&&r.level===e&&t(this.byId.get(r.element)?.owner??``)}),a=i(`c3`),o=new Set,s=i(`c2`).map(e=>{let t=a.filter(t=>this.ancestors(xD(t.id)).includes(xD(e.id)));for(let e of t)o.add(e.id);return{...r(e),children:t.map(r)}}),c=a.filter(e=>!o.has(e.id)).map(r),l=[...s,...c].sort((e,t)=>e.label.localeCompare(t.label));return[{key:`views:${e}`,label:e,team:n?this.teams.get(n):void 0,children:l}]}},TD={Model:`model`,Teams:`teams`,Views:`views`};function ED({workspace:e,view:t,selected:n,home:r,onPickElement:i,onPickView:a,onPickTeam:o,finding:s,onFind:c,onOpenPanel:l}){let[u,d]=(0,O.useState)(null),[f,p]=(0,O.useState)({Model:`kind`,Views:`kind`}),[m,h]=(0,O.useState)(s);s!==m&&(h(s),s&&d(null)),(0,O.useEffect)(()=>{if(!u)return;let e=e=>e.key===`Escape`&&d(null);return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let g=(0,O.useMemo)(()=>u===`Model`?f.Model===`kind`?e.modelByKind():e.modelByTeam():u===`Views`?f.Views===`kind`?e.viewsByKind():e.viewsByTeam():[],[u,f,e]),_=e=>u===`Views`?e.view===t:e.element!==void 0&&e.element===(n??xD(t));return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`nav`,{className:`arc-rail`,"aria-label":`Rail`,children:[(0,P.jsx)(`a`,{className:`arc-logo-link`,href:r,"aria-label":`Archidocs home`,title:`Archidocs home`,children:(0,P.jsxs)(`svg`,{className:`arc-logo`,viewBox:`0 0 64 64`,"aria-hidden":`true`,focusable:`false`,children:[(0,P.jsx)(`path`,{className:`arc-logo-tile`,d:`M17 4H47A13 13 0 0 1 60 17V47A13 13 0 0 1 47 60H42V38A10 10 0 0 0 22 38V60H17A13 13 0 0 1 4 47V17A13 13 0 0 1 17 4Z`}),(0,P.jsx)(`path`,{className:`arc-logo-key`,d:`M26.5 12.5H37.5L35.5 21H28.5Z`})]})}),(0,P.jsxs)(`button`,{type:`button`,className:`arc-rail-button`,title:`Find ( / )`,"aria-label":`Find`,"aria-keyshortcuts":`/`,"aria-pressed":s,onClick:()=>(d(null),c()),children:[(0,P.jsx)(L,{name:`find`}),(0,P.jsx)(`span`,{className:`arc-rail-label`,"aria-hidden":`true`,children:`Find`})]}),[`Model`,`Teams`,`Views`].map(e=>(0,P.jsxs)(`button`,{type:`button`,className:`arc-rail-button`,title:e,"aria-label":e,"aria-expanded":u===e,onClick:()=>{u!==e&&l(),d(u===e?null:e)},children:[(0,P.jsx)(L,{name:TD[e]}),(0,P.jsx)(`span`,{className:`arc-rail-label`,"aria-hidden":`true`,children:e})]},e))]}),u===`Teams`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`arc-scrim`,onClick:()=>d(null)}),(0,P.jsxs)(`section`,{className:`arc-flyout`,role:`dialog`,"aria-label":`Teams`,children:[(0,P.jsxs)(`header`,{className:`arc-flyout-head`,children:[(0,P.jsx)(`h2`,{children:`Teams`}),(0,P.jsx)(DD,{onClose:()=>d(null)})]}),(0,P.jsx)(`ul`,{className:`arc-team-list`,children:[...e.bundle.teams].sort((e,t)=>e.name.localeCompare(t.name)).map(t=>{let n=e.teams.get(t.id);return(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{type:`button`,className:`arc-row-label`,onClick:()=>{d(null),o(t.id)},children:[(0,P.jsx)(`span`,{className:`arc-row-team`,style:{"--team":n?.color},children:n?.code}),` `,t.name]})},t.id)})})]})]}),u&&u!==`Teams`&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`arc-scrim`,onClick:()=>d(null)}),(0,P.jsxs)(`section`,{className:`arc-flyout`,role:`dialog`,"aria-label":u,children:[(0,P.jsxs)(`header`,{className:`arc-flyout-head`,children:[(0,P.jsx)(`h2`,{children:u}),(0,P.jsx)(DD,{onClose:()=>d(null)})]}),(0,P.jsx)(`div`,{className:`arc-flyout-by`,children:(0,P.jsx)(`div`,{className:`arc-segmented`,role:`radiogroup`,"aria-label":`Group`,children:[`kind`,`team`].map(e=>(0,P.jsxs)(`label`,{children:[(0,P.jsx)(`input`,{type:`radio`,name:`group-${u}`,checked:f[u]===e,onChange:()=>p({...f,[u]:e})}),(0,P.jsx)(`span`,{children:e===`kind`?`By kind`:`By Team`})]},e))})}),(0,P.jsx)(OD,{label:u,rows:g,isCurrent:_,onPick:e=>{d(null),e.view===void 0?e.element!==void 0&&i(e.element):a(e.view)}},`${u}:${f[u]}`)]})]})]})}function DD({onClose:e}){return(0,P.jsx)(`button`,{type:`button`,className:`arc-flyout-close`,"aria-label":`Close`,onClick:e,children:(0,P.jsx)(L,{name:`close`})})}function OD({label:e,rows:t,isCurrent:n,onPick:r}){let[i,a]=(0,O.useState)(()=>new Set(AD(t,n))),o=e=>a(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),s=(e,t)=>{let a=e.children.length>0?i.has(e.key):void 0,c=e.view!==void 0||e.element!==void 0;return(0,P.jsxs)(`li`,{role:`treeitem`,"aria-level":t,"aria-expanded":a,"aria-label":e.label,"aria-selected":n(e),children:[(0,P.jsxs)(`div`,{className:n(e)?`arc-row arc-current`:`arc-row`,style:{paddingLeft:8+(t-1)*14},children:[e.children.length>0?(0,P.jsx)(`button`,{type:`button`,className:a?`arc-disclosure arc-open`:`arc-disclosure`,"aria-label":`${a?`Collapse`:`Expand`} ${e.label}`,onClick:()=>o(e.key)}):(0,P.jsx)(`span`,{className:`arc-disclosure-space`}),kD(e)&&(0,P.jsx)(`span`,{className:`arc-vtag arc-vtag-${kD(e).toLowerCase()}`,children:kD(e)}),(0,P.jsxs)(`button`,{type:`button`,className:c?`arc-row-label`:`arc-row-label arc-group`,"aria-current":n(e)?`page`:void 0,onClick:()=>c?r(e):o(e.key),children:[e.view===void 0&&e.glyph&&Ce[e.glyph]&&(0,P.jsx)(L,{name:Ce[e.glyph],className:`arc-row-icon`}),e.label]}),e.children.length>0&&(0,P.jsx)(`span`,{className:`arc-count`,children:e.children.length}),e.team&&(0,P.jsx)(`span`,{className:`arc-row-team`,style:{"--team":e.team.color},children:e.team.code})]}),a&&(0,P.jsx)(`ul`,{role:`group`,children:e.children.map(e=>s(e,t+1))})]},e.key)};return(0,P.jsx)(`ul`,{className:`arc-tree`,role:`tree`,"aria-label":e,children:t.map(e=>s(e,1))})}function kD(e){if(e.view===void 0)return;if(e.glyph===`▶`)return`Dyn`;if(e.glyph===`◇`)return`Saved`;let t=_(e.view);if(e.glyph===`⛁`||t?.form===`deployment`)return`Env`;if(t?.form===`landscape`||t?.form===`focused`)return t.level.toUpperCase()}function AD(e,t,n=[]){for(let r of e){if(t(r))return n;let e=AD(r.children,t,[...n,r.key]);if(e.length>0)return e}return[]}var jD=30;function MD({workspace:e,prompt:t,onPick:n,onClose:r}){let[i,a]=(0,O.useState)(``),o=(0,O.useRef)(null),s=(0,O.useMemo)(()=>i.trim()?hD(e.bundle,i,{fields:[`team`,`technology`]}).slice(0,jD):[],[e,i]);return(0,O.useEffect)(()=>o.current?.focus(),[]),(0,O.useEffect)(()=>{let e=e=>e.key===`Escape`&&r();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`arc-scrim`,onClick:r}),(0,P.jsxs)(`section`,{className:`arc-flyout arc-find`,role:`dialog`,"aria-label":`Find`,children:[(0,P.jsxs)(`header`,{className:`arc-flyout-head`,children:[(0,P.jsx)(`h2`,{children:`Find`}),t&&(0,P.jsx)(`p`,{className:`arc-muted`,children:t}),(0,P.jsx)(DD,{onClose:r})]}),(0,P.jsx)(`input`,{ref:o,type:`search`,className:`arc-find-input`,placeholder:`Name, id, Team, technology or URL`,"aria-label":`Find`,"aria-controls":`arc-find-results`,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s[0]&&n(s[0].element.id)}}),(0,P.jsxs)(`ul`,{className:`arc-results`,id:`arc-find-results`,role:`listbox`,"aria-label":`Results`,children:[s.map(({element:t,deployment:r})=>{let i=e.teams.get(t.owner);return(0,P.jsxs)(`li`,{role:`option`,"aria-selected":`false`,tabIndex:-1,onClick:()=>n(t.id),onKeyDown:e=>e.key===`Enter`&&n(t.id),children:[(0,P.jsxs)(`span`,{className:`arc-result-name`,children:[(0,P.jsx)(L,{name:Ce[CD[t.kind]],className:`arc-row-icon`}),t.name]}),(0,P.jsx)(`code`,{className:`arc-muted`,children:t.id}),i&&(0,P.jsx)(`span`,{className:`arc-row-team`,style:{"--team":i.color},children:i.code}),r&&(0,P.jsxs)(`span`,{className:`arc-result-url`,children:[e.name(r.environment),` · `,r.url]})]},t.id)}),!i.trim()&&(0,P.jsx)(`li`,{className:`arc-empty`,children:`Start typing to see matching elements.`}),i.trim()&&s.length===0&&(0,P.jsx)(`li`,{className:`arc-empty`,children:`No matches`})]})]})]})}function ND(e){let t=Uw(Rw(`./`),{recheckMs:0}),n=async()=>{let n=await t.latest();return u(n,sT(window.location.hash).view)!==void 0&&(e(n),!0)};return window.__archidocsSwap=n,()=>{window.__archidocsSwap===n&&delete window.__archidocsSwap}}var PD=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)||`view`;function FD({workspace:e,screen:t,title:n,onClose:r}){let i=(0,O.useMemo)(()=>[...e.bundle.projects].sort((e,t)=>e.name.localeCompare(t.name)),[e]),a=e.bundle.views.find(e=>e.id===t.view)?.project,[o,c]=(0,O.useState)(a??i[0]?.id??``),[l,u]=(0,O.useState)(n),[d,f]=(0,O.useState)(PD(n)),p=(0,O.useMemo)(()=>{if(o)try{return s(e.bundle,t,{project:o,id:d||`view`,title:l||`View`})}catch(e){return{problem:e instanceof Error?e.message:String(e)}}},[e,t,o,d,l]);return(0,O.useEffect)(()=>{let e=e=>e.key===`Escape`&&r();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`arc-scrim`,onClick:r}),(0,P.jsxs)(`section`,{className:`arc-dialog`,role:`dialog`,"aria-label":`Save as View`,children:[(0,P.jsxs)(`header`,{className:`arc-flyout-head`,children:[(0,P.jsx)(`h2`,{children:`Save as View`}),(0,P.jsx)(`button`,{type:`button`,className:`arc-chip-clear`,"aria-label":`Close`,onClick:r,children:(0,P.jsx)(`span`,{className:`arc-chip-x`,"aria-hidden":`true`})})]}),(0,P.jsxs)(`div`,{className:`arc-form`,children:[(0,P.jsxs)(`label`,{children:[`Project`,(0,P.jsx)(`select`,{value:o,onChange:e=>c(e.target.value),children:i.map(e=>(0,P.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,P.jsxs)(`label`,{children:[`Id`,(0,P.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),spellCheck:!1})]}),(0,P.jsxs)(`label`,{children:[`Title`,(0,P.jsx)(`input`,{value:l,onChange:e=>u(e.target.value)})]})]}),p&&`problem`in p&&(0,P.jsx)(`p`,{className:`arc-snippet`,role:`alert`,children:p.problem}),p&&!(`problem`in p)&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(ID,{label:`YAML`,hint:`Add to a file in ${e.name(o)}`,text:p.yaml}),(0,P.jsx)(ID,{label:`upsert_view call`,hint:`Or ask an agent to make this MCP call`,text:JSON.stringify(p.call,null,2)})]})]})]})}function ID({label:e,hint:t,text:n}){let[r,i]=(0,O.useState)(!1);return(0,P.jsxs)(`div`,{className:`arc-snippet`,children:[(0,P.jsxs)(`div`,{className:`arc-snippet-head`,children:[(0,P.jsxs)(`span`,{children:[(0,P.jsx)(`strong`,{children:e}),` `,(0,P.jsx)(`span`,{className:`arc-muted`,children:t})]}),(0,P.jsx)(`button`,{type:`button`,className:`arc-tool`,"aria-label":`Copy ${e}`,onClick:()=>void navigator.clipboard.writeText(n).then(()=>i(!0)),children:r?`Copied`:`Copy`})]}),(0,P.jsx)(`pre`,{"aria-label":e,children:n})]})}function LD(){let[e,t]=(0,O.useState)({});return(0,O.useEffect)(()=>{let e=fetch(`./${Gw}`).then(e=>e.ok?e.json():{}).then(e=>e.workspace).catch(()=>void 0);Promise.all([WT.latest(),GT(),e]).then(([e,n,r])=>{RD(n),t({latest:e,timeline:n,name:r})}).catch(e=>t({error:e instanceof Error?e.message:String(e)}))},[]),(0,O.useEffect)(()=>ND(e=>t(t=>t.latest?{...t,latest:e}:t)),[]),e}function RD(e){let t=e.previewBase();t&&!iT(window.location.hash)&&bT({...aT,view:`c2`,vs:HT(t)},{replace:!0})}function zD(){let{latest:e,timeline:t,name:n,error:r}=LD();return r?(0,P.jsx)(GD,{title:`Couldn't load the Workspace`,children:r}):!e||!t?(0,P.jsx)(GD,{title:`Loading the Workspace…`}):(0,P.jsx)(BD,{latest:e,timeline:t,name:n})}function BD({latest:e,timeline:t,name:n}){let r=yT(),{state:i,loading:a}=ZT(e,t,r.at,r.vs),o=i?.kind===`ready`?i.times:void 0,s=o?.current,c=(0,O.useMemo)(()=>s?new wD(s,n):void 0,[s,n]),l=(0,O.useMemo)(()=>{if(!o?.before)return;let{before:e,current:n,vs:r,at:i}=o;return{before:e,after:n,changes:re(e,n),label:t.compareLabel(r,i)}},[o,t]),u=(0,O.useMemo)(()=>l?new wD(te(l.before,l.after),n):c,[l,c,n]);return i?.kind===`problem`?(0,P.jsx)(QT,{problem:i.problem,place:r}):!u||!c?(0,P.jsx)(GD,{title:`Loading the Revision…`}):(0,P.jsx)(HD,{workspace:u,plain:c,comparison:l,timeline:t,at:o?.at,loading:a})}var VD=new WeakMap;function HD({workspace:e,plain:t,comparison:r,timeline:i,at:a,loading:o}){let s=yT(),c=`${s.open.join(`,`)}|${s.closed.join(`,`)}`,l={expand:s.open,collapse:s.closed},d=(0,O.useMemo)(()=>r?de(r.before,r.after,s.view,{...l,lens:`none`}):bD(e.bundle,s.view,{...l,lens:`none`}),[e,r,s.view,c]),f=(0,O.useMemo)(()=>{let e=u(t.bundle,s.view);return e?.kind===`dynamic`?e:void 0},[t,s.view]),m=s.direction??d?.direction,{laidOut:h,error:g}=TT(d,m),_=(0,O.useMemo)(()=>{let t=(d?.nodes??[]).filter(t=>!t.collapsed&&WD(e,s.view,t.id)&&e.children(t.id).length>0).map(e=>e.id);return[...new Set([...s.open,...t])]},[d,e,s.view,s.open]);d&&VD.set(d,`${s.view}|${c}|${s.at??``}|${s.vs??``}`);let v=h&&`${VD.get(h.view)??``}|${h.layout.direction}`,[y,b]=(0,O.useState)(),x=!o&&h!==void 0&&y===h&&h.view===d&&h.layout.direction===m,S=e.title(s.view),C=s.lens?JSON.stringify(s.lens):``,w=(0,O.useMemo)(()=>s.lens?bD(e.bundle,s.view,{...l,lens:s.lens}):void 0,[e,s.view,c,C]),[T,E]=(0,O.useState)(!1),[D,k]=(0,O.useState)(null);(0,O.useEffect)(()=>{document.title=S?`${S} · Archidocs`:`Archidocs`,S&&BT(s,S)},[pT(s),S]);let A=(0,O.useCallback)(t=>{let n=t&&`path`in t?bD(e.bundle,s.view,{expand:s.open,collapse:s.closed,lens:t})?.nodes.filter(e=>e.mark?.hit).map(e=>e.id)??[]:s.picks;bT({...s,lens:t,picks:n})},[s,e]),j=(0,O.useCallback)(e=>{let t=D;k(null),e!==t&&A({path:{from:t,to:e,paths:`shortest`}})},[D,A]),M=(0,O.useCallback)(e=>{if(D!==null&&e!==null)return j(e);bT({...s,selected:e,edge:null},{replace:!0})},[s,D,j]),ee=(0,O.useCallback)(e=>{D===null&&bT({...s,selected:null,edge:e},{replace:!0})},[s,D]),te=(0,O.useCallback)(e=>bT({...s,picks:s.picks.includes(e)?s.picks.filter(t=>t!==e):[...s.picks,e]},{replace:!0}),[s]);(0,O.useEffect)(()=>{let e=e=>{let t=e.target instanceof HTMLElement&&(e.target.isContentEditable||[`INPUT`,`TEXTAREA`,`SELECT`].includes(e.target.tagName));e.key===`/`&&!t&&!e.metaKey&&!e.ctrlKey&&!e.altKey?(e.preventDefault(),E(!0)):e.key===`Escape`&&!T&&(D===null?s.adr!==null&&bT({...s,adr:null},{replace:!0}):k(null))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[T,D,s]);let ne=(0,O.useCallback)(e=>bT({...s,adr:e},{replace:!0}),[s]),re=(0,O.useCallback)(t=>{let n=n=>t.some(t=>n===t||e.ancestors(n).includes(t)),r=s.selected!==null&&e.ancestors(s.selected).some(e=>t.includes(e)),i=t.filter(t=>WD(e,s.view,t)&&!s.closed.includes(t));bT({...s,open:s.open.filter(e=>!n(e)),closed:[...s.closed,...i],selected:r?null:s.selected})},[s,e]),ie=(0,O.useCallback)((t,n)=>{if(n)return bT(WD(e,s.view,t)?{...s,closed:s.closed.filter(e=>e!==t)}:{...s,open:[...s.open,t]});re([t])},[s,e,re]),ae=(0,O.useCallback)(t=>{let r=d?.nodes.find(e=>e.id===t)?.element??t;if(s.view===`c1`&&e.byId.get(r)?.kind===`system`)return bT(hT(`c2`,r,s.lens,s));let i=n(e.bundle,r);i!==void 0&&i!==s.view&&bT(hT(i,null,s.lens,s))},[s,e,d]),N=(0,O.useCallback)(t=>{let r=UD(e,s,t);if(r)return bT({...s,...r,selected:t,edge:null,adr:null},{replace:r.open.length===s.open.length&&r.closed.length===s.closed.length});let i=e.byId.get(t);bT(hT((i?.kind===`component`?n(e.bundle,i.parent):i?.kind===`person`?`c1`:n(e.bundle,t))??`c2`,t,s.lens,s))},[s,e]),oe=(0,O.useCallback)(e=>bT({...s,direction:e===d?.direction?null:e}),[s,d]),se=(0,O.useCallback)(t=>bT(hT(t,null,bD(e.bundle,t,{lens:`own`})?.lens??s.lens,s)),[e,s]),[ce,le]=(0,O.useState)(!1),ue=(0,O.useCallback)((t,n)=>{let r=w??d;r&&MT(e,t===`picks`?p(r,s.picks):r,m,n).then(e=>IT(e,FT(s.view,n,t===`picks`)))},[e,w,d,s.picks,s.view,m]),fe=(0,O.useCallback)((t,n)=>{let r=[n.relationship.from,n.relationship.to],i={open:[],closed:[]};for(let n of r)i=UD(e,{...hT(t),...i},n)??i;let a=new Set(bD(e.bundle,t,{expand:i.open,collapse:i.closed,lens:`none`})?.nodes.map(e=>e.id)??[]),o=[r[0],...e.ancestors(r[0]).reverse()].find(e=>a.has(e))??null;bT({...hT(t,null,null,s),...i,selected:o})},[e,s]),pe=(0,P.jsx)(ED,{workspace:e,view:s.view,selected:s.selected,home:pT({...aT,at:s.at,vs:s.vs}),onPickElement:N,onPickView:se,onPickTeam:e=>A({team:e}),finding:T,onFind:()=>E(!0),onOpenPanel:()=>E(!1)}),me=s.selected===null?void 0:d?.nodes.find(e=>e.id===s.selected)?.element??s.selected,he=qD(me!==void 0&&e.byId.has(me)?me:void 0),F=s.edge===null?void 0:d?.edges.find(e=>e.from===s.edge.from&&e.to===s.edge.to),I=t=>d?.nodes.find(e=>e.id===t)?.name??e.name(t);return f?(0,P.jsxs)(`div`,{className:`arc-app`,children:[pe,T&&(0,P.jsx)(MD,{workspace:e,onClose:()=>E(!1),onPick:e=>{E(!1),N(e)}}),(0,P.jsx)(`main`,{className:`arc-main arc-main-dynamic`,children:(0,P.jsx)(UE,{workspace:t,view:f,place:s,keys:!T,onOpenStepView:fe,onOpenView:e=>bT(hT(e,null,null,s))})})]}):d?(0,P.jsxs)(`div`,{className:`arc-app`,children:[pe,T&&(0,P.jsx)(MD,{workspace:e,prompt:D===null?void 0:`Pick the node to connect ${e.name(D)} to`,onClose:()=>E(!1),onPick:e=>{E(!1),D===null?N(e):j(e)}}),(0,P.jsxs)(`main`,{className:a?`arc-main arc-has-time`:`arc-main`,children:[(0,P.jsx)(sE,{workspace:e,place:s,direction:s.direction??d.direction,compare:r?.label,timeline:i,onCollapse:re,onDirection:oe,onLens:A,onPicks:e=>bT({...s,picks:e},{replace:!0}),onExport:ue,onSaveAsView:()=>le(!0),onTime:e=>bT({...s,...e})}),ce&&(0,P.jsx)(FD,{workspace:e,screen:{view:s.view,open:s.open,closed:s.closed,lens:s.lens,picks:s.picks,direction:s.direction},title:S??d.title,onClose:()=>le(!1)}),a&&(0,P.jsx)($T,{revision:a,place:s}),D!==null&&(0,P.jsxs)(`p`,{className:`arc-banner`,role:`status`,children:[`Pick the node to connect `,e.name(D),` to: click it, or press / to find it. Escape cancels.`]}),(0,P.jsxs)(`div`,{className:`arc-stage`,children:[r&&(0,P.jsx)(iE,{changes:r.changes,label:r.label,onElement:N,onView:e=>bT(hT(e,null,s.lens,s))}),(0,P.jsxs)(`div`,{className:`arc-canvas`,"data-canvas":!0,"data-state":x?`ready`:`busy`,children:[g&&(0,P.jsxs)(`p`,{className:`arc-error`,children:[`Layout failed: `,g]}),h&&(0,P.jsx)(mm,{workspace:e,laidOut:h,selected:s.selected,selectedEdge:F?s.edge:null,open:_,fitKey:v,lensed:w,picks:s.picks,ring:s.lens!==null&&`team`in s.lens,onSelect:M,onSelectEdge:ee,onPick:te,onToggle:ie,onOpenView:ae,onSettled:b}),he!==void 0&&(0,P.jsx)(nD,{workspace:e,id:he,timeline:i,comparison:r,onLens:A,onConnect:k,onFocus:N,onOpenView:ae,onOpenAdr:ne,onTime:e=>bT({...s,...e}),onDeployed:(e,t)=>bT({...hT(e,null,null,s),picks:t}),onClose:()=>M(null)}),F&&he===void 0&&(0,P.jsx)(fD,{workspace:e,edge:F,fromName:I(F.from),toName:I(F.to),onSelectNode:M,onFocus:N,onClose:()=>bT({...s,edge:null},{replace:!0})},`${F.from}>${F.to}`),s.adr!==null&&(0,P.jsx)(Ee,{workspace:e,id:s.adr,beside:he!==void 0||F!==void 0,onClose:()=>ne(null),onOpenAdr:ne,onFocus:N,onOpenView:e=>bT(hT(e,null,s.lens,s))})]})]})]})]}):(0,P.jsx)(GD,{title:`No View ${s.view}`,children:(0,P.jsx)(`a`,{href:pT({...aT,at:s.at,vs:s.vs}),children:`Open the C1 Landscape`})})}function UD(e,t,n){let r=[...t.open],i=[...t.closed];for(let a of[...e.ancestors(n),n]){let o=bD(e.bundle,t.view,{expand:r,collapse:i,lens:`none`})?.nodes??[];if(o.some(e=>e.id===n))return{open:r,closed:i};a!==n&&o.some(e=>e.id===a)&&(i.includes(a)?i=i.filter(e=>e!==a):r.includes(a)||r.push(a))}}var WD=(e,t,n)=>t===`c2`&&e.byId.get(n)?.kind===`system`;function GD({title:e,children:t}){return(0,P.jsxs)(`div`,{className:`arc-message`,children:[(0,P.jsx)(`h1`,{children:e}),t&&(0,P.jsx)(`p`,{children:t})]})}var KD=250;function qD(e){let[t,n]=(0,O.useState)(e),[r,i]=(0,O.useState)(e);return e!==r&&(i(e),(e===void 0||r!==void 0)&&n(e)),(0,O.useEffect)(()=>{if(e===void 0||t===e)return;let r=window.setTimeout(()=>n(e),KD);return()=>window.clearTimeout(r)},[e,t]),t===e?e:void 0}var JD=class extends O.Component{state={};static getDerivedStateFromError(e){return{error:e}}render(){let{error:e}=this.state;return e?(0,P.jsxs)(`div`,{className:`arc-message`,role:`alert`,children:[(0,P.jsx)(`h1`,{children:`Something went wrong`}),(0,P.jsx)(`pre`,{className:`arc-crash`,children:`${e.stack??e.message}\n\n${navigator.userAgent}`})]}):this.props.children}};(0,k.createRoot)(document.getElementById(`root`)).render((0,P.jsx)(O.StrictMode,{children:(0,P.jsx)(JD,{children:(0,P.jsx)(zD,{})})}));export{Fm as n,Pm as r,jm as t};