@linkdlab/funcnodes_react_flow 0.3.16 → 0.3.17

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.
@@ -25,7 +25,7 @@ Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=
25
25
  *
26
26
  * This source code is licensed under the MIT license found in the
27
27
  * LICENSE file in the root directory of this source tree.
28
- */var C=(w||(w=1,"production"===process.env.NODE_ENV?u.exports=function(){if(g)return d;g=1;var t=e,n=b(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,a=t.useEffect,s=t.useMemo,l=t.useDebugValue;return d.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=i(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=s((function(){function e(e){if(!a){if(a=!0,o=e,e=c(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,i=n)}var o,i,a=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]}),[t,n,c,u]);var f=o(e,d[0],d[1]);return a((function(){p.hasValue=!0,p.value=f}),[f]),l(f),f},d}():u.exports=(v||(v=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=e,n=b(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,a=t.useEffect,s=t.useMemo,l=t.useDebugValue;x.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=i(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=s((function(){function e(e){if(!a){if(a=!0,o=e,e=c(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,i=n)}var o,i,a=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]}),[t,n,c,u]);var f=o(e,d[0],d[1]);return a((function(){p.hasValue=!0,p.value=f}),[f]),l(f),f},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),x)),u.exports),E=l(C);const{useDebugValue:k}=e,{useSyncExternalStoreWithSelector:S}=E;let I=!1;const _=e=>e;const A=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t="function"==typeof e?s(e):e,n=(e,n)=>function(e,t=_,n){n&&!I&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),I=!0);const r=S(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return k(r),r}(t,e,n);return Object.assign(n,t),n},N=e=>e?A(e):A;function R(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e.constructor!==t.constructor)return!1;if(e.constructor===Object||e.constructor===Array){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){if(!r.includes(o))return!1;if(!O(e[o],t[o]))return!1}}return!(e instanceof Date&&t instanceof Date)||e.getTime()===t.getTime()}const T=(e,t)=>{let n=!1;if(!R(e))throw new Error("Target must be a plain object");if(!R(t))throw new Error("Source must be a plain object");const r={...e};return Object.keys(t).forEach((o=>{const i=t[o],a=e[o];if(R(i)&&R(a)){const{new_obj:e,change:t}=T(a,i);t&&(n=!0,r[o]=e)}else O(a,i)||(n=!0,r[o]=i)})),{new_obj:r,change:n}},M=(e,t)=>{let n=!1;if(!R(e))throw new Error("Target must be a plain object");if(!R(t))throw new Error("Source must be a plain object");const r={...e};return Object.keys(t).forEach((o=>{const i=t[o],a=e[o];if(void 0!==a||void 0!==i){if(void 0===a)return n=!0,void(r[o]=i);if(R(i)&&R(a)){const{new_obj:e,change:t}=M(a,i);t&&(n=!0,r[o]=e)}}})),{new_obj:r,change:n}},P={id:"dummy",name:"dummy",node:"dummy",full_id:"dummy",type:"any",value:void 0,is_input:!1,connected:!1,does_trigger:!0,fullvalue:void 0,try_get_full_value:void 0,render_options:{set_default:!0,type:"any"},set_hidden:void 0,hidden:!1},D=e=>{if(!e.id)throw new Error("IO must have an id but is missing for "+JSON.stringify(e));void 0===e.name&&(e.name=e.id);const{new_obj:t}=M(e,P);return"any"!==t.render_options.type&&void 0!==t.render_options.type||(t.render_options.type=t.type),t},B={id:"dummy",node_name:"dummy",frontend:{pos:[NaN,NaN],size:[200,100],collapsed:!1},io:{},name:"dummy",in_trigger:!1,io_order:[],progress:{ascii:!1,elapsed:0,initial:0,n:0,prefix:"idle",unit:"it",unit_divisor:1e3,unit_scale:!1}},j=JSON.stringify(B),F=e=>{if(!e.id)throw new Error("Node must have an id");const t=JSON.parse(j),{new_obj:n}=M(e,t);for(const e in n.io){if(void 0===n.io[e])continue;void 0===n.io[e].id&&(n.io[e].id=e);const t=D(n.io[e]);n.io[e]=t}return n},L=e=>{if(void 0===e.io&&(e.io={}),void 0===e.io_order)if(Array.isArray(e.io)){e.io_order=e.io.map((e=>e.id));const t={};for(const n of e.io)t[n.id]=n;e.io=t}else e.io_order=Object.keys(e.io);else if(Array.isArray(e.io)){const t={};for(const n of e.io)t[n.id]=n,e.io_order.includes(n.id)||e.io_order.push(n.id);e.io=t}else for(const t in e.io)e.io_order.includes(t)||e.io_order.push(t);return e};function V(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=V(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const{useDebugValue:z}=e,{useSyncExternalStoreWithSelector:G}=E,H=e=>e;function W(e,t=H,n){const r=G(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return z(r),r}const X=(e,t)=>{const n=s(e),r=(e,r=t)=>W(n,e,r);return Object.assign(r,n),r};function Z(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[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(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var $={value:()=>{}};function Y(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new U(r)}function U(e){this._=e}function J(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function K(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=$,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}U.prototype=Y.prototype={constructor:U,on:function(e,t){var n,r=this._,o=function(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 new Error("unknown type: "+e);return{type:e,name:n}}))}(e+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<a;)if(n=(e=o[i]).type)r[n]=K(r[n],e.name,t);else if(null==t)for(n in r)r[n]=K(r[n],e.name,null);return this}for(;++i<a;)if((n=(e=o[i]).type)&&(n=J(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new U(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(r=this._[e]).length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var Q="http://www.w3.org/1999/xhtml",q={svg:"http://www.w3.org/2000/svg",xhtml:Q,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ee(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),q.hasOwnProperty(t)?{space:q[t],local:e}:e}function te(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Q&&t.documentElement.namespaceURI===Q?t.createElement(e):t.createElementNS(n,e)}}function ne(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function re(e){var t=ee(e);return(t.local?ne:te)(t)}function oe(){}function ie(e){return null==e?oe:function(){return this.querySelector(e)}}function ae(){return[]}function se(e){return null==e?ae:function(){return this.querySelectorAll(e)}}function le(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function ce(e){return function(){return this.matches(e)}}function ue(e){return function(t){return t.matches(e)}}var de=Array.prototype.find;function pe(){return this.firstElementChild}var fe=Array.prototype.filter;function he(){return Array.from(this.children)}function me(e){return new Array(e.length)}function ge(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ye(e,t,n,r,o,i){for(var a,s=0,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new ge(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function be(e,t,n,r,o,i,a){var s,l,c,u=new Map,d=t.length,p=i.length,f=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(f[s]=c=a.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<p;++s)c=a.call(e,i[s],s,i)+"",(l=u.get(c))?(r[s]=l,l.__data__=i[s],u.delete(c)):n[s]=new ge(e,i[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(f[s])===l&&(o[s]=l)}function ve(e){return e.__data__}function we(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function xe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ce(e){return function(){this.removeAttribute(e)}}function Ee(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ke(e,t){return function(){this.setAttribute(e,t)}}function Se(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ie(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function _e(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ae(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ne(e){return function(){this.style.removeProperty(e)}}function Re(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Oe(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Te(e,t){return e.style.getPropertyValue(t)||Ae(e).getComputedStyle(e,null).getPropertyValue(t)}function Me(e){return function(){delete this[e]}}function Pe(e,t){return function(){this[e]=t}}function De(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Be(e){return e.trim().split(/^|\s+/)}function je(e){return e.classList||new Fe(e)}function Fe(e){this._node=e,this._names=Be(e.getAttribute("class")||"")}function Le(e,t){for(var n=je(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Ve(e,t){for(var n=je(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function ze(e){return function(){Le(this,e)}}function Ge(e){return function(){Ve(this,e)}}function He(e,t){return function(){(t.apply(this,arguments)?Le:Ve)(this,e)}}function We(){this.textContent=""}function Xe(e){return function(){this.textContent=e}}function Ze(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function $e(){this.innerHTML=""}function Ye(e){return function(){this.innerHTML=e}}function Ue(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Je(){this.nextSibling&&this.parentNode.appendChild(this)}function Ke(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Qe(){return null}function qe(){var e=this.parentNode;e&&e.removeChild(this)}function et(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tt(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nt(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function rt(e,t,n){return function(){var r,o=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var a=0,s=o.length;a<s;++a)if((r=o[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=t);this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function ot(e,t,n){var r=Ae(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function it(e,t){return function(){return ot(this,e,t)}}function at(e,t){return function(){return ot(this,e,t.apply(this,arguments))}}ge.prototype={constructor:ge,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)}},Fe.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}};var st=[null];function lt(e,t){this._groups=e,this._parents=t}function ct(){return new lt([[document.documentElement]],st)}function ut(e){return"string"==typeof e?new lt([[document.querySelector(e)]],[document.documentElement]):new lt([[e]],st)}function dt(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(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())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}lt.prototype=ct.prototype={constructor:lt,select:function(e){"function"!=typeof e&&(e=ie(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a,s=t[o],l=s.length,c=r[o]=new Array(l),u=0;u<l;++u)(i=s[u])&&(a=e.call(i,i.__data__,u,s))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new lt(r,this._parents)},selectAll:function(e){e="function"==typeof e?le(e):se(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var a,s=t[i],l=s.length,c=0;c<l;++c)(a=s[c])&&(r.push(e.call(a,a.__data__,c,s)),o.push(a));return new lt(r,o)},selectChild:function(e){return this.select(null==e?pe:function(e){return function(){return de.call(this.children,e)}}("function"==typeof e?e:ue(e)))},selectChildren:function(e){return this.selectAll(null==e?he:function(e){return function(){return fe.call(this.children,e)}}("function"==typeof e?e:ue(e)))},filter:function(e){"function"!=typeof e&&(e=ce(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,l=r[o]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new lt(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,ve);var n,r=t?be:ye,o=this._parents,i=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=i.length,s=new Array(a),l=new Array(a),c=new Array(a),u=0;u<a;++u){var d=o[u],p=i[u],f=p.length,h=we(e.call(d,d&&d.__data__,u,o)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);r(d,p,g,y,c[u]=new Array(f),h,t);for(var b,v,w=0,x=0;w<m;++w)if(b=g[w]){for(w>=x&&(x=w+1);!(v=y[x])&&++x<m;);b._next=v||null}}return(s=new lt(s,o))._enter=l,s._exit=c,s},enter:function(){return new lt(this._enter||this._groups.map(me),this._parents)},exit:function(){return new lt(this._exit||this._groups.map(me),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),s=new Array(o),l=0;l<a;++l)for(var c,u=n[l],d=r[l],p=u.length,f=s[l]=new Array(p),h=0;h<p;++h)(c=u[h]||d[h])&&(f[h]=c);for(;l<o;++l)s[l]=n[l];return new lt(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=xe);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,s=n[i],l=s.length,c=o[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new lt(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,s=i.length;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=ee(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?Ee:Ce:"function"==typeof t?n.local?_e:Ie:n.local?Se:ke)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Ne:"function"==typeof t?Oe:Re)(e,t,null==n?"":n)):Te(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Me:"function"==typeof t?De:Pe)(e,t)):this.node()[e]},classed:function(e,t){var n=Be(e+"");if(arguments.length<2){for(var r=je(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?He:t?ze:Ge)(n,t))},text:function(e){return arguments.length?this.each(null==e?We:("function"==typeof e?Ze:Xe)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?$e:("function"==typeof e?Ue:Ye)(e)):this.node().innerHTML},raise:function(){return this.each(Je)},lower:function(){return this.each(Ke)},append:function(e){var t="function"==typeof e?e:re(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:re(e),r=null==t?Qe:"function"==typeof t?t:ie(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(qe)},clone:function(e){return this.select(e?tt:et)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=function(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}}))}(e+""),a=i.length;if(!(arguments.length<2)){for(s=t?rt:nt,r=0;r<a;++r)this.each(s(i[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<a;++r)if((o=i[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?at:it)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const pt={passive:!1},ft={capture:!0,passive:!1};function ht(e){e.stopImmediatePropagation()}function mt(e){e.preventDefault(),e.stopImmediatePropagation()}function gt(e){var t=e.document.documentElement,n=ut(e).on("dragstart.drag",mt,ft);"onselectstart"in t?n.on("selectstart.drag",mt,ft):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function yt(e,t){var n=e.document.documentElement,r=ut(e).on("dragstart.drag",null);t&&(r.on("click.drag",mt,ft),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 bt=e=>()=>e;function vt(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:s,dx:l,dy:c,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:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function wt(e){return!e.ctrlKey&&!e.button}function xt(){return this.parentNode}function Ct(e,t){return null==t?{x:e.x,y:e.y}:t}function Et(){return navigator.maxTouchPoints||"ontouchstart"in this}function kt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function St(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function It(){}vt.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var _t=.7,At=1/_t,Nt="\\s*([+-]?\\d+)\\s*",Rt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ot="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tt=/^#([0-9a-f]{3,8})$/,Mt=new RegExp(`^rgb\\(${Nt},${Nt},${Nt}\\)$`),Pt=new RegExp(`^rgb\\(${Ot},${Ot},${Ot}\\)$`),Dt=new RegExp(`^rgba\\(${Nt},${Nt},${Nt},${Rt}\\)$`),Bt=new RegExp(`^rgba\\(${Ot},${Ot},${Ot},${Rt}\\)$`),jt=new RegExp(`^hsl\\(${Rt},${Ot},${Ot}\\)$`),Ft=new RegExp(`^hsla\\(${Rt},${Ot},${Ot},${Rt}\\)$`),Lt={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};function Vt(){return this.rgb().formatHex()}function zt(){return this.rgb().formatRgb()}function Gt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Tt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ht(t):3===n?new Zt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Wt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Wt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Mt.exec(e))?new Zt(t[1],t[2],t[3],1):(t=Pt.exec(e))?new Zt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Dt.exec(e))?Wt(t[1],t[2],t[3],t[4]):(t=Bt.exec(e))?Wt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=jt.exec(e))?Qt(t[1],t[2]/100,t[3]/100,1):(t=Ft.exec(e))?Qt(t[1],t[2]/100,t[3]/100,t[4]):Lt.hasOwnProperty(e)?Ht(Lt[e]):"transparent"===e?new Zt(NaN,NaN,NaN,0):null}function Ht(e){return new Zt(e>>16&255,e>>8&255,255&e,1)}function Wt(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zt(e,t,n,r)}function Xt(e,t,n,r){return 1===arguments.length?((o=e)instanceof It||(o=Gt(o)),o?new Zt((o=o.rgb()).r,o.g,o.b,o.opacity):new Zt):new Zt(e,t,n,null==r?1:r);var o}function Zt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function $t(){return`#${Kt(this.r)}${Kt(this.g)}${Kt(this.b)}`}function Yt(){const e=Ut(this.opacity);return`${1===e?"rgb(":"rgba("}${Jt(this.r)}, ${Jt(this.g)}, ${Jt(this.b)}${1===e?")":`, ${e})`}`}function Ut(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Jt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Kt(e){return((e=Jt(e))<16?"0":"")+e.toString(16)}function Qt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new en(e,t,n,r)}function qt(e){if(e instanceof en)return new en(e.h,e.s,e.l,e.opacity);if(e instanceof It||(e=Gt(e)),!e)return new en;if(e instanceof en)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(a=t===i?(n-r)/s+6*(n<r):n===i?(r-t)/s+2:(t-n)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new en(a,s,l,e.opacity)}function en(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function tn(e){return(e=(e||0)%360)<0?e+360:e}function nn(e){return Math.max(0,Math.min(1,e||0))}function rn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}kt(It,Gt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Vt,formatHex:Vt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return qt(this).formatHsl()},formatRgb:zt,toString:zt}),kt(Zt,Xt,St(It,{brighter(e){return e=null==e?At:Math.pow(At,e),new Zt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?_t:Math.pow(_t,e),new Zt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zt(Jt(this.r),Jt(this.g),Jt(this.b),Ut(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:$t,formatHex:$t,formatHex8:function(){return`#${Kt(this.r)}${Kt(this.g)}${Kt(this.b)}${Kt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Yt,toString:Yt})),kt(en,(function(e,t,n,r){return 1===arguments.length?qt(e):new en(e,t,n,null==r?1:r)}),St(It,{brighter(e){return e=null==e?At:Math.pow(At,e),new en(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?_t:Math.pow(_t,e),new en(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Zt(rn(e>=240?e-240:e+120,o,r),rn(e,o,r),rn(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new en(tn(this.h),nn(this.s),nn(this.l),Ut(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ut(this.opacity);return`${1===e?"hsl(":"hsla("}${tn(this.h)}, ${100*nn(this.s)}%, ${100*nn(this.l)}%${1===e?")":`, ${e})`}`}}));var on=e=>()=>e;function an(e){return 1==(e=+e)?sn:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):on(isNaN(t)?n:t)}}function sn(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):on(isNaN(e)?t:e)}var ln=function e(t){var n=an(t);function r(e,t){var r=n((e=Xt(e)).r,(t=Xt(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=sn(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function cn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var un=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dn=new RegExp(un.source,"g");function pn(e,t){var n,r,o,i=un.lastIndex=dn.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=un.exec(e))&&(r=dn.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:cn(n,r)})),i=dn.lastIndex;return i<t.length&&(o=t.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}var fn,hn=180/Math.PI,mn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gn(e,t,n,r,o,i){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*hn,skewX:Math.atan(l)*hn,scaleX:a,scaleY:s}}function yn(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var s=[],l=[];return i=e(i),a=e(a),function(e,r,o,i,a,s){if(e!==o||r!==i){var l=a.push("translate(",null,t,null,n);s.push({i:l-4,x:cn(e,o)},{i:l-2,x:cn(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,l),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:cn(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(i.rotate,a.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:cn(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(i.skewX,a.skewX,s,l),function(e,t,n,r,i,a){if(e!==n||t!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:cn(e,n)},{i:s-2,x:cn(t,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,l),i=a=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var bn=yn((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?mn:gn(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),vn=yn((function(e){return null==e?mn:(fn||(fn=document.createElementNS("http://www.w3.org/2000/svg","g")),fn.setAttribute("transform",e),(e=fn.transform.baseVal.consolidate())?gn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):mn)}),", ",")",")");function wn(e){return((e=Math.exp(e))+1/e)/2}var xn,Cn,En=function e(t,n,r){function o(e,o){var i,a,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],p=o[2],f=u-s,h=d-l,m=f*f+h*h;if(m<1e-12)a=Math.log(p/c)/t,i=function(e){return[s+e*f,l+e*h,c*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(p*p-c*c+r*m)/(2*c*n*g),b=(p*p-c*c-r*m)/(2*p*n*g),v=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(b*b+1)-b);a=(w-v)/t,i=function(e){var r,o=e*a,i=wn(v),u=c/(n*g)*(i*(r=t*o+v,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[s+u*f,l+u*h,c*i/wn(t*o+v)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4),kn=0,Sn=0,In=0,_n=0,An=0,Nn=0,Rn="object"==typeof performance&&performance.now?performance:Date,On="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Tn(){return An||(On(Mn),An=Rn.now()+Nn)}function Mn(){An=0}function Pn(){this._call=this._time=this._next=null}function Dn(e,t,n){var r=new Pn;return r.restart(e,t,n),r}function Bn(){An=(_n=Rn.now())+Nn,kn=Sn=0;try{!function(){Tn(),++kn;for(var e,t=xn;t;)(e=An-t._time)>=0&&t._call.call(void 0,e),t=t._next;--kn}()}finally{kn=0,function(){var e,t,n=xn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:xn=t);Cn=e,Fn(r)}(),An=0}}function jn(){var e=Rn.now(),t=e-_n;t>1e3&&(Nn-=t,_n=e)}function Fn(e){kn||(Sn&&(Sn=clearTimeout(Sn)),e-An>24?(e<1/0&&(Sn=setTimeout(Bn,e-Rn.now()-Nn)),In&&(In=clearInterval(In))):(In||(_n=Rn.now(),In=setInterval(jn,1e3)),kn=1,On(Bn)))}function Ln(e,t,n){var r=new Pn;return t=null==t?0:+t,r.restart((n=>{r.stop(),e(n+t)}),t,n),r}Pn.prototype=Dn.prototype={constructor:Pn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Tn():+n)+(null==t?0:+t),this._next||Cn===this||(Cn?Cn._next=this:xn=this,Cn=this),this._call=e,this._time=n,Fn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fn())}};var Vn=Y("start","end","cancel","interrupt"),zn=[];function Gn(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(i){var c,u,d,p;if(1!==n.state)return l();for(c in o)if((p=o[c]).name===n.name){if(3===p.state)return Ln(a);4===p.state?(p.state=6,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[c]):+c<t&&(p.state=6,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[c])}if(Ln((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(i))})),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=p);r.length=u+1}}function s(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=Dn(i,0,n.time)}(e,n,{name:t,index:r,group:o,on:Vn,tween:zn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Hn(e,t){var n=Xn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Wn(e,t){var n=Xn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Xn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Zn(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i)(n=i[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete e.__transition}}function $n(e,t){var n,r;return function(){var o=Wn(this,e),i=o.tween;if(i!==n)for(var a=0,s=(r=n=i).length;a<s;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}o.tween=r}}function Yn(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=Wn(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}i.tween=o}}function Un(e,t,n){var r=e._id;return e.each((function(){var e=Wn(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)})),function(e){return Xn(e,r).value[t]}}function Jn(e,t){var n;return("number"==typeof t?cn:t instanceof Gt?ln:(n=Gt(t))?(t=n,ln):pn)(e,t)}function Kn(e){return function(){this.removeAttribute(e)}}function Qn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qn(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function er(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function tr(e,t,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttribute(e))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,l));this.removeAttribute(e)}}function nr(e,t,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,l));this.removeAttributeNS(e.space,e.local)}}function rr(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function or(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function ir(e,t){return function(){Hn(this,e).delay=+t.apply(this,arguments)}}function ar(e,t){return t=+t,function(){Hn(this,e).delay=t}}function sr(e,t){return function(){Wn(this,e).duration=+t.apply(this,arguments)}}function lr(e,t){return t=+t,function(){Wn(this,e).duration=t}}var cr=ct.prototype.constructor;function ur(e){return function(){this.style.removeProperty(e)}}var dr=0;function pr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function fr(){return++dr}var hr=ct.prototype;pr.prototype={constructor:pr,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ie(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s,l,c=r[a],u=c.length,d=i[a]=new Array(u),p=0;p<u;++p)(s=c[p])&&(l=e.call(s,s.__data__,p,c))&&("__data__"in s&&(l.__data__=s.__data__),d[p]=l,Gn(d[p],t,n,p,d,Xn(s,n)));return new pr(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=se(e));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var l,c=r[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var p,f=e.call(l,l.__data__,d,c),h=Xn(l,n),m=0,g=f.length;m<g;++m)(p=f[m])&&Gn(p,t,n,m,f,h);i.push(f),a.push(l)}return new pr(i,a,t,n)},selectChild:hr.selectChild,selectChildren:hr.selectChildren,filter:function(e){"function"!=typeof e&&(e=ce(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,l=r[o]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new pr(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var l,c=t[s],u=n[s],d=c.length,p=a[s]=new Array(d),f=0;f<d;++f)(l=c[f]||u[f])&&(p[f]=l);for(;s<r;++s)a[s]=t[s];return new pr(a,this._parents,this._name,this._id)},selection:function(){return new cr(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=fr(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,c=0;c<l;++c)if(a=s[c]){var u=Xn(a,t);Gn(a,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new pr(r,this._parents,e,n)},call:hr.call,nodes:hr.nodes,node:hr.node,size:hr.size,empty:hr.empty,each:hr.each,on:function(e,t){var n=this._id;return arguments.length<2?Xn(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,i=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?Hn:Wn;return function(){var a=i(this,e),s=a.on;s!==r&&(o=(r=s).copy()).on(t,n),a.on=o}}(n,e,t))},attr:function(e,t){var n=ee(e),r="transform"===n?vn:Jn;return this.attrTween(e,"function"==typeof t?(n.local?nr:tr)(n,r,Un(this,"attr."+e,t)):null==t?(n.local?Qn:Kn)(n):(n.local?er:qn)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=ee(e);return this.tween(n,(r.local?rr:or)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?bn:Jn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var i=Te(this,e),a=(this.style.removeProperty(e),Te(this,e));return i===a?null:i===n&&a===r?o:o=t(n=i,r=a)}}(e,r)).on("end.style."+e,ur(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,i;return function(){var a=Te(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=Te(this,e)),a===l?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}}(e,r,Un(this,"style."+e,t))).each(function(e,t){var n,r,o,i,a="style."+t,s="end."+a;return function(){var l=Wn(this,e),c=l.on,u=null==l.value[a]?i||(i=ur(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(s,o=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,i=n+"";return function(){var a=Te(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,i,n)),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(Un(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=Xn(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?$n:Yn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ir:ar)(t,e)):Xn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?sr:lr)(t,e)):Xn(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){Wn(this,e).ease=t}}(t,e)):Xn(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;Wn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var s={value:a},l={value:function(){0==--o&&i()}};n.each((function(){var n=Wn(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t})),0===o&&i()}))},[Symbol.iterator]:hr[Symbol.iterator]};var mr={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function gr(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}ct.prototype.interrupt=function(e){return this.each((function(){Zn(this,e)}))},ct.prototype.transition=function(e){var t,n;e instanceof pr?(t=e._id,e=e._name):(t=fr(),(n=mr).time=Tn(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,c=0;c<l;++c)(a=s[c])&&Gn(a,e,t,c,s,n||gr(a,t));return new pr(r,this._parents,e,t)};var yr=e=>()=>e;function br(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function vr(e,t,n){this.k=e,this.x=t,this.y=n}vr.prototype={constructor:vr,scale:function(e){return 1===e?this:new vr(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new vr(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 wr=new vr(1,0,0);function xr(e){e.stopImmediatePropagation()}function Cr(e){e.preventDefault(),e.stopImmediatePropagation()}function Er(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function kr(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).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 Sr(){return this.__zoom||wr}function Ir(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function _r(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ar(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Nr(){var e,t,n,r=Er,o=kr,i=Ar,a=Ir,s=_r,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=En,p=Y("start","zoom","end"),f=0,h=10;function m(e){e.property("__zoom",Sr).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",k).filter(s).on("touchstart.zoom",S).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",_).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new vr(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new vr(e.k,r,o)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function v(e,t,n,r){e.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var e=this,i=arguments,a=w(e,i).event(r),s=o.apply(e,i),l=null==n?b(s):"function"==typeof n?n.apply(e,i):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,p="function"==typeof t?t.apply(e,i):t,f=d(u.invert(l).concat(c/u.k),p.invert(l).concat(c/p.k));return function(e){if(1===e)e=p;else{var t=f(e),n=c/t[2];e=new vr(n,l[0]-t[0]*n,l[1]-t[1]*n)}a.zoom(null,e)}}))}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function C(e,...t){if(r.apply(this,arguments)){var n=w(this,t).event(e),o=this.__zoom,s=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,a.apply(this,arguments)))),u=dt(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[u,o.invert(u)],Zn(this),n.start()}Cr(e),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),150),n.zoom("mouse",i(y(g(o,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function E(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=w(this,t,!0).event(e),s=ut(e.view).on("mousemove.zoom",(function(e){if(Cr(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>f}a.event(e).zoom("mouse",i(y(a.that.__zoom,a.mouse[0]=dt(e,o),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(e){s.on("mousemove.zoom mouseup.zoom",null),yt(e.view,a.moved),Cr(e),a.event(e).end()}),!0),l=dt(e,o),u=e.clientX,d=e.clientY;gt(e.view),xr(e),a.mouse=[l,this.__zoom.invert(l)],Zn(this),a.start()}}function k(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=dt(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(a),l=n.k*(e.shiftKey?.5:2),d=i(y(g(n,l),a,s),o.apply(this,t),c);Cr(e),u>0?ut(this).transition().duration(u).call(v,d,a,e):ut(this).call(m.transform,d,a,e)}}function S(n,...o){if(r.apply(this,arguments)){var i,a,s,l,c=n.touches,u=c.length,d=w(this,o,n.changedTouches.length===u).event(n);for(xr(n),a=0;a<u;++a)l=[l=dt(s=c[a],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=l[0],e=setTimeout((function(){e=null}),500)),Zn(this),d.start())}}function I(e,...t){if(this.__zooming){var n,r,o,a,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(Cr(e),n=0;n<u;++n)o=dt(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=s.that.__zoom,s.touch1){var d=s.touch0[0],p=s.touch0[1],f=s.touch1[0],h=s.touch1[1],m=(m=f[0]-d[0])*m+(m=f[1]-d[1])*m,b=(b=h[0]-p[0])*b+(b=h[1]-p[1])*b;r=g(r,Math.sqrt(m/b)),o=[(d[0]+f[0])/2,(d[1]+f[1])/2],a=[(p[0]+h[0])/2,(p[1]+h[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(y(r,o,a),s.extent,c))}}function _(e,...r){if(this.__zooming){var o,i,a=w(this,r).event(e),s=e.changedTouches,l=s.length;for(xr(e),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),o=0;o<l;++o)i=s[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=dt(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<h)){var c=ut(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",Sr),e!==o?v(e,t,n,r):o.interrupt().each((function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},m.scaleBy=function(e,t,n,r){m.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,(function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?b(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(a),l="function"==typeof t?t.apply(this,arguments):t;return i(y(g(r,l),a,s),e,c)}),n,r)},m.translateBy=function(e,t,n,r){m.transform(e,(function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)}),null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,(function(){var e=o.apply(this,arguments),a=this.__zoom,s=null==r?b(e):"function"==typeof r?r.apply(this,arguments):r;return i(wr.translate(s[0],s[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)}),r,a)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ut(this.that).datum();p.call(e,this.that,new br(e,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:p}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:yr(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:yr(!!e),m):r},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:yr(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:yr([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(i=e,m):i},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=p.on.apply(p,arguments);return e===p?m:e},m.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,m):Math.sqrt(f)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}vr.prototype;const Rr=e.createContext(null),Or=Rr.Provider,Tr=()=>"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.",Mr=e=>`Node type "${e}" not found. Using fallback type "default".`,Pr=()=>"The React Flow parent container needs a width and a height to render the graph.",Dr=()=>"Only child nodes can use a parent extent.",Br=()=>"Can't create edge. An edge needs a source and a target.",jr=e=>`Marker type "${e}" doesn't exist.`,Fr=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,Lr=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",Vr=e=>`Edge type "${e}" not found. Using fallback type "default".`,zr=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.`,Gr=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function Hr(t,n){const r=e.useContext(Rr);if(null===r)throw new Error(Gr);return W(r,t,n)}const Wr=()=>{const t=e.useContext(Rr);if(null===t)throw new Error(Gr);return e.useMemo((()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy})),[t])},Xr=e=>e.userSelectionActive?"none":"all";function Zr({position:t,children:n,className:r,style:o,...i}){const a=Hr(Xr),s=`${t}`.split("-");return e.createElement("div",{className:V(["react-flow__panel",r,...s]),style:{...o,pointerEvents:a},...i},n)}function $r({proOptions:t,position:n="bottom-right"}){return t?.hideAttribution?null:e.createElement(Zr,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},e.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Yr=e.memo((({x:t,y:n,label:r,labelStyle:o={},labelShowBg:i=!0,labelBgStyle:a={},labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d})=>{const p=e.useRef(null),[f,h]=e.useState({x:0,y:0,width:0,height:0}),m=V(["react-flow__edge-textwrapper",u]);return e.useEffect((()=>{if(p.current){const e=p.current.getBBox();h({x:e.x,y:e.y,width:e.width,height:e.height})}}),[r]),void 0!==r&&r?e.createElement("g",{transform:`translate(${t-f.width/2} ${n-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d},i&&e.createElement("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),e.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:p,style:o},r),c):null}));const Ur=e=>({width:e.offsetWidth,height:e.offsetHeight}),Jr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Kr=(e={x:0,y:0},t)=>({x:Jr(e.x,t[0][0],t[1][0]),y:Jr(e.y,t[0][1],t[1][1])}),Qr=(e,t,n)=>e<t?Jr(Math.abs(e-t),1,50)/50:e>n?-Jr(Math.abs(e-n),1,50)/50:0,qr=(e,t)=>[20*Qr(e.x,35,t.width-35),20*Qr(e.y,35,t.height-35)],eo=e=>e.getRootNode?.()||window?.document,to=(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)}),no=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),ro=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),oo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),io=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},ao=e=>!isNaN(e)&&isFinite(e),so=Symbol.for("internals"),lo=["Enter"," ","Escape"],co=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function uo(e){const t=(e=>"nativeEvent"in e)(e)?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const po=e=>"clientX"in e,fo=(e,t)=>{const n=po(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},ho=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,mo=({id:t,path:n,labelX:r,labelY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:p,markerStart:f,interactionWidth:h=20})=>e.createElement(e.Fragment,null,e.createElement("path",{id:t,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:p,markerStart:f}),h&&e.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&ao(r)&&ao(o)?e.createElement(Yr,{x:r,y:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function go(e,t,n){return void 0===n?n:r=>{const o=t().edges.find((t=>t.id===e));o&&n(r,{...o})}}function yo({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,a=Math.abs(r-t)/2;return[i,r<t?r+a:r-a,o,a]}function bo({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:s}){const l=.125*e+.375*o+.375*a+.125*n,c=.125*t+.375*i+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var vo,wo,xo,Co,Eo,ko;function So({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===ko.Left||e===ko.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Io({sourceX:e,sourceY:t,sourcePosition:n=ko.Bottom,targetX:r,targetY:o,targetPosition:i=ko.Top}){const[a,s]=So({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=So({pos:i,x1:r,y1:o,x2:e,y2:t}),[u,d,p,f]=bo({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${a},${s} ${l},${c} ${r},${o}`,u,d,p,f]}mo.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(vo||(vo={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(wo||(wo={})),function(e){e.Partial="partial",e.Full="full"}(xo||(xo={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(Co||(Co={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(Eo||(Eo={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(ko||(ko={}));const _o=e.memo((({sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i=ko.Bottom,targetPosition:a=ko.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:p,style:f,markerEnd:h,markerStart:m,interactionWidth:g})=>{const[y,b,v]=Io({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a});return e.createElement(mo,{path:y,labelX:b,labelY:v,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:p,style:f,markerEnd:h,markerStart:m,interactionWidth:g})}));_o.displayName="SimpleBezierEdge";const Ao={[ko.Left]:{x:-1,y:0},[ko.Right]:{x:1,y:0},[ko.Top]:{x:0,y:-1},[ko.Bottom]:{x:0,y:1}},No=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Ro({source:e,sourcePosition:t=ko.Bottom,target:n,targetPosition:r=ko.Top,center:o,offset:i}){const a=Ao[t],s=Ao[r],l={x:e.x+a.x*i,y:e.y+a.y*i},c={x:n.x+s.x*i,y:n.y+s.y*i},u=(({source:e,sourcePosition:t=ko.Bottom,target:n})=>t===ko.Left||t===ko.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})({source:l,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",p=u[d];let f,h,m=[];const g={x:0,y:0},y={x:0,y:0},[b,v,w,x]=yo({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]==-1){f=o.x??b,h=o.y??v;const e=[{x:f,y:l.y},{x:f,y:c.y}],t=[{x:l.x,y:h},{x:c.x,y:h}];m=a[d]===p?"x"===d?e:t:"x"===d?t:e}else{const o=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?a.x===p?u:o:a.y===p?o:u,t===r){const t=Math.abs(e[d]-n[d]);if(t<=i){const r=Math.min(i-1,i-t);a[d]===p?g[d]=(l[d]>e[d]?-1:1)*r:y[d]=(c[d]>n[d]?-1:1)*r}}if(t!==r){const e="x"===d?"y":"x",t=a[d]===s[e],n=l[e]>c[e],r=l[e]<c[e];(1===a[d]&&(!t&&n||t&&r)||1!==a[d]&&(!t&&r||t&&n))&&(m="x"===d?o:u)}const b={x:l.x+g.x,y:l.y+g.y},v={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(b.x-m[0].x),Math.abs(v.x-m[0].x))>=Math.max(Math.abs(b.y-m[0].y),Math.abs(v.y-m[0].y))?(f=(b.x+v.x)/2,h=m[0].y):(f=m[0].x,h=(b.y+v.y)/2)}return[[e,{x:l.x+g.x,y:l.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],f,h,w,x]}function Oo({sourceX:e,sourceY:t,sourcePosition:n=ko.Bottom,targetX:r,targetY:o,targetPosition:i=ko.Top,borderRadius:a=5,centerX:s,centerY:l,offset:c=20}){const[u,d,p,f,h]=Ro({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:s,y:l},offset:c}),m=u.reduce(((e,t,n)=>{let r="";return r=n>0&&n<u.length-1?function(e,t,n,r){const o=Math.min(No(e,t)/2,No(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a)return`L ${i+o*(e.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+o*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${i},${a+o*(e.y<n.y?-1:1)}Q ${i},${a} ${i+o*s},${a}`}(u[n-1],t,u[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=r}),"");return[m,d,p,f,h]}const To=e.memo((({sourceX:t,sourceY:n,targetX:r,targetY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:p=ko.Bottom,targetPosition:f=ko.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[b,v,w]=Oo({sourceX:t,sourceY:n,sourcePosition:p,targetX:r,targetY:o,targetPosition:f,borderRadius:g?.borderRadius,offset:g?.offset});return e.createElement(mo,{path:b,labelX:v,labelY:w,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})}));To.displayName="SmoothStepEdge";const Mo=e.memo((t=>e.createElement(To,{...t,pathOptions:e.useMemo((()=>({borderRadius:0,offset:t.pathOptions?.offset})),[t.pathOptions?.offset])})));Mo.displayName="StepEdge";const Po=e.memo((({sourceX:t,sourceY:n,targetX:r,targetY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:p,markerStart:f,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,a,s]=yo({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,s]}({sourceX:t,sourceY:n,targetX:r,targetY:o});return e.createElement(mo,{path:m,labelX:g,labelY:y,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:p,markerStart:f,interactionWidth:h})}));function Do(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function Bo({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case ko.Left:return[t-Do(t-r,i),n];case ko.Right:return[t+Do(r-t,i),n];case ko.Top:return[t,n-Do(n-o,i)];case ko.Bottom:return[t,n+Do(o-n,i)]}}function jo({sourceX:e,sourceY:t,sourcePosition:n=ko.Bottom,targetX:r,targetY:o,targetPosition:i=ko.Top,curvature:a=.25}){const[s,l]=Bo({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[c,u]=Bo({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,p,f,h]=bo({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${o}`,d,p,f,h]}Po.displayName="StraightEdge";const Fo=e.memo((({sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i=ko.Bottom,targetPosition:a=ko.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:p,style:f,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[b,v,w]=jo({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a,curvature:g?.curvature});return e.createElement(mo,{path:b,labelX:v,labelY:w,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:p,style:f,markerEnd:h,markerStart:m,interactionWidth:y})}));Fo.displayName="BezierEdge";const Lo=e.createContext(null),Vo=Lo.Provider;Lo.Consumer;const zo=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Go=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map((t=>`${t}=${e[t]}`)).join("&")}`},Ho=({x:e,y:t},[n,r,o],i,[a,s])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?{x:a*Math.round(l.x/a),y:s*Math.round(l.y/s)}:l},Wo=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Xo=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},Zo=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce(((e,n)=>{const{x:r,y:o}=Xo(n,t).positionAbsolute;return to(e,no({x:r,y:o,width:n.width||0,height:n.height||0}))}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ro(n)},$o=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1,s=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach((e=>{const{width:t,height:n,selectable:r=!0,hidden:o=!1}=e;if(a&&!r||o)return!1;const{positionAbsolute:u}=Xo(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},p=io(l,d);(void 0===t||void 0===n||null===t||null===n||i&&p>0||p>=(t||0)*(n||0)||e.dragging)&&c.push(e)})),c},Yo=(e,t)=>{const n=e.map((e=>e.id));return t.filter((e=>n.includes(e.source)||n.includes(e.target)))},Uo=(e,t,n,r,o,i=.1)=>{const a=t/(e.width*(1+i)),s=n/(e.height*(1+i)),l=Math.min(a,s),c=Jr(l,r,o);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Jo=(e,t=0)=>e.transition().duration(t);function Ko(e,t,n,r){return(t[n]||[]).reduce(((t,o)=>(`${e.id}-${o.id}-${n}`!==r&&t.push({id:o.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+o.x+o.width/2,y:(e.positionAbsolute?.y??0)+o.y+o.height/2}),t)),[])}const Qo={source:null,target:null,sourceHandle:null,targetHandle:null},qo=()=>({handleDomNode:null,isValid:!1,connection:Qo,endHandle:null});function ei(e,t,n,r,o,i,a){const s="target"===o,l=a.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...qo(),handleDomNode:l};if(l){const e=ti(void 0,l),o=l.getAttribute("data-nodeid"),a=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),p={source:s?o:n,sourceHandle:s?a:r,target:s?n:o,targetHandle:s?r:a};c.connection=p;u&&d&&(t===vo.Strict?s&&"source"===e||!s&&"target"===e:o!==n||a!==r)&&(c.endHandle={nodeId:o,handleId:a,type:e},c.isValid=i(p))}return c}function ti(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function ni(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function ri(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function oi({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:a,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=eo(e.target),{connectionMode:d,domNode:p,autoPanOnConnect:f,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:b}=i();let v,w=0;const{x:x,y:C}=fo(e),E=u?.elementFromPoint(x,C),k=ti(l,E),S=p?.getBoundingClientRect();if(!S||!k)return;let I,_=fo(e,S),A=!1,N=null,R=!1,O=null;const T=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce(((e,o)=>{if(o[so]){const{handleBounds:i}=o[so];let a=[],s=[];i&&(a=Ko(o,i,"source",`${t}-${n}-${r}`),s=Ko(o,i,"target",`${t}-${n}-${r}`)),e.push(...a,...s)}return e}),[])}({nodes:y(),nodeId:n,handleId:t,handleType:k}),M=()=>{if(!f)return;const[e,t]=qr(_,S);g({x:e,y:t}),w=requestAnimationFrame(M)};function P(e){const{transform:r}=i();_=fo(e,S);const{handle:l,validHandleResult:c}=function(e,t,n,r,o,i){const{x:a,y:s}=fo(e),l=t.elementsFromPoint(a,s).find((e=>e.classList.contains("react-flow__handle")));if(l){const e=l.getAttribute("data-nodeid");if(e){const t=ti(void 0,l),r=l.getAttribute("data-handleid"),a=i({nodeId:e,id:r,type:t});if(a){const i=o.find((n=>n.nodeId===e&&n.type===t&&n.id===r));return{handle:{id:r,type:t,nodeId:e,x:i?.x||n.x,y:i?.y||n.y},validHandleResult:a}}}}let c=[],u=1/0;if(o.forEach((e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=r){const n=i(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}})),!c.length)return{handle:null,validHandleResult:qo()};if(1===c.length)return c[0];const d=c.some((({validHandleResult:e})=>e.isValid)),p=c.some((({handle:e})=>"target"===e.type));return c.find((({handle:e,validHandleResult:t})=>p?"target"===e.type:!d||t.isValid))||c[0]}(e,u,Ho(_,r,!1,[1,1]),h,T,(e=>ei(e,d,n,t,o?"target":"source",s,u)));if(v=l,A||(M(),A=!0),O=c.handleDomNode,N=c.connection,R=c.isValid,a({connectionPosition:v&&R?Wo({x:v.x,y:v.y},r):_,connectionStatus:ri(!!v,R),connectionEndHandle:c.endHandle}),!v&&!R&&!O)return ni(I);N.source!==N.target&&O&&(ni(I),I=O,O.classList.add("connecting","react-flow__handle-connecting"),O.classList.toggle("valid",R),O.classList.toggle("react-flow__handle-valid",R))}function D(e){(v||O)&&N&&R&&r?.(N),i().onConnectEnd?.(e),l&&c?.(e),ni(I),b(),cancelAnimationFrame(w),A=!1,R=!1,N=null,O=null,u.removeEventListener("mousemove",P),u.removeEventListener("mouseup",D),u.removeEventListener("touchmove",P),u.removeEventListener("touchend",D)}a({connectionPosition:_,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:k,connectionStartHandle:{nodeId:n,handleId:t,type:k},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:k}),u.addEventListener("mousemove",P),u.addEventListener("mouseup",D),u.addEventListener("touchmove",P),u.addEventListener("touchend",D)}const ii=()=>!0,ai=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),si=e.forwardRef((({type:t="source",position:n=ko.Top,isValidConnection:r,isConnectable:o=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:s,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:p,...f},h)=>{const m=s||null,g="target"===t,y=Wr(),b=e.useContext(Lo),{connectOnClick:v,noPanClassName:w}=Hr(ai,Z),{connecting:x,clickConnecting:C}=Hr(((e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.type===n||i?.nodeId===e&&i?.handleId===t&&i?.type===n,clickConnecting:a?.nodeId===e&&a?.handleId===t&&a?.type===n}})(b,m,t),Z);b||y.getState().onError?.("010",Lr());const E=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=y.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=y.getState();t(((e,t)=>{if(!e.source||!e.target)return co("006",Br()),t;let n;return n=(e=>"id"in e&&"source"in e&&"target"in e)(e)?{...e}:{...e,id:zo(e)},((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)))))(n,t)?t:t.concat(n)})(o,e))}n?.(o),l?.(o)},k=e=>{if(!b)return;const t=po(e);i&&(t&&0===e.button||!t)&&oi({event:e,handleId:m,nodeId:b,onConnect:E,isTarget:g,getState:y.getState,setState:y.setState,isValidConnection:r||y.getState().isValidConnection||ii}),t?d?.(e):p?.(e)};return e.createElement("div",{"data-handleid":m,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${m}-${t}`,className:V(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",w,u,{source:!g,target:g,connectable:o,connectablestart:i,connectableend:a,connecting:C,connectionindicator:o&&(i&&!x||a&&x)}]),onMouseDown:k,onTouchStart:k,onClick:v?e=>{const{onClickConnectStart:n,onClickConnectEnd:o,connectionClickStartHandle:a,connectionMode:s,isValidConnection:l}=y.getState();if(!b||!a&&!i)return;if(!a)return n?.(e,{nodeId:b,handleId:m,handleType:t}),void y.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:m}});const c=eo(e.target),u=r||l||ii,{connection:d,isValid:p}=ei({nodeId:b,id:m,type:t},s,a.nodeId,a.handleId||null,a.type,u,c);p&&E(d),o?.(e),y.setState({connectionClickStartHandle:null})}:void 0,ref:h,...f},c)}));si.displayName="Handle";var li=e.memo(si);const ci=({data:t,isConnectable:n,targetPosition:r=ko.Top,sourcePosition:o=ko.Bottom})=>e.createElement(e.Fragment,null,e.createElement(li,{type:"target",position:r,isConnectable:n}),t?.label,e.createElement(li,{type:"source",position:o,isConnectable:n}));ci.displayName="DefaultNode";var ui=e.memo(ci);const di=({data:t,isConnectable:n,sourcePosition:r=ko.Bottom})=>e.createElement(e.Fragment,null,t?.label,e.createElement(li,{type:"source",position:r,isConnectable:n}));di.displayName="InputNode";var pi=e.memo(di);const fi=({data:t,isConnectable:n,targetPosition:r=ko.Top})=>e.createElement(e.Fragment,null,e.createElement(li,{type:"target",position:r,isConnectable:n}),t?.label);fi.displayName="OutputNode";var hi=e.memo(fi);const mi=()=>null;mi.displayName="GroupNode";const gi=e=>({selectedNodes:e.getNodes().filter((e=>e.selected)),selectedEdges:e.edges.filter((e=>e.selected)).map((e=>({...e})))}),yi=e=>e.id;function bi(e,t){return Z(e.selectedNodes.map(yi),t.selectedNodes.map(yi))&&Z(e.selectedEdges.map(yi),t.selectedEdges.map(yi))}const vi=e.memo((({onSelectionChange:t})=>{const n=Wr(),{selectedNodes:r,selectedEdges:o}=Hr(gi,bi);return e.useEffect((()=>{const e={nodes:r,edges:o};t?.(e),n.getState().onSelectionChange.forEach((t=>t(e)))}),[r,o,t]),null}));vi.displayName="SelectionListener";const wi=e=>!!e.onSelectionChange;function xi({onSelectionChange:t}){const n=Hr(wi);return t||n?e.createElement(vi,{onSelectionChange:t}):null}const Ci=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Ei(t,n){e.useEffect((()=>{void 0!==t&&n(t)}),[t])}function ki(t,n,r){e.useEffect((()=>{void 0!==n&&r({[t]:n})}),[n])}const Si=({nodes:t,edges:n,defaultNodes:r,defaultEdges:o,onConnect:i,onConnectStart:a,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:p,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:b,onNodesChange:v,onEdgesChange:w,elementsSelectable:x,connectionMode:C,snapGrid:E,snapToGrid:k,translateExtent:S,connectOnClick:I,defaultEdgeOptions:_,fitView:A,fitViewOptions:N,onNodesDelete:R,onEdgesDelete:O,onNodeDrag:T,onNodeDragStart:M,onNodeDragStop:P,onSelectionDrag:D,onSelectionDragStart:B,onSelectionDragStop:j,noPanClassName:F,nodeOrigin:L,rfId:V,autoPanOnConnect:z,autoPanOnNodeDrag:G,onError:H,connectionRadius:W,isValidConnection:X,nodeDragThreshold:$})=>{const{setNodes:Y,setEdges:U,setDefaultNodesAndEdges:J,setMinZoom:K,setMaxZoom:Q,setTranslateExtent:q,setNodeExtent:ee,reset:te}=Hr(Ci,Z),ne=Wr();return e.useEffect((()=>{const e=o?.map((e=>({...e,..._})));return J(r,e),()=>{te()}}),[]),ki("defaultEdgeOptions",_,ne.setState),ki("connectionMode",C,ne.setState),ki("onConnect",i,ne.setState),ki("onConnectStart",a,ne.setState),ki("onConnectEnd",s,ne.setState),ki("onClickConnectStart",l,ne.setState),ki("onClickConnectEnd",c,ne.setState),ki("nodesDraggable",u,ne.setState),ki("nodesConnectable",d,ne.setState),ki("nodesFocusable",p,ne.setState),ki("edgesFocusable",f,ne.setState),ki("edgesUpdatable",h,ne.setState),ki("elementsSelectable",x,ne.setState),ki("elevateNodesOnSelect",m,ne.setState),ki("snapToGrid",k,ne.setState),ki("snapGrid",E,ne.setState),ki("onNodesChange",v,ne.setState),ki("onEdgesChange",w,ne.setState),ki("connectOnClick",I,ne.setState),ki("fitViewOnInit",A,ne.setState),ki("fitViewOnInitOptions",N,ne.setState),ki("onNodesDelete",R,ne.setState),ki("onEdgesDelete",O,ne.setState),ki("onNodeDrag",T,ne.setState),ki("onNodeDragStart",M,ne.setState),ki("onNodeDragStop",P,ne.setState),ki("onSelectionDrag",D,ne.setState),ki("onSelectionDragStart",B,ne.setState),ki("onSelectionDragStop",j,ne.setState),ki("noPanClassName",F,ne.setState),ki("nodeOrigin",L,ne.setState),ki("rfId",V,ne.setState),ki("autoPanOnConnect",z,ne.setState),ki("autoPanOnNodeDrag",G,ne.setState),ki("onError",H,ne.setState),ki("connectionRadius",W,ne.setState),ki("isValidConnection",X,ne.setState),ki("nodeDragThreshold",$,ne.setState),Ei(t,Y),Ei(n,U),Ei(g,K),Ei(y,Q),Ei(S,q),Ei(b,ee),null},Ii={display:"none"},_i={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ai="react-flow__node-desc",Ni="react-flow__edge-desc",Ri=e=>e.ariaLiveMessage;function Oi({rfId:t}){const n=Hr(Ri);return e.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:_i},n)}function Ti({rfId:t,disableKeyboardA11y:n}){return e.createElement(e.Fragment,null,e.createElement("div",{id:`${Ai}-${t}`,style:Ii},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),e.createElement("div",{id:`${Ni}-${t}`,style:Ii},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&e.createElement(Oi,{rfId:t}))}var Mi=(t=null,n={actInsideInputWithModifier:!0})=>{const[r,o]=e.useState(!1),i=e.useRef(!1),a=e.useRef(new Set([])),[s,l]=e.useMemo((()=>{if(null!==t){const e=(Array.isArray(t)?t:[t]).filter((e=>"string"==typeof e)).map((e=>e.split("+"))),n=e.reduce(((e,t)=>e.concat(...t)),[]);return[e,n]}return[[],[]]}),[t]);return e.useEffect((()=>{const e="undefined"!=typeof document?document:null,r=n?.target||e;if(null!==t){const e=e=>{i.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!i.current||i.current&&!n.actInsideInputWithModifier)&&uo(e))return!1;const t=Di(e.code,l);a.current.add(e[t]),Pi(s,a.current,!1)&&(e.preventDefault(),o(!0))},t=e=>{if((!i.current||i.current&&!n.actInsideInputWithModifier)&&uo(e))return!1;const t=Di(e.code,l);Pi(s,a.current,!0)?(o(!1),a.current.clear()):a.current.delete(e[t]),"Meta"===e.key&&a.current.clear(),i.current=!1},c=()=>{a.current.clear(),o(!1)};return r?.addEventListener("keydown",e),r?.addEventListener("keyup",t),window.addEventListener("blur",c),()=>{r?.removeEventListener("keydown",e),r?.removeEventListener("keyup",t),window.removeEventListener("blur",c)}}}),[t,o]),r};function Pi(e,t,n){return e.filter((e=>n||e.length===t.size)).some((e=>e.every((e=>t.has(e)))))}function Di(e,t){return t.includes(e)?"code":"key"}function Bi(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const i=t.get(o),a=Xo(i,r);return Bi(i,t,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[so]?.z??0)>(n.z??0)?i[so]?.z??0:n.z??0},r)}function ji(e,t,n){e.forEach((r=>{const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){const{x:o,y:i,z:a}=Bi(r,e,{...r.position,z:r[so]?.z??0},t);r.positionAbsolute={x:o,y:i},r[so].z=a,n?.[r.id]&&(r[so].isParent=!0)}}))}function Fi(e,t,n,r){const o=new Map,i={},a=r?1e3:0;return e.forEach((e=>{const n=(ao(e.zIndex)?e.zIndex:0)+(e.selected?a:0),r=t.get(e.id),s={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},l=e.parentNode||e.parentId;l&&(i[l]=!0);const c=r?.type&&r?.type!==e.type;Object.defineProperty(s,so,{enumerable:!1,value:{handleBounds:c?void 0:r?.[so]?.handleBounds,z:n}}),o.set(e.id,s)})),ji(o,n,i),o}function Li(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:a,d3Zoom:s,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),p=t.initial&&!c&&u;if(s&&l&&(p||!t.initial)){const e=n().filter((e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some((t=>t.id===e.id)):n})),c=e.every((e=>e.width&&e.height));if(e.length>0&&c){const n=Zo(e,d),{x:c,y:u,zoom:p}=Uo(n,r,o,t.minZoom??i,t.maxZoom??a,t.padding??.1),f=wr.translate(c,u).scale(p);return"number"==typeof t.duration&&t.duration>0?s.transform(Jo(l,t.duration),f):s.transform(l,f),!0}}return!1}function Vi(e,t){return e.forEach((e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[so]:n[so],selected:e.selected})})),new Map(t)}function zi(e,t){return t.map((t=>{const n=e.find((e=>e.id===t.id));return n&&(t.selected=n.selected),t}))}function Gi({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:a,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&r({nodeInternals:Vi(e,o)}),a?.(e)),t?.length&&(c&&r({edges:zi(t,i)}),s?.(t))}const Hi=()=>{},Wi={zoomIn:Hi,zoomOut:Hi,zoomTo:Hi,getZoom:()=>1,setViewport:Hi,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Hi,fitBounds:Hi,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Xi=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function Zi(){const t=(()=>{const t=Wr(),{d3Zoom:n,d3Selection:r}=Hr(Xi,Z),o=e.useMemo((()=>r&&n?{zoomIn:e=>n.scaleBy(Jo(r,e?.duration),1.2),zoomOut:e=>n.scaleBy(Jo(r,e?.duration),1/1.2),zoomTo:(e,t)=>n.scaleTo(Jo(r,t?.duration),e),getZoom:()=>t.getState().transform[2],setViewport:(e,o)=>{const[i,a,s]=t.getState().transform,l=wr.translate(e.x??i,e.y??a).scale(e.zoom??s);n.transform(Jo(r,o?.duration),l)},getViewport:()=>{const[e,n,r]=t.getState().transform;return{x:e,y:n,zoom:r}},fitView:e=>Li(t.getState,e),setCenter:(e,o,i)=>{const{width:a,height:s,maxZoom:l}=t.getState(),c=void 0!==i?.zoom?i.zoom:l,u=a/2-e*c,d=s/2-o*c,p=wr.translate(u,d).scale(c);n.transform(Jo(r,i?.duration),p)},fitBounds:(e,o)=>{const{width:i,height:a,minZoom:s,maxZoom:l}=t.getState(),{x:c,y:u,zoom:d}=Uo(e,i,a,s,l,o?.padding??.1),p=wr.translate(c,u).scale(d);n.transform(Jo(r,o?.duration),p)},project:e=>{const{transform:n,snapToGrid:r,snapGrid:o}=t.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Ho(e,n,r,o)},screenToFlowPosition:e=>{const{transform:n,snapToGrid:r,snapGrid:o,domNode:i}=t.getState();if(!i)return e;const{x:a,y:s}=i.getBoundingClientRect(),l={x:e.x-a,y:e.y-s};return Ho(l,n,r,o)},flowToScreenPosition:e=>{const{transform:n,domNode:r}=t.getState();if(!r)return e;const{x:o,y:i}=r.getBoundingClientRect(),a=Wo(e,n);return{x:a.x+o,y:a.y+i}},viewportInitialized:!0}:Wi),[n,r]);return o})(),n=Wr(),r=e.useCallback((()=>n.getState().getNodes().map((e=>({...e})))),[]),o=e.useCallback((e=>n.getState().nodeInternals.get(e)),[]),i=e.useCallback((()=>{const{edges:e=[]}=n.getState();return e.map((e=>({...e})))}),[]),a=e.useCallback((e=>{const{edges:t=[]}=n.getState();return t.find((t=>t.id===e))}),[]),s=e.useCallback((e=>{const{getNodes:t,setNodes:r,hasDefaultNodes:o,onNodesChange:i}=n.getState(),a=t(),s="function"==typeof e?e(a):e;if(o)r(s);else if(i){const e=0===s.length?a.map((e=>({type:"remove",id:e.id}))):s.map((e=>({item:e,type:"reset"})));i(e)}}),[]),l=e.useCallback((e=>{const{edges:t=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:i}=n.getState(),a="function"==typeof e?e(t):e;if(o)r(a);else if(i){i(0===a.length?t.map((e=>({type:"remove",id:e.id}))):a.map((e=>({item:e,type:"reset"}))))}}),[]),c=e.useCallback((e=>{const t=Array.isArray(e)?e:[e],{getNodes:r,setNodes:o,hasDefaultNodes:i,onNodesChange:a}=n.getState();if(i){o([...r(),...t])}else if(a){const e=t.map((e=>({item:e,type:"add"})));a(e)}}),[]),u=e.useCallback((e=>{const t=Array.isArray(e)?e:[e],{edges:r=[],setEdges:o,hasDefaultEdges:i,onEdgesChange:a}=n.getState();if(i)o([...r,...t]);else if(a){a(t.map((e=>({item:e,type:"add"}))))}}),[]),d=e.useCallback((()=>{const{getNodes:e,edges:t=[],transform:r}=n.getState(),[o,i,a]=r;return{nodes:e().map((e=>({...e}))),edges:t.map((e=>({...e}))),viewport:{x:o,y:i,zoom:a}}}),[]),p=e.useCallback((({nodes:e,edges:t})=>{const{nodeInternals:r,getNodes:o,edges:i,hasDefaultNodes:a,hasDefaultEdges:s,onNodesDelete:l,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=n.getState(),p=(e||[]).map((e=>e.id)),f=(t||[]).map((e=>e.id)),h=o().reduce(((e,t)=>{const n=t.parentNode||t.parentId,r=!p.includes(t.id)&&n&&e.find((e=>e.id===n));return("boolean"!=typeof t.deletable||t.deletable)&&(p.includes(t.id)||r)&&e.push(t),e}),[]),m=i.filter((e=>"boolean"!=typeof e.deletable||e.deletable)),g=m.filter((e=>f.includes(e.id)));if(h||g){const e=Yo(h,m),t=[...g,...e],o=t.reduce(((e,t)=>(e.includes(t.id)||e.push(t.id),e)),[]);if((s||a)&&(s&&n.setState({edges:i.filter((e=>!o.includes(e.id)))}),a&&(h.forEach((e=>{r.delete(e.id)})),n.setState({nodeInternals:new Map(r)}))),o.length>0&&(c?.(t),d&&d(o.map((e=>({id:e,type:"remove"}))))),h.length>0&&(l?.(h),u)){u(h.map((e=>({id:e.id,type:"remove"}))))}}}),[]),f=e.useCallback((e=>{const t=ao((r=e).width)&&ao(r.height)&&ao(r.x)&&ao(r.y);var r;const o=t?null:n.getState().nodeInternals.get(e.id);if(!t&&!o)return[null,null,t];return[t?e:oo(o),o,t]}),[]),h=e.useCallback(((e,t=!0,r)=>{const[o,i,a]=f(e);return o?(r||n.getState().getNodes()).filter((e=>{if(!(a||e.id!==i.id&&e.positionAbsolute))return!1;const n=oo(e),r=io(n,o);return t&&r>0||r>=o.width*o.height})):[]}),[]),m=e.useCallback(((e,t,n=!0)=>{const[r]=f(e);if(!r)return!1;const o=io(r,t);return n&&o>0||o>=r.width*r.height}),[]);return e.useMemo((()=>({...t,getNodes:r,getNode:o,getEdges:i,getEdge:a,setNodes:s,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:p,getIntersectingNodes:h,isNodeIntersecting:m})),[t,r,o,i,a,s,l,c,u,d,p,h,m])}const $i={actInsideInputWithModifier:!1};const Yi={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ui=e=>({x:e.x,y:e.y,zoom:e.k}),Ji=(e,t)=>e.target.closest(`.${t}`),Ki=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Qi=e=>{const t=e.ctrlKey&&ho()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},qi=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),ea=({onMove:t,onMoveStart:n,onMoveEnd:r,onPaneContextMenu:o,zoomOnScroll:i=!0,zoomOnPinch:a=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=wo.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:p=!0,defaultViewport:f,translateExtent:h,minZoom:m,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:b=!0,children:v,noWheelClassName:w,noPanClassName:x})=>{const C=e.useRef(),E=Wr(),k=e.useRef(!1),S=e.useRef(!1),I=e.useRef(null),_=e.useRef({x:0,y:0,zoom:0}),{d3Zoom:A,d3Selection:N,d3ZoomHandler:R,userSelectionActive:O}=Hr(qi,Z),T=Mi(y),M=e.useRef(0),P=e.useRef(!1),D=e.useRef();return function(t){const n=Wr();e.useEffect((()=>{let e;const r=()=>{if(!t.current)return;const e=Ur(t.current);0!==e.height&&0!==e.width||n.getState().onError?.("004",Pr()),n.setState({width:e.width||500,height:e.height||500})};return r(),window.addEventListener("resize",r),t.current&&(e=new ResizeObserver((()=>r())),e.observe(t.current)),()=>{window.removeEventListener("resize",r),e&&t.current&&e.unobserve(t.current)}}),[])}(I),e.useEffect((()=>{if(I.current){const e=I.current.getBoundingClientRect(),t=Nr().scaleExtent([m,g]).translateExtent(h),n=ut(I.current).call(t),r=wr.translate(f.x,f.y).scale(Jr(f.zoom,m,g)),o=[[0,0],[e.width,e.height]],i=t.constrain()(r,o,h);t.transform(n,i),t.wheelDelta(Qi),E.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[i.x,i.y,i.k],domNode:I.current.closest(".react-flow")})}}),[]),e.useEffect((()=>{N&&A&&(!s||T||O?void 0!==R&&N.on("wheel.zoom",(function(e,t){if(!b&&"wheel"===e.type&&!e.ctrlKey||Ji(e,w))return null;e.preventDefault(),R.call(this,e,t)}),{passive:!1}):N.on("wheel.zoom",(e=>{if(Ji(e,w))return!1;e.preventDefault(),e.stopImmediatePropagation();const o=N.property("__zoom").k||1;if(e.ctrlKey&&a){const t=dt(e),n=Qi(e),r=o*Math.pow(2,n);return void A.scaleTo(N,r,t,e)}const i=1===e.deltaMode?20:1;let s=c===wo.Vertical?0:e.deltaX*i,u=c===wo.Horizontal?0:e.deltaY*i;!ho()&&e.shiftKey&&c!==wo.Vertical&&(s=e.deltaY*i,u=0),A.translateBy(N,-s/o*l,-u/o*l,{internal:!0});const d=Ui(N.property("__zoom")),{onViewportChangeStart:p,onViewportChange:f,onViewportChangeEnd:h}=E.getState();clearTimeout(D.current),P.current||(P.current=!0,n?.(e,d),p?.(d)),P.current&&(t?.(e,d),f?.(d),D.current=setTimeout((()=>{r?.(e,d),h?.(d),P.current=!1}),150))}),{passive:!1}))}),[O,s,c,N,A,R,T,a,b,w,n,t,r]),e.useEffect((()=>{A&&A.on("start",(e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;M.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=E.getState(),r=Ui(e.transform);k.current=!0,_.current=r,"mousedown"===e.sourceEvent?.type&&E.setState({paneDragging:!0}),t?.(r),n?.(e.sourceEvent,r)}))}),[A,n]),e.useEffect((()=>{A&&(O&&!k.current?A.on("zoom",null):O||A.on("zoom",(e=>{const{onViewportChange:n}=E.getState();if(E.setState({transform:[e.transform.x,e.transform.y,e.transform.k]}),S.current=!(!o||!Ki(p,M.current??0)),(t||n)&&!e.sourceEvent?.internal){const r=Ui(e.transform);n?.(r),t?.(e.sourceEvent,r)}})))}),[O,A,t,p,o]),e.useEffect((()=>{A&&A.on("end",(e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=E.getState();if(k.current=!1,E.setState({paneDragging:!1}),o&&Ki(p,M.current??0)&&!S.current&&o(e.sourceEvent),S.current=!1,(r||t)&&(n=_.current,i=e.transform,n.x!==i.x||n.y!==i.y||n.zoom!==i.k)){const n=Ui(e.transform);_.current=n,clearTimeout(C.current),C.current=setTimeout((()=>{t?.(n),r?.(e.sourceEvent,n)}),s?150:0)}var n,i}))}),[A,s,p,r,o]),e.useEffect((()=>{A&&A.filter((e=>{const t=T||i,n=a&&e.ctrlKey;if((!0===p||Array.isArray(p)&&p.includes(1))&&1===e.button&&"mousedown"===e.type&&(Ji(e,"react-flow__node")||Ji(e,"react-flow__edge")))return!0;if(!(p||t||s||u||a))return!1;if(O)return!1;if(!u&&"dblclick"===e.type)return!1;if(Ji(e,w)&&"wheel"===e.type)return!1;if(Ji(e,x)&&("wheel"!==e.type||s&&"wheel"===e.type&&!T))return!1;if(!a&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!s&&!n&&"wheel"===e.type)return!1;if(!p&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(p)&&!p.includes(e.button)&&"mousedown"===e.type)return!1;const r=Array.isArray(p)&&p.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r}))}),[O,A,i,a,s,u,p,d,T]),e.createElement("div",{className:"react-flow__renderer",ref:I,style:Yi},v)},ta=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function na(){const{userSelectionActive:t,userSelectionRect:n}=Hr(ta,Z);return t&&n?e.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function ra(e,t){const n=t.parentNode||t.parentId,r=e.find((e=>e.id===n));if(r){const e=t.position.x+t.width-r.width,n=t.position.y+t.height-r.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(r.style={...r.style}||{},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,e>0&&(r.style.width+=e),n>0&&(r.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);r.position.x=r.position.x-e,r.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);r.position.y=r.position.y-e,r.style.height+=e,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function oa(e,t){if(e.some((e=>"reset"===e.type)))return e.filter((e=>"reset"===e.type)).map((e=>e.item));const n=e.filter((e=>"add"===e.type)).map((e=>e.item));return t.reduce(((t,n)=>{const r=e.filter((e=>e.id===n.id));if(0===r.length)return t.push(n),t;const o={...n};for(const e of r)if(e)switch(e.type){case"select":o.selected=e.selected;break;case"position":void 0!==e.position&&(o.position=e.position),void 0!==e.positionAbsolute&&(o.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(o.dragging=e.dragging),o.expandParent&&ra(t,o);break;case"dimensions":void 0!==e.dimensions&&(o.width=e.dimensions.width,o.height=e.dimensions.height),void 0!==e.updateStyle&&(o.style={...o.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(o.resizing=e.resizing),o.expandParent&&ra(t,o);break;case"remove":return t}return t.push(o),t}),n)}function ia(e,t){return oa(e,t)}function aa(e,t){return oa(e,t)}const sa=(e,t)=>({id:e,type:"select",selected:t});function la(e,t){return e.reduce(((e,n)=>{const r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(sa(n.id,!0))):n.selected&&!r&&(n.selected=!1,e.push(sa(n.id,!1))),e}),[])}const ca=(e,t)=>n=>{n.target===t.current&&e?.(n)},ua=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),da=e.memo((({isSelecting:t,selectionMode:n=xo.Full,panOnDrag:r,onSelectionStart:o,onSelectionEnd:i,onPaneClick:a,onPaneContextMenu:s,onPaneScroll:l,onPaneMouseEnter:c,onPaneMouseMove:u,onPaneMouseLeave:d,children:p})=>{const f=e.useRef(null),h=Wr(),m=e.useRef(0),g=e.useRef(0),y=e.useRef(),{userSelectionActive:b,elementsSelectable:v,dragging:w}=Hr(ua,Z),x=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,g.current=0},C=e=>{a?.(e),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},E=l?e=>l(e):void 0,k=v&&(t||b);return e.createElement("div",{className:V(["react-flow__pane",{dragging:w,selection:t}]),onClick:k?void 0:ca(C,f),onContextMenu:ca((e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():s?.(e)}),f),onWheel:ca(E,f),onMouseEnter:k?void 0:c,onMouseDown:k?e=>{const{resetSelectedElements:n,domNode:r}=h.getState();if(y.current=r?.getBoundingClientRect(),!v||!t||0!==e.button||e.target!==f.current||!y.current)return;const{x:i,y:a}=fo(e,y.current);n(),h.setState({userSelectionRect:{width:0,height:0,startX:i,startY:a,x:i,y:a}}),o?.(e)}:void 0,onMouseMove:k?e=>{const{userSelectionRect:r,nodeInternals:o,edges:i,transform:a,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=h.getState();if(!t||!y.current||!r)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=fo(e,y.current),p=r.startX??0,f=r.startY??0,b={...r,x:d.x<p?d.x:p,y:d.y<f?d.y:f,width:Math.abs(d.x-p),height:Math.abs(d.y-f)},v=u(),w=$o(o,b,a,n===xo.Partial,!0,c),x=Yo(w,i).map((e=>e.id)),C=w.map((e=>e.id));if(m.current!==C.length){m.current=C.length;const e=la(v,C);e.length&&s?.(e)}if(g.current!==x.length){g.current=x.length;const e=la(i,x);e.length&&l?.(e)}h.setState({userSelectionRect:b})}:u,onMouseUp:k?e=>{if(0!==e.button)return;const{userSelectionRect:t}=h.getState();!b&&t&&e.target===f.current&&C?.(e),h.setState({nodesSelectionActive:m.current>0}),x(),i?.(e)}:void 0,onMouseLeave:k?e=>{b&&(h.setState({nodesSelectionActive:m.current>0}),i?.(e)),x()}:d,ref:f,style:Yi},p,e.createElement(na,null))}));function pa(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return!!r&&(!!r.selected||pa(r,t))}function fa(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function ha(e,t,n,r){return Array.from(e.values()).filter((n=>(n.selected||n.id===r)&&(!n.parentNode||n.parentId||!pa(n,e))&&(n.draggable||t&&void 0===n.draggable))).map((e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:n.x-(e.positionAbsolute?.x??0),y:n.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent})))}function ma(e,t,n,r,o=[0,0],i){const a=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||r);let s=a;const l=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&l&&"parent"!==e.extent){const t=n.get(l),{x:r,y:i}=Xo(t,o).positionAbsolute;s=[[e.extent[0][0]+r,e.extent[0][1]+i],[e.extent[1][0]+r,e.extent[1][1]+i]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:r,y:i}=Xo(t,o).positionAbsolute;s=t&&ao(r)&&ao(i)&&ao(t.width)&&ao(t.height)?[[r+e.width*o[0],i+e.height*o[1]],[r+t.width-e.width+e.width*o[0],i+t.height-e.height+e.height*o[1]]]:s}else i?.("005",Dr()),s=a;let c={x:0,y:0};if(l){const e=n.get(l);c=Xo(e,o).positionAbsolute}const u=s&&"parent"!==s?Kr(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function ga({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map((e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute})));return[e?r.find((t=>t.id===e)):r[0],r]}da.displayName="Pane";const ya=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),a=t.getBoundingClientRect(),s=a.width*r[0],l=a.height*r[1];return i.map((e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-a.left-s)/n,y:(t.top-a.top-l)/n,...Ur(e)}}))};function ba(e,t,n){return void 0===n?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function va({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame((()=>r?.current?.blur()))):o([e])):l?.("012",zr(e))}function wa(e){return(t,n,r)=>e?.(t,r)}function xa({nodeRef:t,disabled:n=!1,noDragClassName:r,handleSelector:o,nodeId:i,isSelectable:a,selectNodesOnDrag:s}){const l=Wr(),[c,u]=e.useState(!1),d=e.useRef([]),p=e.useRef({x:null,y:null}),f=e.useRef(0),h=e.useRef(null),m=e.useRef({x:0,y:0}),g=e.useRef(null),y=e.useRef(!1),b=e.useRef(!1),v=e.useRef(!1),w=function(){const t=Wr(),n=e.useCallback((({sourceEvent:e})=>{const{transform:n,snapGrid:r,snapToGrid:o}=t.getState(),i=e.touches?e.touches[0].clientX:e.clientX,a=e.touches?e.touches[0].clientY:e.clientY,s={x:(i-n[0])/n[2],y:(a-n[1])/n[2]};return{xSnapped:o?r[0]*Math.round(s.x/r[0]):s.x,ySnapped:o?r[1]*Math.round(s.y/r[1]):s.y,...s}}),[]);return n}();return e.useEffect((()=>{if(t?.current){const e=ut(t.current),c=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:r,onSelectionDrag:o,updateNodePositions:a,nodeExtent:s,snapGrid:c,snapToGrid:f,nodeOrigin:h,onError:m}=l.getState();p.current={x:e,y:t};let y=!1,b={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&s){const e=Zo(d.current,h);b=no(e)}if(d.current=d.current.map((r=>{const o={x:e-r.distance.x,y:t-r.distance.y};f&&(o.x=c[0]*Math.round(o.x/c[0]),o.y=c[1]*Math.round(o.y/c[1]));const i=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];d.current.length>1&&s&&!r.extent&&(i[0][0]=r.positionAbsolute.x-b.x+s[0][0],i[1][0]=r.positionAbsolute.x+(r.width??0)-b.x2+s[1][0],i[0][1]=r.positionAbsolute.y-b.y+s[0][1],i[1][1]=r.positionAbsolute.y+(r.height??0)-b.y2+s[1][1]);const a=ma(r,o,n,i,h,m);return y=y||r.position.x!==a.position.x||r.position.y!==a.position.y,r.position=a.position,r.positionAbsolute=a.positionAbsolute,r})),!y)return;a(d.current,!0,!0),u(!0);const v=i?r:wa(o);if(v&&g.current){const[e,t]=ga({nodeId:i,dragItems:d.current,nodeInternals:n});v(g.current,e,t)}},x=()=>{if(!h.current)return;const[e,t]=qr(m.current,h.current);if(0!==e||0!==t){const{transform:n,panBy:r}=l.getState();p.current.x=(p.current.x??0)-e/n[2],p.current.y=(p.current.y??0)-t/n[2],r({x:e,y:t})&&c(p.current)}f.current=requestAnimationFrame(x)},C=e=>{const{nodeInternals:n,multiSelectionActive:r,nodesDraggable:o,unselectNodesAndEdges:c,onNodeDragStart:u,onSelectionDragStart:f}=l.getState();b.current=!0;const h=i?u:wa(f);s&&a||r||!i||n.get(i)?.selected||c(),i&&a&&s&&va({id:i,store:l,nodeRef:t});const m=w(e);if(p.current=m,d.current=ha(n,o,m,i),h&&d.current){const[t,r]=ga({nodeId:i,dragItems:d.current,nodeInternals:n});h(e.sourceEvent,t,r)}};if(!n){const n=function(){var e,t,n,r,o=wt,i=xt,a=Ct,s=Et,l={},c=Y("start","drag","end"),u=0,d=0;function p(e){e.on("mousedown.drag",f).filter(s).on("touchstart.drag",g).on("touchmove.drag",y,pt).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(a,s){if(!r&&o.call(this,a,s)){var l=v(this,i.call(this,a,s),a,s,"mouse");l&&(ut(a.view).on("mousemove.drag",h,ft).on("mouseup.drag",m,ft),gt(a.view),ht(a),n=!1,e=a.clientX,t=a.clientY,l("start",a))}}function h(r){if(mt(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>d}l.mouse("drag",r)}function m(e){ut(e.view).on("mousemove.drag mouseup.drag",null),yt(e.view,n),mt(e),l.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,s=i.call(this,e,t),l=a.length;for(n=0;n<l;++n)(r=v(this,s,e,t,a[n].identifier,a[n]))&&(ht(e),r("start",e,a[n]))}}function y(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=l[r[t].identifier])&&(mt(e),n("drag",e,r[t]))}function b(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(n=l[o[t].identifier])&&(ht(e),n("end",e,o[t]))}function v(e,t,n,r,o,i){var s,d,f,h=c.copy(),m=dt(i||n,t);if(null!=(f=a.call(e,new vt("beforestart",{sourceEvent:n,target:p,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return s=f.x-m[0]||0,d=f.y-m[1]||0,function n(i,a,c){var g,y=m;switch(i){case"start":l[o]=n,g=u++;break;case"end":delete l[o],--u;case"drag":m=dt(c||a,t),g=u}h.call(i,e,new vt(i,{sourceEvent:a,subject:f,target:p,identifier:o,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),r)}}return p.filter=function(e){return arguments.length?(o="function"==typeof e?e:bt(!!e),p):o},p.container=function(e){return arguments.length?(i="function"==typeof e?e:bt(e),p):i},p.subject=function(e){return arguments.length?(a="function"==typeof e?e:bt(e),p):a},p.touchable=function(e){return arguments.length?(s="function"==typeof e?e:bt(!!e),p):s},p.on=function(){var e=c.on.apply(c,arguments);return e===c?p:e},p.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,p):Math.sqrt(d)},p}().on("start",(e=>{const{domNode:t,nodeDragThreshold:n}=l.getState();0===n&&C(e),v.current=!1;const r=w(e);p.current=r,h.current=t?.getBoundingClientRect()||null,m.current=fo(e.sourceEvent,h.current)})).on("drag",(e=>{const t=w(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=l.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(v.current=!0),!v.current){if(!y.current&&b.current&&n&&(y.current=!0,x()),!b.current){const n=t.xSnapped-(p?.current?.x??0),o=t.ySnapped-(p?.current?.y??0);Math.sqrt(n*n+o*o)>r&&C(e)}(p.current.x!==t.xSnapped||p.current.y!==t.ySnapped)&&d.current&&b.current&&(g.current=e.sourceEvent,m.current=fo(e.sourceEvent,h.current),c(t))}})).on("end",(e=>{if(b.current&&!v.current&&(u(!1),y.current=!1,b.current=!1,cancelAnimationFrame(f.current),d.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:r,onSelectionDragStop:o}=l.getState(),a=i?r:wa(o);if(t(d.current,!1,!1),a){const[t,r]=ga({nodeId:i,dragItems:d.current,nodeInternals:n});a(e.sourceEvent,t,r)}}})).filter((e=>{const n=e.target;return!e.button&&(!r||!fa(n,`.${r}`,t))&&(!o||fa(n,o,t))}));return e.call(n),()=>{e.on(".drag",null)}}e.on(".drag",null)}}),[t,n,r,o,a,l,i,s,w]),c}function Ca(){const t=Wr(),n=e.useCallback((e=>{const{nodeInternals:n,nodeExtent:r,updateNodePositions:o,getNodes:i,snapToGrid:a,snapGrid:s,onError:l,nodesDraggable:c}=t.getState(),u=i().filter((e=>e.selected&&(e.draggable||c&&void 0===e.draggable))),d=a?s[0]:5,p=a?s[1]:5,f=e.isShiftPressed?4:1,h=e.x*d*f,m=e.y*p*f,g=u.map((e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};a&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:o,position:i}=ma(e,t,n,r,void 0,l);e.position=i,e.positionAbsolute=o}return e}));o(g,!0,!1)}),[]);return n}const Ea={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ka=t=>{const n=({id:n,type:r,data:o,xPos:i,yPos:a,xPosOrigin:s,yPosOrigin:l,selected:c,onClick:u,onMouseEnter:d,onMouseMove:p,onMouseLeave:f,onContextMenu:h,onDoubleClick:m,style:g,className:y,isDraggable:b,isSelectable:v,isConnectable:w,isFocusable:x,selectNodesOnDrag:C,sourcePosition:E,targetPosition:k,hidden:S,resizeObserver:I,dragHandle:_,zIndex:A,isParent:N,noDragClassName:R,noPanClassName:O,initialized:T,disableKeyboardA11y:M,ariaLabel:P,rfId:D,hasHandleBounds:B})=>{const j=Wr(),F=e.useRef(null),L=e.useRef(null),z=e.useRef(E),G=e.useRef(k),H=e.useRef(r),W=v||b||u||d||p||f,X=Ca(),Z=ba(n,j.getState,d),$=ba(n,j.getState,p),Y=ba(n,j.getState,f),U=ba(n,j.getState,h),J=ba(n,j.getState,m);e.useEffect((()=>()=>{L.current&&(I?.unobserve(L.current),L.current=null)}),[]),e.useEffect((()=>{if(F.current&&!S){const e=F.current;T&&B&&L.current===e||(L.current&&I?.unobserve(L.current),I?.observe(e),L.current=e)}}),[S,T,B]),e.useEffect((()=>{const e=H.current!==r,t=z.current!==E,o=G.current!==k;F.current&&(e||t||o)&&(e&&(H.current=r),t&&(z.current=E),o&&(G.current=k),j.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))}),[n,r,E,k]);const K=xa({nodeRef:F,disabled:S||!b,noDragClassName:R,handleSelector:_,nodeId:n,isSelectable:v,selectNodesOnDrag:C});return S?null:e.createElement("div",{className:V(["react-flow__node",`react-flow__node-${r}`,{[O]:b},y,{selected:c,selectable:v,parent:N,dragging:K}]),ref:F,style:{zIndex:A,transform:`translate(${s}px,${l}px)`,pointerEvents:W?"all":"none",visibility:T?"visible":"hidden",...g},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:Z,onMouseMove:$,onMouseLeave:Y,onContextMenu:U,onClick:e=>{const{nodeDragThreshold:t}=j.getState();if(v&&(!C||!b||t>0)&&va({id:n,store:j,nodeRef:F}),u){const t=j.getState().nodeInternals.get(n);t&&u(e,{...t})}},onDoubleClick:J,onKeyDown:x?e=>{if(!uo(e)&&!M)if(lo.includes(e.key)&&v){const t="Escape"===e.key;va({id:n,store:j,unselect:t,nodeRef:F})}else b&&c&&Object.prototype.hasOwnProperty.call(Ea,e.key)&&(j.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~a}`}),X({x:Ea[e.key].x,y:Ea[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:x?0:void 0,role:x?"button":void 0,"aria-describedby":M?void 0:`${Ai}-${D}`,"aria-label":P},e.createElement(Vo,{value:n},e.createElement(t,{id:n,data:o,type:r,xPos:i,yPos:a,selected:c,isConnectable:w,sourcePosition:E,targetPosition:k,dragging:K,dragHandle:_,zIndex:A})))};return n.displayName="NodeWrapper",e.memo(n)};const Sa=e=>{const t=e.getNodes().filter((e=>e.selected));return{...Zo(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var Ia=e.memo((function({onSelectionContextMenu:t,noPanClassName:n,disableKeyboardA11y:r}){const o=Wr(),{width:i,height:a,x:s,y:l,transformString:c,userSelectionActive:u}=Hr(Sa,Z),d=Ca(),p=e.useRef(null);if(e.useEffect((()=>{r||p.current?.focus({preventScroll:!0})}),[r]),xa({nodeRef:p}),u||!i||!a)return null;const f=t?e=>{const n=o.getState().getNodes().filter((e=>e.selected));t(e,n)}:void 0;return e.createElement("div",{className:V(["react-flow__nodesselection","react-flow__container",n]),style:{transform:c}},e.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:r?void 0:-1,onKeyDown:r?void 0:e=>{Object.prototype.hasOwnProperty.call(Ea,e.key)&&d({x:Ea[e.key].x,y:Ea[e.key].y,isShiftPressed:e.shiftKey})},style:{width:i,height:a,top:l,left:s}}))}));const _a=e=>e.nodesSelectionActive,Aa=({children:t,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:s,deleteKeyCode:l,onMove:c,onMoveStart:u,onMoveEnd:d,selectionKeyCode:p,selectionOnDrag:f,selectionMode:h,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:C,panOnScroll:E,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:I,panOnDrag:_,defaultViewport:A,translateExtent:N,minZoom:R,maxZoom:O,preventScrolling:T,onSelectionContextMenu:M,noWheelClassName:P,noPanClassName:D,disableKeyboardA11y:B})=>{const j=Hr(_a),F=Mi(p),L=Mi(b),V=L||_,z=L||E,G=F||f&&!0!==V;return(({deleteKeyCode:t,multiSelectionKeyCode:n})=>{const r=Wr(),{deleteElements:o}=Zi(),i=Mi(t,$i),a=Mi(n);e.useEffect((()=>{if(i){const{edges:e,getNodes:t}=r.getState(),n=t().filter((e=>e.selected)),i=e.filter((e=>e.selected));o({nodes:n,edges:i}),r.setState({nodesSelectionActive:!1})}}),[i]),e.useEffect((()=>{r.setState({multiSelectionActive:a})}),[a])})({deleteKeyCode:l,multiSelectionKeyCode:y}),e.createElement(ea,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:a,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:C,panOnScroll:z,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:I,panOnDrag:!F&&V,defaultViewport:A,translateExtent:N,minZoom:R,maxZoom:O,zoomActivationKeyCode:v,preventScrolling:T,noWheelClassName:P,noPanClassName:D},e.createElement(da,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:s,panOnDrag:V,isSelecting:!!G,selectionMode:h},t,j&&e.createElement(Ia,{onSelectionContextMenu:M,noPanClassName:D,disableKeyboardA11y:B})))};Aa.displayName="FlowRenderer";var Na=e.memo(Aa);function Ra(e){return{...{input:ka(e.input||pi),default:ka(e.default||ui),output:ka(e.output||hi),group:ka(e.group||mi)},...Object.keys(e).filter((e=>!["input","default","output","group"].includes(e))).reduce(((t,n)=>(t[n]=ka(e[n]||ui),t)),{})}}const Oa=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Ta=t=>{const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:o,elementsSelectable:i,updateNodeDimensions:a,onError:s}=Hr(Oa,Z),l=(c=t.onlyRenderVisibleElements,Hr(e.useCallback((e=>c?$o(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes()),[c])));var c;const u=e.useRef(),d=e.useMemo((()=>{if("undefined"==typeof ResizeObserver)return null;const e=new ResizeObserver((e=>{const t=e.map((e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0})));a(t)}));return u.current=e,e}),[]);return e.useEffect((()=>()=>{u?.current?.disconnect()}),[]),e.createElement("div",{className:"react-flow__nodes",style:Yi},l.map((a=>{let l=a.type||"default";t.nodeTypes[l]||(s?.("003",Mr(l)),l="default");const c=t.nodeTypes[l]||t.nodeTypes.default,u=!!(a.draggable||n&&void 0===a.draggable),p=!!(a.selectable||i&&void 0===a.selectable),f=!!(a.connectable||r&&void 0===a.connectable),h=!!(a.focusable||o&&void 0===a.focusable),m=t.nodeExtent?Kr(a.positionAbsolute,t.nodeExtent):a.positionAbsolute,g=m?.x??0,y=m?.y??0,b=(({x:e,y:t,width:n,height:r,origin:o})=>n&&r?o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]}:{x:e,y:t})({x:g,y:y,width:a.width??0,height:a.height??0,origin:t.nodeOrigin});return e.createElement(c,{key:a.id,id:a.id,className:a.className,style:a.style,type:l,data:a.data,sourcePosition:a.sourcePosition||ko.Bottom,targetPosition:a.targetPosition||ko.Top,hidden:a.hidden,xPos:g,yPos:y,xPosOrigin:b.x,yPosOrigin:b.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!a.selected,isDraggable:u,isSelectable:p,isConnectable:f,isFocusable:h,resizeObserver:d,dragHandle:a.dragHandle,zIndex:a[so]?.z??0,isParent:!!a[so]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!a.width&&!!a.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:a.ariaLabel,hasHandleBounds:!!a[so]?.handleBounds})})))};Ta.displayName="NodeRenderer";var Ma=e.memo(Ta);const Pa=(e,t,n)=>n===ko.Left?e-t:n===ko.Right?e+t:e,Da=(e,t,n)=>n===ko.Top?e-t:n===ko.Bottom?e+t:e,Ba="react-flow__edgeupdater",ja=({position:t,centerX:n,centerY:r,radius:o=10,onMouseDown:i,onMouseEnter:a,onMouseOut:s,type:l})=>e.createElement("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:s,className:V([Ba,`${Ba}-${l}`]),cx:Pa(n,o,t),cy:Da(r,o,t),r:o,stroke:"transparent",fill:"transparent"}),Fa=()=>!0;var La=t=>{const n=({id:n,className:r,type:o,data:i,onClick:a,onEdgeDoubleClick:s,selected:l,animated:c,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,source:y,target:b,sourceX:v,sourceY:w,targetX:x,targetY:C,sourcePosition:E,targetPosition:k,elementsSelectable:S,hidden:I,sourceHandleId:_,targetHandleId:A,onContextMenu:N,onMouseEnter:R,onMouseMove:O,onMouseLeave:T,reconnectRadius:M,onReconnect:P,onReconnectStart:D,onReconnectEnd:B,markerEnd:j,markerStart:F,rfId:L,ariaLabel:z,isFocusable:G,isReconnectable:H,pathOptions:W,interactionWidth:X,disableKeyboardA11y:Z})=>{const $=e.useRef(null),[Y,U]=e.useState(!1),[J,K]=e.useState(!1),Q=Wr(),q=e.useMemo((()=>`url('#${Go(F,L)}')`),[F,L]),ee=e.useMemo((()=>`url('#${Go(j,L)}')`),[j,L]);if(I)return null;const te=go(n,Q.getState,s),ne=go(n,Q.getState,N),re=go(n,Q.getState,R),oe=go(n,Q.getState,O),ie=go(n,Q.getState,T),ae=(e,t)=>{if(0!==e.button)return;const{edges:r,isValidConnection:o}=Q.getState(),i=t?b:y,a=(t?A:_)||null,s=t?"target":"source",l=o||Fa,c=t,u=r.find((e=>e.id===n));K(!0),D?.(e,u,s);oi({event:e,handleId:a,nodeId:i,onConnect:e=>P?.(u,e),isTarget:c,getState:Q.getState,setState:Q.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{K(!1),B?.(e,u,s)}})},se=()=>U(!0),le=()=>U(!1),ce=!S&&!a;return e.createElement("g",{className:V(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:l,animated:c,inactive:ce,updating:Y}]),onClick:e=>{const{edges:t,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:i}=Q.getState(),s=t.find((e=>e.id===n));s&&(S&&(Q.setState({nodesSelectionActive:!1}),s.selected&&i?(o({nodes:[],edges:[s]}),$.current?.blur()):r([n])),a&&a(e,s))},onDoubleClick:te,onContextMenu:ne,onMouseEnter:re,onMouseMove:oe,onMouseLeave:ie,onKeyDown:G?e=>{if(!Z&&lo.includes(e.key)&&S){const{unselectNodesAndEdges:t,addSelectedEdges:r,edges:o}=Q.getState();"Escape"===e.key?($.current?.blur(),t({edges:[o.find((e=>e.id===n))]})):r([n])}}:void 0,tabIndex:G?0:void 0,role:G?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===z?void 0:z||`Edge from ${y} to ${b}`,"aria-describedby":G?`${Ni}-${L}`:void 0,ref:$},!J&&e.createElement(t,{id:n,source:y,target:b,selected:l,animated:c,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,data:i,style:g,sourceX:v,sourceY:w,targetX:x,targetY:C,sourcePosition:E,targetPosition:k,sourceHandleId:_,targetHandleId:A,markerStart:q,markerEnd:ee,pathOptions:W,interactionWidth:X}),H&&e.createElement(e.Fragment,null,("source"===H||!0===H)&&e.createElement(ja,{position:E,centerX:v,centerY:w,radius:M,onMouseDown:e=>ae(e,!0),onMouseEnter:se,onMouseOut:le,type:"source"}),("target"===H||!0===H)&&e.createElement(ja,{position:k,centerX:x,centerY:C,radius:M,onMouseDown:e=>ae(e,!1),onMouseEnter:se,onMouseOut:le,type:"target"})))};return n.displayName="EdgeWrapper",e.memo(n)};function Va(e){return{...{default:La(e.default||Fo),straight:La(e.bezier||Po),step:La(e.step||Mo),smoothstep:La(e.step||To),simplebezier:La(e.simplebezier||_o)},...Object.keys(e).filter((e=>!["default","bezier"].includes(e))).reduce(((t,n)=>(t[n]=La(e[n]||Fo),t)),{})}}function za(e,t,n=null){const r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,i=n?.width||t.width,a=n?.height||t.height;switch(e){case ko.Top:return{x:r+i/2,y:o};case ko.Right:return{x:r+i,y:o+a/2};case ko.Bottom:return{x:r+i/2,y:o+a};case ko.Left:return{x:r,y:o+a/2}}}function Ga(e,t){return e?1!==e.length&&t?t&&e.find((e=>e.id===t))||null:e[0]:null}function Ha(e){const t=e?.[so]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Wa=[{level:0,isMaxLevel:!0,edges:[]}];function Xa(t,n,r){const o=Hr(e.useCallback((e=>t?e.edges.filter((t=>{const r=n.get(t.source),o=n.get(t.target);return r?.width&&r?.height&&o?.width&&o?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:a,height:s,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=no({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:a/l[2],height:s/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),p=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*p)>0}({sourcePos:r.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:r.width,sourceHeight:r.height,targetWidth:o.width,targetHeight:o.height,width:e.width,height:e.height,transform:e.transform})})):e.edges),[t,n]));return function(e,t,n=!1){let r=-1;const o=e.reduce(((e,o)=>{const i=ao(o.zIndex);let a=i?o.zIndex:0;if(n){const e=t.get(o.target),n=t.get(o.source),r=o.selected||e?.selected||n?.selected,s=Math.max(n?.[so]?.z||0,e?.[so]?.z||0,1e3);a=(i?o.zIndex:0)+(r?s:0)}return e[a]?e[a].push(o):e[a]=[o],r=a>r?a:r,e}),{}),i=Object.entries(o).map((([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===r}}));return 0===i.length?Wa:i}(o,n,r)}const Za={[Eo.Arrow]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[Eo.ArrowClosed]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const $a=({id:t,type:n,color:r,width:o=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=function(t){const n=Wr();return e.useMemo((()=>Object.prototype.hasOwnProperty.call(Za,t)?Za[t]:(n.getState().onError?.("009",jr(t)),null)),[t])}(n);return c?e.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0"},e.createElement(c,{color:r,strokeWidth:s})):null},Ya=({defaultColor:t,rfId:n})=>{const r=Hr(e.useCallback((({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce(((n,o)=>([o.markerStart,o.markerEnd].forEach((o=>{if(o&&"object"==typeof o){const i=Go(o,t);r.includes(i)||(n.push({id:i,color:o.color||e,...o}),r.push(i))}})),n)),[]).sort(((e,t)=>e.id.localeCompare(t.id)))})({defaultColor:t,rfId:n}),[t,n]),((e,t)=>!(e.length!==t.length||e.some(((e,n)=>e.id!==t[n].id)))));return e.createElement("defs",null,r.map((t=>e.createElement($a,{id:t.id,key:t.id,type:t.type,color:t.color,width:t.width,height:t.height,markerUnits:t.markerUnits,strokeWidth:t.strokeWidth,orient:t.orient}))))};Ya.displayName="MarkerDefinitions";var Ua=e.memo(Ya);const Ja=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Ka=({defaultMarkerColor:t,onlyRenderVisibleElements:n,elevateEdgesOnSelect:r,rfId:o,edgeTypes:i,noPanClassName:a,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:p,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,children:y,disableKeyboardA11y:b})=>{const{edgesFocusable:v,edgesUpdatable:w,elementsSelectable:x,width:C,height:E,connectionMode:k,nodeInternals:S,onError:I}=Hr(Ja,Z),_=Xa(n,S,r);return C?e.createElement(e.Fragment,null,_.map((({level:n,edges:r,isMaxLevel:y})=>e.createElement("svg",{key:n,style:{zIndex:n},width:C,height:E,className:"react-flow__edges react-flow__container"},y&&e.createElement(Ua,{defaultColor:t,rfId:o}),e.createElement("g",null,r.map((t=>{const[n,r,y]=Ha(S.get(t.source)),[C,E,_]=Ha(S.get(t.target));if(!y||!_)return null;let A=t.type||"default";i[A]||(I?.("011",Vr(A)),A="default");const N=i[A]||i.default,R=k===vo.Strict?E.target:(E.target??[]).concat(E.source??[]),O=Ga(r.source,t.sourceHandle),T=Ga(R,t.targetHandle),M=O?.position||ko.Bottom,P=T?.position||ko.Top,D=!!(t.focusable||v&&void 0===t.focusable),B=t.reconnectable||t.updatable,j=void 0!==f&&(B||w&&void 0===B);if(!O||!T)return I?.("008",Fr(O,t)),null;const{sourceX:F,sourceY:L,targetX:z,targetY:G}=((e,t,n,r,o,i)=>{const a=za(n,e,t),s=za(i,r,o);return{sourceX:a.x,sourceY:a.y,targetX:s.x,targetY:s.y}})(n,O,M,C,T,P);return e.createElement(N,{key:t.id,id:t.id,className:V([t.className,a]),type:A,data:t.data,selected:!!t.selected,animated:!!t.animated,hidden:!!t.hidden,label:t.label,labelStyle:t.labelStyle,labelShowBg:t.labelShowBg,labelBgStyle:t.labelBgStyle,labelBgPadding:t.labelBgPadding,labelBgBorderRadius:t.labelBgBorderRadius,style:t.style,source:t.source,target:t.target,sourceHandleId:t.sourceHandle,targetHandleId:t.targetHandle,markerEnd:t.markerEnd,markerStart:t.markerStart,sourceX:F,sourceY:L,targetX:z,targetY:G,sourcePosition:M,targetPosition:P,elementsSelectable:x,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:p,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,rfId:o,ariaLabel:t.ariaLabel,isFocusable:D,isReconnectable:j,pathOptions:"pathOptions"in t?t.pathOptions:void 0,interactionWidth:t.interactionWidth,disableKeyboardA11y:b})})))))),y):null};Ka.displayName="EdgeRenderer";var Qa=e.memo(Ka);const qa=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function es({children:t}){const n=Hr(qa);return e.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},t)}const ts={[ko.Left]:ko.Right,[ko.Right]:ko.Left,[ko.Top]:ko.Bottom,[ko.Bottom]:ko.Top},ns=({nodeId:t,handleType:n,style:r,type:o=Co.Bezier,CustomComponent:i,connectionStatus:a})=>{const{fromNode:s,handleId:l,toX:c,toY:u,connectionMode:d}=Hr(e.useCallback((e=>({fromNode:e.nodeInternals.get(t),handleId:e.connectionHandleId,toX:(e.connectionPosition.x-e.transform[0])/e.transform[2],toY:(e.connectionPosition.y-e.transform[1])/e.transform[2],connectionMode:e.connectionMode})),[t]),Z),p=s?.[so]?.handleBounds;let f=p?.[n];if(d===vo.Loose&&(f=f||p?.["source"===n?"target":"source"]),!s||!f)return null;const h=l?f.find((e=>e.id===l)):f[0],m=h?h.x+h.width/2:(s.width??0)/2,g=h?h.y+h.height/2:s.height??0,y=(s.positionAbsolute?.x??0)+m,b=(s.positionAbsolute?.y??0)+g,v=h?.position,w=v?ts[v]:null;if(!v||!w)return null;if(i)return e.createElement(i,{connectionLineType:o,connectionLineStyle:r,fromNode:s,fromHandle:h,fromX:y,fromY:b,toX:c,toY:u,fromPosition:v,toPosition:w,connectionStatus:a});let x="";const C={sourceX:y,sourceY:b,sourcePosition:v,targetX:c,targetY:u,targetPosition:w};return o===Co.Bezier?[x]=jo(C):o===Co.Step?[x]=Oo({...C,borderRadius:0}):o===Co.SmoothStep?[x]=Oo(C):o===Co.SimpleBezier?[x]=Io(C):x=`M${y},${b} ${c},${u}`,e.createElement("path",{d:x,fill:"none",className:"react-flow__connection-path",style:r})};ns.displayName="ConnectionLine";const rs=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function os({containerStyle:t,style:n,type:r,component:o}){const{nodeId:i,handleType:a,nodesConnectable:s,width:l,height:c,connectionStatus:u}=Hr(rs,Z);return!!(i&&a&&l&&s)?e.createElement("svg",{style:t,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},e.createElement("g",{className:V(["react-flow__connection",u])},e.createElement(ns,{nodeId:i,handleType:a,style:n,type:r,CustomComponent:o,connectionStatus:u}))):null}function is(t,n){const r=e.useRef(null),o=Wr();return e.useMemo((()=>{if("development"===process.env.NODE_ENV){const e=Object.keys(t);Z(r.current,e)&&o.getState().onError?.("002",Tr()),r.current=e}return n(t)}),[t])}const as=({nodeTypes:t,edgeTypes:n,onMove:r,onMoveStart:o,onMoveEnd:i,onInit:a,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:p,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:y,connectionLineType:b,connectionLineStyle:v,connectionLineComponent:w,connectionLineContainerStyle:x,selectionKeyCode:C,selectionOnDrag:E,selectionMode:k,multiSelectionKeyCode:S,panActivationKeyCode:I,zoomActivationKeyCode:_,deleteKeyCode:A,onlyRenderVisibleElements:N,elementsSelectable:R,selectNodesOnDrag:O,defaultViewport:T,translateExtent:M,minZoom:P,maxZoom:D,preventScrolling:B,defaultMarkerColor:j,zoomOnScroll:F,zoomOnPinch:L,panOnScroll:V,panOnScrollSpeed:z,panOnScrollMode:G,zoomOnDoubleClick:H,panOnDrag:W,onPaneClick:X,onPaneMouseEnter:Z,onPaneMouseMove:$,onPaneMouseLeave:Y,onPaneScroll:U,onPaneContextMenu:J,onEdgeContextMenu:K,onEdgeMouseEnter:Q,onEdgeMouseMove:q,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,reconnectRadius:oe,noDragClassName:ie,noWheelClassName:ae,noPanClassName:se,elevateEdgesOnSelect:le,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:pe})=>{const fe=is(t,Ra),he=is(n,Va);return function(t){const n=Zi(),r=e.useRef(!1);e.useEffect((()=>{!r.current&&n.viewportInitialized&&t&&(setTimeout((()=>t(n)),1),r.current=!0)}),[t,n.viewportInitialized])}(a),e.createElement(Na,{onPaneClick:X,onPaneMouseEnter:Z,onPaneMouseMove:$,onPaneMouseLeave:Y,onPaneContextMenu:J,onPaneScroll:U,deleteKeyCode:A,selectionKeyCode:C,selectionOnDrag:E,selectionMode:k,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:S,panActivationKeyCode:I,zoomActivationKeyCode:_,elementsSelectable:R,onMove:r,onMoveStart:o,onMoveEnd:i,zoomOnScroll:F,zoomOnPinch:L,zoomOnDoubleClick:H,panOnScroll:V,panOnScrollSpeed:z,panOnScrollMode:G,panOnDrag:W,defaultViewport:T,translateExtent:M,minZoom:P,maxZoom:D,onSelectionContextMenu:m,preventScrolling:B,noDragClassName:ie,noWheelClassName:ae,noPanClassName:se,disableKeyboardA11y:ce},e.createElement(es,null,e.createElement(Qa,{edgeTypes:he,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:N,onEdgeContextMenu:K,onEdgeMouseEnter:Q,onEdgeMouseMove:q,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,reconnectRadius:oe,defaultMarkerColor:j,noPanClassName:se,elevateEdgesOnSelect:!!le,disableKeyboardA11y:ce,rfId:pe},e.createElement(os,{style:v,type:b,component:w,containerStyle:x})),e.createElement("div",{className:"react-flow__edgelabel-renderer"}),e.createElement(Ma,{nodeTypes:fe,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:p,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:O,onlyRenderVisibleElements:N,noPanClassName:se,noDragClassName:ie,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:pe})))};as.displayName="GraphView";var ss=e.memo(as);const ls=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],cs={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:ls,nodeExtent:ls,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:vo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:co,isValidConnection:void 0},us=()=>((e,t)=>e?X(e,t):X)(((e,t)=>({...cs,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Fi(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map((e=>({...r,...e})))})},setDefaultNodesAndEdges:(n,r)=>{const o=void 0!==n,i=void 0!==r,a=o?Fi(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:s,domNode:l,nodeOrigin:c}=t(),u=l?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:p}=new window.DOMMatrixReadOnly(d.transform),f=n.reduce(((e,t)=>{const n=o.get(t.id);if(n?.hidden)o.set(n.id,{...n,[so]:{...n[so],handleBounds:void 0}});else if(n){const r=Ur(t.nodeElement);!(!r.width||!r.height||n.width===r.width&&n.height===r.height&&!t.forceUpdate)&&(o.set(n.id,{...n,[so]:{...n[so],handleBounds:{source:ya(".source",t.nodeElement,p,c),target:ya(".target",t.nodeElement,p,c)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e}),[]);ji(o,c);const h=a||i&&!a&&Li(t,{initial:!0,...s});e({nodeInternals:new Map(o),fitViewOnInitDone:h}),f?.length>0&&r?.(f)},updateNodePositions:(e,n=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),i=e.map((e=>{const t={id:e.id,type:"position",dragging:r};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t}));o(i)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:a,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(i){const t=Fi(ia(n,s()),o,a,l);e({nodeInternals:t})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,s=null;r?a=n.map((e=>sa(e,!0))):(a=la(i(),n),s=la(o,[])),Gi({changedNodes:a,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,s=null;r?a=n.map((e=>sa(e,!0))):(a=la(o,n),s=la(i(),[])),Gi({changedNodes:s,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),a=r||o;Gi({changedNodes:(n||i()).map((e=>(e.selected=!1,sa(e.id,!1)))),changedEdges:a.map((e=>sa(e.id,!1))),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t();Gi({changedNodes:r().filter((e=>e.selected)).map((e=>sa(e.id,!1))),changedEdges:n.filter((e=>e.selected)).map((e=>sa(e.id,!1))),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach((e=>{e.positionAbsolute=Kr(e.position,n)})),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:e=>{const{transform:n,width:r,height:o,d3Zoom:i,d3Selection:a,translateExtent:s}=t();if(!i||!a||!e.x&&!e.y)return!1;const l=wr.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[r,o]],u=i?.constrain()(l,c,s);i.transform(a,u);return n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:cs.connectionNodeId,connectionHandleId:cs.connectionHandleId,connectionHandleType:cs.connectionHandleType,connectionStatus:cs.connectionStatus,connectionStartHandle:cs.connectionStartHandle,connectionEndHandle:cs.connectionEndHandle}),reset:()=>e({...cs})})),Object.is),ds=({children:t})=>{const n=e.useRef(null);return n.current||(n.current=us()),e.createElement(Or,{value:n.current},t)};ds.displayName="ReactFlowProvider";const ps=({children:t})=>e.useContext(Rr)?e.createElement(e.Fragment,null,t):e.createElement(ds,null,t);ps.displayName="ReactFlowWrapper";const fs={input:pi,default:ui,output:hi,group:mi},hs={default:Fo,straight:Po,step:Mo,smoothstep:To,simplebezier:_o},ms=[0,0],gs=[15,15],ys={x:0,y:0,zoom:1},bs={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},vs=e.forwardRef((({nodes:t,edges:n,defaultNodes:r,defaultEdges:o,className:i,nodeTypes:a=fs,edgeTypes:s=hs,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:p,onMoveEnd:f,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:x,onNodeContextMenu:C,onNodeDoubleClick:E,onNodeDragStart:k,onNodeDrag:S,onNodeDragStop:I,onNodesDelete:_,onEdgesDelete:A,onSelectionChange:N,onSelectionDragStart:R,onSelectionDrag:O,onSelectionDragStop:T,onSelectionContextMenu:M,onSelectionStart:P,onSelectionEnd:D,connectionMode:B=vo.Strict,connectionLineType:j=Co.Bezier,connectionLineStyle:F,connectionLineComponent:L,connectionLineContainerStyle:z,deleteKeyCode:G="Backspace",selectionKeyCode:H="Shift",selectionOnDrag:W=!1,selectionMode:X=xo.Full,panActivationKeyCode:Z="Space",multiSelectionKeyCode:$=(ho()?"Meta":"Control"),zoomActivationKeyCode:Y=(ho()?"Meta":"Control"),snapToGrid:U=!1,snapGrid:J=gs,onlyRenderVisibleElements:K=!1,selectNodesOnDrag:Q=!0,nodesDraggable:q,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=ms,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,defaultViewport:ae=ys,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=ls,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:pe="#b1b1b7",zoomOnScroll:fe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=wo.Free,zoomOnDoubleClick:be=!0,panOnDrag:ve=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ce,onPaneMouseLeave:Ee,onPaneScroll:ke,onPaneContextMenu:Se,children:Ie,onEdgeContextMenu:_e,onEdgeDoubleClick:Ae,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Oe,onEdgeUpdate:Te,onEdgeUpdateStart:Me,onEdgeUpdateEnd:Pe,onReconnect:De,onReconnectStart:Be,onReconnectEnd:je,reconnectRadius:Fe=10,edgeUpdaterRadius:Le=10,onNodesChange:Ve,onEdgesChange:ze,noDragClassName:Ge="nodrag",noWheelClassName:He="nowheel",noPanClassName:We="nopan",fitView:Xe=!1,fitViewOptions:Ze,connectOnClick:$e=!0,attributionPosition:Ye,proOptions:Ue,defaultEdgeOptions:Je,elevateNodesOnSelect:Ke=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:qe=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:rt,onError:ot,style:it,id:at,nodeDragThreshold:st,...lt},ct)=>{const ut=at||"1";return e.createElement("div",{...lt,style:{...it,...bs},ref:ct,className:V(["react-flow",i]),"data-testid":"rf__wrapper",id:at},e.createElement(ps,null,e.createElement(ss,{onInit:u,onMove:d,onMoveStart:p,onMoveEnd:f,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:x,onNodeContextMenu:C,onNodeDoubleClick:E,nodeTypes:a,edgeTypes:s,connectionLineType:j,connectionLineStyle:F,connectionLineComponent:L,connectionLineContainerStyle:z,selectionKeyCode:H,selectionOnDrag:W,selectionMode:X,deleteKeyCode:G,multiSelectionKeyCode:$,panActivationKeyCode:Z,zoomActivationKeyCode:Y,onlyRenderVisibleElements:K,selectNodesOnDrag:Q,defaultViewport:ae,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:fe,zoomOnPinch:he,zoomOnDoubleClick:be,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:ve,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ce,onPaneMouseLeave:Ee,onPaneScroll:ke,onPaneContextMenu:Se,onSelectionContextMenu:M,onSelectionStart:P,onSelectionEnd:D,onEdgeContextMenu:_e,onEdgeDoubleClick:Ae,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Oe,onReconnect:De??Te,onReconnectStart:Be??Me,onReconnectEnd:je??Pe,reconnectRadius:Fe??Le,defaultMarkerColor:pe,noDragClassName:Ge,noWheelClassName:He,noPanClassName:We,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:qe,nodeOrigin:ne,nodeExtent:de}),e.createElement(Si,{nodes:t,edges:n,defaultNodes:r,defaultEdges:o,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,nodesDraggable:q,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,elevateNodesOnSelect:Ke,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:Ve,onEdgesChange:ze,snapToGrid:U,snapGrid:J,connectionMode:B,translateExtent:ce,connectOnClick:$e,defaultEdgeOptions:Je,fitView:Xe,fitViewOptions:Ze,onNodesDelete:_,onEdgesDelete:A,onNodeDragStart:k,onNodeDrag:S,onNodeDragStop:I,onSelectionDrag:O,onSelectionDragStart:R,onSelectionDragStop:T,noPanClassName:We,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:ot,connectionRadius:nt,isValidConnection:rt,nodeDragThreshold:st}),e.createElement(xi,{onSelectionChange:N}),Ie,e.createElement($r,{proOptions:Ue,position:Ye}),e.createElement(Ti,{rfId:ut,disableKeyboardA11y:qe})))}));vs.displayName="ReactFlow";const ws=e=>e.getNodes();const xs=e=>e.edges;const Cs=({id:t,x:n,y:r,width:o,height:i,style:a,color:s,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:p,onClick:f,selected:h})=>{const{background:m,backgroundColor:g}=a||{},y=s||m||g;return e.createElement("rect",{className:V(["react-flow__minimap-node",{selected:h},u]),x:n,y:r,rx:d,ry:d,width:o,height:i,fill:y,stroke:l,strokeWidth:c,shapeRendering:p,onClick:f?e=>f(e,t):void 0})};Cs.displayName="MiniMapNode";var Es=e.memo(Cs);const ks=e=>e.nodeOrigin,Ss=e=>e.getNodes().filter((e=>!e.hidden&&e.width&&e.height)),Is=e=>e instanceof Function?e:()=>e;var _s=e.memo((function({nodeStrokeColor:t="transparent",nodeColor:n="#e2e2e2",nodeClassName:r="",nodeBorderRadius:o=5,nodeStrokeWidth:i=2,nodeComponent:a=Es,onClick:s}){const l=Hr(Ss,Z),c=Hr(ks),u=Is(n),d=Is(t),p=Is(r),f="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return e.createElement(e.Fragment,null,l.map((t=>{const{x:n,y:r}=Xo(t,c).positionAbsolute;return e.createElement(a,{key:t.id,x:n,y:r,width:t.width,height:t.height,style:t.style,selected:t.selected,className:p(t),color:u(t),borderRadius:o,strokeColor:d(t),strokeWidth:i,shapeRendering:f,onClick:s,id:t.id})})))}));const As=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?(r=Zo(t,e.nodeOrigin),o=n,ro(to(no(r),no(o)))):n,rfId:e.rfId};var r,o};function Ns({style:t,className:n,nodeStrokeColor:r="transparent",nodeColor:o="#e2e2e2",nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:s=2,nodeComponent:l,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:u="none",maskStrokeWidth:d=1,position:p="bottom-right",onClick:f,onNodeClick:h,pannable:m=!1,zoomable:g=!1,ariaLabel:y="React Flow mini map",inversePan:b=!1,zoomStep:v=10,offsetScale:w=5}){const x=Wr(),C=e.useRef(null),{boundingRect:E,viewBB:k,rfId:S}=Hr(As,Z),I=t?.width??200,_=t?.height??150,A=E.width/I,N=E.height/_,R=Math.max(A,N),O=R*I,T=R*_,M=w*R,P=E.x-(O-E.width)/2-M,D=E.y-(T-E.height)/2-M,B=O+2*M,j=T+2*M,F=`react-flow__minimap-desc-${S}`,L=e.useRef(0);L.current=R,e.useEffect((()=>{if(C.current){const e=ut(C.current),t=e=>{const{transform:t,d3Selection:n,d3Zoom:r}=x.getState();if("wheel"!==e.sourceEvent.type||!n||!r)return;const o=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*v,i=t[2]*Math.pow(2,o);r.scaleTo(n,i)},n=e=>{const{transform:t,d3Selection:n,d3Zoom:r,translateExtent:o,width:i,height:a}=x.getState();if("mousemove"!==e.sourceEvent.type||!n||!r)return;const s=L.current*Math.max(1,t[2])*(b?-1:1),l={x:t[0]-e.sourceEvent.movementX*s,y:t[1]-e.sourceEvent.movementY*s},c=[[0,0],[i,a]],u=wr.translate(l.x,l.y).scale(t[2]),d=r.constrain()(u,c,o);r.transform(n,d)},r=Nr().on("zoom",m?n:null).on("zoom.wheel",g?t:null);return e.call(r),()=>{e.on("zoom",null)}}}),[m,g,b,v]);const z=f?e=>{const t=dt(e);f(e,{x:t[0],y:t[1]})}:void 0,G=h?(e,t)=>{const n=x.getState().nodeInternals.get(t);h(e,n)}:void 0;return e.createElement(Zr,{position:p,style:t,className:V(["react-flow__minimap",n]),"data-testid":"rf__minimap"},e.createElement("svg",{width:I,height:_,viewBox:`${P} ${D} ${B} ${j}`,role:"img","aria-labelledby":F,ref:C,onClick:z},y&&e.createElement("title",{id:F},y),e.createElement(_s,{onClick:G,nodeColor:o,nodeStrokeColor:r,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:l}),e.createElement("path",{className:"react-flow__minimap-mask",d:`M${P-M},${D-M}h${B+2*M}v${j+2*M}h${-B-2*M}z\n M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fill:c,fillRule:"evenodd",stroke:u,strokeWidth:d,pointerEvents:"none"})))}Ns.displayName="MiniMap";var Rs,Os=e.memo(Ns);function Ts({color:t,dimensions:n,lineWidth:r}){return e.createElement("path",{stroke:t,strokeWidth:r,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function Ms({color:t,radius:n}){return e.createElement("circle",{cx:n,cy:n,r:n,fill:t})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(Rs||(Rs={}));const Ps={[Rs.Dots]:"#91919a",[Rs.Lines]:"#eee",[Rs.Cross]:"#e2e2e2"},Ds={[Rs.Dots]:1,[Rs.Lines]:1,[Rs.Cross]:6},Bs=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function js({id:t,variant:n=Rs.Dots,gap:r=20,size:o,lineWidth:i=1,offset:a=2,color:s,style:l,className:c}){const u=e.useRef(null),{transform:d,patternId:p}=Hr(Bs,Z),f=s||Ps[n],h=o||Ds[n],m=n===Rs.Dots,g=n===Rs.Cross,y=Array.isArray(r)?r:[r,r],b=[y[0]*d[2]||1,y[1]*d[2]||1],v=h*d[2],w=g?[v,v]:b,x=m?[v/a,v/a]:[w[0]/a,w[1]/a];return e.createElement("svg",{className:V(["react-flow__background",c]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:u,"data-testid":"rf__background"},e.createElement("pattern",{id:p+t,x:d[0]%b[0],y:d[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${x[0]},-${x[1]})`},m?e.createElement(Ms,{color:f,radius:v/a}):e.createElement(Ts,{dimensions:w,color:f,lineWidth:i})),e.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+t})`}))}js.displayName="Background";var Fs=e.memo(js);const Ls=({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r})=>[`${e}:${t}`,`${n}:${r}`].sort().join("--"),Vs=0,zs=10,Gs=20,Hs=30,Ws=zs,Xs=e=>"string"==typeof e?e:e===Vs?"DEBUG":e===zs?"INFO":e===Gs?"WARN":e===Hs?"ERROR":"UNKNOWN";class Zs{constructor(e,t=zs){this.name=e,this.level=(e=>{if("number"==typeof e)return e;const t=e.toLowerCase();if("debug"===t)return Vs;if("info"===t)return zs;if("warn"===t||"warning"===t)return Gs;if("error"===t)return Hs;throw new Error(`Unknown log level: ${e}`)})(t),this._level_name=Xs(t)}set_level(e){this.level=e,this._level_name=Xs(e)}_fomat_message(e,...t){return`[${this.name}] ${this._level_name}: ${e} ${t.map((e=>JSON.stringify(e,function(){const e=[];return function(t,n){if("object"!=typeof n||null===n)return n;for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}}()))).join(" ")}`}debug(e,...t){this.level<=Vs&&console.debug(this._fomat_message(e,...t))}info(e,...t){this.level<=zs&&console.info(this._fomat_message(e,...t))}warn(e,...t){this.level<=Gs&&console.warn(this._fomat_message(e,...t))}error(e,...t){this.level<=Hs&&console.error(this._fomat_message(e,...t))}}const $s=(e,t)=>("<NoValue>"===e.value&&(e.value=void 0),"<NoValue>"===e.fullvalue&&(e.fullvalue=void 0),void 0===e.try_get_full_value&&(e.try_get_full_value=()=>{t&&void 0!==e.node&&void 0!==e.id&&t.worker?.get_io_full_value({nid:e.node,ioid:e.id})}),void 0===e.hidden&&(e.hidden=!1),void 0===e.set_hidden&&(e.set_hidden=n=>{t&&void 0!==e.node&&void 0!==e.id&&t.worker?.update_io_options({nid:e.node,ioid:e.id,options:{hidden:n}})}),e),Ys=(e,t,n)=>{if(((e,t)=>{const n=e.frontend||{};if(n.size||(n.size=[200,100]),!n.pos||2!==n.pos.length||isNaN(n.pos[0])||null===n.pos[0]||isNaN(n.pos[1])||null===n.pos[1])if(t&&t.rf_instance&&null!==t.reactflowRef){const e=t.reactflowRef.getBoundingClientRect(),r=e.left+e.width/2,o=e.top+e.height/2,i=t.rf_instance.screenToFlowPosition({x:r,y:o});n.pos=[i.x-n.size[0]/2,i.y-n.size[1]/2]}else n.pos=[0,0];n.collapsed||(n.collapsed=!1),e.frontend=n})(e,n),void 0===(e=F(e)).id)throw new Error("Node must have an id");for(const t in e.io)e.io[t].node=e.id,$s(e.io[t],n);return{position:{x:e.frontend.pos[0],y:e.frontend.pos[1]},data:{UseNodeStore:t},type:"default",...e}},Us=e=>{const t={...e},n=e=>{const t=o.getState();if(e.from_remote){let n=i.get_node(e.node.id,!1);if(!n)try{n=(e=>N(((t,n)=>F(L(e)))))(e.node),i.nodesstates.set(e.node.id,n)}catch(e){return void s.logger.error(`Failed to create node store ${e}`)}const r=n.getState();s.logger.info("Add node",r.id,r.name);const a=[...t.nodes,Ys(r,n,s)];o.setState({nodes:a});for(const t in e.node.io){const n=e.node.io[t].id;void 0!==n&&s.worker?.get_io_value({nid:e.node.id,ioid:n})}}},r=e=>{switch(e.type){case"add":n(e);break;case"update":(e=>{if(e.node.in_trigger&&(e.node.error=void 0),e.from_remote){const t=i.get_node(e.id,!1);if(!t)return;L(e.node);const n=t.getState(),{new_obj:r,change:o}=T(n,e.node);if(o){if(e.node.io)for(const t in e.node.io){r.io[t].fullvalue=e.node.io[t]?.fullvalue;for(const t in e.node.io){const n=e.node.io[t],o=r.io[t];n.hasOwnProperty("value")&&(void 0===n.value?o.value=null:"<NoValue>"===n.value?o.value=void 0:o.value=n.value)}}Ys(r,t,s),s.logger.debug("update_action",r),t.setState(F(r))}}else s.worker&&s.worker.locally_update_node(e)})(e);break;case"delete":(e=>{s.logger.info("Deleting node",e.id),e.from_remote?o.getState().onNodesChange([{type:"remove",id:e.id}]):s.worker?.remove_node(e.id)})(e);break;case"error":(e=>{s.logger.error("Error",e),r({type:"update",id:e.id,node:{in_trigger:!1,error:e.error},from_remote:!0})})(e);break;case"trigger":(e=>{e.from_remote?r({type:"update",id:e.id,node:{in_trigger:!0,error:void 0},from_remote:!0}):s.worker?.trigger_node(e.id)})(e);break;default:s.logger.error("Unknown node action",e)}},o=(({on_node_change:e,on_edge_change:t,on_connect:n})=>{const r=e||(e=>{}),o=n||(e=>{}),i=N(((e,t)=>({nodes:[],edges:[],onNodesChange:n=>{e({nodes:ia(n,t().nodes)}),r(n)},onEdgesChange:n=>{e({edges:aa(n,t().edges)})},onConnect:e=>{null!=e.source&&null!=e.target&&o(e)}})));return i})({on_node_change:e=>{for(const t of e)switch(t.type){case"position":t.position&&r({type:"update",id:t.id,node:{frontend:{pos:[t.position.x,t.position.y]}},from_remote:!1});break;case"dimensions":t.dimensions&&r({type:"update",id:t.id,node:{frontend:{size:[t.dimensions.width,t.dimensions.height]}},from_remote:!1})}},on_edge_change:e=>{},on_connect:e=>{null!==e.source&&null!==e.target&&null!==e.sourceHandle&&null!==e.targetHandle&&s.worker&&s.worker.add_edge({src_nid:e.source,src_ioid:e.sourceHandle,trg_nid:e.target,trg_ioid:e.targetHandle,replace:!0})}}),i=(({})=>{const e=new Map;return{nodesstates:e,get_node:(t,n=!0)=>{const r=e.get(t);if(!r&&n){const n=e.keys();throw new Error(`Node ${t} not found, available nodes: ${Array.from(n)}`)}return r}}})({}),a={libstate:N(((e,t)=>({lib:{shelves:[]},external_worker:[],set:t=>e((e=>({...e,...t}))),get_lib:()=>t().lib,get_external_worker:()=>t().external_worker})))},s={local_settings:N(((e,t)=>({view_settings:{expand_node_props:!1},update_view_settings:e=>{const t=s.local_settings.getState().view_settings,{new_obj:n,change:r}=T(t,e);r&&s.local_settings.setState((e=>({...e,view_settings:n})))}}))),local_state:N(((e,t)=>({selected_nodes:[],selected_edges:[]}))),options:t,lib:a,workermanager:void 0,workers:N(((e,t)=>({}))),workerstate:N(((e,t)=>({is_open:!1}))),render_options:N(((e,t)=>({}))),progress_state:N(((e,t)=>({message:"please select worker",status:"info",progress:0,blocking:!1}))),update_render_options:e=>{const t=s.render_options.getState(),{new_obj:n,change:r}=T(t,e);r&&s.render_options.setState(n)},worker:void 0,_unsubscribeFromWorker:void 0,set_worker:e=>{e!==s.worker&&(s._unsubscribeFromWorker&&(s._unsubscribeFromWorker(),s._unsubscribeFromWorker=void 0),e&&(s._unsubscribeFromWorker=e.state.subscribe((e=>{s.workerstate.setState(e)})),s.workerstate.setState(e.state.getState())),s.worker=e,e?.set_zustand(s))},nodespace:i,useReactFlowStore:o,on_node_action:r,on_edge_action:e=>{const t=o.getState();switch(e.type){case"add":if(e.from_remote){const n=t.edges,r=Ls(e);if(n.some((e=>e.id===r)))return;const i={id:r,source:e.src_nid,target:e.trg_nid,sourceHandle:e.src_ioid,targetHandle:e.trg_ioid,className:"funcnodes-edge animated"};s.logger.info("Adding edge",i),o.setState({edges:[...n,i]}),s.worker?.get_remote_node_state(e.src_nid),s.worker?.get_remote_node_state(e.trg_nid)}break;case"delete":if(e.from_remote){const n=t.edges,r=Ls(e);s.logger.info("Deleting edge",r);const i=n.filter((e=>e.id!==r));o.setState({edges:i}),s.worker?.get_remote_node_state(e.src_nid),s.worker?.get_remote_node_state(e.trg_nid)}break;default:s.logger.error("Unknown edge action",e)}},reactflowRef:null,clear_all:()=>{s.worker?.disconnect(),s.set_worker(void 0),s.workermanager?.setWorker(void 0),s.lib.libstate.getState().set({lib:{shelves:[]},external_worker:[]}),s.nodespace.nodesstates.clear(),s.useReactFlowStore.setState({nodes:[],edges:[]}),s.auto_progress()},set_progress:e=>{if(""===e.message)return s.auto_progress();const t=s.progress_state.getState(),{new_obj:n,change:r}=T(t,e);r&&s.progress_state.setState(n)},auto_progress:()=>void 0===s.workermanager||s.workermanager.open?void 0===s.worker?s.set_progress({progress:0,message:"please select worker",status:"error",blocking:!1}):s.worker.is_open?void s.set_progress({progress:1,message:"running",status:"info",blocking:!1}):s.set_progress({progress:0,message:"connecting to worker",status:"info",blocking:!0}):s.set_progress({progress:0,message:"connecting to worker manager",status:"error",blocking:!1}),plugins:N(((e,t)=>({}))),add_plugin:(e,t)=>{void 0!==t&&s.plugins.setState((n=>({...n,[e]:t})))},dev_settings:{debug:!0},logger:new Zs("fn",Ws)};return s};function Js(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ks}=Object.prototype,{getPrototypeOf:Qs}=Object,qs=(e=>t=>{const n=Ks.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),el=e=>(e=e.toLowerCase(),t=>qs(t)===e),tl=e=>t=>typeof t===e,{isArray:nl}=Array,rl=tl("undefined");const ol=el("ArrayBuffer");const il=tl("string"),al=tl("function"),sl=tl("number"),ll=e=>null!==e&&"object"==typeof e,cl=e=>{if("object"!==qs(e))return!1;const t=Qs(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ul=el("Date"),dl=el("File"),pl=el("Blob"),fl=el("FileList"),hl=el("URLSearchParams"),[ml,gl,yl,bl]=["ReadableStream","Request","Response","Headers"].map(el);function vl(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),nl(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function wl(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const xl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Cl=e=>!rl(e)&&e!==xl;const El=(kl="undefined"!=typeof Uint8Array&&Qs(Uint8Array),e=>kl&&e instanceof kl);var kl;const Sl=el("HTMLFormElement"),Il=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_l=el("RegExp"),Al=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};vl(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)},Nl="abcdefghijklmnopqrstuvwxyz",Rl="0123456789",Ol={DIGIT:Rl,ALPHA:Nl,ALPHA_DIGIT:Nl+Nl.toUpperCase()+Rl};const Tl=el("AsyncFunction"),Ml=(Pl="function"==typeof setImmediate,Dl=al(xl.postMessage),Pl?setImmediate:Dl?((e,t)=>(xl.addEventListener("message",(({source:n,data:r})=>{n===xl&&r===e&&t.length&&t.shift()()}),!1),n=>{t.push(n),xl.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var Pl,Dl;const Bl="undefined"!=typeof queueMicrotask?queueMicrotask.bind(xl):"undefined"!=typeof process&&process.nextTick||Ml;var jl={isArray:nl,isArrayBuffer:ol,isBuffer:function(e){return null!==e&&!rl(e)&&null!==e.constructor&&!rl(e.constructor)&&al(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||al(e.append)&&("formdata"===(t=qs(e))||"object"===t&&al(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ol(e.buffer),t},isString:il,isNumber:sl,isBoolean:e=>!0===e||!1===e,isObject:ll,isPlainObject:cl,isReadableStream:ml,isRequest:gl,isResponse:yl,isHeaders:bl,isUndefined:rl,isDate:ul,isFile:dl,isBlob:pl,isRegExp:_l,isFunction:al,isStream:e=>ll(e)&&al(e.pipe),isURLSearchParams:hl,isTypedArray:El,isFileList:fl,forEach:vl,merge:function e(){const{caseless:t}=Cl(this)&&this||{},n={},r=(r,o)=>{const i=t&&wl(n,o)||o;cl(n[i])&&cl(r)?n[i]=e(n[i],r):cl(r)?n[i]=e({},r):nl(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&vl(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(vl(t,((t,r)=>{n&&al(t)?e[r]=Js(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Qs(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:qs,kindOfTest:el,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(nl(e))return e;let t=e.length;if(!sl(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Sl,hasOwnProperty:Il,hasOwnProp:Il,reduceDescriptors:Al,freezeMethods:e=>{Al(e,((t,n)=>{if(al(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];al(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return nl(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:wl,global:xl,isContextDefined:Cl,ALPHABET:Ol,generateString:(e=16,t=Ol.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&al(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ll(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=nl(e)?[]:{};return vl(e,((e,t)=>{const i=n(e,r+1);!rl(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Tl,isThenable:e=>e&&(ll(e)||al(e))&&al(e.then)&&al(e.catch),setImmediate:Ml,asap:Bl};function Fl(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}jl.inherits(Fl,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:jl.toJSONObject(this.config),code:this.code,status:this.status}}});const Ll=Fl.prototype,Vl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Vl[e]={value:e}})),Object.defineProperties(Fl,Vl),Object.defineProperty(Ll,"isAxiosError",{value:!0}),Fl.from=(e,t,n,r,o,i)=>{const a=Object.create(Ll);return jl.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Fl.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function zl(e){return jl.isPlainObject(e)||jl.isArray(e)}function Gl(e){return jl.endsWith(e,"[]")?e.slice(0,-2):e}function Hl(e,t,n){return e?e.concat(t).map((function(e,t){return e=Gl(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Wl=jl.toFlatObject(jl,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Xl(e,t,n){if(!jl.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=jl.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!jl.isUndefined(t[e])}))).metaTokens,o=n.visitor||c,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&jl.isSpecCompliantForm(t);if(!jl.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(jl.isDate(e))return e.toISOString();if(!s&&jl.isBlob(e))throw new Fl("Blob is not supported. Use a Buffer instead.");return jl.isArrayBuffer(e)||jl.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(jl.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(jl.isArray(e)&&function(e){return jl.isArray(e)&&!e.some(zl)}(e)||(jl.isFileList(e)||jl.endsWith(n,"[]"))&&(s=jl.toArray(e)))return n=Gl(n),s.forEach((function(e,r){!jl.isUndefined(e)&&null!==e&&t.append(!0===a?Hl([n],r,i):null===a?n:n+"[]",l(e))})),!1;return!!zl(e)||(t.append(Hl(o,n,i),l(e)),!1)}const u=[],d=Object.assign(Wl,{defaultVisitor:c,convertValue:l,isVisitable:zl});if(!jl.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!jl.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),jl.forEach(n,(function(n,i){!0===(!(jl.isUndefined(n)||null===n)&&o.call(t,n,jl.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])})),u.pop()}}(e),t}function Zl(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function $l(e,t){this._pairs=[],e&&Xl(e,this,t)}const Yl=$l.prototype;function Ul(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Jl(e,t,n){if(!t)return e;const r=n&&n.encode||Ul;jl.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):jl.isURLSearchParams(t)?t.toString():new $l(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Yl.append=function(e,t){this._pairs.push([e,t])},Yl.toString=function(e){const t=e?function(t){return e.call(this,t,Zl)}:Zl;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class Kl{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){jl.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var Ql={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ql={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:$l,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ec="undefined"!=typeof window&&"undefined"!=typeof document,tc="object"==typeof navigator&&navigator||void 0,nc=ec&&(!tc||["ReactNative","NativeScript","NS"].indexOf(tc.product)<0),rc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,oc=ec&&window.location.href||"http://localhost";var ic={...Object.freeze({__proto__:null,hasBrowserEnv:ec,hasStandardBrowserEnv:nc,hasStandardBrowserWebWorkerEnv:rc,navigator:tc,origin:oc}),...ql};function ac(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&jl.isArray(r)?r.length:i,s)return jl.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&jl.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&jl.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a}if(jl.isFormData(e)&&jl.isFunction(e.entries)){const n={};return jl.forEachEntry(e,((e,r)=>{t(function(e){return jl.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const sc={transitional:Ql,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=jl.isObject(e);o&&jl.isHTMLForm(e)&&(e=new FormData(e));if(jl.isFormData(e))return r?JSON.stringify(ac(e)):e;if(jl.isArrayBuffer(e)||jl.isBuffer(e)||jl.isStream(e)||jl.isFile(e)||jl.isBlob(e)||jl.isReadableStream(e))return e;if(jl.isArrayBufferView(e))return e.buffer;if(jl.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Xl(e,new ic.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ic.isNode&&jl.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=jl.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Xl(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(jl.isString(e))try{return(t||JSON.parse)(e),jl.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||sc.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(jl.isResponse(e)||jl.isReadableStream(e))return e;if(e&&jl.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Fl.from(e,Fl.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ic.classes.FormData,Blob:ic.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};jl.forEach(["delete","get","head","post","put","patch"],(e=>{sc.headers[e]={}}));const lc=jl.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const cc=Symbol("internals");function uc(e){return e&&String(e).trim().toLowerCase()}function dc(e){return!1===e||null==e?e:jl.isArray(e)?e.map(dc):String(e)}function pc(e,t,n,r,o){return jl.isFunction(r)?r.call(this,t,n):(o&&(t=n),jl.isString(t)?jl.isString(r)?-1!==t.indexOf(r):jl.isRegExp(r)?r.test(t):void 0:void 0)}let fc=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=uc(t);if(!o)throw new Error("header name must be a non-empty string");const i=jl.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=dc(e))}const i=(e,t)=>jl.forEach(e,((e,n)=>o(e,n,t)));if(jl.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(jl.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&lc[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(jl.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=uc(e)){const n=jl.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(jl.isFunction(t))return t.call(this,e,n);if(jl.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=uc(e)){const n=jl.findKey(this,e);return!(!n||void 0===this[n]||t&&!pc(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=uc(e)){const o=jl.findKey(n,e);!o||t&&!pc(0,n[o],o,t)||(delete n[o],r=!0)}}return jl.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!pc(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return jl.forEach(this,((r,o)=>{const i=jl.findKey(n,o);if(i)return t[i]=dc(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();a!==o&&delete t[o],t[a]=dc(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return jl.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&jl.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[cc]=this[cc]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=uc(e);t[r]||(!function(e,t){const n=jl.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return jl.isArray(e)?e.forEach(r):r(e),this}};function hc(e,t){const n=this||sc,r=t||n,o=fc.from(r.headers);let i=r.data;return jl.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function mc(e){return!(!e||!e.__CANCEL__)}function gc(e,t,n){Fl.call(this,null==e?"canceled":e,Fl.ERR_CANCELED,t,n),this.name="CanceledError"}function yc(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Fl("Request failed with status code "+n.status,[Fl.ERR_BAD_REQUEST,Fl.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}fc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),jl.reduceDescriptors(fc.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),jl.freezeMethods(fc),jl.inherits(gc,Fl,{__CANCEL__:!0});const bc=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];o||(o=l),n[i]=s,r[i]=l;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),l-o<t)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout((()=>{r=null,a(n)}),i-s)))},()=>n&&a(n)]}((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,l=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&i<=a?(a-i)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},vc=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},wc=e=>(...t)=>jl.asap((()=>e(...t)));var xc=ic.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ic.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ic.origin),ic.navigator&&/(msie|trident)/i.test(ic.navigator.userAgent)):()=>!0,Cc=ic.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];jl.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),jl.isString(r)&&a.push("path="+r),jl.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ec(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const kc=e=>e instanceof fc?{...e}:e;function Sc(e,t){t=t||{};const n={};function r(e,t,n,r){return jl.isPlainObject(e)&&jl.isPlainObject(t)?jl.merge.call({caseless:r},e,t):jl.isPlainObject(t)?jl.merge({},t):jl.isArray(t)?t.slice():t}function o(e,t,n,o){return jl.isUndefined(t)?jl.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!jl.isUndefined(t))return r(void 0,t)}function a(e,t){return jl.isUndefined(t)?jl.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(kc(e),kc(t),0,!0)};return jl.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=l[r]||o,a=i(e[r],t[r],r);jl.isUndefined(a)&&i!==s||(n[r]=a)})),n}var Ic=e=>{const t=Sc({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:l}=t;if(t.headers=s=fc.from(s),t.url=Jl(Ec(t.baseURL,t.url),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),jl.isFormData(r))if(ic.hasStandardBrowserEnv||ic.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(ic.hasStandardBrowserEnv&&(o&&jl.isFunction(o)&&(o=o(t)),o||!1!==o&&xc(t.url))){const e=i&&a&&Cc.read(a);e&&s.set(i,e)}return t};var _c="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Ic(e);let o=r.data;const i=fc.from(r.headers).normalize();let a,s,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=r;function h(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=fc.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());yc((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Fl("Request aborted",Fl.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Fl("Network Error",Fl.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Ql;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Fl(t,o.clarifyTimeoutError?Fl.ETIMEDOUT:Fl.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&jl.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),jl.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),f&&([l,u]=bc(f,!0),m.addEventListener("progress",l)),p&&m.upload&&([s,c]=bc(p),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new gc(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===ic.protocols.indexOf(y)?n(new Fl("Unsupported protocol "+y+":",Fl.ERR_BAD_REQUEST,e)):m.send(o||null)}))};const Ac=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Fl?t:new gc(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new Fl(`timeout ${t} of ms exceeded`,Fl.ETIMEDOUT))}),t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:s}=r;return s.unsubscribe=()=>jl.asap(a),s}},Nc=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Rc=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Oc=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Rc(e))yield*Nc(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},Tc="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Mc=Tc&&"function"==typeof ReadableStream,Pc=Tc&&("function"==typeof TextEncoder?(Dc=new TextEncoder,e=>Dc.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Dc;const Bc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},jc=Mc&&Bc((()=>{let e=!1;const t=new Request(ic.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Fc=Mc&&Bc((()=>jl.isReadableStream(new Response("").body))),Lc={stream:Fc&&(e=>e.body)};var Vc;Tc&&(Vc=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Lc[e]&&(Lc[e]=jl.isFunction(Vc[e])?t=>t[e]():(t,n)=>{throw new Fl(`Response type '${e}' is not supported`,Fl.ERR_NOT_SUPPORT,n)})})));const zc=async(e,t)=>{const n=jl.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(jl.isBlob(e))return e.size;if(jl.isSpecCompliantForm(e)){const t=new Request(ic.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return jl.isArrayBufferView(e)||jl.isArrayBuffer(e)?e.byteLength:(jl.isURLSearchParams(e)&&(e+=""),jl.isString(e)?(await Pc(e)).byteLength:void 0)})(t):n};var Gc=Tc&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=Ic(e);c=c?(c+"").toLowerCase():"text";let f,h=Ac([o,i&&i.toAbortSignal()],a);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(l&&jc&&"get"!==n&&"head"!==n&&0!==(g=await zc(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(jl.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=vc(g,bc(wc(l)));r=Oc(n.body,65536,e,t)}}jl.isString(d)||(d=d?"include":"omit");const o="credentials"in Request.prototype;f=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?d:void 0});let i=await fetch(f);const a=Fc&&("stream"===c||"response"===c);if(Fc&&(s||a&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=jl.toFiniteNumber(i.headers.get("content-length")),[n,r]=s&&vc(t,bc(wc(s),!0))||[];i=new Response(Oc(i.body,65536,n,(()=>{r&&r(),m&&m()})),e)}c=c||"text";let y=await Lc[jl.findKey(Lc,c)||"text"](i,e);return!a&&m&&m(),await new Promise(((t,n)=>{yc(t,n,{data:y,headers:fc.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Fl("Network Error",Fl.ERR_NETWORK,e,f),{cause:t.cause||t});throw Fl.from(t,t&&t.code,e,f)}});const Hc={http:null,xhr:_c,fetch:Gc};jl.forEach(Hc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Wc=e=>`- ${e}`,Xc=e=>jl.isFunction(e)||null===e||!1===e;var Zc=e=>{e=jl.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){let t;if(n=e[i],r=n,!Xc(n)&&(r=Hc[(t=String(n)).toLowerCase()],void 0===r))throw new Fl(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+i]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Fl("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Wc).join("\n"):" "+Wc(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function $c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gc(null,e)}function Yc(e){$c(e),e.headers=fc.from(e.headers),e.data=hc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Zc(e.adapter||sc.adapter)(e).then((function(t){return $c(e),t.data=hc.call(e,e.transformResponse,t),t.headers=fc.from(t.headers),t}),(function(t){return mc(t)||($c(e),t&&t.response&&(t.response.data=hc.call(e,e.transformResponse,t.response),t.response.headers=fc.from(t.response.headers))),Promise.reject(t)}))}const Uc="1.7.9",Jc={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Jc[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Kc={};Jc.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.9] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Fl(r(o," has been removed"+(t?" in "+t:"")),Fl.ERR_DEPRECATED);return t&&!Kc[o]&&(Kc[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Jc.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Qc={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Fl("options must be an object",Fl.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new Fl("option "+i+" must be "+n,Fl.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Fl("Unknown option "+i,Fl.ERR_BAD_OPTION)}},validators:Jc};const qc=Qc.validators;let eu=class{constructor(e){this.defaults=e,this.interceptors={request:new Kl,response:new Kl}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Sc(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Qc.assertOptions(n,{silentJSONParsing:qc.transitional(qc.boolean),forcedJSONParsing:qc.transitional(qc.boolean),clarifyTimeoutError:qc.transitional(qc.boolean)},!1),null!=r&&(jl.isFunction(r)?t.paramsSerializer={serialize:r}:Qc.assertOptions(r,{encode:qc.function,serialize:qc.function},!0)),Qc.assertOptions(t,{baseUrl:qc.spelling("baseURL"),withXsrfToken:qc.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&jl.merge(o.common,o[t.method]);o&&jl.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=fc.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,d=0;if(!s){const e=[Yc.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=a.length;let p=t;for(d=0;d<u;){const e=a[d++],t=a[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{c=Yc.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return Jl(Ec((e=Sc(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};jl.forEach(["delete","get","head","options"],(function(e){eu.prototype[e]=function(t,n){return this.request(Sc(n||{},{method:e,url:t,data:(n||{}).data}))}})),jl.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Sc(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}eu.prototype[e]=t(),eu.prototype[e+"Form"]=t(!0)}));const tu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(tu).forEach((([e,t])=>{tu[t]=e}));const nu=function e(t){const n=new eu(t),r=Js(eu.prototype.request,n);return jl.extend(r,eu.prototype,n,{allOwnKeys:!0}),jl.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Sc(t,n))},r}(sc);nu.Axios=eu,nu.CanceledError=gc,nu.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new gc(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}},nu.isCancel=mc,nu.VERSION=Uc,nu.toFormData=Xl,nu.AxiosError=Fl,nu.Cancel=nu.CanceledError,nu.all=function(e){return Promise.all(e)},nu.spread=function(e){return function(t){return e.apply(null,t)}},nu.isAxiosError=function(e){return jl.isObject(e)&&!0===e.isAxiosError},nu.mergeConfig=Sc,nu.AxiosHeaders=fc,nu.formToJSON=e=>ac(jl.isHTMLForm(e)?new FormData(e):e),nu.getAdapter=Zc,nu.HttpStatusCode=tu,nu.default=nu;const{Axios:ru,AxiosError:ou,CanceledError:iu,isCancel:au,CancelToken:su,VERSION:lu,all:cu,Cancel:uu,isAxiosError:du,spread:pu,toFormData:fu,AxiosHeaders:hu,HttpStatusCode:mu,formToJSON:gu,getAdapter:yu,mergeConfig:bu}=nu;let vu;const wu=new Uint8Array(16);function xu(){if(!vu&&(vu="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vu(wu)}const Cu=[];for(let e=0;e<256;++e)Cu.push((e+256).toString(16).slice(1));var Eu={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ku(e,t,n){if(Eu.randomUUID&&!e)return Eu.randomUUID();const r=(e=e||{}).random||(e.rng||xu)();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return Cu[e[t+0]]+Cu[e[t+1]]+Cu[e[t+2]]+Cu[e[t+3]]+"-"+Cu[e[t+4]]+Cu[e[t+5]]+"-"+Cu[e[t+6]]+Cu[e[t+7]]+"-"+Cu[e[t+8]]+Cu[e[t+9]]+"-"+Cu[e[t+10]]+Cu[e[t+11]]+Cu[e[t+12]]+Cu[e[t+13]]+Cu[e[t+14]]+Cu[e[t+15]]}(r)}class Su{constructor(e){this.uuid=e.uuid,this.on_error=e.on_error||(e=>{this._zustand?.logger.error(e)}),this.messagePromises=new Map,this._local_nodeupdates=new Map,this._nodeupdatetimer=setTimeout((()=>{this.sync_local_node_updates()}),5e3),this.state=N(((e,t)=>({is_open:!1}))),e.zustand&&this.set_zustand(e.zustand),e.on_sync_complete?this.on_sync_complete=e.on_sync_complete:this.on_sync_complete=async()=>{}}set_zustand(e){e!==this._zustand&&(this._zustand=e,e.set_worker(this),this._zustand.auto_progress(),this.stepwise_fullsync())}get is_open(){return this.state.getState().is_open}set is_open(e){this.state.setState({is_open:e})}async stepwise_fullsync(){this._zustand&&this.is_open&&(await this.sync_lib(),await this.sync_external_worker(),await this.sync_funcnodes_plugins(),await this.sync_nodespace(),await this.sync_view_state(),await this.on_sync_complete(this))}async sync_lib(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_library",wait_for_response:!0,retries:2});this._zustand.lib.libstate.getState().set({lib:e})}async sync_external_worker(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_worker_dependencies",wait_for_response:!0});this._zustand.lib.libstate.getState().set({external_worker:e})}async sync_funcnodes_plugins(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_plugin_keys",wait_for_response:!0,kwargs:{type:"react"}});for(const t of e){const e=await this._send_cmd({cmd:"get_plugin",wait_for_response:!0,kwargs:{key:t,type:"react"}});if(e.js)for(const t of e.js){const e=document.createElement("script");e.text=atob(t),document.body.appendChild(e)}if(e.css)for(const t of e.css){const e=document.createElement("style");e.innerHTML=atob(t),document.head.appendChild(e)}if(void 0!==e.module){const n=atob(e.module),r=n.length,o=new Uint8Array(r);for(let e=0;e<r;e++)o[e]=n.charCodeAt(e);const i=new Blob([o],{type:"application/javascript"}),a=URL.createObjectURL(i),s=await import(a);URL.revokeObjectURL(a),this._zustand.add_plugin(t,s.default)}}}async sync_view_state(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"view_state",wait_for_response:!0});e.renderoptions&&this._zustand.update_render_options(e.renderoptions);const t=e.nodes;if(t)for(const e in t){const n=t[e];this._zustand.on_node_action({type:"update",node:{frontend:n},id:e,from_remote:!0})}}async sync_nodespace(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_nodes",kwargs:{with_frontend:!0},wait_for_response:!0});for(const t of e)this._receive_node_added(t);const t=await this._send_cmd({cmd:"get_edges",wait_for_response:!0});for(const e of t)this._receive_edge_added(...e)}async fullsync(){if(!this._zustand)return;if(!this.is_open)return;let e;for(;;)try{e=await this._send_cmd({cmd:"full_state"});break}catch(e){this._zustand.logger.error("Error in fullsync",e)}this._zustand.logger.debug("Full state",e),this._zustand.lib.libstate.getState().set({lib:e.backend.lib,external_worker:e.worker_dependencies}),e.view.renderoptions&&this._zustand.update_render_options(e.view.renderoptions);const t=e.view.nodes;for(const n of e.backend.nodes)void 0!==t[n.id]&&(n.frontend=t[n.id]),this._receive_node_added(n);for(const t of e.backend.edges)this._receive_edge_added(...t)}async _receive_edge_added(e,t,n,r){this._zustand&&this._zustand.on_edge_action({type:"add",from_remote:!0,src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r})}async trigger_node(e){await this._send_cmd({cmd:"trigger_node",kwargs:{nid:e},wait_for_response:!1})}async add_node(e){const t=await this._send_cmd({cmd:"add_node",kwargs:{id:e}});this._receive_node_added(t)}async remove_node(e){await this._send_cmd({cmd:"remove_node",kwargs:{id:e}})}async _receive_node_added(e){this._zustand&&this._zustand.on_node_action({type:"add",node:e,id:e.id,from_remote:!0})}add_edge({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r,replace:o=!1}){return this._send_cmd({cmd:"add_edge",kwargs:{src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r,replace:o}})}remove_edge({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r}){return this._send_cmd({cmd:"remove_edge",kwargs:{src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r}})}async add_external_worker({module:e,cls_module:t,cls_name:n}){return await this._send_cmd({cmd:"add_external_worker",kwargs:{module:e,cls_module:t,cls_name:n}})}sync_local_node_updates(){clearTimeout(this._nodeupdatetimer),this._local_nodeupdates.forEach((async(e,t)=>{const n=await this._send_cmd({cmd:"update_node",kwargs:{nid:t,data:e},wait_for_response:!0});this._zustand&&this._zustand.on_node_action({type:"update",node:n,id:t,from_remote:!0})})),this._local_nodeupdates.clear(),this._nodeupdatetimer=setTimeout((()=>{this.sync_local_node_updates()}),200)}locally_update_node(e){const t=this._local_nodeupdates.get(e.id);if(t){const{new_obj:n,change:r}=T(t,e.node);r&&this._local_nodeupdates.set(e.id,n)}else this._local_nodeupdates.set(e.id,e.node);e.immediate&&this.sync_local_node_updates()}async get_remote_node_state(e){const t=await this._send_cmd({cmd:"get_node_state",kwargs:{nid:e},wait_for_response:!0});this._zustand&&this._zustand.on_node_action({type:"update",node:t,id:t.id,from_remote:!0})}set_io_value({nid:e,ioid:t,value:n,set_default:r=!1}){return this._send_cmd({cmd:"set_io_value",kwargs:{nid:e,ioid:t,value:n,set_default:r},wait_for_response:!0})}clear(){return this._send_cmd({cmd:"clear"})}save(){return this._send_cmd({cmd:"save",wait_for_response:!0})}load(e){return this._send_cmd({cmd:"load_data",kwargs:{data:e},wait_for_response:!0}).then((()=>{this.stepwise_fullsync()}))}async get_io_value({nid:e,ioid:t}){const n=await this._send_cmd({cmd:"get_io_value",kwargs:{nid:e,ioid:t},wait_for_response:!0});return this._zustand?(this._zustand.on_node_action({type:"update",node:{io:{[t]:{value:n}}},id:e,from_remote:!0}),n):n}async get_ios_values({nid:e}){const t=await this._send_cmd({cmd:"get_ios_values",kwargs:{nid:e},wait_for_response:!0});if(!this._zustand)return t;const n={};for(const e in t)n[e]={value:t[e]};return this._zustand.on_node_action({type:"update",node:{io:n},id:e,from_remote:!0}),t}async _send_cmd({cmd:e,kwargs:t,wait_for_response:n=!0,response_timeout:r=5e3,retries:o=2}){const i={type:"cmd",cmd:e,kwargs:t||{}};if(n){o<0&&(o=0);const t=async()=>{let t;for(;o>=0;){const n=i.id||ku();i.id=n;const a=new Promise(((t,o)=>{const i=setTimeout((()=>{o("Timeout@wait_for_response for "+e)}),r);this.messagePromises.set(n,{resolve:e=>{clearTimeout(i),t(e),this.messagePromises.delete(n)},reject:e=>{clearTimeout(i),o(e),this.messagePromises.delete(n)}})}));await this.send(i);try{t=await a;break}catch(e){if(0===o)throw e;o-=1;continue}}return t};return t()}return this.send(i)}async send(e){throw new Error("async send(data: any) not implemented")}async upload_file({files:e,onProgressCallback:t,root:n}){throw new Error("upload_file not implemented ")}async handle_large_message_hint({}){throw new Error("async handle_large_message_hint({}: LargeMessageHint) not implemented ")}async receive_workerevent({event:e,data:t}){switch(e){case"worker_error":if(!this._zustand)return;return this._zustand.logger.error(t.error);case"update_worker_dependencies":if(!this._zustand)return;return this._zustand.lib.libstate.getState().set({external_worker:t.worker_dependencies});case"lib_update":return void await this.sync_lib();case"fullsync":return void await this.stepwise_fullsync();case"external_worker_update":return await this.sync_lib(),void await this.sync_external_worker();default:console.warn("Unhandled worker event",e,t)}}async receive_nodespace_event({event:e,data:t}){switch(e){case"after_set_value":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,io:{[t.io]:{value:t.result}}},id:t.node,from_remote:!0});case"after_update_value_options":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,io:{[t.io]:{value_options:t.result}}},id:t.node,from_remote:!0});case"triggerstart":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,in_trigger:!0},id:t.node,from_remote:!0});case"triggerdone":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:t.node,in_trigger:!1},id:t.node,from_remote:!0});case"node_trigger_error":if(!this._zustand)return;return this._zustand.on_node_action({type:"error",errortype:"trigger",error:t.error,id:t.node,tb:t.tb,from_remote:!0});case"node_removed":if(!this._zustand)return;return this._zustand.on_node_action({type:"delete",id:t.node,from_remote:!0});case"node_added":return this._receive_node_added(t.node);case"after_disconnect":case"after_unforward":if(!t.result)return;if(!Array.isArray(t.result))return;if(4!==t.result.length)return;if(!this._zustand)return;return this._zustand.on_edge_action({type:"delete",from_remote:!0,src_nid:t.result[0],src_ioid:t.result[1],trg_nid:t.result[2],trg_ioid:t.result[3]});case"after_connect":case"after_forward":if(!t.result)return;if(!Array.isArray(t.result))return;if(4!==t.result.length)return;return this._receive_edge_added(...t.result);case"after_add_shelf":case"after_remove_shelf":if(!t.result)return;if(!this._zustand)return;return this._zustand.lib.libstate.getState().set({lib:t.result});case"progress":if(!this._zustand)return;if(t.node)return this._zustand.on_node_action({type:"update",node:{id:t.node,progress:t.info},id:t.node,from_remote:!0});console.warn("Unhandled nodepsace event",e,t);break;default:console.warn("Unhandled nodepsace event",e,t)}}async add_lib(e,t){return await this._send_cmd({cmd:"add_package_dependency",kwargs:{name:e,version:t},wait_for_response:!1})}async remove_lib(e){return await this._send_cmd({cmd:"remove_package_dependency",kwargs:{name:e},wait_for_response:!1})}async receive(e){let t;switch(e.type){case"nsevent":return await this.receive_nodespace_event(e);case"result":if(t=e.id&&this.messagePromises.get(e.id),t)return t.resolve(e.result);break;case"error":if(this.on_error(e.tb+"\n"+e.error),t=e.id&&this.messagePromises.get(e.id),t)return t.reject(e.error);break;case"progress":if(!this._zustand)return;this._zustand.set_progress(e);break;case"workerevent":return await this.receive_workerevent(e);case"large_message":return await this.handle_large_message_hint(e);default:console.warn("Unhandled message",e)}}disconnect(){}onclose(){this.is_open=!1,this._zustand&&this._zustand.auto_progress()}async reconnect(){}async stop(){await this._send_cmd({cmd:"stop_worker",wait_for_response:!1});const e=this.onclose.bind(this);this.onclose=()=>{e(),this._zustand&&(this._zustand.worker===this&&this._zustand.clear_all(),this.onclose=e)}}async get_io_full_value({nid:e,ioid:t}){const n=await this._send_cmd({cmd:"get_io_full_value",kwargs:{nid:e,ioid:t},wait_for_response:!0});return this._zustand?(this._zustand.on_node_action({type:"update",node:{io:{[t]:{fullvalue:n}}},id:e,from_remote:!0}),n):n}async update_io_options({nid:e,ioid:t,options:n}){const r=await this._send_cmd({cmd:"update_io_options",kwargs:{nid:e,ioid:t,...n},wait_for_response:!0});if(!this._zustand)return r;this._zustand.on_node_action({type:"update",node:{io:{[t]:{...n}}},id:e,from_remote:!0})}async get_node_status(e){return await this._send_cmd({cmd:"get_node_state",kwargs:{nid:e},wait_for_response:!0})}async get_available_modules(){return await this._send_cmd({cmd:"get_available_modules",wait_for_response:!0})}async update_external_worker(e,t,n){return await this._send_cmd({cmd:"update_external_worker",kwargs:{worker_id:e,class_id:t,...n},wait_for_response:!0})}async remove_external_worker(e,t){return await this._send_cmd({cmd:"remove_external_worker",kwargs:{worker_id:e,class_id:t},wait_for_response:!0})}async export({withFiles:e=!1}){return await this._send_cmd({cmd:"export_worker",wait_for_response:!0,kwargs:{with_files:e}})}async update_from_export(e){const t=await this._send_cmd({cmd:"update_from_export",kwargs:{data:e},wait_for_response:!0});return this.stepwise_fullsync(),t}}class Iu extends Su{constructor(e){super(e),this._websocket=null,this.reconnectAttempts=0,this.maxReconnectAttempts=999,this.initialTimeout=200,this.maxTimeout=5e3,this._reconnect=!0,this._url=e.url,new Promise((e=>{this.connect(),e(null)})),this._zustand&&this._zustand.auto_progress()}connect(){this._zustand?.logger.info("Connecting to websocket"),this.is_open=!1,this._websocket=new WebSocket(this._url),this._websocket.onopen=()=>{this.onopen()},this._websocket.onclose=()=>{this.onclose()},this._websocket.onerror=()=>{this.on_ws_error()},this._websocket.onmessage=e=>{this.onmessage(e.data)}}calculateReconnectTimeout(){return Math.min(this.initialTimeout*Math.pow(2,this.reconnectAttempts),this.maxTimeout)}auto_reconnect(){if(this.reconnectAttempts<this.maxReconnectAttempts){let e=this.calculateReconnectTimeout();this._zustand?.logger.info(`Attempting to reconnect in ${e} ms`),setTimeout((()=>{this._websocket&&this._websocket.readyState===WebSocket.OPEN||(this.reconnectAttempts++,this.connect())}),e)}else this._zustand?.logger.warn("Maximum reconnect attempts reached. Giving up.")}async onmessage(e){const t=JSON.parse(e);this._zustand?.logger.debug(`Recieved data of length: ${e.length} and data"`,t),await this.receive(t)}get http_protocol(){return this.secure_url?"https":"http"}get secure_url(){return this._url.startsWith("wss")}get url_wo_protocol(){return this._url.substring(this.secure_url?6:5)}get http_url(){var e=this.http_protocol+"://"+this.url_wo_protocol;return"/"!==e[e.length-1]&&(e+="/"),e}async upload_file({files:e,onProgressCallback:t,root:n}){const r=`${this.http_url}upload/`,o=new FormData,i=Array.isArray(e)?e:Array.from(e);for(const e of i){const t=e.webkitRelativePath||e.name,r=n?`${n}/${t}`:t;o.append("file",e,r)}try{return(await nu.post(r,o,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:e=>{t&&t(e.loaded,e.total)}})).data.file}catch(e){throw new Error("Failed to upload file")}}async handle_large_message_hint({msg_id:e}){const t=this.http_url+"message/"+e,n=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}}),r=await n.json();this.receive(r)}onopen(){this._zustand?.logger.info("Websocket opened"),this.is_open=!0,this._zustand&&this._zustand.auto_progress(),this.reconnectAttempts=0,this.stepwise_fullsync()}onclose(){this._zustand?.logger.info("Websocket closed"),super.onclose(),this._reconnect&&(this._zustand?.logger.info("Websocket closed,reconnecting"),this.auto_reconnect())}on_ws_error(){this._zustand?.logger.warn("Websocket error"),this._websocket?this._websocket.close():this.auto_reconnect()}async send_large_message(e){const t=`${this.http_url}message/`;await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:e})}async send(e){if(!this._websocket||this._websocket.readyState!==WebSocket.OPEN)return void this._zustand?.logger.warn("Websocket not connected");const t=JSON.stringify(e);if(new Blob([t]).size>1e6)return this._zustand?.logger.info("Data too large, sending via http"),await this.send_large_message(t);this._zustand?.logger.debug("Sending data",e),this._websocket.send(t)}async stop(){await super.stop(),this._reconnect=!1}close(){this._websocket&&this._websocket.close()}disconnect(){super.disconnect(),this._reconnect=!1,this.close()}async reconnect(){await super.reconnect(),this._reconnect=!0,!this._websocket||(this._zustand?.logger.info("Reconnecting"),this._websocket.readyState!==WebSocket.OPEN&&this._websocket.readyState!==WebSocket.CONNECTING||(this._websocket.readyState===WebSocket.CONNECTING&&await new Promise(((e,t)=>{if(null===this._websocket)return;let n=setTimeout((()=>{t("Timeout@reconnect")}),2e3);this._websocket.addEventListener("open",(()=>{clearTimeout(n),e(null)}),{once:!0}),this._websocket.readyState===WebSocket.OPEN&&(clearTimeout(n),e(null))})),this._websocket.readyState!==WebSocket.OPEN))?this.connect():this.stepwise_fullsync()}}class _u{constructor(e,t){this.ws=null,this.reconnectAttempts=0,this.maxReconnectAttempts=999,this.initialTimeout=200,this.maxTimeout=2e3,this.wsuri=e,this.zustand=t,this.workers={},this.on_setWorker=e=>{this.zustand.set_worker(e)},this.connect()}get open(){return this.ws?.readyState===WebSocket.OPEN}connect(){this.zustand.set_progress({progress:0,message:"connecting to worker manager",status:"info",blocking:!0}),this.zustand.logger.info("Connecting to websocket:",this.wsuri),this.ws=new WebSocket(this.wsuri),this.ws.onopen=()=>{this.onopen()},this.ws.onclose=()=>{this.onclose()},this.ws.onerror=()=>{this.on_ws_error()},this.ws.onmessage=e=>{this.onmessage(e.data)},this.connectionTimeout=setTimeout((()=>{this.ws?.readyState!==WebSocket.OPEN&&this.on_ws_error()}),5e3)}on_ws_error(){console.warn("Websocket error"),this.ws?this.ws.close():this.reconnect()}onopen(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=void 0),this.zustand.auto_progress(),this.ws&&this.ws.send("worker_status");const e=window.localStorage.getItem("funcnodes__active_worker");e&&this.set_active(e)}onmessage(e){let t=JSON.parse(e);if("worker_status"!==t.type)if("set_worker"!==t.type)"progress"!==t.type?this.zustand.logger.error("WorkerManager: unknown message",t):this.zustand.set_progress(t);else if("WSWorker"===t.data.type){let e="ws"+(t.data.ssl?"s":"")+"://"+t.data.host+":"+t.data.port;this.setWorker(this.workers[t.data.uuid]||new Iu({url:e,zustand:this.zustand,uuid:t.data.uuid,on_sync_complete:this.zustand.options.on_sync_complete}))}else this.zustand.logger.error("WorkerManager: unknown worker type",t);else{const e={};for(let n of t.active)n.active=!0,e[n.uuid]=n;for(let n of t.inactive)n.active=!1,e[n.uuid]=n;this.zustand.workers.setState(e)}}setWorker(e){for(let t in this.workers)t!==e?.uuid&&this.workers[t].disconnect();void 0!==e&&(this.workers[e.uuid]=e,e.reconnect()),window.localStorage.setItem("funcnodes__active_worker",e?.uuid||""),void 0!==this.zustand.worker&&this.zustand.clear_all(),this.zustand.set_worker(e),this.on_setWorker(e)}async restart_worker(e){this.ws?.send(JSON.stringify({type:"restart_worker",workerid:e}))}calculateReconnectTimeout(){return Math.min(this.initialTimeout*Math.pow(2,this.reconnectAttempts),this.maxTimeout)}reconnect(){if(this.reconnectAttempts<this.maxReconnectAttempts){let e=this.calculateReconnectTimeout();this.zustand.logger.info(`Attempting to reconnect in ${e} ms`),setTimeout((()=>{this.ws&&this.ws.readyState===WebSocket.OPEN||(this.reconnectAttempts++,this.connect())}),e)}else this.zustand.logger.warn("Maximum reconnect attempts reached. Giving up.")}onclose(){this.zustand.logger.warn("WorkerManager: onclose"),this.reconnect()}set_active(e){this.ws&&this.ws.send(JSON.stringify({type:"set_active",workerid:e}))}new_worker({name:e,reference:t,copyLib:n,copyNS:r}){e||(e=void 0),n||(n=!1),r||(r=!1),t||(t=void 0,n=!1,r=!1),this.ws&&this.ws.send(JSON.stringify({type:"new_worker",kwargs:{name:e,reference:t,copyLib:n,copyNS:r}}))}}function Au(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Nu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Ru(...e){return t=>{let n=!1;const r=e.map((e=>{const r=Nu(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Nu(e[t],null)}}}}function Ou(...e){return o.useCallback(Ru(...e),e)}var Tu,Mu={exports:{}},Pu={};var Du,Bu,ju={};
28
+ */var C=(w||(w=1,"production"===process.env.NODE_ENV?u.exports=function(){if(g)return d;g=1;var t=e,n=b(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,a=t.useEffect,s=t.useMemo,l=t.useDebugValue;return d.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=i(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=s((function(){function e(e){if(!a){if(a=!0,o=e,e=c(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,i=n)}var o,i,a=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]}),[t,n,c,u]);var f=o(e,d[0],d[1]);return a((function(){p.hasValue=!0,p.value=f}),[f]),l(f),f},d}():u.exports=(v||(v=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=e,n=b(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=t.useRef,a=t.useEffect,s=t.useMemo,l=t.useDebugValue;x.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=i(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=s((function(){function e(e){if(!a){if(a=!0,o=e,e=c(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,i=n)}var o,i,a=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]}),[t,n,c,u]);var f=o(e,d[0],d[1]);return a((function(){p.hasValue=!0,p.value=f}),[f]),l(f),f},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),x)),u.exports),E=l(C);const{useDebugValue:k}=e,{useSyncExternalStoreWithSelector:S}=E;let I=!1;const _=e=>e;const A=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t="function"==typeof e?s(e):e,n=(e,n)=>function(e,t=_,n){n&&!I&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),I=!0);const r=S(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return k(r),r}(t,e,n);return Object.assign(n,t),n},N=e=>e?A(e):A;function R(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e.constructor!==t.constructor)return!1;if(e.constructor===Object||e.constructor===Array){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){if(!r.includes(o))return!1;if(!O(e[o],t[o]))return!1}}return!(e instanceof Date&&t instanceof Date)||e.getTime()===t.getTime()}const T=(e,t)=>{let n=!1;if(!R(e))throw new Error("Target must be a plain object");if(!R(t))throw new Error("Source must be a plain object");const r={...e};return Object.keys(t).forEach((o=>{const i=t[o],a=e[o];if(R(i)&&R(a)){const{new_obj:e,change:t}=T(a,i);t&&(n=!0,r[o]=e)}else O(a,i)||(n=!0,r[o]=i)})),{new_obj:r,change:n}},M=(e,t)=>{let n=!1;if(!R(e))throw new Error("Target must be a plain object");if(!R(t))throw new Error("Source must be a plain object");const r={...e};return Object.keys(t).forEach((o=>{const i=t[o],a=e[o];if(void 0!==a||void 0!==i){if(void 0===a)return n=!0,void(r[o]=i);if(R(i)&&R(a)){const{new_obj:e,change:t}=M(a,i);t&&(n=!0,r[o]=e)}}})),{new_obj:r,change:n}},P={id:"dummy",name:"dummy",node:"dummy",full_id:"dummy",type:"any",value:void 0,is_input:!1,connected:!1,does_trigger:!0,fullvalue:void 0,try_get_full_value:void 0,render_options:{set_default:!0,type:"any"},set_hidden:void 0,hidden:!1},D=e=>{if(!e.id)throw new Error("IO must have an id but is missing for "+JSON.stringify(e));void 0===e.name&&(e.name=e.id);const{new_obj:t}=M(e,P);return"any"!==t.render_options.type&&void 0!==t.render_options.type||(t.render_options.type=t.type),t},B={id:"dummy",node_name:"dummy",frontend:{pos:[NaN,NaN],size:[200,100],collapsed:!1},io:{},name:"dummy",in_trigger:!1,io_order:[],progress:{ascii:!1,elapsed:0,initial:0,n:0,prefix:"idle",unit:"it",unit_divisor:1e3,unit_scale:!1}},j=JSON.stringify(B),F=e=>{if(!e.id)throw new Error("Node must have an id");const t=JSON.parse(j),{new_obj:n}=M(e,t);for(const e in n.io){if(void 0===n.io[e])continue;void 0===n.io[e].id&&(n.io[e].id=e);const t=D(n.io[e]);n.io[e]=t}return n},L=e=>{if(void 0===e.io&&(e.io={}),void 0===e.io_order)if(Array.isArray(e.io)){e.io_order=e.io.map((e=>e.id));const t={};for(const n of e.io)t[n.id]=n;e.io=t}else e.io_order=Object.keys(e.io);else if(Array.isArray(e.io)){const t={};for(const n of e.io)t[n.id]=n,e.io_order.includes(n.id)||e.io_order.push(n.id);e.io=t}else for(const t in e.io)e.io_order.includes(t)||e.io_order.push(t);return e};function V(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=V(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const{useDebugValue:z}=e,{useSyncExternalStoreWithSelector:G}=E,H=e=>e;function W(e,t=H,n){const r=G(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return z(r),r}const X=(e,t)=>{const n=s(e),r=(e,r=t)=>W(n,e,r);return Object.assign(r,n),r};function Z(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[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(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var $={value:()=>{}};function Y(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new U(r)}function U(e){this._=e}function J(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function K(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=$,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}U.prototype=Y.prototype={constructor:U,on:function(e,t){var n,r=this._,o=function(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 new Error("unknown type: "+e);return{type:e,name:n}}))}(e+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<a;)if(n=(e=o[i]).type)r[n]=K(r[n],e.name,t);else if(null==t)for(n in r)r[n]=K(r[n],e.name,null);return this}for(;++i<a;)if((n=(e=o[i]).type)&&(n=J(r[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new U(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(r=this._[e]).length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var Q="http://www.w3.org/1999/xhtml",q={svg:"http://www.w3.org/2000/svg",xhtml:Q,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ee(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),q.hasOwnProperty(t)?{space:q[t],local:e}:e}function te(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Q&&t.documentElement.namespaceURI===Q?t.createElement(e):t.createElementNS(n,e)}}function ne(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function re(e){var t=ee(e);return(t.local?ne:te)(t)}function oe(){}function ie(e){return null==e?oe:function(){return this.querySelector(e)}}function ae(){return[]}function se(e){return null==e?ae:function(){return this.querySelectorAll(e)}}function le(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function ce(e){return function(){return this.matches(e)}}function ue(e){return function(t){return t.matches(e)}}var de=Array.prototype.find;function pe(){return this.firstElementChild}var fe=Array.prototype.filter;function he(){return Array.from(this.children)}function me(e){return new Array(e.length)}function ge(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ye(e,t,n,r,o,i){for(var a,s=0,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new ge(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function be(e,t,n,r,o,i,a){var s,l,c,u=new Map,d=t.length,p=i.length,f=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(f[s]=c=a.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<p;++s)c=a.call(e,i[s],s,i)+"",(l=u.get(c))?(r[s]=l,l.__data__=i[s],u.delete(c)):n[s]=new ge(e,i[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(f[s])===l&&(o[s]=l)}function ve(e){return e.__data__}function we(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function xe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ce(e){return function(){this.removeAttribute(e)}}function Ee(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ke(e,t){return function(){this.setAttribute(e,t)}}function Se(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ie(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function _e(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ae(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ne(e){return function(){this.style.removeProperty(e)}}function Re(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Oe(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Te(e,t){return e.style.getPropertyValue(t)||Ae(e).getComputedStyle(e,null).getPropertyValue(t)}function Me(e){return function(){delete this[e]}}function Pe(e,t){return function(){this[e]=t}}function De(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Be(e){return e.trim().split(/^|\s+/)}function je(e){return e.classList||new Fe(e)}function Fe(e){this._node=e,this._names=Be(e.getAttribute("class")||"")}function Le(e,t){for(var n=je(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Ve(e,t){for(var n=je(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function ze(e){return function(){Le(this,e)}}function Ge(e){return function(){Ve(this,e)}}function He(e,t){return function(){(t.apply(this,arguments)?Le:Ve)(this,e)}}function We(){this.textContent=""}function Xe(e){return function(){this.textContent=e}}function Ze(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function $e(){this.innerHTML=""}function Ye(e){return function(){this.innerHTML=e}}function Ue(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Je(){this.nextSibling&&this.parentNode.appendChild(this)}function Ke(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Qe(){return null}function qe(){var e=this.parentNode;e&&e.removeChild(this)}function et(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tt(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nt(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function rt(e,t,n){return function(){var r,o=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var a=0,s=o.length;a<s;++a)if((r=o[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=t);this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function ot(e,t,n){var r=Ae(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function it(e,t){return function(){return ot(this,e,t)}}function at(e,t){return function(){return ot(this,e,t.apply(this,arguments))}}ge.prototype={constructor:ge,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)}},Fe.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}};var st=[null];function lt(e,t){this._groups=e,this._parents=t}function ct(){return new lt([[document.documentElement]],st)}function ut(e){return"string"==typeof e?new lt([[document.querySelector(e)]],[document.documentElement]):new lt([[e]],st)}function dt(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(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())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}lt.prototype=ct.prototype={constructor:lt,select:function(e){"function"!=typeof e&&(e=ie(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a,s=t[o],l=s.length,c=r[o]=new Array(l),u=0;u<l;++u)(i=s[u])&&(a=e.call(i,i.__data__,u,s))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new lt(r,this._parents)},selectAll:function(e){e="function"==typeof e?le(e):se(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var a,s=t[i],l=s.length,c=0;c<l;++c)(a=s[c])&&(r.push(e.call(a,a.__data__,c,s)),o.push(a));return new lt(r,o)},selectChild:function(e){return this.select(null==e?pe:function(e){return function(){return de.call(this.children,e)}}("function"==typeof e?e:ue(e)))},selectChildren:function(e){return this.selectAll(null==e?he:function(e){return function(){return fe.call(this.children,e)}}("function"==typeof e?e:ue(e)))},filter:function(e){"function"!=typeof e&&(e=ce(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,l=r[o]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new lt(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,ve);var n,r=t?be:ye,o=this._parents,i=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=i.length,s=new Array(a),l=new Array(a),c=new Array(a),u=0;u<a;++u){var d=o[u],p=i[u],f=p.length,h=we(e.call(d,d&&d.__data__,u,o)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);r(d,p,g,y,c[u]=new Array(f),h,t);for(var b,v,w=0,x=0;w<m;++w)if(b=g[w]){for(w>=x&&(x=w+1);!(v=y[x])&&++x<m;);b._next=v||null}}return(s=new lt(s,o))._enter=l,s._exit=c,s},enter:function(){return new lt(this._enter||this._groups.map(me),this._parents)},exit:function(){return new lt(this._exit||this._groups.map(me),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),s=new Array(o),l=0;l<a;++l)for(var c,u=n[l],d=r[l],p=u.length,f=s[l]=new Array(p),h=0;h<p;++h)(c=u[h]||d[h])&&(f[h]=c);for(;l<o;++l)s[l]=n[l];return new lt(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=xe);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,s=n[i],l=s.length,c=o[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new lt(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,s=i.length;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=ee(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?Ee:Ce:"function"==typeof t?n.local?_e:Ie:n.local?Se:ke)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Ne:"function"==typeof t?Oe:Re)(e,t,null==n?"":n)):Te(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Me:"function"==typeof t?De:Pe)(e,t)):this.node()[e]},classed:function(e,t){var n=Be(e+"");if(arguments.length<2){for(var r=je(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?He:t?ze:Ge)(n,t))},text:function(e){return arguments.length?this.each(null==e?We:("function"==typeof e?Ze:Xe)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?$e:("function"==typeof e?Ue:Ye)(e)):this.node().innerHTML},raise:function(){return this.each(Je)},lower:function(){return this.each(Ke)},append:function(e){var t="function"==typeof e?e:re(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:re(e),r=null==t?Qe:"function"==typeof t?t:ie(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(qe)},clone:function(e){return this.select(e?tt:et)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=function(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}}))}(e+""),a=i.length;if(!(arguments.length<2)){for(s=t?rt:nt,r=0;r<a;++r)this.each(s(i[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<a;++r)if((o=i[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?at:it)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const pt={passive:!1},ft={capture:!0,passive:!1};function ht(e){e.stopImmediatePropagation()}function mt(e){e.preventDefault(),e.stopImmediatePropagation()}function gt(e){var t=e.document.documentElement,n=ut(e).on("dragstart.drag",mt,ft);"onselectstart"in t?n.on("selectstart.drag",mt,ft):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function yt(e,t){var n=e.document.documentElement,r=ut(e).on("dragstart.drag",null);t&&(r.on("click.drag",mt,ft),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 bt=e=>()=>e;function vt(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:s,dx:l,dy:c,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:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function wt(e){return!e.ctrlKey&&!e.button}function xt(){return this.parentNode}function Ct(e,t){return null==t?{x:e.x,y:e.y}:t}function Et(){return navigator.maxTouchPoints||"ontouchstart"in this}function kt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function St(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function It(){}vt.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var _t=.7,At=1/_t,Nt="\\s*([+-]?\\d+)\\s*",Rt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ot="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tt=/^#([0-9a-f]{3,8})$/,Mt=new RegExp(`^rgb\\(${Nt},${Nt},${Nt}\\)$`),Pt=new RegExp(`^rgb\\(${Ot},${Ot},${Ot}\\)$`),Dt=new RegExp(`^rgba\\(${Nt},${Nt},${Nt},${Rt}\\)$`),Bt=new RegExp(`^rgba\\(${Ot},${Ot},${Ot},${Rt}\\)$`),jt=new RegExp(`^hsl\\(${Rt},${Ot},${Ot}\\)$`),Ft=new RegExp(`^hsla\\(${Rt},${Ot},${Ot},${Rt}\\)$`),Lt={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};function Vt(){return this.rgb().formatHex()}function zt(){return this.rgb().formatRgb()}function Gt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Tt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ht(t):3===n?new Zt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Wt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Wt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Mt.exec(e))?new Zt(t[1],t[2],t[3],1):(t=Pt.exec(e))?new Zt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Dt.exec(e))?Wt(t[1],t[2],t[3],t[4]):(t=Bt.exec(e))?Wt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=jt.exec(e))?Qt(t[1],t[2]/100,t[3]/100,1):(t=Ft.exec(e))?Qt(t[1],t[2]/100,t[3]/100,t[4]):Lt.hasOwnProperty(e)?Ht(Lt[e]):"transparent"===e?new Zt(NaN,NaN,NaN,0):null}function Ht(e){return new Zt(e>>16&255,e>>8&255,255&e,1)}function Wt(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zt(e,t,n,r)}function Xt(e,t,n,r){return 1===arguments.length?((o=e)instanceof It||(o=Gt(o)),o?new Zt((o=o.rgb()).r,o.g,o.b,o.opacity):new Zt):new Zt(e,t,n,null==r?1:r);var o}function Zt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function $t(){return`#${Kt(this.r)}${Kt(this.g)}${Kt(this.b)}`}function Yt(){const e=Ut(this.opacity);return`${1===e?"rgb(":"rgba("}${Jt(this.r)}, ${Jt(this.g)}, ${Jt(this.b)}${1===e?")":`, ${e})`}`}function Ut(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Jt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Kt(e){return((e=Jt(e))<16?"0":"")+e.toString(16)}function Qt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new en(e,t,n,r)}function qt(e){if(e instanceof en)return new en(e.h,e.s,e.l,e.opacity);if(e instanceof It||(e=Gt(e)),!e)return new en;if(e instanceof en)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(a=t===i?(n-r)/s+6*(n<r):n===i?(r-t)/s+2:(t-n)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new en(a,s,l,e.opacity)}function en(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function tn(e){return(e=(e||0)%360)<0?e+360:e}function nn(e){return Math.max(0,Math.min(1,e||0))}function rn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}kt(It,Gt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Vt,formatHex:Vt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return qt(this).formatHsl()},formatRgb:zt,toString:zt}),kt(Zt,Xt,St(It,{brighter(e){return e=null==e?At:Math.pow(At,e),new Zt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?_t:Math.pow(_t,e),new Zt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zt(Jt(this.r),Jt(this.g),Jt(this.b),Ut(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:$t,formatHex:$t,formatHex8:function(){return`#${Kt(this.r)}${Kt(this.g)}${Kt(this.b)}${Kt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Yt,toString:Yt})),kt(en,(function(e,t,n,r){return 1===arguments.length?qt(e):new en(e,t,n,null==r?1:r)}),St(It,{brighter(e){return e=null==e?At:Math.pow(At,e),new en(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?_t:Math.pow(_t,e),new en(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Zt(rn(e>=240?e-240:e+120,o,r),rn(e,o,r),rn(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new en(tn(this.h),nn(this.s),nn(this.l),Ut(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ut(this.opacity);return`${1===e?"hsl(":"hsla("}${tn(this.h)}, ${100*nn(this.s)}%, ${100*nn(this.l)}%${1===e?")":`, ${e})`}`}}));var on=e=>()=>e;function an(e){return 1==(e=+e)?sn:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):on(isNaN(t)?n:t)}}function sn(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):on(isNaN(e)?t:e)}var ln=function e(t){var n=an(t);function r(e,t){var r=n((e=Xt(e)).r,(t=Xt(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=sn(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function cn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var un=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dn=new RegExp(un.source,"g");function pn(e,t){var n,r,o,i=un.lastIndex=dn.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=un.exec(e))&&(r=dn.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:cn(n,r)})),i=dn.lastIndex;return i<t.length&&(o=t.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}var fn,hn=180/Math.PI,mn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gn(e,t,n,r,o,i){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*hn,skewX:Math.atan(l)*hn,scaleX:a,scaleY:s}}function yn(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var s=[],l=[];return i=e(i),a=e(a),function(e,r,o,i,a,s){if(e!==o||r!==i){var l=a.push("translate(",null,t,null,n);s.push({i:l-4,x:cn(e,o)},{i:l-2,x:cn(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,l),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:cn(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(i.rotate,a.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:cn(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(i.skewX,a.skewX,s,l),function(e,t,n,r,i,a){if(e!==n||t!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:cn(e,n)},{i:s-2,x:cn(t,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,l),i=a=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var bn=yn((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?mn:gn(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),vn=yn((function(e){return null==e?mn:(fn||(fn=document.createElementNS("http://www.w3.org/2000/svg","g")),fn.setAttribute("transform",e),(e=fn.transform.baseVal.consolidate())?gn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):mn)}),", ",")",")");function wn(e){return((e=Math.exp(e))+1/e)/2}var xn,Cn,En=function e(t,n,r){function o(e,o){var i,a,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],p=o[2],f=u-s,h=d-l,m=f*f+h*h;if(m<1e-12)a=Math.log(p/c)/t,i=function(e){return[s+e*f,l+e*h,c*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(p*p-c*c+r*m)/(2*c*n*g),b=(p*p-c*c-r*m)/(2*p*n*g),v=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(b*b+1)-b);a=(w-v)/t,i=function(e){var r,o=e*a,i=wn(v),u=c/(n*g)*(i*(r=t*o+v,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[s+u*f,l+u*h,c*i/wn(t*o+v)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4),kn=0,Sn=0,In=0,_n=0,An=0,Nn=0,Rn="object"==typeof performance&&performance.now?performance:Date,On="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Tn(){return An||(On(Mn),An=Rn.now()+Nn)}function Mn(){An=0}function Pn(){this._call=this._time=this._next=null}function Dn(e,t,n){var r=new Pn;return r.restart(e,t,n),r}function Bn(){An=(_n=Rn.now())+Nn,kn=Sn=0;try{!function(){Tn(),++kn;for(var e,t=xn;t;)(e=An-t._time)>=0&&t._call.call(void 0,e),t=t._next;--kn}()}finally{kn=0,function(){var e,t,n=xn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:xn=t);Cn=e,Fn(r)}(),An=0}}function jn(){var e=Rn.now(),t=e-_n;t>1e3&&(Nn-=t,_n=e)}function Fn(e){kn||(Sn&&(Sn=clearTimeout(Sn)),e-An>24?(e<1/0&&(Sn=setTimeout(Bn,e-Rn.now()-Nn)),In&&(In=clearInterval(In))):(In||(_n=Rn.now(),In=setInterval(jn,1e3)),kn=1,On(Bn)))}function Ln(e,t,n){var r=new Pn;return t=null==t?0:+t,r.restart((n=>{r.stop(),e(n+t)}),t,n),r}Pn.prototype=Dn.prototype={constructor:Pn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Tn():+n)+(null==t?0:+t),this._next||Cn===this||(Cn?Cn._next=this:xn=this,Cn=this),this._call=e,this._time=n,Fn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fn())}};var Vn=Y("start","end","cancel","interrupt"),zn=[];function Gn(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(i){var c,u,d,p;if(1!==n.state)return l();for(c in o)if((p=o[c]).name===n.name){if(3===p.state)return Ln(a);4===p.state?(p.state=6,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete o[c]):+c<t&&(p.state=6,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete o[c])}if(Ln((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(i))})),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=p);r.length=u+1}}function s(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=Dn(i,0,n.time)}(e,n,{name:t,index:r,group:o,on:Vn,tween:zn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Hn(e,t){var n=Xn(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function Wn(e,t){var n=Xn(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Xn(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Zn(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i)(n=i[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete e.__transition}}function $n(e,t){var n,r;return function(){var o=Wn(this,e),i=o.tween;if(i!==n)for(var a=0,s=(r=n=i).length;a<s;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}o.tween=r}}function Yn(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=Wn(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}i.tween=o}}function Un(e,t,n){var r=e._id;return e.each((function(){var e=Wn(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)})),function(e){return Xn(e,r).value[t]}}function Jn(e,t){var n;return("number"==typeof t?cn:t instanceof Gt?ln:(n=Gt(t))?(t=n,ln):pn)(e,t)}function Kn(e){return function(){this.removeAttribute(e)}}function Qn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qn(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function er(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function tr(e,t,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttribute(e))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,l));this.removeAttribute(e)}}function nr(e,t,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,l));this.removeAttributeNS(e.space,e.local)}}function rr(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function or(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function ir(e,t){return function(){Hn(this,e).delay=+t.apply(this,arguments)}}function ar(e,t){return t=+t,function(){Hn(this,e).delay=t}}function sr(e,t){return function(){Wn(this,e).duration=+t.apply(this,arguments)}}function lr(e,t){return t=+t,function(){Wn(this,e).duration=t}}var cr=ct.prototype.constructor;function ur(e){return function(){this.style.removeProperty(e)}}var dr=0;function pr(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function fr(){return++dr}var hr=ct.prototype;pr.prototype={constructor:pr,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ie(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s,l,c=r[a],u=c.length,d=i[a]=new Array(u),p=0;p<u;++p)(s=c[p])&&(l=e.call(s,s.__data__,p,c))&&("__data__"in s&&(l.__data__=s.__data__),d[p]=l,Gn(d[p],t,n,p,d,Xn(s,n)));return new pr(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=se(e));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var l,c=r[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var p,f=e.call(l,l.__data__,d,c),h=Xn(l,n),m=0,g=f.length;m<g;++m)(p=f[m])&&Gn(p,t,n,m,f,h);i.push(f),a.push(l)}return new pr(i,a,t,n)},selectChild:hr.selectChild,selectChildren:hr.selectChildren,filter:function(e){"function"!=typeof e&&(e=ce(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,l=r[o]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new pr(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var l,c=t[s],u=n[s],d=c.length,p=a[s]=new Array(d),f=0;f<d;++f)(l=c[f]||u[f])&&(p[f]=l);for(;s<r;++s)a[s]=t[s];return new pr(a,this._parents,this._name,this._id)},selection:function(){return new cr(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=fr(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,c=0;c<l;++c)if(a=s[c]){var u=Xn(a,t);Gn(a,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new pr(r,this._parents,e,n)},call:hr.call,nodes:hr.nodes,node:hr.node,size:hr.size,empty:hr.empty,each:hr.each,on:function(e,t){var n=this._id;return arguments.length<2?Xn(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,i=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?Hn:Wn;return function(){var a=i(this,e),s=a.on;s!==r&&(o=(r=s).copy()).on(t,n),a.on=o}}(n,e,t))},attr:function(e,t){var n=ee(e),r="transform"===n?vn:Jn;return this.attrTween(e,"function"==typeof t?(n.local?nr:tr)(n,r,Un(this,"attr."+e,t)):null==t?(n.local?Qn:Kn)(n):(n.local?er:qn)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=ee(e);return this.tween(n,(r.local?rr:or)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?bn:Jn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var i=Te(this,e),a=(this.style.removeProperty(e),Te(this,e));return i===a?null:i===n&&a===r?o:o=t(n=i,r=a)}}(e,r)).on("end.style."+e,ur(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,i;return function(){var a=Te(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=Te(this,e)),a===l?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}}(e,r,Un(this,"style."+e,t))).each(function(e,t){var n,r,o,i,a="style."+t,s="end."+a;return function(){var l=Wn(this,e),c=l.on,u=null==l.value[a]?i||(i=ur(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(s,o=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,i=n+"";return function(){var a=Te(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,i,n)),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(Un(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=Xn(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?$n:Yn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ir:ar)(t,e)):Xn(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?sr:lr)(t,e)):Xn(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){Wn(this,e).ease=t}}(t,e)):Xn(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;Wn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var s={value:a},l={value:function(){0==--o&&i()}};n.each((function(){var n=Wn(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t})),0===o&&i()}))},[Symbol.iterator]:hr[Symbol.iterator]};var mr={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function gr(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}ct.prototype.interrupt=function(e){return this.each((function(){Zn(this,e)}))},ct.prototype.transition=function(e){var t,n;e instanceof pr?(t=e._id,e=e._name):(t=fr(),(n=mr).time=Tn(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,c=0;c<l;++c)(a=s[c])&&Gn(a,e,t,c,s,n||gr(a,t));return new pr(r,this._parents,e,t)};var yr=e=>()=>e;function br(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function vr(e,t,n){this.k=e,this.x=t,this.y=n}vr.prototype={constructor:vr,scale:function(e){return 1===e?this:new vr(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new vr(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 wr=new vr(1,0,0);function xr(e){e.stopImmediatePropagation()}function Cr(e){e.preventDefault(),e.stopImmediatePropagation()}function Er(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function kr(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).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 Sr(){return this.__zoom||wr}function Ir(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function _r(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ar(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Nr(){var e,t,n,r=Er,o=kr,i=Ar,a=Ir,s=_r,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=En,p=Y("start","zoom","end"),f=0,h=10;function m(e){e.property("__zoom",Sr).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",k).filter(s).on("touchstart.zoom",S).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",_).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new vr(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new vr(e.k,r,o)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function v(e,t,n,r){e.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var e=this,i=arguments,a=w(e,i).event(r),s=o.apply(e,i),l=null==n?b(s):"function"==typeof n?n.apply(e,i):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,p="function"==typeof t?t.apply(e,i):t,f=d(u.invert(l).concat(c/u.k),p.invert(l).concat(c/p.k));return function(e){if(1===e)e=p;else{var t=f(e),n=c/t[2];e=new vr(n,l[0]-t[0]*n,l[1]-t[1]*n)}a.zoom(null,e)}}))}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function C(e,...t){if(r.apply(this,arguments)){var n=w(this,t).event(e),o=this.__zoom,s=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,a.apply(this,arguments)))),u=dt(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[u,o.invert(u)],Zn(this),n.start()}Cr(e),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),150),n.zoom("mouse",i(y(g(o,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function E(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=w(this,t,!0).event(e),s=ut(e.view).on("mousemove.zoom",(function(e){if(Cr(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>f}a.event(e).zoom("mouse",i(y(a.that.__zoom,a.mouse[0]=dt(e,o),a.mouse[1]),a.extent,c))}),!0).on("mouseup.zoom",(function(e){s.on("mousemove.zoom mouseup.zoom",null),yt(e.view,a.moved),Cr(e),a.event(e).end()}),!0),l=dt(e,o),u=e.clientX,d=e.clientY;gt(e.view),xr(e),a.mouse=[l,this.__zoom.invert(l)],Zn(this),a.start()}}function k(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=dt(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(a),l=n.k*(e.shiftKey?.5:2),d=i(y(g(n,l),a,s),o.apply(this,t),c);Cr(e),u>0?ut(this).transition().duration(u).call(v,d,a,e):ut(this).call(m.transform,d,a,e)}}function S(n,...o){if(r.apply(this,arguments)){var i,a,s,l,c=n.touches,u=c.length,d=w(this,o,n.changedTouches.length===u).event(n);for(xr(n),a=0;a<u;++a)l=[l=dt(s=c[a],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=l[0],e=setTimeout((function(){e=null}),500)),Zn(this),d.start())}}function I(e,...t){if(this.__zooming){var n,r,o,a,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(Cr(e),n=0;n<u;++n)o=dt(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=s.that.__zoom,s.touch1){var d=s.touch0[0],p=s.touch0[1],f=s.touch1[0],h=s.touch1[1],m=(m=f[0]-d[0])*m+(m=f[1]-d[1])*m,b=(b=h[0]-p[0])*b+(b=h[1]-p[1])*b;r=g(r,Math.sqrt(m/b)),o=[(d[0]+f[0])/2,(d[1]+f[1])/2],a=[(p[0]+h[0])/2,(p[1]+h[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(y(r,o,a),s.extent,c))}}function _(e,...r){if(this.__zooming){var o,i,a=w(this,r).event(e),s=e.changedTouches,l=s.length;for(xr(e),n&&clearTimeout(n),n=setTimeout((function(){n=null}),500),o=0;o<l;++o)i=s[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=dt(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<h)){var c=ut(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",Sr),e!==o?v(e,t,n,r):o.interrupt().each((function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},m.scaleBy=function(e,t,n,r){m.scaleTo(e,(function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)}),n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,(function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?b(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(a),l="function"==typeof t?t.apply(this,arguments):t;return i(y(g(r,l),a,s),e,c)}),n,r)},m.translateBy=function(e,t,n,r){m.transform(e,(function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)}),null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,(function(){var e=o.apply(this,arguments),a=this.__zoom,s=null==r?b(e):"function"==typeof r?r.apply(this,arguments):r;return i(wr.translate(s[0],s[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)}),r,a)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ut(this.that).datum();p.call(e,this.that,new br(e,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:p}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:yr(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:yr(!!e),m):r},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:yr(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:yr([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(i=e,m):i},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=p.on.apply(p,arguments);return e===p?m:e},m.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,m):Math.sqrt(f)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}vr.prototype;const Rr=e.createContext(null),Or=Rr.Provider,Tr=()=>"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.",Mr=e=>`Node type "${e}" not found. Using fallback type "default".`,Pr=()=>"The React Flow parent container needs a width and a height to render the graph.",Dr=()=>"Only child nodes can use a parent extent.",Br=()=>"Can't create edge. An edge needs a source and a target.",jr=e=>`Marker type "${e}" doesn't exist.`,Fr=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,Lr=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",Vr=e=>`Edge type "${e}" not found. Using fallback type "default".`,zr=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.`,Gr=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function Hr(t,n){const r=e.useContext(Rr);if(null===r)throw new Error(Gr);return W(r,t,n)}const Wr=()=>{const t=e.useContext(Rr);if(null===t)throw new Error(Gr);return e.useMemo((()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe,destroy:t.destroy})),[t])},Xr=e=>e.userSelectionActive?"none":"all";function Zr({position:t,children:n,className:r,style:o,...i}){const a=Hr(Xr),s=`${t}`.split("-");return e.createElement("div",{className:V(["react-flow__panel",r,...s]),style:{...o,pointerEvents:a},...i},n)}function $r({proOptions:t,position:n="bottom-right"}){return t?.hideAttribution?null:e.createElement(Zr,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},e.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Yr=e.memo((({x:t,y:n,label:r,labelStyle:o={},labelShowBg:i=!0,labelBgStyle:a={},labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d})=>{const p=e.useRef(null),[f,h]=e.useState({x:0,y:0,width:0,height:0}),m=V(["react-flow__edge-textwrapper",u]);return e.useEffect((()=>{if(p.current){const e=p.current.getBBox();h({x:e.x,y:e.y,width:e.width,height:e.height})}}),[r]),void 0!==r&&r?e.createElement("g",{transform:`translate(${t-f.width/2} ${n-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d},i&&e.createElement("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:a,rx:l,ry:l}),e.createElement("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:p,style:o},r),c):null}));const Ur=e=>({width:e.offsetWidth,height:e.offsetHeight}),Jr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Kr=(e={x:0,y:0},t)=>({x:Jr(e.x,t[0][0],t[1][0]),y:Jr(e.y,t[0][1],t[1][1])}),Qr=(e,t,n)=>e<t?Jr(Math.abs(e-t),1,50)/50:e>n?-Jr(Math.abs(e-n),1,50)/50:0,qr=(e,t)=>[20*Qr(e.x,35,t.width-35),20*Qr(e.y,35,t.height-35)],eo=e=>e.getRootNode?.()||window?.document,to=(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)}),no=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),ro=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),oo=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),io=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},ao=e=>!isNaN(e)&&isFinite(e),so=Symbol.for("internals"),lo=["Enter"," ","Escape"],co=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function uo(e){const t=(e=>"nativeEvent"in e)(e)?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const po=e=>"clientX"in e,fo=(e,t)=>{const n=po(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},ho=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,mo=({id:t,path:n,labelX:r,labelY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:p,markerStart:f,interactionWidth:h=20})=>e.createElement(e.Fragment,null,e.createElement("path",{id:t,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:p,markerStart:f}),h&&e.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&ao(r)&&ao(o)?e.createElement(Yr,{x:r,y:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function go(e,t,n){return void 0===n?n:r=>{const o=t().edges.find((t=>t.id===e));o&&n(r,{...o})}}function yo({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,a=Math.abs(r-t)/2;return[i,r<t?r+a:r-a,o,a]}function bo({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:s}){const l=.125*e+.375*o+.375*a+.125*n,c=.125*t+.375*i+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var vo,wo,xo,Co,Eo,ko;function So({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===ko.Left||e===ko.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Io({sourceX:e,sourceY:t,sourcePosition:n=ko.Bottom,targetX:r,targetY:o,targetPosition:i=ko.Top}){const[a,s]=So({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=So({pos:i,x1:r,y1:o,x2:e,y2:t}),[u,d,p,f]=bo({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${a},${s} ${l},${c} ${r},${o}`,u,d,p,f]}mo.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(vo||(vo={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(wo||(wo={})),function(e){e.Partial="partial",e.Full="full"}(xo||(xo={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(Co||(Co={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(Eo||(Eo={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(ko||(ko={}));const _o=e.memo((({sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i=ko.Bottom,targetPosition:a=ko.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:p,style:f,markerEnd:h,markerStart:m,interactionWidth:g})=>{const[y,b,v]=Io({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a});return e.createElement(mo,{path:y,labelX:b,labelY:v,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:p,style:f,markerEnd:h,markerStart:m,interactionWidth:g})}));_o.displayName="SimpleBezierEdge";const Ao={[ko.Left]:{x:-1,y:0},[ko.Right]:{x:1,y:0},[ko.Top]:{x:0,y:-1},[ko.Bottom]:{x:0,y:1}},No=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Ro({source:e,sourcePosition:t=ko.Bottom,target:n,targetPosition:r=ko.Top,center:o,offset:i}){const a=Ao[t],s=Ao[r],l={x:e.x+a.x*i,y:e.y+a.y*i},c={x:n.x+s.x*i,y:n.y+s.y*i},u=(({source:e,sourcePosition:t=ko.Bottom,target:n})=>t===ko.Left||t===ko.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})({source:l,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",p=u[d];let f,h,m=[];const g={x:0,y:0},y={x:0,y:0},[b,v,w,x]=yo({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]==-1){f=o.x??b,h=o.y??v;const e=[{x:f,y:l.y},{x:f,y:c.y}],t=[{x:l.x,y:h},{x:c.x,y:h}];m=a[d]===p?"x"===d?e:t:"x"===d?t:e}else{const o=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?a.x===p?u:o:a.y===p?o:u,t===r){const t=Math.abs(e[d]-n[d]);if(t<=i){const r=Math.min(i-1,i-t);a[d]===p?g[d]=(l[d]>e[d]?-1:1)*r:y[d]=(c[d]>n[d]?-1:1)*r}}if(t!==r){const e="x"===d?"y":"x",t=a[d]===s[e],n=l[e]>c[e],r=l[e]<c[e];(1===a[d]&&(!t&&n||t&&r)||1!==a[d]&&(!t&&r||t&&n))&&(m="x"===d?o:u)}const b={x:l.x+g.x,y:l.y+g.y},v={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(b.x-m[0].x),Math.abs(v.x-m[0].x))>=Math.max(Math.abs(b.y-m[0].y),Math.abs(v.y-m[0].y))?(f=(b.x+v.x)/2,h=m[0].y):(f=m[0].x,h=(b.y+v.y)/2)}return[[e,{x:l.x+g.x,y:l.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],f,h,w,x]}function Oo({sourceX:e,sourceY:t,sourcePosition:n=ko.Bottom,targetX:r,targetY:o,targetPosition:i=ko.Top,borderRadius:a=5,centerX:s,centerY:l,offset:c=20}){const[u,d,p,f,h]=Ro({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:s,y:l},offset:c}),m=u.reduce(((e,t,n)=>{let r="";return r=n>0&&n<u.length-1?function(e,t,n,r){const o=Math.min(No(e,t)/2,No(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a)return`L ${i+o*(e.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+o*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${i},${a+o*(e.y<n.y?-1:1)}Q ${i},${a} ${i+o*s},${a}`}(u[n-1],t,u[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=r}),"");return[m,d,p,f,h]}const To=e.memo((({sourceX:t,sourceY:n,targetX:r,targetY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:p=ko.Bottom,targetPosition:f=ko.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[b,v,w]=Oo({sourceX:t,sourceY:n,sourcePosition:p,targetX:r,targetY:o,targetPosition:f,borderRadius:g?.borderRadius,offset:g?.offset});return e.createElement(mo,{path:b,labelX:v,labelY:w,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})}));To.displayName="SmoothStepEdge";const Mo=e.memo((t=>e.createElement(To,{...t,pathOptions:e.useMemo((()=>({borderRadius:0,offset:t.pathOptions?.offset})),[t.pathOptions?.offset])})));Mo.displayName="StepEdge";const Po=e.memo((({sourceX:t,sourceY:n,targetX:r,targetY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:p,markerStart:f,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,a,s]=yo({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,s]}({sourceX:t,sourceY:n,targetX:r,targetY:o});return e.createElement(mo,{path:m,labelX:g,labelY:y,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:p,markerStart:f,interactionWidth:h})}));function Do(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function Bo({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case ko.Left:return[t-Do(t-r,i),n];case ko.Right:return[t+Do(r-t,i),n];case ko.Top:return[t,n-Do(n-o,i)];case ko.Bottom:return[t,n+Do(o-n,i)]}}function jo({sourceX:e,sourceY:t,sourcePosition:n=ko.Bottom,targetX:r,targetY:o,targetPosition:i=ko.Top,curvature:a=.25}){const[s,l]=Bo({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[c,u]=Bo({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,p,f,h]=bo({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${o}`,d,p,f,h]}Po.displayName="StraightEdge";const Fo=e.memo((({sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i=ko.Bottom,targetPosition:a=ko.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:p,style:f,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[b,v,w]=jo({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a,curvature:g?.curvature});return e.createElement(mo,{path:b,labelX:v,labelY:w,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:p,style:f,markerEnd:h,markerStart:m,interactionWidth:y})}));Fo.displayName="BezierEdge";const Lo=e.createContext(null),Vo=Lo.Provider;Lo.Consumer;const zo=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Go=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map((t=>`${t}=${e[t]}`)).join("&")}`},Ho=({x:e,y:t},[n,r,o],i,[a,s])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?{x:a*Math.round(l.x/a),y:s*Math.round(l.y/s)}:l},Wo=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Xo=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},Zo=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce(((e,n)=>{const{x:r,y:o}=Xo(n,t).positionAbsolute;return to(e,no({x:r,y:o,width:n.width||0,height:n.height||0}))}),{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ro(n)},$o=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1,s=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach((e=>{const{width:t,height:n,selectable:r=!0,hidden:o=!1}=e;if(a&&!r||o)return!1;const{positionAbsolute:u}=Xo(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},p=io(l,d);(void 0===t||void 0===n||null===t||null===n||i&&p>0||p>=(t||0)*(n||0)||e.dragging)&&c.push(e)})),c},Yo=(e,t)=>{const n=e.map((e=>e.id));return t.filter((e=>n.includes(e.source)||n.includes(e.target)))},Uo=(e,t,n,r,o,i=.1)=>{const a=t/(e.width*(1+i)),s=n/(e.height*(1+i)),l=Math.min(a,s),c=Jr(l,r,o);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Jo=(e,t=0)=>e.transition().duration(t);function Ko(e,t,n,r){return(t[n]||[]).reduce(((t,o)=>(`${e.id}-${o.id}-${n}`!==r&&t.push({id:o.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+o.x+o.width/2,y:(e.positionAbsolute?.y??0)+o.y+o.height/2}),t)),[])}const Qo={source:null,target:null,sourceHandle:null,targetHandle:null},qo=()=>({handleDomNode:null,isValid:!1,connection:Qo,endHandle:null});function ei(e,t,n,r,o,i,a){const s="target"===o,l=a.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...qo(),handleDomNode:l};if(l){const e=ti(void 0,l),o=l.getAttribute("data-nodeid"),a=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),p={source:s?o:n,sourceHandle:s?a:r,target:s?n:o,targetHandle:s?r:a};c.connection=p;u&&d&&(t===vo.Strict?s&&"source"===e||!s&&"target"===e:o!==n||a!==r)&&(c.endHandle={nodeId:o,handleId:a,type:e},c.isValid=i(p))}return c}function ti(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function ni(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function ri(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function oi({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:a,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=eo(e.target),{connectionMode:d,domNode:p,autoPanOnConnect:f,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:b}=i();let v,w=0;const{x:x,y:C}=fo(e),E=u?.elementFromPoint(x,C),k=ti(l,E),S=p?.getBoundingClientRect();if(!S||!k)return;let I,_=fo(e,S),A=!1,N=null,R=!1,O=null;const T=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce(((e,o)=>{if(o[so]){const{handleBounds:i}=o[so];let a=[],s=[];i&&(a=Ko(o,i,"source",`${t}-${n}-${r}`),s=Ko(o,i,"target",`${t}-${n}-${r}`)),e.push(...a,...s)}return e}),[])}({nodes:y(),nodeId:n,handleId:t,handleType:k}),M=()=>{if(!f)return;const[e,t]=qr(_,S);g({x:e,y:t}),w=requestAnimationFrame(M)};function P(e){const{transform:r}=i();_=fo(e,S);const{handle:l,validHandleResult:c}=function(e,t,n,r,o,i){const{x:a,y:s}=fo(e),l=t.elementsFromPoint(a,s).find((e=>e.classList.contains("react-flow__handle")));if(l){const e=l.getAttribute("data-nodeid");if(e){const t=ti(void 0,l),r=l.getAttribute("data-handleid"),a=i({nodeId:e,id:r,type:t});if(a){const i=o.find((n=>n.nodeId===e&&n.type===t&&n.id===r));return{handle:{id:r,type:t,nodeId:e,x:i?.x||n.x,y:i?.y||n.y},validHandleResult:a}}}}let c=[],u=1/0;if(o.forEach((e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=r){const n=i(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}})),!c.length)return{handle:null,validHandleResult:qo()};if(1===c.length)return c[0];const d=c.some((({validHandleResult:e})=>e.isValid)),p=c.some((({handle:e})=>"target"===e.type));return c.find((({handle:e,validHandleResult:t})=>p?"target"===e.type:!d||t.isValid))||c[0]}(e,u,Ho(_,r,!1,[1,1]),h,T,(e=>ei(e,d,n,t,o?"target":"source",s,u)));if(v=l,A||(M(),A=!0),O=c.handleDomNode,N=c.connection,R=c.isValid,a({connectionPosition:v&&R?Wo({x:v.x,y:v.y},r):_,connectionStatus:ri(!!v,R),connectionEndHandle:c.endHandle}),!v&&!R&&!O)return ni(I);N.source!==N.target&&O&&(ni(I),I=O,O.classList.add("connecting","react-flow__handle-connecting"),O.classList.toggle("valid",R),O.classList.toggle("react-flow__handle-valid",R))}function D(e){(v||O)&&N&&R&&r?.(N),i().onConnectEnd?.(e),l&&c?.(e),ni(I),b(),cancelAnimationFrame(w),A=!1,R=!1,N=null,O=null,u.removeEventListener("mousemove",P),u.removeEventListener("mouseup",D),u.removeEventListener("touchmove",P),u.removeEventListener("touchend",D)}a({connectionPosition:_,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:k,connectionStartHandle:{nodeId:n,handleId:t,type:k},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:k}),u.addEventListener("mousemove",P),u.addEventListener("mouseup",D),u.addEventListener("touchmove",P),u.addEventListener("touchend",D)}const ii=()=>!0,ai=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),si=e.forwardRef((({type:t="source",position:n=ko.Top,isValidConnection:r,isConnectable:o=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:s,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:p,...f},h)=>{const m=s||null,g="target"===t,y=Wr(),b=e.useContext(Lo),{connectOnClick:v,noPanClassName:w}=Hr(ai,Z),{connecting:x,clickConnecting:C}=Hr(((e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.type===n||i?.nodeId===e&&i?.handleId===t&&i?.type===n,clickConnecting:a?.nodeId===e&&a?.handleId===t&&a?.type===n}})(b,m,t),Z);b||y.getState().onError?.("010",Lr());const E=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=y.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=y.getState();t(((e,t)=>{if(!e.source||!e.target)return co("006",Br()),t;let n;return n=(e=>"id"in e&&"source"in e&&"target"in e)(e)?{...e}:{...e,id:zo(e)},((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)))))(n,t)?t:t.concat(n)})(o,e))}n?.(o),l?.(o)},k=e=>{if(!b)return;const t=po(e);i&&(t&&0===e.button||!t)&&oi({event:e,handleId:m,nodeId:b,onConnect:E,isTarget:g,getState:y.getState,setState:y.setState,isValidConnection:r||y.getState().isValidConnection||ii}),t?d?.(e):p?.(e)};return e.createElement("div",{"data-handleid":m,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${m}-${t}`,className:V(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",w,u,{source:!g,target:g,connectable:o,connectablestart:i,connectableend:a,connecting:C,connectionindicator:o&&(i&&!x||a&&x)}]),onMouseDown:k,onTouchStart:k,onClick:v?e=>{const{onClickConnectStart:n,onClickConnectEnd:o,connectionClickStartHandle:a,connectionMode:s,isValidConnection:l}=y.getState();if(!b||!a&&!i)return;if(!a)return n?.(e,{nodeId:b,handleId:m,handleType:t}),void y.setState({connectionClickStartHandle:{nodeId:b,type:t,handleId:m}});const c=eo(e.target),u=r||l||ii,{connection:d,isValid:p}=ei({nodeId:b,id:m,type:t},s,a.nodeId,a.handleId||null,a.type,u,c);p&&E(d),o?.(e),y.setState({connectionClickStartHandle:null})}:void 0,ref:h,...f},c)}));si.displayName="Handle";var li=e.memo(si);const ci=({data:t,isConnectable:n,targetPosition:r=ko.Top,sourcePosition:o=ko.Bottom})=>e.createElement(e.Fragment,null,e.createElement(li,{type:"target",position:r,isConnectable:n}),t?.label,e.createElement(li,{type:"source",position:o,isConnectable:n}));ci.displayName="DefaultNode";var ui=e.memo(ci);const di=({data:t,isConnectable:n,sourcePosition:r=ko.Bottom})=>e.createElement(e.Fragment,null,t?.label,e.createElement(li,{type:"source",position:r,isConnectable:n}));di.displayName="InputNode";var pi=e.memo(di);const fi=({data:t,isConnectable:n,targetPosition:r=ko.Top})=>e.createElement(e.Fragment,null,e.createElement(li,{type:"target",position:r,isConnectable:n}),t?.label);fi.displayName="OutputNode";var hi=e.memo(fi);const mi=()=>null;mi.displayName="GroupNode";const gi=e=>({selectedNodes:e.getNodes().filter((e=>e.selected)),selectedEdges:e.edges.filter((e=>e.selected)).map((e=>({...e})))}),yi=e=>e.id;function bi(e,t){return Z(e.selectedNodes.map(yi),t.selectedNodes.map(yi))&&Z(e.selectedEdges.map(yi),t.selectedEdges.map(yi))}const vi=e.memo((({onSelectionChange:t})=>{const n=Wr(),{selectedNodes:r,selectedEdges:o}=Hr(gi,bi);return e.useEffect((()=>{const e={nodes:r,edges:o};t?.(e),n.getState().onSelectionChange.forEach((t=>t(e)))}),[r,o,t]),null}));vi.displayName="SelectionListener";const wi=e=>!!e.onSelectionChange;function xi({onSelectionChange:t}){const n=Hr(wi);return t||n?e.createElement(vi,{onSelectionChange:t}):null}const Ci=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Ei(t,n){e.useEffect((()=>{void 0!==t&&n(t)}),[t])}function ki(t,n,r){e.useEffect((()=>{void 0!==n&&r({[t]:n})}),[n])}const Si=({nodes:t,edges:n,defaultNodes:r,defaultEdges:o,onConnect:i,onConnectStart:a,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:p,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:b,onNodesChange:v,onEdgesChange:w,elementsSelectable:x,connectionMode:C,snapGrid:E,snapToGrid:k,translateExtent:S,connectOnClick:I,defaultEdgeOptions:_,fitView:A,fitViewOptions:N,onNodesDelete:R,onEdgesDelete:O,onNodeDrag:T,onNodeDragStart:M,onNodeDragStop:P,onSelectionDrag:D,onSelectionDragStart:B,onSelectionDragStop:j,noPanClassName:F,nodeOrigin:L,rfId:V,autoPanOnConnect:z,autoPanOnNodeDrag:G,onError:H,connectionRadius:W,isValidConnection:X,nodeDragThreshold:$})=>{const{setNodes:Y,setEdges:U,setDefaultNodesAndEdges:J,setMinZoom:K,setMaxZoom:Q,setTranslateExtent:q,setNodeExtent:ee,reset:te}=Hr(Ci,Z),ne=Wr();return e.useEffect((()=>{const e=o?.map((e=>({...e,..._})));return J(r,e),()=>{te()}}),[]),ki("defaultEdgeOptions",_,ne.setState),ki("connectionMode",C,ne.setState),ki("onConnect",i,ne.setState),ki("onConnectStart",a,ne.setState),ki("onConnectEnd",s,ne.setState),ki("onClickConnectStart",l,ne.setState),ki("onClickConnectEnd",c,ne.setState),ki("nodesDraggable",u,ne.setState),ki("nodesConnectable",d,ne.setState),ki("nodesFocusable",p,ne.setState),ki("edgesFocusable",f,ne.setState),ki("edgesUpdatable",h,ne.setState),ki("elementsSelectable",x,ne.setState),ki("elevateNodesOnSelect",m,ne.setState),ki("snapToGrid",k,ne.setState),ki("snapGrid",E,ne.setState),ki("onNodesChange",v,ne.setState),ki("onEdgesChange",w,ne.setState),ki("connectOnClick",I,ne.setState),ki("fitViewOnInit",A,ne.setState),ki("fitViewOnInitOptions",N,ne.setState),ki("onNodesDelete",R,ne.setState),ki("onEdgesDelete",O,ne.setState),ki("onNodeDrag",T,ne.setState),ki("onNodeDragStart",M,ne.setState),ki("onNodeDragStop",P,ne.setState),ki("onSelectionDrag",D,ne.setState),ki("onSelectionDragStart",B,ne.setState),ki("onSelectionDragStop",j,ne.setState),ki("noPanClassName",F,ne.setState),ki("nodeOrigin",L,ne.setState),ki("rfId",V,ne.setState),ki("autoPanOnConnect",z,ne.setState),ki("autoPanOnNodeDrag",G,ne.setState),ki("onError",H,ne.setState),ki("connectionRadius",W,ne.setState),ki("isValidConnection",X,ne.setState),ki("nodeDragThreshold",$,ne.setState),Ei(t,Y),Ei(n,U),Ei(g,K),Ei(y,Q),Ei(S,q),Ei(b,ee),null},Ii={display:"none"},_i={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ai="react-flow__node-desc",Ni="react-flow__edge-desc",Ri=e=>e.ariaLiveMessage;function Oi({rfId:t}){const n=Hr(Ri);return e.createElement("div",{id:`react-flow__aria-live-${t}`,"aria-live":"assertive","aria-atomic":"true",style:_i},n)}function Ti({rfId:t,disableKeyboardA11y:n}){return e.createElement(e.Fragment,null,e.createElement("div",{id:`${Ai}-${t}`,style:Ii},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),e.createElement("div",{id:`${Ni}-${t}`,style:Ii},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&e.createElement(Oi,{rfId:t}))}var Mi=(t=null,n={actInsideInputWithModifier:!0})=>{const[r,o]=e.useState(!1),i=e.useRef(!1),a=e.useRef(new Set([])),[s,l]=e.useMemo((()=>{if(null!==t){const e=(Array.isArray(t)?t:[t]).filter((e=>"string"==typeof e)).map((e=>e.split("+"))),n=e.reduce(((e,t)=>e.concat(...t)),[]);return[e,n]}return[[],[]]}),[t]);return e.useEffect((()=>{const e="undefined"!=typeof document?document:null,r=n?.target||e;if(null!==t){const e=e=>{i.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!i.current||i.current&&!n.actInsideInputWithModifier)&&uo(e))return!1;const t=Di(e.code,l);a.current.add(e[t]),Pi(s,a.current,!1)&&(e.preventDefault(),o(!0))},t=e=>{if((!i.current||i.current&&!n.actInsideInputWithModifier)&&uo(e))return!1;const t=Di(e.code,l);Pi(s,a.current,!0)?(o(!1),a.current.clear()):a.current.delete(e[t]),"Meta"===e.key&&a.current.clear(),i.current=!1},c=()=>{a.current.clear(),o(!1)};return r?.addEventListener("keydown",e),r?.addEventListener("keyup",t),window.addEventListener("blur",c),()=>{r?.removeEventListener("keydown",e),r?.removeEventListener("keyup",t),window.removeEventListener("blur",c)}}}),[t,o]),r};function Pi(e,t,n){return e.filter((e=>n||e.length===t.size)).some((e=>e.every((e=>t.has(e)))))}function Di(e,t){return t.includes(e)?"code":"key"}function Bi(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const i=t.get(o),a=Xo(i,r);return Bi(i,t,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[so]?.z??0)>(n.z??0)?i[so]?.z??0:n.z??0},r)}function ji(e,t,n){e.forEach((r=>{const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){const{x:o,y:i,z:a}=Bi(r,e,{...r.position,z:r[so]?.z??0},t);r.positionAbsolute={x:o,y:i},r[so].z=a,n?.[r.id]&&(r[so].isParent=!0)}}))}function Fi(e,t,n,r){const o=new Map,i={},a=r?1e3:0;return e.forEach((e=>{const n=(ao(e.zIndex)?e.zIndex:0)+(e.selected?a:0),r=t.get(e.id),s={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},l=e.parentNode||e.parentId;l&&(i[l]=!0);const c=r?.type&&r?.type!==e.type;Object.defineProperty(s,so,{enumerable:!1,value:{handleBounds:c?void 0:r?.[so]?.handleBounds,z:n}}),o.set(e.id,s)})),ji(o,n,i),o}function Li(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:a,d3Zoom:s,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),p=t.initial&&!c&&u;if(s&&l&&(p||!t.initial)){const e=n().filter((e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some((t=>t.id===e.id)):n})),c=e.every((e=>e.width&&e.height));if(e.length>0&&c){const n=Zo(e,d),{x:c,y:u,zoom:p}=Uo(n,r,o,t.minZoom??i,t.maxZoom??a,t.padding??.1),f=wr.translate(c,u).scale(p);return"number"==typeof t.duration&&t.duration>0?s.transform(Jo(l,t.duration),f):s.transform(l,f),!0}}return!1}function Vi(e,t){return e.forEach((e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[so]:n[so],selected:e.selected})})),new Map(t)}function zi(e,t){return t.map((t=>{const n=e.find((e=>e.id===t.id));return n&&(t.selected=n.selected),t}))}function Gi({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:a,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&r({nodeInternals:Vi(e,o)}),a?.(e)),t?.length&&(c&&r({edges:zi(t,i)}),s?.(t))}const Hi=()=>{},Wi={zoomIn:Hi,zoomOut:Hi,zoomTo:Hi,getZoom:()=>1,setViewport:Hi,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Hi,fitBounds:Hi,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Xi=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function Zi(){const t=(()=>{const t=Wr(),{d3Zoom:n,d3Selection:r}=Hr(Xi,Z),o=e.useMemo((()=>r&&n?{zoomIn:e=>n.scaleBy(Jo(r,e?.duration),1.2),zoomOut:e=>n.scaleBy(Jo(r,e?.duration),1/1.2),zoomTo:(e,t)=>n.scaleTo(Jo(r,t?.duration),e),getZoom:()=>t.getState().transform[2],setViewport:(e,o)=>{const[i,a,s]=t.getState().transform,l=wr.translate(e.x??i,e.y??a).scale(e.zoom??s);n.transform(Jo(r,o?.duration),l)},getViewport:()=>{const[e,n,r]=t.getState().transform;return{x:e,y:n,zoom:r}},fitView:e=>Li(t.getState,e),setCenter:(e,o,i)=>{const{width:a,height:s,maxZoom:l}=t.getState(),c=void 0!==i?.zoom?i.zoom:l,u=a/2-e*c,d=s/2-o*c,p=wr.translate(u,d).scale(c);n.transform(Jo(r,i?.duration),p)},fitBounds:(e,o)=>{const{width:i,height:a,minZoom:s,maxZoom:l}=t.getState(),{x:c,y:u,zoom:d}=Uo(e,i,a,s,l,o?.padding??.1),p=wr.translate(c,u).scale(d);n.transform(Jo(r,o?.duration),p)},project:e=>{const{transform:n,snapToGrid:r,snapGrid:o}=t.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Ho(e,n,r,o)},screenToFlowPosition:e=>{const{transform:n,snapToGrid:r,snapGrid:o,domNode:i}=t.getState();if(!i)return e;const{x:a,y:s}=i.getBoundingClientRect(),l={x:e.x-a,y:e.y-s};return Ho(l,n,r,o)},flowToScreenPosition:e=>{const{transform:n,domNode:r}=t.getState();if(!r)return e;const{x:o,y:i}=r.getBoundingClientRect(),a=Wo(e,n);return{x:a.x+o,y:a.y+i}},viewportInitialized:!0}:Wi),[n,r]);return o})(),n=Wr(),r=e.useCallback((()=>n.getState().getNodes().map((e=>({...e})))),[]),o=e.useCallback((e=>n.getState().nodeInternals.get(e)),[]),i=e.useCallback((()=>{const{edges:e=[]}=n.getState();return e.map((e=>({...e})))}),[]),a=e.useCallback((e=>{const{edges:t=[]}=n.getState();return t.find((t=>t.id===e))}),[]),s=e.useCallback((e=>{const{getNodes:t,setNodes:r,hasDefaultNodes:o,onNodesChange:i}=n.getState(),a=t(),s="function"==typeof e?e(a):e;if(o)r(s);else if(i){const e=0===s.length?a.map((e=>({type:"remove",id:e.id}))):s.map((e=>({item:e,type:"reset"})));i(e)}}),[]),l=e.useCallback((e=>{const{edges:t=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:i}=n.getState(),a="function"==typeof e?e(t):e;if(o)r(a);else if(i){i(0===a.length?t.map((e=>({type:"remove",id:e.id}))):a.map((e=>({item:e,type:"reset"}))))}}),[]),c=e.useCallback((e=>{const t=Array.isArray(e)?e:[e],{getNodes:r,setNodes:o,hasDefaultNodes:i,onNodesChange:a}=n.getState();if(i){o([...r(),...t])}else if(a){const e=t.map((e=>({item:e,type:"add"})));a(e)}}),[]),u=e.useCallback((e=>{const t=Array.isArray(e)?e:[e],{edges:r=[],setEdges:o,hasDefaultEdges:i,onEdgesChange:a}=n.getState();if(i)o([...r,...t]);else if(a){a(t.map((e=>({item:e,type:"add"}))))}}),[]),d=e.useCallback((()=>{const{getNodes:e,edges:t=[],transform:r}=n.getState(),[o,i,a]=r;return{nodes:e().map((e=>({...e}))),edges:t.map((e=>({...e}))),viewport:{x:o,y:i,zoom:a}}}),[]),p=e.useCallback((({nodes:e,edges:t})=>{const{nodeInternals:r,getNodes:o,edges:i,hasDefaultNodes:a,hasDefaultEdges:s,onNodesDelete:l,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=n.getState(),p=(e||[]).map((e=>e.id)),f=(t||[]).map((e=>e.id)),h=o().reduce(((e,t)=>{const n=t.parentNode||t.parentId,r=!p.includes(t.id)&&n&&e.find((e=>e.id===n));return("boolean"!=typeof t.deletable||t.deletable)&&(p.includes(t.id)||r)&&e.push(t),e}),[]),m=i.filter((e=>"boolean"!=typeof e.deletable||e.deletable)),g=m.filter((e=>f.includes(e.id)));if(h||g){const e=Yo(h,m),t=[...g,...e],o=t.reduce(((e,t)=>(e.includes(t.id)||e.push(t.id),e)),[]);if((s||a)&&(s&&n.setState({edges:i.filter((e=>!o.includes(e.id)))}),a&&(h.forEach((e=>{r.delete(e.id)})),n.setState({nodeInternals:new Map(r)}))),o.length>0&&(c?.(t),d&&d(o.map((e=>({id:e,type:"remove"}))))),h.length>0&&(l?.(h),u)){u(h.map((e=>({id:e.id,type:"remove"}))))}}}),[]),f=e.useCallback((e=>{const t=ao((r=e).width)&&ao(r.height)&&ao(r.x)&&ao(r.y);var r;const o=t?null:n.getState().nodeInternals.get(e.id);if(!t&&!o)return[null,null,t];return[t?e:oo(o),o,t]}),[]),h=e.useCallback(((e,t=!0,r)=>{const[o,i,a]=f(e);return o?(r||n.getState().getNodes()).filter((e=>{if(!(a||e.id!==i.id&&e.positionAbsolute))return!1;const n=oo(e),r=io(n,o);return t&&r>0||r>=o.width*o.height})):[]}),[]),m=e.useCallback(((e,t,n=!0)=>{const[r]=f(e);if(!r)return!1;const o=io(r,t);return n&&o>0||o>=r.width*r.height}),[]);return e.useMemo((()=>({...t,getNodes:r,getNode:o,getEdges:i,getEdge:a,setNodes:s,setEdges:l,addNodes:c,addEdges:u,toObject:d,deleteElements:p,getIntersectingNodes:h,isNodeIntersecting:m})),[t,r,o,i,a,s,l,c,u,d,p,h,m])}const $i={actInsideInputWithModifier:!1};const Yi={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ui=e=>({x:e.x,y:e.y,zoom:e.k}),Ji=(e,t)=>e.target.closest(`.${t}`),Ki=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Qi=e=>{const t=e.ctrlKey&&ho()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},qi=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),ea=({onMove:t,onMoveStart:n,onMoveEnd:r,onPaneContextMenu:o,zoomOnScroll:i=!0,zoomOnPinch:a=!0,panOnScroll:s=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=wo.Free,zoomOnDoubleClick:u=!0,elementsSelectable:d,panOnDrag:p=!0,defaultViewport:f,translateExtent:h,minZoom:m,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:b=!0,children:v,noWheelClassName:w,noPanClassName:x})=>{const C=e.useRef(),E=Wr(),k=e.useRef(!1),S=e.useRef(!1),I=e.useRef(null),_=e.useRef({x:0,y:0,zoom:0}),{d3Zoom:A,d3Selection:N,d3ZoomHandler:R,userSelectionActive:O}=Hr(qi,Z),T=Mi(y),M=e.useRef(0),P=e.useRef(!1),D=e.useRef();return function(t){const n=Wr();e.useEffect((()=>{let e;const r=()=>{if(!t.current)return;const e=Ur(t.current);0!==e.height&&0!==e.width||n.getState().onError?.("004",Pr()),n.setState({width:e.width||500,height:e.height||500})};return r(),window.addEventListener("resize",r),t.current&&(e=new ResizeObserver((()=>r())),e.observe(t.current)),()=>{window.removeEventListener("resize",r),e&&t.current&&e.unobserve(t.current)}}),[])}(I),e.useEffect((()=>{if(I.current){const e=I.current.getBoundingClientRect(),t=Nr().scaleExtent([m,g]).translateExtent(h),n=ut(I.current).call(t),r=wr.translate(f.x,f.y).scale(Jr(f.zoom,m,g)),o=[[0,0],[e.width,e.height]],i=t.constrain()(r,o,h);t.transform(n,i),t.wheelDelta(Qi),E.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[i.x,i.y,i.k],domNode:I.current.closest(".react-flow")})}}),[]),e.useEffect((()=>{N&&A&&(!s||T||O?void 0!==R&&N.on("wheel.zoom",(function(e,t){if(!b&&"wheel"===e.type&&!e.ctrlKey||Ji(e,w))return null;e.preventDefault(),R.call(this,e,t)}),{passive:!1}):N.on("wheel.zoom",(e=>{if(Ji(e,w))return!1;e.preventDefault(),e.stopImmediatePropagation();const o=N.property("__zoom").k||1;if(e.ctrlKey&&a){const t=dt(e),n=Qi(e),r=o*Math.pow(2,n);return void A.scaleTo(N,r,t,e)}const i=1===e.deltaMode?20:1;let s=c===wo.Vertical?0:e.deltaX*i,u=c===wo.Horizontal?0:e.deltaY*i;!ho()&&e.shiftKey&&c!==wo.Vertical&&(s=e.deltaY*i,u=0),A.translateBy(N,-s/o*l,-u/o*l,{internal:!0});const d=Ui(N.property("__zoom")),{onViewportChangeStart:p,onViewportChange:f,onViewportChangeEnd:h}=E.getState();clearTimeout(D.current),P.current||(P.current=!0,n?.(e,d),p?.(d)),P.current&&(t?.(e,d),f?.(d),D.current=setTimeout((()=>{r?.(e,d),h?.(d),P.current=!1}),150))}),{passive:!1}))}),[O,s,c,N,A,R,T,a,b,w,n,t,r]),e.useEffect((()=>{A&&A.on("start",(e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;M.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=E.getState(),r=Ui(e.transform);k.current=!0,_.current=r,"mousedown"===e.sourceEvent?.type&&E.setState({paneDragging:!0}),t?.(r),n?.(e.sourceEvent,r)}))}),[A,n]),e.useEffect((()=>{A&&(O&&!k.current?A.on("zoom",null):O||A.on("zoom",(e=>{const{onViewportChange:n}=E.getState();if(E.setState({transform:[e.transform.x,e.transform.y,e.transform.k]}),S.current=!(!o||!Ki(p,M.current??0)),(t||n)&&!e.sourceEvent?.internal){const r=Ui(e.transform);n?.(r),t?.(e.sourceEvent,r)}})))}),[O,A,t,p,o]),e.useEffect((()=>{A&&A.on("end",(e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=E.getState();if(k.current=!1,E.setState({paneDragging:!1}),o&&Ki(p,M.current??0)&&!S.current&&o(e.sourceEvent),S.current=!1,(r||t)&&(n=_.current,i=e.transform,n.x!==i.x||n.y!==i.y||n.zoom!==i.k)){const n=Ui(e.transform);_.current=n,clearTimeout(C.current),C.current=setTimeout((()=>{t?.(n),r?.(e.sourceEvent,n)}),s?150:0)}var n,i}))}),[A,s,p,r,o]),e.useEffect((()=>{A&&A.filter((e=>{const t=T||i,n=a&&e.ctrlKey;if((!0===p||Array.isArray(p)&&p.includes(1))&&1===e.button&&"mousedown"===e.type&&(Ji(e,"react-flow__node")||Ji(e,"react-flow__edge")))return!0;if(!(p||t||s||u||a))return!1;if(O)return!1;if(!u&&"dblclick"===e.type)return!1;if(Ji(e,w)&&"wheel"===e.type)return!1;if(Ji(e,x)&&("wheel"!==e.type||s&&"wheel"===e.type&&!T))return!1;if(!a&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!s&&!n&&"wheel"===e.type)return!1;if(!p&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(p)&&!p.includes(e.button)&&"mousedown"===e.type)return!1;const r=Array.isArray(p)&&p.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r}))}),[O,A,i,a,s,u,p,d,T]),e.createElement("div",{className:"react-flow__renderer",ref:I,style:Yi},v)},ta=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function na(){const{userSelectionActive:t,userSelectionRect:n}=Hr(ta,Z);return t&&n?e.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function ra(e,t){const n=t.parentNode||t.parentId,r=e.find((e=>e.id===n));if(r){const e=t.position.x+t.width-r.width,n=t.position.y+t.height-r.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(r.style={...r.style}||{},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,e>0&&(r.style.width+=e),n>0&&(r.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);r.position.x=r.position.x-e,r.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);r.position.y=r.position.y-e,r.style.height+=e,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function oa(e,t){if(e.some((e=>"reset"===e.type)))return e.filter((e=>"reset"===e.type)).map((e=>e.item));const n=e.filter((e=>"add"===e.type)).map((e=>e.item));return t.reduce(((t,n)=>{const r=e.filter((e=>e.id===n.id));if(0===r.length)return t.push(n),t;const o={...n};for(const e of r)if(e)switch(e.type){case"select":o.selected=e.selected;break;case"position":void 0!==e.position&&(o.position=e.position),void 0!==e.positionAbsolute&&(o.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(o.dragging=e.dragging),o.expandParent&&ra(t,o);break;case"dimensions":void 0!==e.dimensions&&(o.width=e.dimensions.width,o.height=e.dimensions.height),void 0!==e.updateStyle&&(o.style={...o.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(o.resizing=e.resizing),o.expandParent&&ra(t,o);break;case"remove":return t}return t.push(o),t}),n)}function ia(e,t){return oa(e,t)}function aa(e,t){return oa(e,t)}const sa=(e,t)=>({id:e,type:"select",selected:t});function la(e,t){return e.reduce(((e,n)=>{const r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(sa(n.id,!0))):n.selected&&!r&&(n.selected=!1,e.push(sa(n.id,!1))),e}),[])}const ca=(e,t)=>n=>{n.target===t.current&&e?.(n)},ua=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),da=e.memo((({isSelecting:t,selectionMode:n=xo.Full,panOnDrag:r,onSelectionStart:o,onSelectionEnd:i,onPaneClick:a,onPaneContextMenu:s,onPaneScroll:l,onPaneMouseEnter:c,onPaneMouseMove:u,onPaneMouseLeave:d,children:p})=>{const f=e.useRef(null),h=Wr(),m=e.useRef(0),g=e.useRef(0),y=e.useRef(),{userSelectionActive:b,elementsSelectable:v,dragging:w}=Hr(ua,Z),x=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),m.current=0,g.current=0},C=e=>{a?.(e),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},E=l?e=>l(e):void 0,k=v&&(t||b);return e.createElement("div",{className:V(["react-flow__pane",{dragging:w,selection:t}]),onClick:k?void 0:ca(C,f),onContextMenu:ca((e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():s?.(e)}),f),onWheel:ca(E,f),onMouseEnter:k?void 0:c,onMouseDown:k?e=>{const{resetSelectedElements:n,domNode:r}=h.getState();if(y.current=r?.getBoundingClientRect(),!v||!t||0!==e.button||e.target!==f.current||!y.current)return;const{x:i,y:a}=fo(e,y.current);n(),h.setState({userSelectionRect:{width:0,height:0,startX:i,startY:a,x:i,y:a}}),o?.(e)}:void 0,onMouseMove:k?e=>{const{userSelectionRect:r,nodeInternals:o,edges:i,transform:a,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=h.getState();if(!t||!y.current||!r)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=fo(e,y.current),p=r.startX??0,f=r.startY??0,b={...r,x:d.x<p?d.x:p,y:d.y<f?d.y:f,width:Math.abs(d.x-p),height:Math.abs(d.y-f)},v=u(),w=$o(o,b,a,n===xo.Partial,!0,c),x=Yo(w,i).map((e=>e.id)),C=w.map((e=>e.id));if(m.current!==C.length){m.current=C.length;const e=la(v,C);e.length&&s?.(e)}if(g.current!==x.length){g.current=x.length;const e=la(i,x);e.length&&l?.(e)}h.setState({userSelectionRect:b})}:u,onMouseUp:k?e=>{if(0!==e.button)return;const{userSelectionRect:t}=h.getState();!b&&t&&e.target===f.current&&C?.(e),h.setState({nodesSelectionActive:m.current>0}),x(),i?.(e)}:void 0,onMouseLeave:k?e=>{b&&(h.setState({nodesSelectionActive:m.current>0}),i?.(e)),x()}:d,ref:f,style:Yi},p,e.createElement(na,null))}));function pa(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return!!r&&(!!r.selected||pa(r,t))}function fa(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function ha(e,t,n,r){return Array.from(e.values()).filter((n=>(n.selected||n.id===r)&&(!n.parentNode||n.parentId||!pa(n,e))&&(n.draggable||t&&void 0===n.draggable))).map((e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:n.x-(e.positionAbsolute?.x??0),y:n.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent})))}function ma(e,t,n,r,o=[0,0],i){const a=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||r);let s=a;const l=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&l&&"parent"!==e.extent){const t=n.get(l),{x:r,y:i}=Xo(t,o).positionAbsolute;s=[[e.extent[0][0]+r,e.extent[0][1]+i],[e.extent[1][0]+r,e.extent[1][1]+i]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:r,y:i}=Xo(t,o).positionAbsolute;s=t&&ao(r)&&ao(i)&&ao(t.width)&&ao(t.height)?[[r+e.width*o[0],i+e.height*o[1]],[r+t.width-e.width+e.width*o[0],i+t.height-e.height+e.height*o[1]]]:s}else i?.("005",Dr()),s=a;let c={x:0,y:0};if(l){const e=n.get(l);c=Xo(e,o).positionAbsolute}const u=s&&"parent"!==s?Kr(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function ga({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map((e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute})));return[e?r.find((t=>t.id===e)):r[0],r]}da.displayName="Pane";const ya=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),a=t.getBoundingClientRect(),s=a.width*r[0],l=a.height*r[1];return i.map((e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-a.left-s)/n,y:(t.top-a.top-l)/n,...Ur(e)}}))};function ba(e,t,n){return void 0===n?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function va({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame((()=>r?.current?.blur()))):o([e])):l?.("012",zr(e))}function wa(e){return(t,n,r)=>e?.(t,r)}function xa({nodeRef:t,disabled:n=!1,noDragClassName:r,handleSelector:o,nodeId:i,isSelectable:a,selectNodesOnDrag:s}){const l=Wr(),[c,u]=e.useState(!1),d=e.useRef([]),p=e.useRef({x:null,y:null}),f=e.useRef(0),h=e.useRef(null),m=e.useRef({x:0,y:0}),g=e.useRef(null),y=e.useRef(!1),b=e.useRef(!1),v=e.useRef(!1),w=function(){const t=Wr(),n=e.useCallback((({sourceEvent:e})=>{const{transform:n,snapGrid:r,snapToGrid:o}=t.getState(),i=e.touches?e.touches[0].clientX:e.clientX,a=e.touches?e.touches[0].clientY:e.clientY,s={x:(i-n[0])/n[2],y:(a-n[1])/n[2]};return{xSnapped:o?r[0]*Math.round(s.x/r[0]):s.x,ySnapped:o?r[1]*Math.round(s.y/r[1]):s.y,...s}}),[]);return n}();return e.useEffect((()=>{if(t?.current){const e=ut(t.current),c=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:r,onSelectionDrag:o,updateNodePositions:a,nodeExtent:s,snapGrid:c,snapToGrid:f,nodeOrigin:h,onError:m}=l.getState();p.current={x:e,y:t};let y=!1,b={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&s){const e=Zo(d.current,h);b=no(e)}if(d.current=d.current.map((r=>{const o={x:e-r.distance.x,y:t-r.distance.y};f&&(o.x=c[0]*Math.round(o.x/c[0]),o.y=c[1]*Math.round(o.y/c[1]));const i=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];d.current.length>1&&s&&!r.extent&&(i[0][0]=r.positionAbsolute.x-b.x+s[0][0],i[1][0]=r.positionAbsolute.x+(r.width??0)-b.x2+s[1][0],i[0][1]=r.positionAbsolute.y-b.y+s[0][1],i[1][1]=r.positionAbsolute.y+(r.height??0)-b.y2+s[1][1]);const a=ma(r,o,n,i,h,m);return y=y||r.position.x!==a.position.x||r.position.y!==a.position.y,r.position=a.position,r.positionAbsolute=a.positionAbsolute,r})),!y)return;a(d.current,!0,!0),u(!0);const v=i?r:wa(o);if(v&&g.current){const[e,t]=ga({nodeId:i,dragItems:d.current,nodeInternals:n});v(g.current,e,t)}},x=()=>{if(!h.current)return;const[e,t]=qr(m.current,h.current);if(0!==e||0!==t){const{transform:n,panBy:r}=l.getState();p.current.x=(p.current.x??0)-e/n[2],p.current.y=(p.current.y??0)-t/n[2],r({x:e,y:t})&&c(p.current)}f.current=requestAnimationFrame(x)},C=e=>{const{nodeInternals:n,multiSelectionActive:r,nodesDraggable:o,unselectNodesAndEdges:c,onNodeDragStart:u,onSelectionDragStart:f}=l.getState();b.current=!0;const h=i?u:wa(f);s&&a||r||!i||n.get(i)?.selected||c(),i&&a&&s&&va({id:i,store:l,nodeRef:t});const m=w(e);if(p.current=m,d.current=ha(n,o,m,i),h&&d.current){const[t,r]=ga({nodeId:i,dragItems:d.current,nodeInternals:n});h(e.sourceEvent,t,r)}};if(!n){const n=function(){var e,t,n,r,o=wt,i=xt,a=Ct,s=Et,l={},c=Y("start","drag","end"),u=0,d=0;function p(e){e.on("mousedown.drag",f).filter(s).on("touchstart.drag",g).on("touchmove.drag",y,pt).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(a,s){if(!r&&o.call(this,a,s)){var l=v(this,i.call(this,a,s),a,s,"mouse");l&&(ut(a.view).on("mousemove.drag",h,ft).on("mouseup.drag",m,ft),gt(a.view),ht(a),n=!1,e=a.clientX,t=a.clientY,l("start",a))}}function h(r){if(mt(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>d}l.mouse("drag",r)}function m(e){ut(e.view).on("mousemove.drag mouseup.drag",null),yt(e.view,n),mt(e),l.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,s=i.call(this,e,t),l=a.length;for(n=0;n<l;++n)(r=v(this,s,e,t,a[n].identifier,a[n]))&&(ht(e),r("start",e,a[n]))}}function y(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=l[r[t].identifier])&&(mt(e),n("drag",e,r[t]))}function b(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(n=l[o[t].identifier])&&(ht(e),n("end",e,o[t]))}function v(e,t,n,r,o,i){var s,d,f,h=c.copy(),m=dt(i||n,t);if(null!=(f=a.call(e,new vt("beforestart",{sourceEvent:n,target:p,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return s=f.x-m[0]||0,d=f.y-m[1]||0,function n(i,a,c){var g,y=m;switch(i){case"start":l[o]=n,g=u++;break;case"end":delete l[o],--u;case"drag":m=dt(c||a,t),g=u}h.call(i,e,new vt(i,{sourceEvent:a,subject:f,target:p,identifier:o,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),r)}}return p.filter=function(e){return arguments.length?(o="function"==typeof e?e:bt(!!e),p):o},p.container=function(e){return arguments.length?(i="function"==typeof e?e:bt(e),p):i},p.subject=function(e){return arguments.length?(a="function"==typeof e?e:bt(e),p):a},p.touchable=function(e){return arguments.length?(s="function"==typeof e?e:bt(!!e),p):s},p.on=function(){var e=c.on.apply(c,arguments);return e===c?p:e},p.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,p):Math.sqrt(d)},p}().on("start",(e=>{const{domNode:t,nodeDragThreshold:n}=l.getState();0===n&&C(e),v.current=!1;const r=w(e);p.current=r,h.current=t?.getBoundingClientRect()||null,m.current=fo(e.sourceEvent,h.current)})).on("drag",(e=>{const t=w(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=l.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(v.current=!0),!v.current){if(!y.current&&b.current&&n&&(y.current=!0,x()),!b.current){const n=t.xSnapped-(p?.current?.x??0),o=t.ySnapped-(p?.current?.y??0);Math.sqrt(n*n+o*o)>r&&C(e)}(p.current.x!==t.xSnapped||p.current.y!==t.ySnapped)&&d.current&&b.current&&(g.current=e.sourceEvent,m.current=fo(e.sourceEvent,h.current),c(t))}})).on("end",(e=>{if(b.current&&!v.current&&(u(!1),y.current=!1,b.current=!1,cancelAnimationFrame(f.current),d.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:r,onSelectionDragStop:o}=l.getState(),a=i?r:wa(o);if(t(d.current,!1,!1),a){const[t,r]=ga({nodeId:i,dragItems:d.current,nodeInternals:n});a(e.sourceEvent,t,r)}}})).filter((e=>{const n=e.target;return!e.button&&(!r||!fa(n,`.${r}`,t))&&(!o||fa(n,o,t))}));return e.call(n),()=>{e.on(".drag",null)}}e.on(".drag",null)}}),[t,n,r,o,a,l,i,s,w]),c}function Ca(){const t=Wr(),n=e.useCallback((e=>{const{nodeInternals:n,nodeExtent:r,updateNodePositions:o,getNodes:i,snapToGrid:a,snapGrid:s,onError:l,nodesDraggable:c}=t.getState(),u=i().filter((e=>e.selected&&(e.draggable||c&&void 0===e.draggable))),d=a?s[0]:5,p=a?s[1]:5,f=e.isShiftPressed?4:1,h=e.x*d*f,m=e.y*p*f,g=u.map((e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};a&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:o,position:i}=ma(e,t,n,r,void 0,l);e.position=i,e.positionAbsolute=o}return e}));o(g,!0,!1)}),[]);return n}const Ea={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ka=t=>{const n=({id:n,type:r,data:o,xPos:i,yPos:a,xPosOrigin:s,yPosOrigin:l,selected:c,onClick:u,onMouseEnter:d,onMouseMove:p,onMouseLeave:f,onContextMenu:h,onDoubleClick:m,style:g,className:y,isDraggable:b,isSelectable:v,isConnectable:w,isFocusable:x,selectNodesOnDrag:C,sourcePosition:E,targetPosition:k,hidden:S,resizeObserver:I,dragHandle:_,zIndex:A,isParent:N,noDragClassName:R,noPanClassName:O,initialized:T,disableKeyboardA11y:M,ariaLabel:P,rfId:D,hasHandleBounds:B})=>{const j=Wr(),F=e.useRef(null),L=e.useRef(null),z=e.useRef(E),G=e.useRef(k),H=e.useRef(r),W=v||b||u||d||p||f,X=Ca(),Z=ba(n,j.getState,d),$=ba(n,j.getState,p),Y=ba(n,j.getState,f),U=ba(n,j.getState,h),J=ba(n,j.getState,m);e.useEffect((()=>()=>{L.current&&(I?.unobserve(L.current),L.current=null)}),[]),e.useEffect((()=>{if(F.current&&!S){const e=F.current;T&&B&&L.current===e||(L.current&&I?.unobserve(L.current),I?.observe(e),L.current=e)}}),[S,T,B]),e.useEffect((()=>{const e=H.current!==r,t=z.current!==E,o=G.current!==k;F.current&&(e||t||o)&&(e&&(H.current=r),t&&(z.current=E),o&&(G.current=k),j.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))}),[n,r,E,k]);const K=xa({nodeRef:F,disabled:S||!b,noDragClassName:R,handleSelector:_,nodeId:n,isSelectable:v,selectNodesOnDrag:C});return S?null:e.createElement("div",{className:V(["react-flow__node",`react-flow__node-${r}`,{[O]:b},y,{selected:c,selectable:v,parent:N,dragging:K}]),ref:F,style:{zIndex:A,transform:`translate(${s}px,${l}px)`,pointerEvents:W?"all":"none",visibility:T?"visible":"hidden",...g},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:Z,onMouseMove:$,onMouseLeave:Y,onContextMenu:U,onClick:e=>{const{nodeDragThreshold:t}=j.getState();if(v&&(!C||!b||t>0)&&va({id:n,store:j,nodeRef:F}),u){const t=j.getState().nodeInternals.get(n);t&&u(e,{...t})}},onDoubleClick:J,onKeyDown:x?e=>{if(!uo(e)&&!M)if(lo.includes(e.key)&&v){const t="Escape"===e.key;va({id:n,store:j,unselect:t,nodeRef:F})}else b&&c&&Object.prototype.hasOwnProperty.call(Ea,e.key)&&(j.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~a}`}),X({x:Ea[e.key].x,y:Ea[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:x?0:void 0,role:x?"button":void 0,"aria-describedby":M?void 0:`${Ai}-${D}`,"aria-label":P},e.createElement(Vo,{value:n},e.createElement(t,{id:n,data:o,type:r,xPos:i,yPos:a,selected:c,isConnectable:w,sourcePosition:E,targetPosition:k,dragging:K,dragHandle:_,zIndex:A})))};return n.displayName="NodeWrapper",e.memo(n)};const Sa=e=>{const t=e.getNodes().filter((e=>e.selected));return{...Zo(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var Ia=e.memo((function({onSelectionContextMenu:t,noPanClassName:n,disableKeyboardA11y:r}){const o=Wr(),{width:i,height:a,x:s,y:l,transformString:c,userSelectionActive:u}=Hr(Sa,Z),d=Ca(),p=e.useRef(null);if(e.useEffect((()=>{r||p.current?.focus({preventScroll:!0})}),[r]),xa({nodeRef:p}),u||!i||!a)return null;const f=t?e=>{const n=o.getState().getNodes().filter((e=>e.selected));t(e,n)}:void 0;return e.createElement("div",{className:V(["react-flow__nodesselection","react-flow__container",n]),style:{transform:c}},e.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:r?void 0:-1,onKeyDown:r?void 0:e=>{Object.prototype.hasOwnProperty.call(Ea,e.key)&&d({x:Ea[e.key].x,y:Ea[e.key].y,isShiftPressed:e.shiftKey})},style:{width:i,height:a,top:l,left:s}}))}));const _a=e=>e.nodesSelectionActive,Aa=({children:t,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:s,deleteKeyCode:l,onMove:c,onMoveStart:u,onMoveEnd:d,selectionKeyCode:p,selectionOnDrag:f,selectionMode:h,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:C,panOnScroll:E,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:I,panOnDrag:_,defaultViewport:A,translateExtent:N,minZoom:R,maxZoom:O,preventScrolling:T,onSelectionContextMenu:M,noWheelClassName:P,noPanClassName:D,disableKeyboardA11y:B})=>{const j=Hr(_a),F=Mi(p),L=Mi(b),V=L||_,z=L||E,G=F||f&&!0!==V;return(({deleteKeyCode:t,multiSelectionKeyCode:n})=>{const r=Wr(),{deleteElements:o}=Zi(),i=Mi(t,$i),a=Mi(n);e.useEffect((()=>{if(i){const{edges:e,getNodes:t}=r.getState(),n=t().filter((e=>e.selected)),i=e.filter((e=>e.selected));o({nodes:n,edges:i}),r.setState({nodesSelectionActive:!1})}}),[i]),e.useEffect((()=>{r.setState({multiSelectionActive:a})}),[a])})({deleteKeyCode:l,multiSelectionKeyCode:y}),e.createElement(ea,{onMove:c,onMoveStart:u,onMoveEnd:d,onPaneContextMenu:a,elementsSelectable:w,zoomOnScroll:x,zoomOnPinch:C,panOnScroll:z,panOnScrollSpeed:k,panOnScrollMode:S,zoomOnDoubleClick:I,panOnDrag:!F&&V,defaultViewport:A,translateExtent:N,minZoom:R,maxZoom:O,zoomActivationKeyCode:v,preventScrolling:T,noWheelClassName:P,noPanClassName:D},e.createElement(da,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:s,panOnDrag:V,isSelecting:!!G,selectionMode:h},t,j&&e.createElement(Ia,{onSelectionContextMenu:M,noPanClassName:D,disableKeyboardA11y:B})))};Aa.displayName="FlowRenderer";var Na=e.memo(Aa);function Ra(e){return{...{input:ka(e.input||pi),default:ka(e.default||ui),output:ka(e.output||hi),group:ka(e.group||mi)},...Object.keys(e).filter((e=>!["input","default","output","group"].includes(e))).reduce(((t,n)=>(t[n]=ka(e[n]||ui),t)),{})}}const Oa=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Ta=t=>{const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:o,elementsSelectable:i,updateNodeDimensions:a,onError:s}=Hr(Oa,Z),l=(c=t.onlyRenderVisibleElements,Hr(e.useCallback((e=>c?$o(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes()),[c])));var c;const u=e.useRef(),d=e.useMemo((()=>{if("undefined"==typeof ResizeObserver)return null;const e=new ResizeObserver((e=>{const t=e.map((e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0})));a(t)}));return u.current=e,e}),[]);return e.useEffect((()=>()=>{u?.current?.disconnect()}),[]),e.createElement("div",{className:"react-flow__nodes",style:Yi},l.map((a=>{let l=a.type||"default";t.nodeTypes[l]||(s?.("003",Mr(l)),l="default");const c=t.nodeTypes[l]||t.nodeTypes.default,u=!!(a.draggable||n&&void 0===a.draggable),p=!!(a.selectable||i&&void 0===a.selectable),f=!!(a.connectable||r&&void 0===a.connectable),h=!!(a.focusable||o&&void 0===a.focusable),m=t.nodeExtent?Kr(a.positionAbsolute,t.nodeExtent):a.positionAbsolute,g=m?.x??0,y=m?.y??0,b=(({x:e,y:t,width:n,height:r,origin:o})=>n&&r?o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]}:{x:e,y:t})({x:g,y:y,width:a.width??0,height:a.height??0,origin:t.nodeOrigin});return e.createElement(c,{key:a.id,id:a.id,className:a.className,style:a.style,type:l,data:a.data,sourcePosition:a.sourcePosition||ko.Bottom,targetPosition:a.targetPosition||ko.Top,hidden:a.hidden,xPos:g,yPos:y,xPosOrigin:b.x,yPosOrigin:b.y,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!a.selected,isDraggable:u,isSelectable:p,isConnectable:f,isFocusable:h,resizeObserver:d,dragHandle:a.dragHandle,zIndex:a[so]?.z??0,isParent:!!a[so]?.isParent,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!a.width&&!!a.height,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,ariaLabel:a.ariaLabel,hasHandleBounds:!!a[so]?.handleBounds})})))};Ta.displayName="NodeRenderer";var Ma=e.memo(Ta);const Pa=(e,t,n)=>n===ko.Left?e-t:n===ko.Right?e+t:e,Da=(e,t,n)=>n===ko.Top?e-t:n===ko.Bottom?e+t:e,Ba="react-flow__edgeupdater",ja=({position:t,centerX:n,centerY:r,radius:o=10,onMouseDown:i,onMouseEnter:a,onMouseOut:s,type:l})=>e.createElement("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:s,className:V([Ba,`${Ba}-${l}`]),cx:Pa(n,o,t),cy:Da(r,o,t),r:o,stroke:"transparent",fill:"transparent"}),Fa=()=>!0;var La=t=>{const n=({id:n,className:r,type:o,data:i,onClick:a,onEdgeDoubleClick:s,selected:l,animated:c,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:g,source:y,target:b,sourceX:v,sourceY:w,targetX:x,targetY:C,sourcePosition:E,targetPosition:k,elementsSelectable:S,hidden:I,sourceHandleId:_,targetHandleId:A,onContextMenu:N,onMouseEnter:R,onMouseMove:O,onMouseLeave:T,reconnectRadius:M,onReconnect:P,onReconnectStart:D,onReconnectEnd:B,markerEnd:j,markerStart:F,rfId:L,ariaLabel:z,isFocusable:G,isReconnectable:H,pathOptions:W,interactionWidth:X,disableKeyboardA11y:Z})=>{const $=e.useRef(null),[Y,U]=e.useState(!1),[J,K]=e.useState(!1),Q=Wr(),q=e.useMemo((()=>`url('#${Go(F,L)}')`),[F,L]),ee=e.useMemo((()=>`url('#${Go(j,L)}')`),[j,L]);if(I)return null;const te=go(n,Q.getState,s),ne=go(n,Q.getState,N),re=go(n,Q.getState,R),oe=go(n,Q.getState,O),ie=go(n,Q.getState,T),ae=(e,t)=>{if(0!==e.button)return;const{edges:r,isValidConnection:o}=Q.getState(),i=t?b:y,a=(t?A:_)||null,s=t?"target":"source",l=o||Fa,c=t,u=r.find((e=>e.id===n));K(!0),D?.(e,u,s);oi({event:e,handleId:a,nodeId:i,onConnect:e=>P?.(u,e),isTarget:c,getState:Q.getState,setState:Q.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{K(!1),B?.(e,u,s)}})},se=()=>U(!0),le=()=>U(!1),ce=!S&&!a;return e.createElement("g",{className:V(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:l,animated:c,inactive:ce,updating:Y}]),onClick:e=>{const{edges:t,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:i}=Q.getState(),s=t.find((e=>e.id===n));s&&(S&&(Q.setState({nodesSelectionActive:!1}),s.selected&&i?(o({nodes:[],edges:[s]}),$.current?.blur()):r([n])),a&&a(e,s))},onDoubleClick:te,onContextMenu:ne,onMouseEnter:re,onMouseMove:oe,onMouseLeave:ie,onKeyDown:G?e=>{if(!Z&&lo.includes(e.key)&&S){const{unselectNodesAndEdges:t,addSelectedEdges:r,edges:o}=Q.getState();"Escape"===e.key?($.current?.blur(),t({edges:[o.find((e=>e.id===n))]})):r([n])}}:void 0,tabIndex:G?0:void 0,role:G?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===z?void 0:z||`Edge from ${y} to ${b}`,"aria-describedby":G?`${Ni}-${L}`:void 0,ref:$},!J&&e.createElement(t,{id:n,source:y,target:b,selected:l,animated:c,label:u,labelStyle:d,labelShowBg:p,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,data:i,style:g,sourceX:v,sourceY:w,targetX:x,targetY:C,sourcePosition:E,targetPosition:k,sourceHandleId:_,targetHandleId:A,markerStart:q,markerEnd:ee,pathOptions:W,interactionWidth:X}),H&&e.createElement(e.Fragment,null,("source"===H||!0===H)&&e.createElement(ja,{position:E,centerX:v,centerY:w,radius:M,onMouseDown:e=>ae(e,!0),onMouseEnter:se,onMouseOut:le,type:"source"}),("target"===H||!0===H)&&e.createElement(ja,{position:k,centerX:x,centerY:C,radius:M,onMouseDown:e=>ae(e,!1),onMouseEnter:se,onMouseOut:le,type:"target"})))};return n.displayName="EdgeWrapper",e.memo(n)};function Va(e){return{...{default:La(e.default||Fo),straight:La(e.bezier||Po),step:La(e.step||Mo),smoothstep:La(e.step||To),simplebezier:La(e.simplebezier||_o)},...Object.keys(e).filter((e=>!["default","bezier"].includes(e))).reduce(((t,n)=>(t[n]=La(e[n]||Fo),t)),{})}}function za(e,t,n=null){const r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,i=n?.width||t.width,a=n?.height||t.height;switch(e){case ko.Top:return{x:r+i/2,y:o};case ko.Right:return{x:r+i,y:o+a/2};case ko.Bottom:return{x:r+i/2,y:o+a};case ko.Left:return{x:r,y:o+a/2}}}function Ga(e,t){return e?1!==e.length&&t?t&&e.find((e=>e.id===t))||null:e[0]:null}function Ha(e){const t=e?.[so]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Wa=[{level:0,isMaxLevel:!0,edges:[]}];function Xa(t,n,r){const o=Hr(e.useCallback((e=>t?e.edges.filter((t=>{const r=n.get(t.source),o=n.get(t.target);return r?.width&&r?.height&&o?.width&&o?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:a,height:s,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=no({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:a/l[2],height:s/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),p=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*p)>0}({sourcePos:r.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:r.width,sourceHeight:r.height,targetWidth:o.width,targetHeight:o.height,width:e.width,height:e.height,transform:e.transform})})):e.edges),[t,n]));return function(e,t,n=!1){let r=-1;const o=e.reduce(((e,o)=>{const i=ao(o.zIndex);let a=i?o.zIndex:0;if(n){const e=t.get(o.target),n=t.get(o.source),r=o.selected||e?.selected||n?.selected,s=Math.max(n?.[so]?.z||0,e?.[so]?.z||0,1e3);a=(i?o.zIndex:0)+(r?s:0)}return e[a]?e[a].push(o):e[a]=[o],r=a>r?a:r,e}),{}),i=Object.entries(o).map((([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===r}}));return 0===i.length?Wa:i}(o,n,r)}const Za={[Eo.Arrow]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[Eo.ArrowClosed]:({color:t="none",strokeWidth:n=1})=>e.createElement("polyline",{style:{stroke:t,fill:t,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const $a=({id:t,type:n,color:r,width:o=12.5,height:i=12.5,markerUnits:a="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=function(t){const n=Wr();return e.useMemo((()=>Object.prototype.hasOwnProperty.call(Za,t)?Za[t]:(n.getState().onError?.("009",jr(t)),null)),[t])}(n);return c?e.createElement("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:l,refX:"0",refY:"0"},e.createElement(c,{color:r,strokeWidth:s})):null},Ya=({defaultColor:t,rfId:n})=>{const r=Hr(e.useCallback((({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce(((n,o)=>([o.markerStart,o.markerEnd].forEach((o=>{if(o&&"object"==typeof o){const i=Go(o,t);r.includes(i)||(n.push({id:i,color:o.color||e,...o}),r.push(i))}})),n)),[]).sort(((e,t)=>e.id.localeCompare(t.id)))})({defaultColor:t,rfId:n}),[t,n]),((e,t)=>!(e.length!==t.length||e.some(((e,n)=>e.id!==t[n].id)))));return e.createElement("defs",null,r.map((t=>e.createElement($a,{id:t.id,key:t.id,type:t.type,color:t.color,width:t.width,height:t.height,markerUnits:t.markerUnits,strokeWidth:t.strokeWidth,orient:t.orient}))))};Ya.displayName="MarkerDefinitions";var Ua=e.memo(Ya);const Ja=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Ka=({defaultMarkerColor:t,onlyRenderVisibleElements:n,elevateEdgesOnSelect:r,rfId:o,edgeTypes:i,noPanClassName:a,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:p,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,children:y,disableKeyboardA11y:b})=>{const{edgesFocusable:v,edgesUpdatable:w,elementsSelectable:x,width:C,height:E,connectionMode:k,nodeInternals:S,onError:I}=Hr(Ja,Z),_=Xa(n,S,r);return C?e.createElement(e.Fragment,null,_.map((({level:n,edges:r,isMaxLevel:y})=>e.createElement("svg",{key:n,style:{zIndex:n},width:C,height:E,className:"react-flow__edges react-flow__container"},y&&e.createElement(Ua,{defaultColor:t,rfId:o}),e.createElement("g",null,r.map((t=>{const[n,r,y]=Ha(S.get(t.source)),[C,E,_]=Ha(S.get(t.target));if(!y||!_)return null;let A=t.type||"default";i[A]||(I?.("011",Vr(A)),A="default");const N=i[A]||i.default,R=k===vo.Strict?E.target:(E.target??[]).concat(E.source??[]),O=Ga(r.source,t.sourceHandle),T=Ga(R,t.targetHandle),M=O?.position||ko.Bottom,P=T?.position||ko.Top,D=!!(t.focusable||v&&void 0===t.focusable),B=t.reconnectable||t.updatable,j=void 0!==f&&(B||w&&void 0===B);if(!O||!T)return I?.("008",Fr(O,t)),null;const{sourceX:F,sourceY:L,targetX:z,targetY:G}=((e,t,n,r,o,i)=>{const a=za(n,e,t),s=za(i,r,o);return{sourceX:a.x,sourceY:a.y,targetX:s.x,targetY:s.y}})(n,O,M,C,T,P);return e.createElement(N,{key:t.id,id:t.id,className:V([t.className,a]),type:A,data:t.data,selected:!!t.selected,animated:!!t.animated,hidden:!!t.hidden,label:t.label,labelStyle:t.labelStyle,labelShowBg:t.labelShowBg,labelBgStyle:t.labelBgStyle,labelBgPadding:t.labelBgPadding,labelBgBorderRadius:t.labelBgBorderRadius,style:t.style,source:t.source,target:t.target,sourceHandleId:t.sourceHandle,targetHandleId:t.targetHandle,markerEnd:t.markerEnd,markerStart:t.markerStart,sourceX:F,sourceY:L,targetX:z,targetY:G,sourcePosition:M,targetPosition:P,elementsSelectable:x,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:p,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,rfId:o,ariaLabel:t.ariaLabel,isFocusable:D,isReconnectable:j,pathOptions:"pathOptions"in t?t.pathOptions:void 0,interactionWidth:t.interactionWidth,disableKeyboardA11y:b})})))))),y):null};Ka.displayName="EdgeRenderer";var Qa=e.memo(Ka);const qa=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function es({children:t}){const n=Hr(qa);return e.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},t)}const ts={[ko.Left]:ko.Right,[ko.Right]:ko.Left,[ko.Top]:ko.Bottom,[ko.Bottom]:ko.Top},ns=({nodeId:t,handleType:n,style:r,type:o=Co.Bezier,CustomComponent:i,connectionStatus:a})=>{const{fromNode:s,handleId:l,toX:c,toY:u,connectionMode:d}=Hr(e.useCallback((e=>({fromNode:e.nodeInternals.get(t),handleId:e.connectionHandleId,toX:(e.connectionPosition.x-e.transform[0])/e.transform[2],toY:(e.connectionPosition.y-e.transform[1])/e.transform[2],connectionMode:e.connectionMode})),[t]),Z),p=s?.[so]?.handleBounds;let f=p?.[n];if(d===vo.Loose&&(f=f||p?.["source"===n?"target":"source"]),!s||!f)return null;const h=l?f.find((e=>e.id===l)):f[0],m=h?h.x+h.width/2:(s.width??0)/2,g=h?h.y+h.height/2:s.height??0,y=(s.positionAbsolute?.x??0)+m,b=(s.positionAbsolute?.y??0)+g,v=h?.position,w=v?ts[v]:null;if(!v||!w)return null;if(i)return e.createElement(i,{connectionLineType:o,connectionLineStyle:r,fromNode:s,fromHandle:h,fromX:y,fromY:b,toX:c,toY:u,fromPosition:v,toPosition:w,connectionStatus:a});let x="";const C={sourceX:y,sourceY:b,sourcePosition:v,targetX:c,targetY:u,targetPosition:w};return o===Co.Bezier?[x]=jo(C):o===Co.Step?[x]=Oo({...C,borderRadius:0}):o===Co.SmoothStep?[x]=Oo(C):o===Co.SimpleBezier?[x]=Io(C):x=`M${y},${b} ${c},${u}`,e.createElement("path",{d:x,fill:"none",className:"react-flow__connection-path",style:r})};ns.displayName="ConnectionLine";const rs=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function os({containerStyle:t,style:n,type:r,component:o}){const{nodeId:i,handleType:a,nodesConnectable:s,width:l,height:c,connectionStatus:u}=Hr(rs,Z);return!!(i&&a&&l&&s)?e.createElement("svg",{style:t,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},e.createElement("g",{className:V(["react-flow__connection",u])},e.createElement(ns,{nodeId:i,handleType:a,style:n,type:r,CustomComponent:o,connectionStatus:u}))):null}function is(t,n){const r=e.useRef(null),o=Wr();return e.useMemo((()=>{if("development"===process.env.NODE_ENV){const e=Object.keys(t);Z(r.current,e)&&o.getState().onError?.("002",Tr()),r.current=e}return n(t)}),[t])}const as=({nodeTypes:t,edgeTypes:n,onMove:r,onMoveStart:o,onMoveEnd:i,onInit:a,onNodeClick:s,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:p,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:m,onSelectionStart:g,onSelectionEnd:y,connectionLineType:b,connectionLineStyle:v,connectionLineComponent:w,connectionLineContainerStyle:x,selectionKeyCode:C,selectionOnDrag:E,selectionMode:k,multiSelectionKeyCode:S,panActivationKeyCode:I,zoomActivationKeyCode:_,deleteKeyCode:A,onlyRenderVisibleElements:N,elementsSelectable:R,selectNodesOnDrag:O,defaultViewport:T,translateExtent:M,minZoom:P,maxZoom:D,preventScrolling:B,defaultMarkerColor:j,zoomOnScroll:F,zoomOnPinch:L,panOnScroll:V,panOnScrollSpeed:z,panOnScrollMode:G,zoomOnDoubleClick:H,panOnDrag:W,onPaneClick:X,onPaneMouseEnter:Z,onPaneMouseMove:$,onPaneMouseLeave:Y,onPaneScroll:U,onPaneContextMenu:J,onEdgeContextMenu:K,onEdgeMouseEnter:Q,onEdgeMouseMove:q,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,reconnectRadius:oe,noDragClassName:ie,noWheelClassName:ae,noPanClassName:se,elevateEdgesOnSelect:le,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:pe})=>{const fe=is(t,Ra),he=is(n,Va);return function(t){const n=Zi(),r=e.useRef(!1);e.useEffect((()=>{!r.current&&n.viewportInitialized&&t&&(setTimeout((()=>t(n)),1),r.current=!0)}),[t,n.viewportInitialized])}(a),e.createElement(Na,{onPaneClick:X,onPaneMouseEnter:Z,onPaneMouseMove:$,onPaneMouseLeave:Y,onPaneContextMenu:J,onPaneScroll:U,deleteKeyCode:A,selectionKeyCode:C,selectionOnDrag:E,selectionMode:k,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:S,panActivationKeyCode:I,zoomActivationKeyCode:_,elementsSelectable:R,onMove:r,onMoveStart:o,onMoveEnd:i,zoomOnScroll:F,zoomOnPinch:L,zoomOnDoubleClick:H,panOnScroll:V,panOnScrollSpeed:z,panOnScrollMode:G,panOnDrag:W,defaultViewport:T,translateExtent:M,minZoom:P,maxZoom:D,onSelectionContextMenu:m,preventScrolling:B,noDragClassName:ie,noWheelClassName:ae,noPanClassName:se,disableKeyboardA11y:ce},e.createElement(es,null,e.createElement(Qa,{edgeTypes:he,onEdgeClick:l,onEdgeDoubleClick:u,onlyRenderVisibleElements:N,onEdgeContextMenu:K,onEdgeMouseEnter:Q,onEdgeMouseMove:q,onEdgeMouseLeave:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,reconnectRadius:oe,defaultMarkerColor:j,noPanClassName:se,elevateEdgesOnSelect:!!le,disableKeyboardA11y:ce,rfId:pe},e.createElement(os,{style:v,type:b,component:w,containerStyle:x})),e.createElement("div",{className:"react-flow__edgelabel-renderer"}),e.createElement(Ma,{nodeTypes:fe,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:p,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:O,onlyRenderVisibleElements:N,noPanClassName:se,noDragClassName:ie,disableKeyboardA11y:ce,nodeOrigin:ue,nodeExtent:de,rfId:pe})))};as.displayName="GraphView";var ss=e.memo(as);const ls=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],cs={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:ls,nodeExtent:ls,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:vo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:co,isValidConnection:void 0},us=()=>((e,t)=>e?X(e,t):X)(((e,t)=>({...cs,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Fi(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map((e=>({...r,...e})))})},setDefaultNodesAndEdges:(n,r)=>{const o=void 0!==n,i=void 0!==r,a=o?Fi(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:s,domNode:l,nodeOrigin:c}=t(),u=l?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:p}=new window.DOMMatrixReadOnly(d.transform),f=n.reduce(((e,t)=>{const n=o.get(t.id);if(n?.hidden)o.set(n.id,{...n,[so]:{...n[so],handleBounds:void 0}});else if(n){const r=Ur(t.nodeElement);!(!r.width||!r.height||n.width===r.width&&n.height===r.height&&!t.forceUpdate)&&(o.set(n.id,{...n,[so]:{...n[so],handleBounds:{source:ya(".source",t.nodeElement,p,c),target:ya(".target",t.nodeElement,p,c)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e}),[]);ji(o,c);const h=a||i&&!a&&Li(t,{initial:!0,...s});e({nodeInternals:new Map(o),fitViewOnInitDone:h}),f?.length>0&&r?.(f)},updateNodePositions:(e,n=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),i=e.map((e=>{const t={id:e.id,type:"position",dragging:r};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t}));o(i)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:a,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(i){const t=Fi(ia(n,s()),o,a,l);e({nodeInternals:t})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,s=null;r?a=n.map((e=>sa(e,!0))):(a=la(i(),n),s=la(o,[])),Gi({changedNodes:a,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,s=null;r?a=n.map((e=>sa(e,!0))):(a=la(o,n),s=la(i(),[])),Gi({changedNodes:s,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),a=r||o;Gi({changedNodes:(n||i()).map((e=>(e.selected=!1,sa(e.id,!1)))),changedEdges:a.map((e=>sa(e.id,!1))),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t();Gi({changedNodes:r().filter((e=>e.selected)).map((e=>sa(e.id,!1))),changedEdges:n.filter((e=>e.selected)).map((e=>sa(e.id,!1))),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach((e=>{e.positionAbsolute=Kr(e.position,n)})),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:e=>{const{transform:n,width:r,height:o,d3Zoom:i,d3Selection:a,translateExtent:s}=t();if(!i||!a||!e.x&&!e.y)return!1;const l=wr.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[r,o]],u=i?.constrain()(l,c,s);i.transform(a,u);return n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:cs.connectionNodeId,connectionHandleId:cs.connectionHandleId,connectionHandleType:cs.connectionHandleType,connectionStatus:cs.connectionStatus,connectionStartHandle:cs.connectionStartHandle,connectionEndHandle:cs.connectionEndHandle}),reset:()=>e({...cs})})),Object.is),ds=({children:t})=>{const n=e.useRef(null);return n.current||(n.current=us()),e.createElement(Or,{value:n.current},t)};ds.displayName="ReactFlowProvider";const ps=({children:t})=>e.useContext(Rr)?e.createElement(e.Fragment,null,t):e.createElement(ds,null,t);ps.displayName="ReactFlowWrapper";const fs={input:pi,default:ui,output:hi,group:mi},hs={default:Fo,straight:Po,step:Mo,smoothstep:To,simplebezier:_o},ms=[0,0],gs=[15,15],ys={x:0,y:0,zoom:1},bs={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},vs=e.forwardRef((({nodes:t,edges:n,defaultNodes:r,defaultEdges:o,className:i,nodeTypes:a=fs,edgeTypes:s=hs,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:p,onMoveEnd:f,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:x,onNodeContextMenu:C,onNodeDoubleClick:E,onNodeDragStart:k,onNodeDrag:S,onNodeDragStop:I,onNodesDelete:_,onEdgesDelete:A,onSelectionChange:N,onSelectionDragStart:R,onSelectionDrag:O,onSelectionDragStop:T,onSelectionContextMenu:M,onSelectionStart:P,onSelectionEnd:D,connectionMode:B=vo.Strict,connectionLineType:j=Co.Bezier,connectionLineStyle:F,connectionLineComponent:L,connectionLineContainerStyle:z,deleteKeyCode:G="Backspace",selectionKeyCode:H="Shift",selectionOnDrag:W=!1,selectionMode:X=xo.Full,panActivationKeyCode:Z="Space",multiSelectionKeyCode:$=(ho()?"Meta":"Control"),zoomActivationKeyCode:Y=(ho()?"Meta":"Control"),snapToGrid:U=!1,snapGrid:J=gs,onlyRenderVisibleElements:K=!1,selectNodesOnDrag:Q=!0,nodesDraggable:q,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=ms,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,defaultViewport:ae=ys,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=ls,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:pe="#b1b1b7",zoomOnScroll:fe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=wo.Free,zoomOnDoubleClick:be=!0,panOnDrag:ve=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ce,onPaneMouseLeave:Ee,onPaneScroll:ke,onPaneContextMenu:Se,children:Ie,onEdgeContextMenu:_e,onEdgeDoubleClick:Ae,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Oe,onEdgeUpdate:Te,onEdgeUpdateStart:Me,onEdgeUpdateEnd:Pe,onReconnect:De,onReconnectStart:Be,onReconnectEnd:je,reconnectRadius:Fe=10,edgeUpdaterRadius:Le=10,onNodesChange:Ve,onEdgesChange:ze,noDragClassName:Ge="nodrag",noWheelClassName:He="nowheel",noPanClassName:We="nopan",fitView:Xe=!1,fitViewOptions:Ze,connectOnClick:$e=!0,attributionPosition:Ye,proOptions:Ue,defaultEdgeOptions:Je,elevateNodesOnSelect:Ke=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:qe=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:rt,onError:ot,style:it,id:at,nodeDragThreshold:st,...lt},ct)=>{const ut=at||"1";return e.createElement("div",{...lt,style:{...it,...bs},ref:ct,className:V(["react-flow",i]),"data-testid":"rf__wrapper",id:at},e.createElement(ps,null,e.createElement(ss,{onInit:u,onMove:d,onMoveStart:p,onMoveEnd:f,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:x,onNodeContextMenu:C,onNodeDoubleClick:E,nodeTypes:a,edgeTypes:s,connectionLineType:j,connectionLineStyle:F,connectionLineComponent:L,connectionLineContainerStyle:z,selectionKeyCode:H,selectionOnDrag:W,selectionMode:X,deleteKeyCode:G,multiSelectionKeyCode:$,panActivationKeyCode:Z,zoomActivationKeyCode:Y,onlyRenderVisibleElements:K,selectNodesOnDrag:Q,defaultViewport:ae,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:fe,zoomOnPinch:he,zoomOnDoubleClick:be,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:ve,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ce,onPaneMouseLeave:Ee,onPaneScroll:ke,onPaneContextMenu:Se,onSelectionContextMenu:M,onSelectionStart:P,onSelectionEnd:D,onEdgeContextMenu:_e,onEdgeDoubleClick:Ae,onEdgeMouseEnter:Ne,onEdgeMouseMove:Re,onEdgeMouseLeave:Oe,onReconnect:De??Te,onReconnectStart:Be??Me,onReconnectEnd:je??Pe,reconnectRadius:Fe??Le,defaultMarkerColor:pe,noDragClassName:Ge,noWheelClassName:He,noPanClassName:We,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:qe,nodeOrigin:ne,nodeExtent:de}),e.createElement(Si,{nodes:t,edges:n,defaultNodes:r,defaultEdges:o,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,nodesDraggable:q,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,elevateNodesOnSelect:Ke,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:Ve,onEdgesChange:ze,snapToGrid:U,snapGrid:J,connectionMode:B,translateExtent:ce,connectOnClick:$e,defaultEdgeOptions:Je,fitView:Xe,fitViewOptions:Ze,onNodesDelete:_,onEdgesDelete:A,onNodeDragStart:k,onNodeDrag:S,onNodeDragStop:I,onSelectionDrag:O,onSelectionDragStart:R,onSelectionDragStop:T,noPanClassName:We,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:ot,connectionRadius:nt,isValidConnection:rt,nodeDragThreshold:st}),e.createElement(xi,{onSelectionChange:N}),Ie,e.createElement($r,{proOptions:Ue,position:Ye}),e.createElement(Ti,{rfId:ut,disableKeyboardA11y:qe})))}));vs.displayName="ReactFlow";const ws=e=>e.getNodes();const xs=e=>e.edges;const Cs=({id:t,x:n,y:r,width:o,height:i,style:a,color:s,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:p,onClick:f,selected:h})=>{const{background:m,backgroundColor:g}=a||{},y=s||m||g;return e.createElement("rect",{className:V(["react-flow__minimap-node",{selected:h},u]),x:n,y:r,rx:d,ry:d,width:o,height:i,fill:y,stroke:l,strokeWidth:c,shapeRendering:p,onClick:f?e=>f(e,t):void 0})};Cs.displayName="MiniMapNode";var Es=e.memo(Cs);const ks=e=>e.nodeOrigin,Ss=e=>e.getNodes().filter((e=>!e.hidden&&e.width&&e.height)),Is=e=>e instanceof Function?e:()=>e;var _s=e.memo((function({nodeStrokeColor:t="transparent",nodeColor:n="#e2e2e2",nodeClassName:r="",nodeBorderRadius:o=5,nodeStrokeWidth:i=2,nodeComponent:a=Es,onClick:s}){const l=Hr(Ss,Z),c=Hr(ks),u=Is(n),d=Is(t),p=Is(r),f="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return e.createElement(e.Fragment,null,l.map((t=>{const{x:n,y:r}=Xo(t,c).positionAbsolute;return e.createElement(a,{key:t.id,x:n,y:r,width:t.width,height:t.height,style:t.style,selected:t.selected,className:p(t),color:u(t),borderRadius:o,strokeColor:d(t),strokeWidth:i,shapeRendering:f,onClick:s,id:t.id})})))}));const As=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?(r=Zo(t,e.nodeOrigin),o=n,ro(to(no(r),no(o)))):n,rfId:e.rfId};var r,o};function Ns({style:t,className:n,nodeStrokeColor:r="transparent",nodeColor:o="#e2e2e2",nodeClassName:i="",nodeBorderRadius:a=5,nodeStrokeWidth:s=2,nodeComponent:l,maskColor:c="rgb(240, 240, 240, 0.6)",maskStrokeColor:u="none",maskStrokeWidth:d=1,position:p="bottom-right",onClick:f,onNodeClick:h,pannable:m=!1,zoomable:g=!1,ariaLabel:y="React Flow mini map",inversePan:b=!1,zoomStep:v=10,offsetScale:w=5}){const x=Wr(),C=e.useRef(null),{boundingRect:E,viewBB:k,rfId:S}=Hr(As,Z),I=t?.width??200,_=t?.height??150,A=E.width/I,N=E.height/_,R=Math.max(A,N),O=R*I,T=R*_,M=w*R,P=E.x-(O-E.width)/2-M,D=E.y-(T-E.height)/2-M,B=O+2*M,j=T+2*M,F=`react-flow__minimap-desc-${S}`,L=e.useRef(0);L.current=R,e.useEffect((()=>{if(C.current){const e=ut(C.current),t=e=>{const{transform:t,d3Selection:n,d3Zoom:r}=x.getState();if("wheel"!==e.sourceEvent.type||!n||!r)return;const o=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*v,i=t[2]*Math.pow(2,o);r.scaleTo(n,i)},n=e=>{const{transform:t,d3Selection:n,d3Zoom:r,translateExtent:o,width:i,height:a}=x.getState();if("mousemove"!==e.sourceEvent.type||!n||!r)return;const s=L.current*Math.max(1,t[2])*(b?-1:1),l={x:t[0]-e.sourceEvent.movementX*s,y:t[1]-e.sourceEvent.movementY*s},c=[[0,0],[i,a]],u=wr.translate(l.x,l.y).scale(t[2]),d=r.constrain()(u,c,o);r.transform(n,d)},r=Nr().on("zoom",m?n:null).on("zoom.wheel",g?t:null);return e.call(r),()=>{e.on("zoom",null)}}}),[m,g,b,v]);const z=f?e=>{const t=dt(e);f(e,{x:t[0],y:t[1]})}:void 0,G=h?(e,t)=>{const n=x.getState().nodeInternals.get(t);h(e,n)}:void 0;return e.createElement(Zr,{position:p,style:t,className:V(["react-flow__minimap",n]),"data-testid":"rf__minimap"},e.createElement("svg",{width:I,height:_,viewBox:`${P} ${D} ${B} ${j}`,role:"img","aria-labelledby":F,ref:C,onClick:z},y&&e.createElement("title",{id:F},y),e.createElement(_s,{onClick:G,nodeColor:o,nodeStrokeColor:r,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:s,nodeComponent:l}),e.createElement("path",{className:"react-flow__minimap-mask",d:`M${P-M},${D-M}h${B+2*M}v${j+2*M}h${-B-2*M}z\n M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fill:c,fillRule:"evenodd",stroke:u,strokeWidth:d,pointerEvents:"none"})))}Ns.displayName="MiniMap";var Rs,Os=e.memo(Ns);function Ts({color:t,dimensions:n,lineWidth:r}){return e.createElement("path",{stroke:t,strokeWidth:r,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function Ms({color:t,radius:n}){return e.createElement("circle",{cx:n,cy:n,r:n,fill:t})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(Rs||(Rs={}));const Ps={[Rs.Dots]:"#91919a",[Rs.Lines]:"#eee",[Rs.Cross]:"#e2e2e2"},Ds={[Rs.Dots]:1,[Rs.Lines]:1,[Rs.Cross]:6},Bs=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function js({id:t,variant:n=Rs.Dots,gap:r=20,size:o,lineWidth:i=1,offset:a=2,color:s,style:l,className:c}){const u=e.useRef(null),{transform:d,patternId:p}=Hr(Bs,Z),f=s||Ps[n],h=o||Ds[n],m=n===Rs.Dots,g=n===Rs.Cross,y=Array.isArray(r)?r:[r,r],b=[y[0]*d[2]||1,y[1]*d[2]||1],v=h*d[2],w=g?[v,v]:b,x=m?[v/a,v/a]:[w[0]/a,w[1]/a];return e.createElement("svg",{className:V(["react-flow__background",c]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:u,"data-testid":"rf__background"},e.createElement("pattern",{id:p+t,x:d[0]%b[0],y:d[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${x[0]},-${x[1]})`},m?e.createElement(Ms,{color:f,radius:v/a}):e.createElement(Ts,{dimensions:w,color:f,lineWidth:i})),e.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+t})`}))}js.displayName="Background";var Fs=e.memo(js);const Ls=({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r})=>[`${e}:${t}`,`${n}:${r}`].sort().join("--"),Vs=0,zs=10,Gs=20,Hs=30,Ws=zs,Xs=e=>"string"==typeof e?e:e===Vs?"DEBUG":e===zs?"INFO":e===Gs?"WARN":e===Hs?"ERROR":"UNKNOWN";class Zs{constructor(e,t=zs){this.name=e,this.level=(e=>{if("number"==typeof e)return e;const t=e.toLowerCase();if("debug"===t)return Vs;if("info"===t)return zs;if("warn"===t||"warning"===t)return Gs;if("error"===t)return Hs;throw new Error(`Unknown log level: ${e}`)})(t),this._level_name=Xs(t)}set_level(e){this.level=e,this._level_name=Xs(e)}_fomat_message(e,...t){return`[${this.name}] ${this._level_name}: ${e} ${t.map((e=>JSON.stringify(e,function(){const e=[];return function(t,n){if("object"!=typeof n||null===n)return n;for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}}()))).join(" ")}`}debug(e,...t){this.level<=Vs&&console.debug(this._fomat_message(e,...t))}info(e,...t){this.level<=zs&&console.info(this._fomat_message(e,...t))}warn(e,...t){this.level<=Gs&&console.warn(this._fomat_message(e,...t))}error(e,...t){this.level<=Hs&&console.error(this._fomat_message(e,...t))}}const $s=(e,t)=>("<NoValue>"===e.value&&(e.value=void 0),"<NoValue>"===e.fullvalue&&(e.fullvalue=void 0),void 0===e.try_get_full_value&&(e.try_get_full_value=()=>{t&&void 0!==e.node&&void 0!==e.id&&t.worker?.get_io_full_value({nid:e.node,ioid:e.id})}),void 0===e.hidden&&(e.hidden=!1),void 0===e.set_hidden&&(e.set_hidden=n=>{t&&void 0!==e.node&&void 0!==e.id&&t.worker?.update_io_options({nid:e.node,ioid:e.id,options:{hidden:n}})}),e),Ys=(e,t,n)=>{if(((e,t)=>{const n=e.frontend||{};if(n.size||(n.size=[200,100]),!n.pos||2!==n.pos.length||isNaN(n.pos[0])||null===n.pos[0]||isNaN(n.pos[1])||null===n.pos[1])if(t&&t.rf_instance&&null!==t.reactflowRef){const e=t.reactflowRef.getBoundingClientRect(),r=e.left+e.width/2,o=e.top+e.height/2,i=t.rf_instance.screenToFlowPosition({x:r,y:o});n.pos=[i.x-n.size[0]/2,i.y-n.size[1]/2]}else n.pos=[0,0];n.collapsed||(n.collapsed=!1),e.frontend=n})(e,n),void 0===(e=F(e)).id)throw new Error("Node must have an id");for(const t in e.io)e.io[t].node=e.id,$s(e.io[t],n);return{position:{x:e.frontend.pos[0],y:e.frontend.pos[1]},data:{UseNodeStore:t},type:"default",...e}},Us=e=>{const t={...e},n=e=>{const t=o.getState();if(e.from_remote){let n=i.get_node(e.node.id,!1);if(!n)try{n=(e=>N(((t,n)=>F(L(e)))))(e.node),i.nodesstates.set(e.node.id,n)}catch(e){return void s.logger.error(`Failed to create node store ${e}`)}const r=n.getState();s.logger.info("Add node",r.id,r.name);const a=[...t.nodes,Ys(r,n,s)];o.setState({nodes:a});for(const t in e.node.io){const n=e.node.io[t].id;void 0!==n&&s.worker?.get_io_value({nid:e.node.id,ioid:n})}setTimeout((()=>{s.worker?.call_hooks("node_added",{node:r.id})}),0)}},r=e=>{switch(e.type){case"add":n(e);break;case"update":(e=>{if(e.node.in_trigger&&(e.node.error=void 0),e.from_remote){const t=i.get_node(e.id,!1);if(!t)return;L(e.node);const n=t.getState(),{new_obj:r,change:o}=T(n,e.node);if(o){if(e.node.io)for(const t in e.node.io){r.io[t].fullvalue=e.node.io[t]?.fullvalue;for(const t in e.node.io){const n=e.node.io[t],o=r.io[t];n.hasOwnProperty("value")&&(void 0===n.value?o.value=null:"<NoValue>"===n.value?o.value=void 0:o.value=n.value)}}Ys(r,t,s),s.logger.debug("update_action",r),t.setState(F(r))}}else s.worker&&s.worker.locally_update_node(e)})(e);break;case"delete":(e=>{s.logger.info("Deleting node",e.id),e.from_remote?o.getState().onNodesChange([{type:"remove",id:e.id}]):s.worker?.remove_node(e.id)})(e);break;case"error":(e=>{s.logger.error("Error",e),r({type:"update",id:e.id,node:{in_trigger:!1,error:e.error},from_remote:!0})})(e);break;case"trigger":(e=>{e.from_remote?r({type:"update",id:e.id,node:{in_trigger:!0,error:void 0},from_remote:!0}):s.worker?.trigger_node(e.id)})(e);break;default:s.logger.error("Unknown node action",e)}},o=(({on_node_change:e,on_edge_change:t,on_connect:n})=>{const r=e||(e=>{}),o=n||(e=>{}),i=N(((e,t)=>({nodes:[],edges:[],onNodesChange:n=>{e({nodes:ia(n,t().nodes)}),r(n)},onEdgesChange:n=>{e({edges:aa(n,t().edges)})},onConnect:e=>{null!=e.source&&null!=e.target&&o(e)}})));return i})({on_node_change:e=>{for(const t of e)switch(t.type){case"position":t.position&&r({type:"update",id:t.id,node:{frontend:{pos:[t.position.x,t.position.y]}},from_remote:!1});break;case"dimensions":t.dimensions&&r({type:"update",id:t.id,node:{frontend:{size:[t.dimensions.width,t.dimensions.height]}},from_remote:!1})}},on_edge_change:e=>{},on_connect:e=>{null!==e.source&&null!==e.target&&null!==e.sourceHandle&&null!==e.targetHandle&&s.worker&&s.worker.add_edge({src_nid:e.source,src_ioid:e.sourceHandle,trg_nid:e.target,trg_ioid:e.targetHandle,replace:!0})}}),i=(({})=>{const e=new Map;return{nodesstates:e,get_node:(t,n=!0)=>{const r=e.get(t);if(!r&&n){const n=e.keys();throw new Error(`Node ${t} not found, available nodes: ${Array.from(n)}`)}return r}}})({}),a={libstate:N(((e,t)=>({lib:{shelves:[]},external_worker:[],set:t=>e((e=>({...e,...t}))),get_lib:()=>t().lib,get_external_worker:()=>t().external_worker})))},s={local_settings:N(((e,t)=>({view_settings:{expand_node_props:!1},update_view_settings:e=>{const t=s.local_settings.getState().view_settings,{new_obj:n,change:r}=T(t,e);r&&s.local_settings.setState((e=>({...e,view_settings:n})))}}))),local_state:N(((e,t)=>({selected_nodes:[],selected_edges:[]}))),options:t,lib:a,workermanager:void 0,workers:N(((e,t)=>({}))),workerstate:N(((e,t)=>({is_open:!1}))),render_options:N(((e,t)=>({}))),progress_state:N(((e,t)=>({message:"please select worker",status:"info",progress:0,blocking:!1}))),update_render_options:e=>{const t=s.render_options.getState(),{new_obj:n,change:r}=T(t,e);r&&s.render_options.setState(n)},worker:void 0,_unsubscribeFromWorker:void 0,set_worker:e=>{e!==s.worker&&(s._unsubscribeFromWorker&&(s._unsubscribeFromWorker(),s._unsubscribeFromWorker=void 0),e&&(s._unsubscribeFromWorker=e.state.subscribe((e=>{s.workerstate.setState(e)})),s.workerstate.setState(e.state.getState())),s.worker=e,e?.set_zustand(s))},nodespace:i,useReactFlowStore:o,on_node_action:r,on_edge_action:e=>{const t=o.getState();switch(e.type){case"add":if(e.from_remote){const n=t.edges,r=Ls(e);if(n.some((e=>e.id===r)))return;const i={id:r,source:e.src_nid,target:e.trg_nid,sourceHandle:e.src_ioid,targetHandle:e.trg_ioid,className:"funcnodes-edge animated"};s.logger.info("Adding edge",i),o.setState({edges:[...n,i]}),s.worker?.get_remote_node_state(e.src_nid),s.worker?.get_remote_node_state(e.trg_nid)}break;case"delete":if(e.from_remote){const n=t.edges,r=Ls(e);s.logger.info("Deleting edge",r);const i=n.filter((e=>e.id!==r));o.setState({edges:i}),s.worker?.get_remote_node_state(e.src_nid),s.worker?.get_remote_node_state(e.trg_nid)}break;default:s.logger.error("Unknown edge action",e)}},reactflowRef:null,clear_all:()=>{s.worker?.disconnect(),s.set_worker(void 0),s.workermanager?.setWorker(void 0),s.lib.libstate.getState().set({lib:{shelves:[]},external_worker:[]}),s.nodespace.nodesstates.clear(),s.useReactFlowStore.setState({nodes:[],edges:[]}),s.auto_progress()},center_node:e=>{if(!s.rf_instance)return;e=Array.isArray(e)?e:[e];const t=s.useReactFlowStore.getState().nodes.filter((t=>e.includes(t.id)));t.length>0&&s.rf_instance?.fitView({padding:.2,nodes:t})},set_progress:e=>{if(""===e.message)return s.auto_progress();const t=s.progress_state.getState(),{new_obj:n,change:r}=T(t,e);r&&s.progress_state.setState(n)},auto_progress:()=>void 0===s.workermanager||s.workermanager.open?void 0===s.worker?s.set_progress({progress:0,message:"please select worker",status:"error",blocking:!1}):s.worker.is_open?void s.set_progress({progress:1,message:"running",status:"info",blocking:!1}):s.set_progress({progress:0,message:"connecting to worker",status:"info",blocking:!0}):s.set_progress({progress:0,message:"connecting to worker manager",status:"error",blocking:!1}),plugins:N(((e,t)=>({}))),add_plugin:(e,t)=>{void 0!==t&&s.plugins.setState((n=>({...n,[e]:t})))},dev_settings:{debug:!0},logger:new Zs("fn",Ws)};return s};function Js(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ks}=Object.prototype,{getPrototypeOf:Qs}=Object,qs=(e=>t=>{const n=Ks.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),el=e=>(e=e.toLowerCase(),t=>qs(t)===e),tl=e=>t=>typeof t===e,{isArray:nl}=Array,rl=tl("undefined");const ol=el("ArrayBuffer");const il=tl("string"),al=tl("function"),sl=tl("number"),ll=e=>null!==e&&"object"==typeof e,cl=e=>{if("object"!==qs(e))return!1;const t=Qs(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},ul=el("Date"),dl=el("File"),pl=el("Blob"),fl=el("FileList"),hl=el("URLSearchParams"),[ml,gl,yl,bl]=["ReadableStream","Request","Response","Headers"].map(el);function vl(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),nl(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(r=0;r<i;r++)a=o[r],t.call(null,e[a],a,e)}}function wl(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const xl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Cl=e=>!rl(e)&&e!==xl;const El=(kl="undefined"!=typeof Uint8Array&&Qs(Uint8Array),e=>kl&&e instanceof kl);var kl;const Sl=el("HTMLFormElement"),Il=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),_l=el("RegExp"),Al=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};vl(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)},Nl="abcdefghijklmnopqrstuvwxyz",Rl="0123456789",Ol={DIGIT:Rl,ALPHA:Nl,ALPHA_DIGIT:Nl+Nl.toUpperCase()+Rl};const Tl=el("AsyncFunction"),Ml=(Pl="function"==typeof setImmediate,Dl=al(xl.postMessage),Pl?setImmediate:Dl?((e,t)=>(xl.addEventListener("message",(({source:n,data:r})=>{n===xl&&r===e&&t.length&&t.shift()()}),!1),n=>{t.push(n),xl.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var Pl,Dl;const Bl="undefined"!=typeof queueMicrotask?queueMicrotask.bind(xl):"undefined"!=typeof process&&process.nextTick||Ml;var jl={isArray:nl,isArrayBuffer:ol,isBuffer:function(e){return null!==e&&!rl(e)&&null!==e.constructor&&!rl(e.constructor)&&al(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||al(e.append)&&("formdata"===(t=qs(e))||"object"===t&&al(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ol(e.buffer),t},isString:il,isNumber:sl,isBoolean:e=>!0===e||!1===e,isObject:ll,isPlainObject:cl,isReadableStream:ml,isRequest:gl,isResponse:yl,isHeaders:bl,isUndefined:rl,isDate:ul,isFile:dl,isBlob:pl,isRegExp:_l,isFunction:al,isStream:e=>ll(e)&&al(e.pipe),isURLSearchParams:hl,isTypedArray:El,isFileList:fl,forEach:vl,merge:function e(){const{caseless:t}=Cl(this)&&this||{},n={},r=(r,o)=>{const i=t&&wl(n,o)||o;cl(n[i])&&cl(r)?n[i]=e(n[i],r):cl(r)?n[i]=e({},r):nl(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&vl(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(vl(t,((t,r)=>{n&&al(t)?e[r]=Js(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Qs(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:qs,kindOfTest:el,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(nl(e))return e;let t=e.length;if(!sl(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:Sl,hasOwnProperty:Il,hasOwnProp:Il,reduceDescriptors:Al,freezeMethods:e=>{Al(e,((t,n)=>{if(al(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];al(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return nl(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:wl,global:xl,isContextDefined:Cl,ALPHABET:Ol,generateString:(e=16,t=Ol.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&al(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(ll(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=nl(e)?[]:{};return vl(e,((e,t)=>{const i=n(e,r+1);!rl(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Tl,isThenable:e=>e&&(ll(e)||al(e))&&al(e.then)&&al(e.catch),setImmediate:Ml,asap:Bl};function Fl(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}jl.inherits(Fl,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:jl.toJSONObject(this.config),code:this.code,status:this.status}}});const Ll=Fl.prototype,Vl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Vl[e]={value:e}})),Object.defineProperties(Fl,Vl),Object.defineProperty(Ll,"isAxiosError",{value:!0}),Fl.from=(e,t,n,r,o,i)=>{const a=Object.create(Ll);return jl.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),Fl.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function zl(e){return jl.isPlainObject(e)||jl.isArray(e)}function Gl(e){return jl.endsWith(e,"[]")?e.slice(0,-2):e}function Hl(e,t,n){return e?e.concat(t).map((function(e,t){return e=Gl(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Wl=jl.toFlatObject(jl,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Xl(e,t,n){if(!jl.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=jl.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!jl.isUndefined(t[e])}))).metaTokens,o=n.visitor||c,i=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&jl.isSpecCompliantForm(t);if(!jl.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(jl.isDate(e))return e.toISOString();if(!s&&jl.isBlob(e))throw new Fl("Blob is not supported. Use a Buffer instead.");return jl.isArrayBuffer(e)||jl.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(jl.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(jl.isArray(e)&&function(e){return jl.isArray(e)&&!e.some(zl)}(e)||(jl.isFileList(e)||jl.endsWith(n,"[]"))&&(s=jl.toArray(e)))return n=Gl(n),s.forEach((function(e,r){!jl.isUndefined(e)&&null!==e&&t.append(!0===a?Hl([n],r,i):null===a?n:n+"[]",l(e))})),!1;return!!zl(e)||(t.append(Hl(o,n,i),l(e)),!1)}const u=[],d=Object.assign(Wl,{defaultVisitor:c,convertValue:l,isVisitable:zl});if(!jl.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!jl.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),jl.forEach(n,(function(n,i){!0===(!(jl.isUndefined(n)||null===n)&&o.call(t,n,jl.isString(i)?i.trim():i,r,d))&&e(n,r?r.concat(i):[i])})),u.pop()}}(e),t}function Zl(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function $l(e,t){this._pairs=[],e&&Xl(e,this,t)}const Yl=$l.prototype;function Ul(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Jl(e,t,n){if(!t)return e;const r=n&&n.encode||Ul;jl.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):jl.isURLSearchParams(t)?t.toString():new $l(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}Yl.append=function(e,t){this._pairs.push([e,t])},Yl.toString=function(e){const t=e?function(t){return e.call(this,t,Zl)}:Zl;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class Kl{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){jl.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var Ql={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ql={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:$l,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const ec="undefined"!=typeof window&&"undefined"!=typeof document,tc="object"==typeof navigator&&navigator||void 0,nc=ec&&(!tc||["ReactNative","NativeScript","NS"].indexOf(tc.product)<0),rc="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,oc=ec&&window.location.href||"http://localhost";var ic={...Object.freeze({__proto__:null,hasBrowserEnv:ec,hasStandardBrowserEnv:nc,hasStandardBrowserWebWorkerEnv:rc,navigator:tc,origin:oc}),...ql};function ac(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=e.length;if(i=!i&&jl.isArray(r)?r.length:i,s)return jl.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&jl.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&jl.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a}if(jl.isFormData(e)&&jl.isFunction(e.entries)){const n={};return jl.forEachEntry(e,((e,r)=>{t(function(e){return jl.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const sc={transitional:Ql,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=jl.isObject(e);o&&jl.isHTMLForm(e)&&(e=new FormData(e));if(jl.isFormData(e))return r?JSON.stringify(ac(e)):e;if(jl.isArrayBuffer(e)||jl.isBuffer(e)||jl.isStream(e)||jl.isFile(e)||jl.isBlob(e)||jl.isReadableStream(e))return e;if(jl.isArrayBufferView(e))return e.buffer;if(jl.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Xl(e,new ic.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ic.isNode&&jl.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=jl.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Xl(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(jl.isString(e))try{return(t||JSON.parse)(e),jl.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||sc.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(jl.isResponse(e)||jl.isReadableStream(e))return e;if(e&&jl.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Fl.from(e,Fl.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ic.classes.FormData,Blob:ic.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};jl.forEach(["delete","get","head","post","put","patch"],(e=>{sc.headers[e]={}}));const lc=jl.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const cc=Symbol("internals");function uc(e){return e&&String(e).trim().toLowerCase()}function dc(e){return!1===e||null==e?e:jl.isArray(e)?e.map(dc):String(e)}function pc(e,t,n,r,o){return jl.isFunction(r)?r.call(this,t,n):(o&&(t=n),jl.isString(t)?jl.isString(r)?-1!==t.indexOf(r):jl.isRegExp(r)?r.test(t):void 0:void 0)}let fc=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=uc(t);if(!o)throw new Error("header name must be a non-empty string");const i=jl.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=dc(e))}const i=(e,t)=>jl.forEach(e,((e,n)=>o(e,n,t)));if(jl.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(jl.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&lc[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(jl.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=uc(e)){const n=jl.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(jl.isFunction(t))return t.call(this,e,n);if(jl.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=uc(e)){const n=jl.findKey(this,e);return!(!n||void 0===this[n]||t&&!pc(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=uc(e)){const o=jl.findKey(n,e);!o||t&&!pc(0,n[o],o,t)||(delete n[o],r=!0)}}return jl.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!pc(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return jl.forEach(this,((r,o)=>{const i=jl.findKey(n,o);if(i)return t[i]=dc(r),void delete t[o];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();a!==o&&delete t[o],t[a]=dc(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return jl.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&jl.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[cc]=this[cc]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=uc(e);t[r]||(!function(e,t){const n=jl.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return jl.isArray(e)?e.forEach(r):r(e),this}};function hc(e,t){const n=this||sc,r=t||n,o=fc.from(r.headers);let i=r.data;return jl.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function mc(e){return!(!e||!e.__CANCEL__)}function gc(e,t,n){Fl.call(this,null==e?"canceled":e,Fl.ERR_CANCELED,t,n),this.name="CanceledError"}function yc(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Fl("Request failed with status code "+n.status,[Fl.ERR_BAD_REQUEST,Fl.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}fc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),jl.reduceDescriptors(fc.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),jl.freezeMethods(fc),jl.inherits(gc,Fl,{__CANCEL__:!0});const bc=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];o||(o=l),n[i]=s,r[i]=l;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),l-o<t)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const a=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=i?a(e,t):(n=e,r||(r=setTimeout((()=>{r=null,a(n)}),i-s)))},()=>n&&a(n)]}((n=>{const i=n.loaded,a=n.lengthComputable?n.total:void 0,s=i-r,l=o(s);r=i;e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&i<=a?(a-i)/l:void 0,event:n,lengthComputable:null!=a,[t?"download":"upload"]:!0})}),n)},vc=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},wc=e=>(...t)=>jl.asap((()=>e(...t)));var xc=ic.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ic.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ic.origin),ic.navigator&&/(msie|trident)/i.test(ic.navigator.userAgent)):()=>!0,Cc=ic.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];jl.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),jl.isString(r)&&a.push("path="+r),jl.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ec(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const kc=e=>e instanceof fc?{...e}:e;function Sc(e,t){t=t||{};const n={};function r(e,t,n,r){return jl.isPlainObject(e)&&jl.isPlainObject(t)?jl.merge.call({caseless:r},e,t):jl.isPlainObject(t)?jl.merge({},t):jl.isArray(t)?t.slice():t}function o(e,t,n,o){return jl.isUndefined(t)?jl.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!jl.isUndefined(t))return r(void 0,t)}function a(e,t){return jl.isUndefined(t)?jl.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t,n)=>o(kc(e),kc(t),0,!0)};return jl.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=l[r]||o,a=i(e[r],t[r],r);jl.isUndefined(a)&&i!==s||(n[r]=a)})),n}var Ic=e=>{const t=Sc({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:l}=t;if(t.headers=s=fc.from(s),t.url=Jl(Ec(t.baseURL,t.url),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),jl.isFormData(r))if(ic.hasStandardBrowserEnv||ic.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(ic.hasStandardBrowserEnv&&(o&&jl.isFunction(o)&&(o=o(t)),o||!1!==o&&xc(t.url))){const e=i&&a&&Cc.read(a);e&&s.set(i,e)}return t};var _c="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Ic(e);let o=r.data;const i=fc.from(r.headers).normalize();let a,s,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:f}=r;function h(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(a),r.signal&&r.signal.removeEventListener("abort",a)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=fc.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());yc((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Fl("Request aborted",Fl.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Fl("Network Error",Fl.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Ql;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Fl(t,o.clarifyTimeoutError?Fl.ETIMEDOUT:Fl.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&jl.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),jl.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),f&&([l,u]=bc(f,!0),m.addEventListener("progress",l)),p&&m.upload&&([s,c]=bc(p),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(a=t=>{m&&(n(!t||t.type?new gc(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(a),r.signal&&(r.signal.aborted?a():r.signal.addEventListener("abort",a)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===ic.protocols.indexOf(y)?n(new Fl("Unsupported protocol "+y+":",Fl.ERR_BAD_REQUEST,e)):m.send(o||null)}))};const Ac=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,a();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Fl?t:new gc(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new Fl(`timeout ${t} of ms exceeded`,Fl.ETIMEDOUT))}),t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:s}=r;return s.unsubscribe=()=>jl.asap(a),s}},Nc=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Rc=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Oc=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Rc(e))yield*Nc(n,t)}(e,t);let i,a=0,s=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let i=r.byteLength;if(n){let e=a+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},Tc="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Mc=Tc&&"function"==typeof ReadableStream,Pc=Tc&&("function"==typeof TextEncoder?(Dc=new TextEncoder,e=>Dc.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Dc;const Bc=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},jc=Mc&&Bc((()=>{let e=!1;const t=new Request(ic.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Fc=Mc&&Bc((()=>jl.isReadableStream(new Response("").body))),Lc={stream:Fc&&(e=>e.body)};var Vc;Tc&&(Vc=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Lc[e]&&(Lc[e]=jl.isFunction(Vc[e])?t=>t[e]():(t,n)=>{throw new Fl(`Response type '${e}' is not supported`,Fl.ERR_NOT_SUPPORT,n)})})));const zc=async(e,t)=>{const n=jl.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(jl.isBlob(e))return e.size;if(jl.isSpecCompliantForm(e)){const t=new Request(ic.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return jl.isArrayBufferView(e)||jl.isArrayBuffer(e)?e.byteLength:(jl.isURLSearchParams(e)&&(e+=""),jl.isString(e)?(await Pc(e)).byteLength:void 0)})(t):n};var Gc=Tc&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=Ic(e);c=c?(c+"").toLowerCase():"text";let f,h=Ac([o,i&&i.toAbortSignal()],a);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(l&&jc&&"get"!==n&&"head"!==n&&0!==(g=await zc(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(jl.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=vc(g,bc(wc(l)));r=Oc(n.body,65536,e,t)}}jl.isString(d)||(d=d?"include":"omit");const o="credentials"in Request.prototype;f=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?d:void 0});let i=await fetch(f);const a=Fc&&("stream"===c||"response"===c);if(Fc&&(s||a&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=jl.toFiniteNumber(i.headers.get("content-length")),[n,r]=s&&vc(t,bc(wc(s),!0))||[];i=new Response(Oc(i.body,65536,n,(()=>{r&&r(),m&&m()})),e)}c=c||"text";let y=await Lc[jl.findKey(Lc,c)||"text"](i,e);return!a&&m&&m(),await new Promise(((t,n)=>{yc(t,n,{data:y,headers:fc.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Fl("Network Error",Fl.ERR_NETWORK,e,f),{cause:t.cause||t});throw Fl.from(t,t&&t.code,e,f)}});const Hc={http:null,xhr:_c,fetch:Gc};jl.forEach(Hc,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Wc=e=>`- ${e}`,Xc=e=>jl.isFunction(e)||null===e||!1===e;var Zc=e=>{e=jl.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){let t;if(n=e[i],r=n,!Xc(n)&&(r=Hc[(t=String(n)).toLowerCase()],void 0===r))throw new Fl(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+i]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new Fl("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Wc).join("\n"):" "+Wc(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function $c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new gc(null,e)}function Yc(e){$c(e),e.headers=fc.from(e.headers),e.data=hc.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Zc(e.adapter||sc.adapter)(e).then((function(t){return $c(e),t.data=hc.call(e,e.transformResponse,t),t.headers=fc.from(t.headers),t}),(function(t){return mc(t)||($c(e),t&&t.response&&(t.response.data=hc.call(e,e.transformResponse,t.response),t.response.headers=fc.from(t.response.headers))),Promise.reject(t)}))}const Uc="1.7.9",Jc={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Jc[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Kc={};Jc.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.9] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new Fl(r(o," has been removed"+(t?" in "+t:"")),Fl.ERR_DEPRECATED);return t&&!Kc[o]&&(Kc[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Jc.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Qc={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Fl("options must be an object",Fl.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new Fl("option "+i+" must be "+n,Fl.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Fl("Unknown option "+i,Fl.ERR_BAD_OPTION)}},validators:Jc};const qc=Qc.validators;let eu=class{constructor(e){this.defaults=e,this.interceptors={request:new Kl,response:new Kl}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Sc(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Qc.assertOptions(n,{silentJSONParsing:qc.transitional(qc.boolean),forcedJSONParsing:qc.transitional(qc.boolean),clarifyTimeoutError:qc.transitional(qc.boolean)},!1),null!=r&&(jl.isFunction(r)?t.paramsSerializer={serialize:r}:Qc.assertOptions(r,{encode:qc.function,serialize:qc.function},!0)),Qc.assertOptions(t,{baseUrl:qc.spelling("baseURL"),withXsrfToken:qc.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&jl.merge(o.common,o[t.method]);o&&jl.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=fc.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,d=0;if(!s){const e=[Yc.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=a.length;let p=t;for(d=0;d<u;){const e=a[d++],t=a[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{c=Yc.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return Jl(Ec((e=Sc(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};jl.forEach(["delete","get","head","options"],(function(e){eu.prototype[e]=function(t,n){return this.request(Sc(n||{},{method:e,url:t,data:(n||{}).data}))}})),jl.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Sc(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}eu.prototype[e]=t(),eu.prototype[e+"Form"]=t(!0)}));const tu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(tu).forEach((([e,t])=>{tu[t]=e}));const nu=function e(t){const n=new eu(t),r=Js(eu.prototype.request,n);return jl.extend(r,eu.prototype,n,{allOwnKeys:!0}),jl.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Sc(t,n))},r}(sc);nu.Axios=eu,nu.CanceledError=gc,nu.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new gc(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}},nu.isCancel=mc,nu.VERSION=Uc,nu.toFormData=Xl,nu.AxiosError=Fl,nu.Cancel=nu.CanceledError,nu.all=function(e){return Promise.all(e)},nu.spread=function(e){return function(t){return e.apply(null,t)}},nu.isAxiosError=function(e){return jl.isObject(e)&&!0===e.isAxiosError},nu.mergeConfig=Sc,nu.AxiosHeaders=fc,nu.formToJSON=e=>ac(jl.isHTMLForm(e)?new FormData(e):e),nu.getAdapter=Zc,nu.HttpStatusCode=tu,nu.default=nu;const{Axios:ru,AxiosError:ou,CanceledError:iu,isCancel:au,CancelToken:su,VERSION:lu,all:cu,Cancel:uu,isAxiosError:du,spread:pu,toFormData:fu,AxiosHeaders:hu,HttpStatusCode:mu,formToJSON:gu,getAdapter:yu,mergeConfig:bu}=nu;let vu;const wu=new Uint8Array(16);function xu(){if(!vu&&(vu="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vu(wu)}const Cu=[];for(let e=0;e<256;++e)Cu.push((e+256).toString(16).slice(1));var Eu={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ku(e,t,n){if(Eu.randomUUID&&!e)return Eu.randomUUID();const r=(e=e||{}).random||(e.rng||xu)();return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return Cu[e[t+0]]+Cu[e[t+1]]+Cu[e[t+2]]+Cu[e[t+3]]+"-"+Cu[e[t+4]]+Cu[e[t+5]]+"-"+Cu[e[t+6]]+Cu[e[t+7]]+"-"+Cu[e[t+8]]+Cu[e[t+9]]+"-"+Cu[e[t+10]]+Cu[e[t+11]]+Cu[e[t+12]]+Cu[e[t+13]]+Cu[e[t+14]]+Cu[e[t+15]]}(r)}class Su{constructor(e){this._hooks=new Map,this._ns_event_intercepts=new Map,this.uuid=e.uuid,this.on_error=e.on_error||(e=>{this._zustand?.logger.error(e)}),this.messagePromises=new Map,this._local_nodeupdates=new Map,this._nodeupdatetimer=setTimeout((()=>{this.sync_local_node_updates()}),5e3),this.state=N(((e,t)=>({is_open:!1}))),e.zustand&&this.set_zustand(e.zustand),e.on_sync_complete?this.on_sync_complete=e.on_sync_complete:this.on_sync_complete=async()=>{}}set_zustand(e){e!==this._zustand&&(this._zustand=e,e.set_worker(this),this._zustand.auto_progress(),this.stepwise_fullsync())}add_hook(e,t){const n=this._hooks.get(e)||[];n.push(t),this._hooks.set(e,n);return()=>{const n=this._hooks.get(e)||[],r=n.indexOf(t);r>=0&&n.splice(r,1)}}async call_hooks(e,t){const n=[];for(const r of this._hooks.get(e)||[]){const e=r({worker:this,data:t});e instanceof Promise&&n.push(e)}await Promise.all(n)}add_ns_event_intercept(e,t){const n=this._ns_event_intercepts.get(e)||[];n.push(t),this._ns_event_intercepts.set(e,n);return()=>{const n=this._ns_event_intercepts.get(e)||[],r=n.indexOf(t);r>=0&&n.splice(r,1)}}async intercept_ns_event(e){let t=e;for(const n of this._ns_event_intercepts.get(e.event)||[])t=await n(t);return t}get is_open(){return this.state.getState().is_open}set is_open(e){this.state.setState({is_open:e})}async stepwise_fullsync(){this._zustand&&this.is_open&&(await this.sync_lib(),await this.sync_external_worker(),await this.sync_funcnodes_plugins(),await this.sync_nodespace(),await this.sync_view_state(),await this.on_sync_complete(this))}async sync_lib(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_library",wait_for_response:!0,retries:2});this._zustand.lib.libstate.getState().set({lib:e})}async sync_external_worker(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_worker_dependencies",wait_for_response:!0});this._zustand.lib.libstate.getState().set({external_worker:e})}async sync_funcnodes_plugins(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_plugin_keys",wait_for_response:!0,kwargs:{type:"react"}});for(const t of e){const e=await this._send_cmd({cmd:"get_plugin",wait_for_response:!0,kwargs:{key:t,type:"react"}});if(e.js)for(const t of e.js){const e=document.createElement("script");e.text=atob(t),document.body.appendChild(e)}if(e.css)for(const t of e.css){const e=document.createElement("style");e.innerHTML=atob(t),document.head.appendChild(e)}if(void 0!==e.module){const n=atob(e.module),r=n.length,o=new Uint8Array(r);for(let e=0;e<r;e++)o[e]=n.charCodeAt(e);const i=new Blob([o],{type:"application/javascript"}),a=URL.createObjectURL(i),s=await import(a);URL.revokeObjectURL(a),this._zustand.add_plugin(t,s.default)}}}async sync_view_state(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"view_state",wait_for_response:!0});e.renderoptions&&this._zustand.update_render_options(e.renderoptions);const t=e.nodes;if(t)for(const e in t){const n=t[e];this._zustand.on_node_action({type:"update",node:{frontend:n},id:e,from_remote:!0})}}async sync_nodespace(){if(!this._zustand)return;if(!this.is_open)return;const e=await this._send_cmd({cmd:"get_nodes",kwargs:{with_frontend:!0},wait_for_response:!0});for(const t of e)this._receive_node_added(t);const t=await this._send_cmd({cmd:"get_edges",wait_for_response:!0});for(const e of t)this._receive_edge_added(...e)}async fullsync(){if(!this._zustand)return;if(!this.is_open)return;let e;for(;;)try{e=await this._send_cmd({cmd:"full_state"});break}catch(e){this._zustand.logger.error("Error in fullsync",e)}this._zustand.logger.debug("Full state",e),this._zustand.lib.libstate.getState().set({lib:e.backend.lib,external_worker:e.worker_dependencies}),e.view.renderoptions&&this._zustand.update_render_options(e.view.renderoptions);const t=e.view.nodes;for(const n of e.backend.nodes)void 0!==t[n.id]&&(n.frontend=t[n.id]),this._receive_node_added(n);for(const t of e.backend.edges)this._receive_edge_added(...t)}async _receive_edge_added(e,t,n,r){this._zustand&&this._zustand.on_edge_action({type:"add",from_remote:!0,src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r})}async trigger_node(e){await this._send_cmd({cmd:"trigger_node",kwargs:{nid:e},wait_for_response:!1})}async add_node(e){const t=await this._send_cmd({cmd:"add_node",kwargs:{id:e}});this._receive_node_added(t)}async remove_node(e){await this._send_cmd({cmd:"remove_node",kwargs:{id:e}})}async _receive_node_added(e){this._zustand&&this._zustand.on_node_action({type:"add",node:e,id:e.id,from_remote:!0})}add_edge({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r,replace:o=!1}){return this._send_cmd({cmd:"add_edge",kwargs:{src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r,replace:o}})}remove_edge({src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r}){return this._send_cmd({cmd:"remove_edge",kwargs:{src_nid:e,src_ioid:t,trg_nid:n,trg_ioid:r}})}async add_external_worker({module:e,cls_module:t,cls_name:n}){return await this._send_cmd({cmd:"add_external_worker",kwargs:{module:e,cls_module:t,cls_name:n}})}sync_local_node_updates(){clearTimeout(this._nodeupdatetimer),this._local_nodeupdates.forEach((async(e,t)=>{const n=await this._send_cmd({cmd:"update_node",kwargs:{nid:t,data:e},wait_for_response:!0});this._zustand&&this._zustand.on_node_action({type:"update",node:n,id:t,from_remote:!0})})),this._local_nodeupdates.clear(),this._nodeupdatetimer=setTimeout((()=>{this.sync_local_node_updates()}),200)}locally_update_node(e){const t=this._local_nodeupdates.get(e.id);if(t){const{new_obj:n,change:r}=T(t,e.node);r&&this._local_nodeupdates.set(e.id,n)}else this._local_nodeupdates.set(e.id,e.node);e.immediate&&this.sync_local_node_updates()}async get_remote_node_state(e){const t=await this._send_cmd({cmd:"get_node_state",kwargs:{nid:e},wait_for_response:!0});this._zustand&&this._zustand.on_node_action({type:"update",node:t,id:t.id,from_remote:!0})}set_io_value({nid:e,ioid:t,value:n,set_default:r=!1}){return this._send_cmd({cmd:"set_io_value",kwargs:{nid:e,ioid:t,value:n,set_default:r},wait_for_response:!0})}clear(){return this._send_cmd({cmd:"clear"})}save(){return this._send_cmd({cmd:"save",wait_for_response:!0})}load(e){return this._send_cmd({cmd:"load_data",kwargs:{data:e},wait_for_response:!0}).then((()=>{this.stepwise_fullsync()}))}async get_io_value({nid:e,ioid:t}){const n=await this._send_cmd({cmd:"get_io_value",kwargs:{nid:e,ioid:t},wait_for_response:!0});return this._zustand?(this._zustand.on_node_action({type:"update",node:{io:{[t]:{value:n}}},id:e,from_remote:!0}),n):n}async get_ios_values({nid:e}){const t=await this._send_cmd({cmd:"get_ios_values",kwargs:{nid:e},wait_for_response:!0});if(!this._zustand)return t;const n={};for(const e in t)n[e]={value:t[e]};return this._zustand.on_node_action({type:"update",node:{io:n},id:e,from_remote:!0}),t}async get_runstate(){return await this._send_cmd({cmd:"get_runstate",wait_for_response:!0})}async _send_cmd({cmd:e,kwargs:t,wait_for_response:n=!0,response_timeout:r=5e3,retries:o=2}){const i={type:"cmd",cmd:e,kwargs:t||{}};if(n){o<0&&(o=0);const t=async()=>{let t;for(;o>=0;){const n=i.id||ku();i.id=n;const a=new Promise(((t,o)=>{const i=setTimeout((()=>{o("Timeout@wait_for_response for "+e)}),r);this.messagePromises.set(n,{resolve:e=>{clearTimeout(i),t(e),this.messagePromises.delete(n)},reject:e=>{clearTimeout(i),o(e),this.messagePromises.delete(n)}})}));await this.send(i);try{t=await a;break}catch(e){if(0===o)throw e;o-=1;continue}}return t};return t()}return this.send(i)}async send(e){throw new Error("async send(data: any) not implemented")}async upload_file({files:e,onProgressCallback:t,root:n}){throw new Error("upload_file not implemented ")}async handle_large_message_hint({}){throw new Error("async handle_large_message_hint({}: LargeMessageHint) not implemented ")}async receive_workerevent({event:e,data:t}){switch(e){case"worker_error":if(!this._zustand)return;return this._zustand.logger.error(t.error);case"update_worker_dependencies":if(!this._zustand)return;return this._zustand.lib.libstate.getState().set({external_worker:t.worker_dependencies});case"lib_update":return void await this.sync_lib();case"fullsync":return void await this.stepwise_fullsync();case"external_worker_update":return await this.sync_lib(),void await this.sync_external_worker();case"starting":return void this.call_hooks("starting");case"stopping":return void this.call_hooks("stopping");default:console.warn("Unhandled worker event",e,t)}}async receive_nodespace_event(e){const{event:t,data:n}=await this.intercept_ns_event(e);switch(t){case"after_set_value":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:n.node,io:{[n.io]:{value:n.result}}},id:n.node,from_remote:!0});case"after_update_value_options":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:n.node,io:{[n.io]:{value_options:n.result}}},id:n.node,from_remote:!0});case"triggerstart":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:n.node,in_trigger:!0},id:n.node,from_remote:!0});case"triggerdone":if(!this._zustand)return;return this._zustand.on_node_action({type:"update",node:{id:n.node,in_trigger:!1},id:n.node,from_remote:!0});case"node_trigger_error":if(!this._zustand)return;return this._zustand.on_node_action({type:"error",errortype:"trigger",error:n.error,id:n.node,tb:n.tb,from_remote:!0});case"node_removed":if(!this._zustand)return;return this._zustand.on_node_action({type:"delete",id:n.node,from_remote:!0}),void this.call_hooks("node_removed",{node:n.node});case"node_added":return void this._receive_node_added(n.node);case"after_disconnect":case"after_unforward":if(!n.result)return;if(!Array.isArray(n.result))return;if(4!==n.result.length)return;if(!this._zustand)return;return this._zustand.on_edge_action({type:"delete",from_remote:!0,src_nid:n.result[0],src_ioid:n.result[1],trg_nid:n.result[2],trg_ioid:n.result[3]});case"after_connect":case"after_forward":if(!n.result)return;if(!Array.isArray(n.result))return;if(4!==n.result.length)return;return this._receive_edge_added(...n.result);case"after_add_shelf":case"after_remove_shelf":if(!n.result)return;if(!this._zustand)return;return this._zustand.lib.libstate.getState().set({lib:n.result});case"progress":if(!this._zustand)return;if(n.node)return this._zustand.on_node_action({type:"update",node:{id:n.node,progress:n.info},id:n.node,from_remote:!0});console.warn("Unhandled nodepsace event",t,n);break;default:console.warn("Unhandled nodepsace event",t,n)}}async add_lib(e,t){return await this._send_cmd({cmd:"add_package_dependency",kwargs:{name:e,version:t},wait_for_response:!1})}async remove_lib(e){return await this._send_cmd({cmd:"remove_package_dependency",kwargs:{name:e},wait_for_response:!1})}async receive(e){let t;switch(e.type){case"nsevent":return await this.receive_nodespace_event(e);case"result":if(t=e.id&&this.messagePromises.get(e.id),t)return t.resolve(e.result);break;case"error":if(this.on_error(e.tb+"\n"+e.error),t=e.id&&this.messagePromises.get(e.id),t)return t.reject(e.error);break;case"progress":if(!this._zustand)return;this._zustand.set_progress(e);break;case"workerevent":return await this.receive_workerevent(e);case"large_message":return await this.handle_large_message_hint(e);default:console.warn("Unhandled message",e)}}disconnect(){}onclose(){this.is_open=!1,this._zustand&&this._zustand.auto_progress()}async reconnect(){}async stop(){await this._send_cmd({cmd:"stop_worker",wait_for_response:!1});const e=this.onclose.bind(this);this.onclose=()=>{e(),this._zustand&&(this._zustand.worker===this&&this._zustand.clear_all(),this.onclose=e)}}async get_io_full_value({nid:e,ioid:t}){const n=await this._send_cmd({cmd:"get_io_full_value",kwargs:{nid:e,ioid:t},wait_for_response:!0});return this._zustand?(this._zustand.on_node_action({type:"update",node:{io:{[t]:{fullvalue:n}}},id:e,from_remote:!0}),n):n}async update_io_options({nid:e,ioid:t,options:n}){const r=await this._send_cmd({cmd:"update_io_options",kwargs:{nid:e,ioid:t,...n},wait_for_response:!0});if(!this._zustand)return r;this._zustand.on_node_action({type:"update",node:{io:{[t]:{...n}}},id:e,from_remote:!0})}async get_node_status(e){return await this._send_cmd({cmd:"get_node_state",kwargs:{nid:e},wait_for_response:!0})}async get_available_modules(){return await this._send_cmd({cmd:"get_available_modules",wait_for_response:!0})}async update_external_worker(e,t,n){return await this._send_cmd({cmd:"update_external_worker",kwargs:{worker_id:e,class_id:t,...n},wait_for_response:!0})}async remove_external_worker(e,t){return await this._send_cmd({cmd:"remove_external_worker",kwargs:{worker_id:e,class_id:t},wait_for_response:!0})}async export({withFiles:e=!1}){return await this._send_cmd({cmd:"export_worker",wait_for_response:!0,kwargs:{with_files:e}})}async update_from_export(e){const t=await this._send_cmd({cmd:"update_from_export",kwargs:{data:e},wait_for_response:!0});return this.stepwise_fullsync(),t}}class Iu extends Su{constructor(e){super(e),this._websocket=null,this.reconnectAttempts=0,this.maxReconnectAttempts=999,this.initialTimeout=200,this.maxTimeout=5e3,this._reconnect=!0,this._url=e.url,new Promise((e=>{this.connect(),e(null)})),this._zustand&&this._zustand.auto_progress()}connect(){this._zustand?.logger.info("Connecting to websocket"),this.is_open=!1,this._websocket=new WebSocket(this._url),this._websocket.onopen=()=>{this.onopen()},this._websocket.onclose=()=>{this.onclose()},this._websocket.onerror=()=>{this.on_ws_error()},this._websocket.onmessage=e=>{this.onmessage(e.data)}}calculateReconnectTimeout(){return Math.min(this.initialTimeout*Math.pow(2,this.reconnectAttempts),this.maxTimeout)}auto_reconnect(){if(this.reconnectAttempts<this.maxReconnectAttempts){let e=this.calculateReconnectTimeout();this._zustand?.logger.info(`Attempting to reconnect in ${e} ms`),setTimeout((()=>{this._websocket&&this._websocket.readyState===WebSocket.OPEN||(this.reconnectAttempts++,this.connect())}),e)}else this._zustand?.logger.warn("Maximum reconnect attempts reached. Giving up.")}async onmessage(e){const t=JSON.parse(e);this._zustand?.logger.debug(`Recieved data of length: ${e.length} and data"`,t),await this.receive(t)}get http_protocol(){return this.secure_url?"https":"http"}get secure_url(){return this._url.startsWith("wss")}get url_wo_protocol(){return this._url.substring(this.secure_url?6:5)}get http_url(){var e=this.http_protocol+"://"+this.url_wo_protocol;return"/"!==e[e.length-1]&&(e+="/"),e}async upload_file({files:e,onProgressCallback:t,root:n}){const r=`${this.http_url}upload/`,o=new FormData,i=Array.isArray(e)?e:Array.from(e);for(const e of i){const t=e.webkitRelativePath||e.name,r=n?`${n}/${t}`:t;o.append("file",e,r)}try{return(await nu.post(r,o,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:e=>{t&&t(e.loaded,e.total)}})).data.file}catch(e){throw new Error("Failed to upload file")}}async handle_large_message_hint({msg_id:e}){const t=this.http_url+"message/"+e,n=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}}),r=await n.json();this.receive(r)}onopen(){this._zustand?.logger.info("Websocket opened"),this.is_open=!0,this._zustand&&this._zustand.auto_progress(),this.reconnectAttempts=0,this.stepwise_fullsync()}onclose(){this._zustand?.logger.info("Websocket closed"),super.onclose(),this._reconnect&&(this._zustand?.logger.info("Websocket closed,reconnecting"),this.auto_reconnect())}on_ws_error(){this._zustand?.logger.warn("Websocket error"),this._websocket?this._websocket.close():this.auto_reconnect()}async send_large_message(e){const t=`${this.http_url}message/`;await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:e})}async send(e){if(!this._websocket||this._websocket.readyState!==WebSocket.OPEN)return void this._zustand?.logger.warn("Websocket not connected");const t=JSON.stringify(e);if(new Blob([t]).size>1e6)return this._zustand?.logger.info("Data too large, sending via http"),await this.send_large_message(t);this._zustand?.logger.debug("Sending data",e),this._websocket.send(t)}async stop(){await super.stop(),this._reconnect=!1}close(){this._websocket&&this._websocket.close()}disconnect(){super.disconnect(),this._reconnect=!1,this.close()}async reconnect(){await super.reconnect(),this._reconnect=!0,!this._websocket||(this._zustand?.logger.info("Reconnecting"),this._websocket.readyState!==WebSocket.OPEN&&this._websocket.readyState!==WebSocket.CONNECTING||(this._websocket.readyState===WebSocket.CONNECTING&&await new Promise(((e,t)=>{if(null===this._websocket)return;let n=setTimeout((()=>{t("Timeout@reconnect")}),2e3);this._websocket.addEventListener("open",(()=>{clearTimeout(n),e(null)}),{once:!0}),this._websocket.readyState===WebSocket.OPEN&&(clearTimeout(n),e(null))})),this._websocket.readyState!==WebSocket.OPEN))?this.connect():this.stepwise_fullsync()}}class _u{constructor(e,t){this.ws=null,this.reconnectAttempts=0,this.maxReconnectAttempts=999,this.initialTimeout=200,this.maxTimeout=2e3,this.wsuri=e,this.zustand=t,this.workers={},this.on_setWorker=e=>{this.zustand.set_worker(e)},this.connect()}get open(){return this.ws?.readyState===WebSocket.OPEN}connect(){this.zustand.set_progress({progress:0,message:"connecting to worker manager",status:"info",blocking:!0}),this.zustand.logger.info("Connecting to websocket:",this.wsuri),this.ws=new WebSocket(this.wsuri),this.ws.onopen=()=>{this.onopen()},this.ws.onclose=()=>{this.onclose()},this.ws.onerror=()=>{this.on_ws_error()},this.ws.onmessage=e=>{this.onmessage(e.data)},this.connectionTimeout=setTimeout((()=>{this.ws?.readyState!==WebSocket.OPEN&&this.on_ws_error()}),5e3)}on_ws_error(){console.warn("Websocket error"),this.ws?this.ws.close():this.reconnect()}onopen(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=void 0),this.zustand.auto_progress(),this.ws&&this.ws.send("worker_status");const e=window.localStorage.getItem("funcnodes__active_worker");e&&this.set_active(e)}onmessage(e){let t=JSON.parse(e);if("worker_status"!==t.type)if("set_worker"!==t.type)"progress"!==t.type?this.zustand.logger.error("WorkerManager: unknown message",t):this.zustand.set_progress(t);else if("WSWorker"===t.data.type){let e="ws"+(t.data.ssl?"s":"")+"://"+t.data.host+":"+t.data.port;this.setWorker(this.workers[t.data.uuid]||new Iu({url:e,zustand:this.zustand,uuid:t.data.uuid,on_sync_complete:this.zustand.options.on_sync_complete}))}else this.zustand.logger.error("WorkerManager: unknown worker type",t);else{const e={};for(let n of t.active)n.active=!0,e[n.uuid]=n;for(let n of t.inactive)n.active=!1,e[n.uuid]=n;this.zustand.workers.setState(e)}}setWorker(e){for(let t in this.workers)t!==e?.uuid&&this.workers[t].disconnect();void 0!==e&&(this.workers[e.uuid]=e,e.reconnect()),window.localStorage.setItem("funcnodes__active_worker",e?.uuid||""),void 0!==this.zustand.worker&&this.zustand.clear_all(),this.zustand.set_worker(e),this.on_setWorker(e)}async restart_worker(e){this.ws?.send(JSON.stringify({type:"restart_worker",workerid:e}))}calculateReconnectTimeout(){return Math.min(this.initialTimeout*Math.pow(2,this.reconnectAttempts),this.maxTimeout)}reconnect(){if(this.reconnectAttempts<this.maxReconnectAttempts){let e=this.calculateReconnectTimeout();this.zustand.logger.info(`Attempting to reconnect in ${e} ms`),setTimeout((()=>{this.ws&&this.ws.readyState===WebSocket.OPEN||(this.reconnectAttempts++,this.connect())}),e)}else this.zustand.logger.warn("Maximum reconnect attempts reached. Giving up.")}onclose(){this.zustand.logger.warn("WorkerManager: onclose"),this.reconnect()}set_active(e){this.ws&&this.ws.send(JSON.stringify({type:"set_active",workerid:e}))}new_worker({name:e,reference:t,copyLib:n,copyNS:r}){e||(e=void 0),n||(n=!1),r||(r=!1),t||(t=void 0,n=!1,r=!1),this.ws&&this.ws.send(JSON.stringify({type:"new_worker",kwargs:{name:e,reference:t,copyLib:n,copyNS:r}}))}}function Au(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Nu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Ru(...e){return t=>{let n=!1;const r=e.map((e=>{const r=Nu(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Nu(e[t],null)}}}}function Ou(...e){return o.useCallback(Ru(...e),e)}var Tu,Mu={exports:{}},Pu={};var Du,Bu,ju={};
29
29
  /**
30
30
  * @license React
31
31
  * react-jsx-runtime.development.js
@@ -137,10 +137,10 @@ function(e,t){const n=py(e,t);return"production"!==process.env.NODE_ENV?(...t)=>
137
137
  animation-iteration-count: infinite;
138
138
  animation-delay: 200ms;
139
139
  }
140
- `,Mw=o.forwardRef((function(e,t){const n=vv({props:e,name:"MuiTouchRipple"}),{center:r=!1,classes:i={},className:a,...s}=n,[l,c]=o.useState([]),u=o.useRef(0),d=o.useRef(null);o.useEffect((()=>{d.current&&(d.current(),d.current=null)}),[l]);const p=o.useRef(!1),f=dh(),h=o.useRef(null),m=o.useRef(null),g=o.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:a}=e;c((e=>[...e,Lu.jsx(Tw,{classes:{ripple:xh(i.ripple,_w.ripple),rippleVisible:xh(i.rippleVisible,_w.rippleVisible),ripplePulsate:xh(i.ripplePulsate,_w.ripplePulsate),child:xh(i.child,_w.child),childLeaving:xh(i.childLeaving,_w.childLeaving),childPulsate:xh(i.childPulsate,_w.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},u.current)])),u.current+=1,d.current=a}),[i]),y=o.useCallback(((e={},t={},n=()=>{})=>{const{pulsate:o=!1,center:i=r||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===e?.type&&p.current)return void(p.current=!1);"touchstart"===e?.type&&(p.current=!0);const s=a?null:m.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,d;if(i||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(n-l.top)}if(i)d=Math.sqrt((2*l.width**2+l.height**2)/3),d%2==0&&(d+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;d=Math.sqrt(e**2+t**2)}e?.touches?null===h.current&&(h.current=()=>{g({pulsate:o,rippleX:c,rippleY:u,rippleSize:d,cb:n})},f.start(80,(()=>{h.current&&(h.current(),h.current=null)}))):g({pulsate:o,rippleX:c,rippleY:u,rippleSize:d,cb:n})}),[r,g,f]),b=o.useCallback((()=>{y({},{pulsate:!0})}),[y]),v=o.useCallback(((e,t)=>{if(f.clear(),"touchend"===e?.type&&h.current)return h.current(),h.current=null,void f.start(0,(()=>{v(e,t)}));h.current=null,c((e=>e.length>0?e.slice(1):e)),d.current=t}),[f]);return o.useImperativeHandle(t,(()=>({pulsate:b,start:y,stop:v})),[b,y,v]),Lu.jsx(Ow,{className:xh(_w.root,i.root,a),ref:m,...s,children:Lu.jsx(Sw,{component:null,exit:!0,children:l})})}));function Pw(e){return bh("MuiButtonBase",e)}"production"!==process.env.NODE_ENV&&(Mw.propTypes={center:Uf.bool,classes:Uf.object,className:Uf.string});const Dw=vh("MuiButtonBase",["root","disabled","focusVisible"]),Bw=yv("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Dw.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),jw=o.forwardRef((function(e,t){const n=vv({props:e,name:"MuiButtonBase"}),{action:r,centerRipple:i=!1,children:a,className:s,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:p=!1,focusVisibleClassName:f,LinkComponent:h="a",onBlur:m,onClick:g,onContextMenu:y,onDragLeave:b,onFocus:v,onFocusVisible:w,onKeyDown:x,onKeyUp:C,onMouseDown:E,onMouseLeave:k,onMouseUp:S,onTouchEnd:I,onTouchMove:_,onTouchStart:A,tabIndex:N=0,TouchRippleProps:R,touchRippleRef:O,type:T,...M}=n,P=o.useRef(null),D=mw.use(),B=ah(D.ref,O),[j,F]=o.useState(!1);c&&j&&F(!1),o.useImperativeHandle(r,(()=>({focusVisible:()=>{F(!0),P.current.focus()}})),[]);const L=D.shouldMount&&!u&&!c;o.useEffect((()=>{j&&p&&!u&&D.pulsate()}),[u,p,j,D]);const V=Fw(D,"start",E,d),z=Fw(D,"stop",y,d),G=Fw(D,"stop",b,d),H=Fw(D,"stop",S,d),W=Fw(D,"stop",(e=>{j&&e.preventDefault(),k&&k(e)}),d),X=Fw(D,"start",A,d),Z=Fw(D,"stop",I,d),$=Fw(D,"stop",_,d),Y=Fw(D,"stop",(e=>{ph(e.target)||F(!1),m&&m(e)}),!1),U=ih((e=>{P.current||(P.current=e.currentTarget),ph(e.target)&&(F(!0),w&&w(e)),v&&v(e)})),J=()=>{const e=P.current;return l&&"button"!==l&&!("A"===e.tagName&&e.href)},K=ih((e=>{p&&!e.repeat&&j&&" "===e.key&&D.stop(e,(()=>{D.start(e)})),e.target===e.currentTarget&&J()&&" "===e.key&&e.preventDefault(),x&&x(e),e.target===e.currentTarget&&J()&&"Enter"===e.key&&!c&&(e.preventDefault(),g&&g(e))})),Q=ih((e=>{p&&" "===e.key&&j&&!e.defaultPrevented&&D.stop(e,(()=>{D.pulsate(e)})),C&&C(e),g&&e.target===e.currentTarget&&J()&&" "===e.key&&!e.defaultPrevented&&g(e)}));let q=l;"button"===q&&(M.href||M.to)&&(q=h);const ee={};"button"===q?(ee.type=void 0===T?"button":T,ee.disabled=c):(M.href||M.to||(ee.role="button"),c&&(ee["aria-disabled"]=c));const te=ah(t,P),ne={...n,centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:p,tabIndex:N,focusVisible:j},re=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,i=hh({root:["root",t&&"disabled",n&&"focusVisible"]},Pw,o);return n&&r&&(i.root+=` ${r}`),i})(ne);return Lu.jsxs(Bw,{as:q,className:xh(re.root,s),ownerState:ne,onBlur:Y,onClick:g,onContextMenu:z,onFocus:U,onKeyDown:K,onKeyUp:Q,onMouseDown:V,onMouseLeave:W,onMouseUp:H,onDragLeave:G,onTouchEnd:Z,onTouchMove:$,onTouchStart:X,ref:te,tabIndex:c?-1:N,type:T,...ee,...M,children:[a,L?Lu.jsx(Mw,{ref:B,center:i,...R}):null]})}));function Fw(e,t,n,r=!1){return ih((o=>(n&&n(o),r||e[t](o),!0)))}"production"!==process.env.NODE_ENV&&(jw.propTypes={action:nh,centerRipple:Uf.bool,children:Uf.node,classes:Uf.object,className:Uf.string,component:Qf,disabled:Uf.bool,disableRipple:Uf.bool,disableTouchRipple:Uf.bool,focusRipple:Uf.bool,focusVisibleClassName:Uf.string,href:Uf.any,LinkComponent:Uf.elementType,onBlur:Uf.func,onClick:Uf.func,onContextMenu:Uf.func,onDragLeave:Uf.func,onFocus:Uf.func,onFocusVisible:Uf.func,onKeyDown:Uf.func,onKeyUp:Uf.func,onMouseDown:Uf.func,onMouseLeave:Uf.func,onMouseUp:Uf.func,onTouchEnd:Uf.func,onTouchMove:Uf.func,onTouchStart:Uf.func,sx:Uf.oneOfType([Uf.arrayOf(Uf.oneOfType([Uf.func,Uf.object,Uf.bool])),Uf.func,Uf.object]),tabIndex:Uf.number,TouchRippleProps:Uf.object,touchRippleRef:Uf.oneOfType([Uf.func,Uf.shape({current:Uf.shape({pulsate:Uf.func.isRequired,start:Uf.func.isRequired,stop:Uf.func.isRequired})})]),type:Uf.oneOfType([Uf.oneOf(["button","reset","submit"]),Uf.string])});var Lw=Ev(Lu.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function Vw(e){return bh("MuiTableSortLabel",e)}const zw=vh("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"]);function Gw(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,internalForwardedProps:a,shouldForwardComponentProp:s=!1,...l}=t,{component:c,slots:u={[e]:void 0},slotProps:d={[e]:void 0},...p}=i,f=u[e]||r,h=function(e,t,n){return"function"==typeof e?e(t,n):e}(d[e],o),{props:{component:m,...g},internalRef:y}=Eh({className:n,...l,externalForwardedProps:"root"===e?p:void 0,externalSlotProps:h}),b=ah(y,h?.ref,t.ref),v="root"===e?m||c:m,w=function(e,t,n){return void 0===e||function(e){return"string"==typeof e}(e)?t:{...t,ownerState:{...t.ownerState,...n}}}(f,{..."root"===e&&!c&&!u[e]&&a,..."root"!==e&&!u[e]&&a,...g,...v&&!s&&{as:v},...v&&s&&{component:v},ref:b},o);return[f,w]}const Hw=yv(jw,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.active&&t.active]}})(bv((({theme:e})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(e.vars||e).palette.text.secondary},"&:hover":{color:(e.vars||e).palette.text.secondary,[`& .${zw.icon}`]:{opacity:.5}},[`&.${zw.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${zw.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}})))),Ww=yv("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,t[`iconDirection${rh(n.direction)}`]]}})(bv((({theme:e})=>({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none",variants:[{props:{direction:"desc"},style:{transform:"rotate(0deg)"}},{props:{direction:"asc"},style:{transform:"rotate(180deg)"}}]})))),Xw=o.forwardRef((function(e,t){const n=vv({props:e,name:"MuiTableSortLabel"}),{active:r=!1,children:o,className:i,direction:a="asc",hideSortIcon:s=!1,IconComponent:l=Lw,slots:c={},slotProps:u={},...d}=n,p={...n,active:r,direction:a,hideSortIcon:s,IconComponent:l},f=(e=>{const{classes:t,direction:n,active:r}=e;return hh({root:["root",r&&"active",`direction${rh(n)}`],icon:["icon",`iconDirection${rh(n)}`]},Vw,t)})(p),h={slots:c,slotProps:u},[m,g]=Gw("root",{elementType:Hw,externalForwardedProps:h,ownerState:p,className:xh(f.root,i),ref:t}),[y,b]=Gw("icon",{elementType:Ww,externalForwardedProps:h,ownerState:p,className:f.icon});return Lu.jsxs(m,{disableRipple:!0,component:"span",...g,...d,children:[o,s&&!r?null:Lu.jsx(y,{as:l,...b})]})}));"production"!==process.env.NODE_ENV&&(Xw.propTypes={active:Uf.bool,children:Uf.node,classes:Uf.object,className:Uf.string,direction:Uf.oneOf(["asc","desc"]),hideSortIcon:Uf.bool,IconComponent:Uf.elementType,slotProps:Uf.shape({icon:Uf.oneOfType([Uf.func,Uf.object]),root:Uf.oneOfType([Uf.func,Uf.object])}),slots:Uf.shape({icon:Uf.elementType,root:Uf.elementType}),sx:Uf.oneOfType([Uf.arrayOf(Uf.oneOfType([Uf.func,Uf.object,Uf.bool])),Uf.func,Uf.object])});var Zw=Ev(Lu.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),$w=Ev(Lu.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),Yw=Ev(Lu.jsx("path",{d:"M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"}),"FullscreenExit"),Uw=Ev(Lu.jsx("path",{d:"M22 3.41 16.71 8.7 20 12h-8V4l3.29 3.29L20.59 2zM3.41 22l5.29-5.29L12 20v-8H4l3.29 3.29L2 20.59z"}),"CloseFullscreen"),Jw=Ev(Lu.jsx("path",{d:"M21 11V3h-8l3.29 3.29-10 10L3 13v8h8l-3.29-3.29 10-10z"}),"OpenInFull");const Kw=({trigger:e,title:t,description:n,children:r,closebutton:i=!0,onOpenChange:a,buttons:s=[],open:l,setOpen:c,modal:u=!0})=>o.createElement(Qp,{open:l,onOpenChange:e=>{c&&c(e),a&&a(e)},modal:u},e&&o.createElement(qp,{asChild:!0},e),o.createElement(ef,null,o.createElement(tf,{className:"dialogoverlay funcnodescontainer"}),o.createElement(nf,{className:"dialogconent funcnodescontainer "},t&&o.createElement(rf,{className:"dialogtitle"},t),n&&o.createElement(of,{className:"dialogdescription"},n),o.createElement("div",{className:"dialogchildren"},r),o.createElement("div",{style:{display:"flex",marginTop:25,justifyContent:"flex-end"}},(s||[]).map(((e,t)=>o.createElement(af,{asChild:!0,key:t},o.createElement("button",{className:"dialogsendbutton",onClick:e.onClick},e.text))))),i&&o.createElement(af,{asChild:!0},o.createElement("button",{className:"dialogclosebutton","aria-label":"Close"},o.createElement(Zw,null))))));function Qw(t){const n=t+"CollectionProvider",[r,o]=Vu(n),[i,a]=r(n,{collectionRef:{current:null},itemMap:new Map}),s=t=>{const{scope:n,children:r}=t,o=e.useRef(null),a=e.useRef(new Map).current;return Lu.jsx(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=n;const l=t+"CollectionSlot",c=e.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=Ou(t,a(l,n).collectionRef);return Lu.jsx(Yu,{ref:o,children:r})}));c.displayName=l;const u=t+"CollectionItemSlot",d="data-radix-collection-item",p=e.forwardRef(((t,n)=>{const{scope:r,children:o,...i}=t,s=e.useRef(null),l=Ou(n,s),c=a(u,r);return e.useEffect((()=>(c.itemMap.set(s,{ref:s,...i}),()=>{c.itemMap.delete(s)}))),Lu.jsx(Yu,{[d]:"",ref:l,children:o})}));return p.displayName=u,[{Provider:s,Slot:c,ItemSlot:p},function(n){const r=a(t+"CollectionConsumer",n);return e.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[r.collectionRef,r.itemMap])},o]}var qw=o.createContext(void 0);function ex(e){const t=o.useContext(qw);return e||t||"ltr"}const tx=["top","right","bottom","left"],nx=Math.min,rx=Math.max,ox=Math.round,ix=Math.floor,ax=e=>({x:e,y:e}),sx={left:"right",right:"left",bottom:"top",top:"bottom"},lx={start:"end",end:"start"};function cx(e,t,n){return rx(e,nx(t,n))}function ux(e,t){return"function"==typeof e?e(t):e}function dx(e){return e.split("-")[0]}function px(e){return e.split("-")[1]}function fx(e){return"x"===e?"y":"x"}function hx(e){return"y"===e?"height":"width"}function mx(e){return["top","bottom"].includes(dx(e))?"y":"x"}function gx(e){return fx(mx(e))}function yx(e){return e.replace(/start|end/g,(e=>lx[e]))}function bx(e){return e.replace(/left|right|bottom|top/g,(e=>sx[e]))}function vx(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function wx(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function xx(e,t,n){let{reference:r,floating:o}=e;const i=mx(t),a=gx(t),s=hx(a),l=dx(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(px(t)){case"start":f[a]-=p*(n&&c?-1:1);break;case"end":f[a]+=p*(n&&c?-1:1)}return f}async function Cx(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=ux(t,e),h=vx(f),m=s[p?"floating"===d?"reference":"floating":d],g=wx(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),v=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},w=wx(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:l}):y);return{top:(g.top-w.top+h.top)/v.y,bottom:(w.bottom-g.bottom+h.bottom)/v.y,left:(g.left-w.left+h.left)/v.x,right:(w.right-g.right+h.right)/v.x}}function Ex(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kx(e){return tx.some((t=>e[t]>=0))}function Sx(){return"undefined"!=typeof window}function Ix(e){return Nx(e)?(e.nodeName||"").toLowerCase():"#document"}function _x(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ax(e){var t;return null==(t=(Nx(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Nx(e){return!!Sx()&&(e instanceof Node||e instanceof _x(e).Node)}function Rx(e){return!!Sx()&&(e instanceof Element||e instanceof _x(e).Element)}function Ox(e){return!!Sx()&&(e instanceof HTMLElement||e instanceof _x(e).HTMLElement)}function Tx(e){return!(!Sx()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof _x(e).ShadowRoot)}function Mx(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Lx(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Px(e){return["table","td","th"].includes(Ix(e))}function Dx(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Bx(e){const t=jx(),n=Rx(e)?Lx(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function jx(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Fx(e){return["html","body","#document"].includes(Ix(e))}function Lx(e){return _x(e).getComputedStyle(e)}function Vx(e){return Rx(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zx(e){if("html"===Ix(e))return e;const t=e.assignedSlot||e.parentNode||Tx(e)&&e.host||Ax(e);return Tx(t)?t.host:t}function Gx(e){const t=zx(e);return Fx(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ox(t)&&Mx(t)?t:Gx(t)}function Hx(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Gx(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=_x(o);if(i){const e=Wx(a);return t.concat(a,a.visualViewport||[],Mx(o)?o:[],e&&n?Hx(e):[])}return t.concat(o,Hx(o,[],n))}function Wx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xx(e){const t=Lx(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ox(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=ox(n)!==i||ox(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Zx(e){return Rx(e)?e:e.contextElement}function $x(e){const t=Zx(e);if(!Ox(t))return ax(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Xx(t);let a=(i?ox(n.width):n.width)/r,s=(i?ox(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Yx=ax(0);function Ux(e){const t=_x(e);return jx()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Yx}function Jx(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Zx(e);let a=ax(1);t&&(r?Rx(r)&&(a=$x(r)):a=$x(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==_x(e))&&t}(i,n,r)?Ux(i):ax(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=_x(i),t=r&&Rx(r)?_x(r):r;let n=e,o=Wx(n);for(;o&&r&&t!==n;){const e=$x(o),t=o.getBoundingClientRect(),r=Lx(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=_x(o),o=Wx(n)}}return wx({width:u,height:d,x:l,y:c})}function Kx(e,t){const n=Vx(e).scrollLeft;return t?t.left+n:Jx(Ax(e)).left+n}function Qx(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Kx(e,r)),y:r.top+t.scrollTop}}function qx(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=_x(e),r=Ax(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=jx();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Ax(e),n=Vx(e),r=e.ownerDocument.body,o=rx(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=rx(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Kx(e);const s=-n.scrollTop;return"rtl"===Lx(r).direction&&(a+=rx(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(Ax(e));else if(Rx(t))r=function(e,t){const n=Jx(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ox(e)?$x(e):ax(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Ux(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wx(r)}function eC(e,t){const n=zx(e);return!(n===t||!Rx(n)||Fx(n))&&("fixed"===Lx(n).position||eC(n,t))}function tC(e,t,n){const r=Ox(t),o=Ax(t),i="fixed"===n,a=Jx(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=ax(0);if(r||!r&&!i)if(("body"!==Ix(t)||Mx(o))&&(s=Vx(t)),r){const e=Jx(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Kx(o));const c=!o||r||i?ax(0):Qx(o,s);return{x:a.left+s.scrollLeft-l.x-c.x,y:a.top+s.scrollTop-l.y-c.y,width:a.width,height:a.height}}function nC(e){return"static"===Lx(e).position}function rC(e,t){if(!Ox(e)||"fixed"===Lx(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Ax(e)===n&&(n=n.ownerDocument.body),n}function oC(e,t){const n=_x(e);if(Dx(e))return n;if(!Ox(e)){let t=zx(e);for(;t&&!Fx(t);){if(Rx(t)&&!nC(t))return t;t=zx(t)}return n}let r=rC(e,t);for(;r&&Px(r)&&nC(r);)r=rC(r,t);return r&&Fx(r)&&nC(r)&&!Bx(r)?n:r||function(e){let t=zx(e);for(;Ox(t)&&!Fx(t);){if(Bx(t))return t;if(Dx(t))return null;t=zx(t)}return null}(e)||n}const iC={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Ax(r),s=!!t&&Dx(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=ax(1);const u=ax(0),d=Ox(r);if((d||!d&&!i)&&(("body"!==Ix(r)||Mx(a))&&(l=Vx(r)),Ox(r))){const e=Jx(r);c=$x(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?ax(0):Qx(a,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:Ax,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?Dx(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Hx(e,[],!1).filter((e=>Rx(e)&&"body"!==Ix(e))),o=null;const i="fixed"===Lx(e).position;let a=i?zx(e):e;for(;Rx(a)&&!Fx(a);){const t=Lx(a),n=Bx(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Mx(a)&&!n&&eC(e,a))?r=r.filter((e=>e!==a)):o=t,a=zx(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce(((e,n)=>{const r=qx(t,n,o);return e.top=rx(r.top,e.top),e.right=nx(r.right,e.right),e.bottom=nx(r.bottom,e.bottom),e.left=rx(r.left,e.left),e}),qx(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:oC,getElementRects:async function(e){const t=this.getOffsetParent||oC,n=this.getDimensions,r=await n(e.floating);return{reference:tC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Xx(e);return{width:t,height:n}},getScale:$x,isElement:Rx,isRTL:function(e){return"rtl"===Lx(e).direction}};function aC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sC(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Zx(e),u=o||i?[...c?Hx(c):[],...Hx(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=Ax(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=c;if(s||t(),!p||!f)return;const h={rootMargin:-ix(d)+"px "+-ix(o.clientWidth-(u+p))+"px "+-ix(o.clientHeight-(d+f))+"px "+-ix(u)+"px",threshold:rx(0,nx(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return a();r?a(!1,r):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==r||aC(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?Jx(e):null;return l&&function t(){const r=Jx(e);m&&!aC(m,r)&&n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const lC=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=dx(n),s=px(n),l="y"===mx(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=ux(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},cC=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ux(e,t),c={x:n,y:r},u=await Cx(t,l),d=mx(dx(o)),p=fx(d);let f=c[p],h=c[d];if(i){const e="y"===p?"bottom":"right";f=cx(f+u["y"===p?"top":"left"],f,f-u[e])}if(a){const e="y"===d?"bottom":"right";h=cx(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:a}}}}}},uC=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=ux(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=dx(o),b=mx(s),v=dx(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=p||(v||!m?[bx(s)]:function(e){const t=bx(e);return[yx(e),t,yx(t)]}(s)),C="none"!==h;!p&&C&&x.push(...function(e,t,n,r){const o=px(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(dx(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(yx)))),i}(s,m,h,w));const E=[s,...x],k=await Cx(t,g),S=[];let I=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&S.push(k[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=px(e),o=gx(e),i=hx(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=bx(a)),[a,bx(a)]}(o,a,w);S.push(k[e[0]],k[e[1]])}if(I=[...I,{placement:o,overflows:S}],!S.every((e=>e<=0))){var _,A;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(A=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=I.filter((e=>{if(C){const t=mx(e.placement);return t===b||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},dC=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=ux(e,t),u=await Cx(t,c),d=dx(o),p=px(o),f="y"===mx(o),{width:h,height:m}=i.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===p?"top":"bottom");const b=m-u.top-u.bottom,v=h-u.left-u.right,w=nx(m-u[g],b),x=nx(h-u[y],v),C=!t.middlewareData.shift;let E=w,k=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=v),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=b),C&&!p){const e=rx(u.left,0),t=rx(u.right,0),n=rx(u.top,0),r=rx(u.bottom,0);f?k=h-2*(0!==e||0!==t?e+t:rx(u.left,u.right)):E=m-2*(0!==n||0!==r?n+r:rx(u.top,u.bottom))}await l({...t,availableWidth:k,availableHeight:E});const S=await a.getDimensions(s.floating);return h!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},pC=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ux(e,t);switch(r){case"referenceHidden":{const e=Ex(await Cx(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:kx(e)}}}case"escaped":{const e=Ex(await Cx(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:kx(e)}}}default:return{}}}}},fC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=ux(e,t)||{};if(null==c)return{};const d=vx(u),p={x:n,y:r},f=gx(o),h=hx(f),m=await a.getDimensions(c),g="y"===f,y=g?"top":"left",b=g?"bottom":"right",v=g?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-p[f]-i.floating[h],x=p[f]-i.reference[f],C=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let E=C?C[v]:0;E&&await(null==a.isElement?void 0:a.isElement(C))||(E=s.floating[v]||i.floating[h]);const k=w/2-x/2,S=E/2-m[h]/2-1,I=nx(d[y],S),_=nx(d[b],S),A=I,N=E-m[h]-_,R=E/2-m[h]/2+k,O=cx(A,R,N),T=!l.arrow&&null!=px(o)&&R!==O&&i.reference[h]/2-(R<A?I:_)-m[h]/2<0,M=T?R<A?R-A:R-N:0;return{[f]:p[f]+M,data:{[f]:O,centerOffset:R-O-M,...T&&{alignmentOffset:M}},reset:T}}}),hC=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=ux(e,t),u={x:n,y:r},d=mx(o),p=fx(d);let f=u[p],h=u[d];const m=ux(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var y,b;const e="y"===p?"width":"height",t=["top","left"].includes(dx(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(y=a.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(b=a.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},mC=(e,t,n)=>{const r=new Map,o={platform:iC,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=xx(c,r,l),p=r,f={},h=0;for(let n=0;n<s.length;n++){const{name:i,fn:m}=s[n],{x:g,y:y,data:b,reset:v}=await m({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,f={...f,[i]:{...f[i],...b}},v&&h<=50&&(h++,"object"==typeof v&&(v.placement&&(p=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):v.rects),({x:u,y:d}=xx(c,p,l))),n=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};var gC="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function yC(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!yC(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!yC(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function bC(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vC(e,t){const n=bC(e);return Math.round(t*n)/n}function wC(e){const t=o.useRef(e);return gC((()=>{t.current=e})),t}const xC=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?fC({element:n.current,padding:r}).fn(t):{}:n?fC({element:n,padding:r}).fn(t):{};var o}}),CC=(e,t)=>({...lC(e),options:[e,t]}),EC=(e,t)=>({...cC(e),options:[e,t]}),kC=(e,t)=>({...hC(e),options:[e,t]}),SC=(e,t)=>({...uC(e),options:[e,t]}),IC=(e,t)=>({...dC(e),options:[e,t]}),_C=(e,t)=>({...pC(e),options:[e,t]}),AC=(e,t)=>({...xC(e),options:[e,t]});var NC=o.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return Lu.jsx(Qu.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:Lu.jsx("polygon",{points:"0,0 30,0 15,10"})})}));NC.displayName="Arrow";var RC=NC;function OC(e){const[t,n]=o.useState(void 0);return Gu((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}var TC="Popper",[MC,PC]=Vu(TC),[DC,BC]=MC(TC),jC=e=>{const{__scopePopper:t,children:n}=e,[r,i]=o.useState(null);return Lu.jsx(DC,{scope:t,anchor:r,onAnchorChange:i,children:n})};jC.displayName=TC;var FC="PopperAnchor",LC=o.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=BC(FC,n),s=o.useRef(null),l=Ou(t,s);return o.useEffect((()=>{a.onAnchorChange(r?.current||s.current)})),r?null:Lu.jsx(Qu.div,{...i,ref:l})}));LC.displayName=FC;var VC="PopperContent",[zC,GC]=MC(VC),HC=o.forwardRef(((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=e,b=BC(VC,n),[v,w]=o.useState(null),x=Ou(t,(e=>w(e))),[C,E]=o.useState(null),k=OC(C),S=k?.width??0,I=k?.height??0,_=r+("center"!==s?"-"+s:""),A="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},N=Array.isArray(d)?d:[d],R=N.length>0,O={padding:A,boundary:N.filter($C),altBoundary:R},{refs:T,floatingStyles:M,placement:P,isPositioned:D,middlewareData:B}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=o.useState(r);yC(h,r)||m(r);const[g,y]=o.useState(null),[b,v]=o.useState(null),w=o.useCallback((e=>{e!==k.current&&(k.current=e,y(e))}),[]),x=o.useCallback((e=>{e!==S.current&&(S.current=e,v(e))}),[]),C=s||g,E=l||b,k=o.useRef(null),S=o.useRef(null),I=o.useRef(p),_=null!=u,A=wC(u),N=wC(a),R=wC(d),O=o.useCallback((()=>{if(!k.current||!S.current)return;const e={placement:t,strategy:n,middleware:h};N.current&&(e.platform=N.current),mC(k.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==R.current};T.current&&!yC(I.current,t)&&(I.current=t,i.flushSync((()=>{f(t)})))}))}),[h,t,n,N,R]);gC((()=>{!1===d&&I.current.isPositioned&&(I.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const T=o.useRef(!1);gC((()=>(T.current=!0,()=>{T.current=!1})),[]),gC((()=>{if(C&&(k.current=C),E&&(S.current=E),C&&E){if(A.current)return A.current(C,E,O);O()}}),[C,E,O,A,_]);const M=o.useMemo((()=>({reference:k,floating:S,setReference:w,setFloating:x})),[w,x]),P=o.useMemo((()=>({reference:C,floating:E})),[C,E]),D=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=vC(P.floating,p.x),r=vC(P.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...bC(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,P.floating,p.x,p.y]);return o.useMemo((()=>({...p,update:O,refs:M,elements:P,floatingStyles:D})),[p,O,M,P,D])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>sC(...e,{animationFrame:"always"===m}),elements:{reference:b.anchor},middleware:[CC({mainAxis:a+I,alignmentAxis:l}),u&&EC({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?kC():void 0,...O}),u&&SC({...O}),IC({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),C&&AC({element:C,padding:c}),YC({arrowWidth:S,arrowHeight:I}),h&&_C({strategy:"referenceHidden",...O})]}),[j,F]=UC(P),L=Zu(g);Gu((()=>{D&&L?.()}),[D,L]);const V=B.arrow?.x,z=B.arrow?.y,G=0!==B.arrow?.centerOffset,[H,W]=o.useState();return Gu((()=>{v&&W(window.getComputedStyle(v).zIndex)}),[v]),Lu.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:D?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Lu.jsx(zC,{scope:n,placedSide:j,onArrowChange:E,arrowX:V,arrowY:z,shouldHideArrow:G,children:Lu.jsx(Qu.div,{"data-side":j,"data-align":F,...y,ref:x,style:{...y.style,animation:D?void 0:"none"}})})})}));HC.displayName=VC;var WC="PopperArrow",XC={top:"bottom",right:"left",bottom:"top",left:"right"},ZC=o.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=GC(WC,n),i=XC[o.placedSide];return Lu.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:Lu.jsx(RC,{...r,ref:t,style:{...r.style,display:"block"}})})}));function $C(e){return null!==e}ZC.displayName=WC;var YC=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[l,c]=UC(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+s/2;let f="",h="";return"bottom"===l?(f=i?u:`${d}px`,h=-s+"px"):"top"===l?(f=i?u:`${d}px`,h=`${r.floating.height+s}px`):"right"===l?(f=-s+"px",h=i?u:`${p}px`):"left"===l&&(f=`${r.floating.width+s}px`,h=i?u:`${p}px`),{data:{x:f,y:h}}}});function UC(e){const[t,n="center"]=e.split("-");return[t,n]}var JC=jC,KC=LC,QC=HC,qC=ZC,eE="rovingFocusGroup.onEntryFocus",tE={bubbles:!1,cancelable:!0},nE="RovingFocusGroup",[rE,oE,iE]=Qw(nE),[aE,sE]=Vu(nE,[iE]),[lE,cE]=aE(nE),uE=o.forwardRef(((e,t)=>Lu.jsx(rE.Provider,{scope:e.__scopeRovingFocusGroup,children:Lu.jsx(rE.Slot,{scope:e.__scopeRovingFocusGroup,children:Lu.jsx(dE,{...e,ref:t})})})));uE.displayName=nE;var dE=o.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...p}=e,f=o.useRef(null),h=Ou(t,f),m=ex(a),[g=null,y]=$u({prop:s,defaultProp:l,onChange:c}),[b,v]=o.useState(!1),w=Zu(u),x=oE(n),C=o.useRef(!1),[E,k]=o.useState(0);return o.useEffect((()=>{const e=f.current;if(e)return e.addEventListener(eE,w),()=>e.removeEventListener(eE,w)}),[w]),Lu.jsx(lE,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:o.useCallback((e=>y(e)),[y]),onItemShiftTab:o.useCallback((()=>v(!0)),[]),onFocusableItemAdd:o.useCallback((()=>k((e=>e+1))),[]),onFocusableItemRemove:o.useCallback((()=>k((e=>e-1))),[]),children:Lu.jsx(Qu.div,{tabIndex:b||0===E?-1:0,"data-orientation":r,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:Au(e.onMouseDown,(()=>{C.current=!0})),onFocus:Au(e.onFocus,(e=>{const t=!C.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(eE,tE);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));mE([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)),d)}}C.current=!1})),onBlur:Au(e.onBlur,(()=>v(!1)))})})})),pE="RovingFocusGroupItem",fE=o.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...s}=e,l=Xu(),c=a||l,u=cE(pE,n),d=u.currentTabStopId===c,p=oE(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=u;return o.useEffect((()=>{if(r)return f(),()=>h()}),[r,f,h]),Lu.jsx(rE.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:Lu.jsx(Qu.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Au(e.onMouseDown,(e=>{r?u.onItemFocus(c):e.preventDefault()})),onFocus:Au(e.onFocus,(()=>u.onItemFocus(c))),onKeyDown:Au(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void u.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:hE[r]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();const r=n.indexOf(e.currentTarget);n=u.loop?function(e,t){return e.map(((n,r)=>e[(t+r)%e.length]))}(n,r+1):n.slice(r+1)}setTimeout((()=>mE(n)))}}))})})}));fE.displayName=pE;var hE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mE(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var gE=uE,yE=fE,bE=["Enter"," "],vE=["ArrowUp","PageDown","End"],wE=["ArrowDown","PageUp","Home",...vE],xE={ltr:[...bE,"ArrowRight"],rtl:[...bE,"ArrowLeft"]},CE={ltr:["ArrowLeft"],rtl:["ArrowRight"]},EE="Menu",[kE,SE,IE]=Qw(EE),[_E,AE]=Vu(EE,[IE,PC,sE]),NE=PC(),RE=sE(),[OE,TE]=_E(EE),[ME,PE]=_E(EE),DE=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:s=!0}=e,l=NE(t),[c,u]=o.useState(null),d=o.useRef(!1),p=Zu(a),f=ex(i);return o.useEffect((()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),Lu.jsx(JC,{...l,children:Lu.jsx(OE,{scope:t,open:n,onOpenChange:p,content:c,onContentChange:u,children:Lu.jsx(ME,{scope:t,onClose:o.useCallback((()=>p(!1)),[p]),isUsingKeyboardRef:d,dir:f,modal:s,children:r})})})};DE.displayName=EE;var BE=o.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=NE(n);return Lu.jsx(KC,{...o,...r,ref:t})}));BE.displayName="MenuAnchor";var jE="MenuPortal",[FE,LE]=_E(jE,{forceMount:void 0}),VE=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=TE(jE,t);return Lu.jsx(FE,{scope:t,forceMount:n,children:Lu.jsx(wd,{present:n||i.open,children:Lu.jsx(vd,{asChild:!0,container:o,children:r})})})};VE.displayName=jE;var zE="MenuContent",[GE,HE]=_E(zE),WE=o.forwardRef(((e,t)=>{const n=LE(zE,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=TE(zE,e.__scopeMenu),a=PE(zE,e.__scopeMenu);return Lu.jsx(kE.Provider,{scope:e.__scopeMenu,children:Lu.jsx(wd,{present:r||i.open,children:Lu.jsx(kE.Slot,{scope:e.__scopeMenu,children:a.modal?Lu.jsx(XE,{...o,ref:t}):Lu.jsx(ZE,{...o,ref:t})})})})})),XE=o.forwardRef(((e,t)=>{const n=TE(zE,e.__scopeMenu),r=o.useRef(null),i=Ou(t,r);return o.useEffect((()=>{const e=r.current;if(e)return vp(e)}),[]),Lu.jsx($E,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Au(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})})),ZE=o.forwardRef(((e,t)=>{const n=TE(zE,e.__scopeMenu);return Lu.jsx($E,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),$E=o.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:h,disableOutsideScroll:m,...g}=e,y=TE(zE,n),b=PE(zE,n),v=NE(n),w=RE(n),x=SE(n),[C,E]=o.useState(null),k=o.useRef(null),S=Ou(t,k,y.onContentChange),I=o.useRef(0),_=o.useRef(""),A=o.useRef(0),N=o.useRef(null),R=o.useRef("right"),O=o.useRef(0),T=m?pp:o.Fragment,M=m?{as:Yu,allowPinchZoom:!0}:void 0,P=e=>{const t=_.current+e,n=x().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=function(e,t){return e.map(((n,r)=>e[(t+r)%e.length]))}(e,Math.max(i,0));1===o.length&&(a=a.filter((e=>e!==n)));const s=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return s!==n?s:void 0}(n.map((e=>e.textValue)),t,o),a=n.find((e=>e.textValue===i))?.ref.current;!function e(t){_.current=t,window.clearTimeout(I.current),""!==t&&(I.current=window.setTimeout((()=>e("")),1e3))}(t),a&&setTimeout((()=>a.focus()))};o.useEffect((()=>()=>window.clearTimeout(I.current)),[]),Ed();const D=o.useCallback((e=>R.current===N.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e].x,s=t[e].y,l=t[i].x,c=t[i].y;s>r!=c>r&&n<(l-a)*(r-s)/(c-s)+a&&(o=!o)}return o}(n,t)}(e,N.current?.area)),[]);return Lu.jsx(GE,{scope:n,searchRef:_,onItemEnter:o.useCallback((e=>{D(e)&&e.preventDefault()}),[D]),onItemLeave:o.useCallback((e=>{D(e)||(k.current?.focus(),E(null))}),[D]),onTriggerLeave:o.useCallback((e=>{D(e)&&e.preventDefault()}),[D]),pointerGraceTimerRef:A,onPointerGraceIntentChange:o.useCallback((e=>{N.current=e}),[]),children:Lu.jsx(T,{...M,children:Lu.jsx(pd,{asChild:!0,trapped:i,onMountAutoFocus:Au(a,(e=>{e.preventDefault(),k.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:s,children:Lu.jsx(id,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:h,children:Lu.jsx(gE,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:E,onEntryFocus:Au(c,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:Lu.jsx(QC,{role:"menu","aria-orientation":"vertical","data-state":xk(y.open),"data-radix-menu-content":"",dir:b.dir,...v,...g,ref:S,style:{outline:"none",...g.style},onKeyDown:Au(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&P(e.key));const o=k.current;if(e.target!==o)return;if(!wE.includes(e.key))return;e.preventDefault();const i=x().filter((e=>!e.disabled)).map((e=>e.ref.current));vE.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:Au(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(I.current),_.current="")})),onPointerMove:Au(e.onPointerMove,kk((e=>{const t=e.target,n=O.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>O.current?"right":"left";R.current=t,O.current=e.clientX}})))})})})})})})}));WE.displayName=zE;var YE=o.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return Lu.jsx(Qu.div,{role:"group",...r,ref:t})}));YE.displayName="MenuGroup";var UE=o.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return Lu.jsx(Qu.div,{...r,ref:t})}));UE.displayName="MenuLabel";var JE="MenuItem",KE="menu.itemSelect",QE=o.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=o.useRef(null),s=PE(JE,e.__scopeMenu),l=HE(JE,e.__scopeMenu),c=Ou(t,a),u=o.useRef(!1);return Lu.jsx(qE,{...i,ref:c,disabled:n,onClick:Au(e.onClick,(()=>{const e=a.current;if(!n&&e){const t=new CustomEvent(KE,{bubbles:!0,cancelable:!0});e.addEventListener(KE,(e=>r?.(e)),{once:!0}),qu(e,t),t.defaultPrevented?u.current=!1:s.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:Au(e.onPointerUp,(e=>{u.current||e.currentTarget?.click()})),onKeyDown:Au(e.onKeyDown,(e=>{const t=""!==l.searchRef.current;n||t&&" "===e.key||bE.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));QE.displayName=JE;var qE=o.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,s=HE(JE,n),l=RE(n),c=o.useRef(null),u=Ou(t,c),[d,p]=o.useState(!1),[f,h]=o.useState("");return o.useEffect((()=>{const e=c.current;e&&h((e.textContent??"").trim())}),[a.children]),Lu.jsx(kE.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:Lu.jsx(yE,{asChild:!0,...l,focusable:!r,children:Lu.jsx(Qu.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:Au(e.onPointerMove,kk((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:Au(e.onPointerLeave,kk((e=>s.onItemLeave(e)))),onFocus:Au(e.onFocus,(()=>p(!0))),onBlur:Au(e.onBlur,(()=>p(!1)))})})})})),ek=o.forwardRef(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return Lu.jsx(lk,{scope:e.__scopeMenu,checked:n,children:Lu.jsx(QE,{role:"menuitemcheckbox","aria-checked":Ck(n)?"mixed":n,...o,ref:t,"data-state":Ek(n),onSelect:Au(o.onSelect,(()=>r?.(!!Ck(n)||!n)),{checkForDefaultPrevented:!1})})})}));ek.displayName="MenuCheckboxItem";var tk="MenuRadioGroup",[nk,rk]=_E(tk,{value:void 0,onValueChange:()=>{}}),ok=o.forwardRef(((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Zu(r);return Lu.jsx(nk,{scope:e.__scopeMenu,value:n,onValueChange:i,children:Lu.jsx(YE,{...o,ref:t})})}));ok.displayName=tk;var ik="MenuRadioItem",ak=o.forwardRef(((e,t)=>{const{value:n,...r}=e,o=rk(ik,e.__scopeMenu),i=n===o.value;return Lu.jsx(lk,{scope:e.__scopeMenu,checked:i,children:Lu.jsx(QE,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Ek(i),onSelect:Au(r.onSelect,(()=>o.onValueChange?.(n)),{checkForDefaultPrevented:!1})})})}));ak.displayName=ik;var sk="MenuItemIndicator",[lk,ck]=_E(sk,{checked:!1}),uk=o.forwardRef(((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=ck(sk,n);return Lu.jsx(wd,{present:r||Ck(i.checked)||!0===i.checked,children:Lu.jsx(Qu.span,{...o,ref:t,"data-state":Ek(i.checked)})})}));uk.displayName=sk;var dk=o.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return Lu.jsx(Qu.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));dk.displayName="MenuSeparator";var pk=o.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=NE(n);return Lu.jsx(qC,{...o,...r,ref:t})}));pk.displayName="MenuArrow";var fk="MenuSub",[hk,mk]=_E(fk),gk=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=TE(fk,t),s=NE(t),[l,c]=o.useState(null),[u,d]=o.useState(null),p=Zu(i);return o.useEffect((()=>(!1===a.open&&p(!1),()=>p(!1))),[a.open,p]),Lu.jsx(JC,{...s,children:Lu.jsx(OE,{scope:t,open:r,onOpenChange:p,content:u,onContentChange:d,children:Lu.jsx(hk,{scope:t,contentId:Xu(),triggerId:Xu(),trigger:l,onTriggerChange:c,children:n})})})};gk.displayName=fk;var yk="MenuSubTrigger",bk=o.forwardRef(((e,t)=>{const n=TE(yk,e.__scopeMenu),r=PE(yk,e.__scopeMenu),i=mk(yk,e.__scopeMenu),a=HE(yk,e.__scopeMenu),s=o.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=o.useCallback((()=>{s.current&&window.clearTimeout(s.current),s.current=null}),[]);return o.useEffect((()=>d),[d]),o.useEffect((()=>{const e=l.current;return()=>{window.clearTimeout(e),c(null)}}),[l,c]),Lu.jsx(BE,{asChild:!0,...u,children:Lu.jsx(qE,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":xk(n.open),...e,ref:Ru(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Au(e.onPointerMove,kk((t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||s.current||(a.onPointerGraceIntentChange(null),s.current=window.setTimeout((()=>{n.onOpenChange(!0),d()}),100))}))),onPointerLeave:Au(e.onPointerLeave,kk((e=>{d();const t=n.content?.getBoundingClientRect();if(t){const r=n.content?.dataset.side,o="right"===r,i=o?-5:5,s=t[o?"left":"right"],c=t[o?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+i,y:e.clientY},{x:s,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(l.current),l.current=window.setTimeout((()=>a.onPointerGraceIntentChange(null)),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}}))),onKeyDown:Au(e.onKeyDown,(t=>{const o=""!==a.searchRef.current;e.disabled||o&&" "===t.key||xE[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())}))})})}));bk.displayName=yk;var vk="MenuSubContent",wk=o.forwardRef(((e,t)=>{const n=LE(zE,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=TE(zE,e.__scopeMenu),s=PE(zE,e.__scopeMenu),l=mk(vk,e.__scopeMenu),c=o.useRef(null),u=Ou(t,c);return Lu.jsx(kE.Provider,{scope:e.__scopeMenu,children:Lu.jsx(wd,{present:r||a.open,children:Lu.jsx(kE.Slot,{scope:e.__scopeMenu,children:Lu.jsx($E,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:u,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Au(e.onFocusOutside,(e=>{e.target!==l.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:Au(e.onEscapeKeyDown,(e=>{s.onClose(),e.preventDefault()})),onKeyDown:Au(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=CE[s.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())}))})})})})}));function xk(e){return e?"open":"closed"}function Ck(e){return"indeterminate"===e}function Ek(e){return Ck(e)?"indeterminate":e?"checked":"unchecked"}function kk(e){return t=>"mouse"===t.pointerType?e(t):void 0}wk.displayName=vk;var Sk=DE,Ik=BE,_k=VE,Ak=WE,Nk=YE,Rk=UE,Ok=QE,Tk=ek,Mk=ok,Pk=ak,Dk=uk,Bk=dk,jk=pk,Fk=gk,Lk=bk,Vk=wk,zk="DropdownMenu",[Gk,Hk]=Vu(zk,[AE]),Wk=AE(),[Xk,Zk]=Gk(zk),$k=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:s,modal:l=!0}=e,c=Wk(t),u=o.useRef(null),[d=!1,p]=$u({prop:i,defaultProp:a,onChange:s});return Lu.jsx(Xk,{scope:t,triggerId:Xu(),triggerRef:u,contentId:Xu(),open:d,onOpenChange:p,onOpenToggle:o.useCallback((()=>p((e=>!e))),[p]),modal:l,children:Lu.jsx(Sk,{...c,open:d,onOpenChange:p,dir:r,modal:l,children:n})})};$k.displayName=zk;var Yk="DropdownMenuTrigger",Uk=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=Zk(Yk,n),a=Wk(n);return Lu.jsx(Ik,{asChild:!0,...a,children:Lu.jsx(Qu.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Ru(t,i.triggerRef),onPointerDown:Au(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())})),onKeyDown:Au(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));Uk.displayName=Yk;var Jk=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Wk(t);return Lu.jsx(_k,{...r,...n})};Jk.displayName="DropdownMenuPortal";var Kk="DropdownMenuContent",Qk=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Zk(Kk,n),a=Wk(n),s=o.useRef(!1);return Lu.jsx(Ak,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Au(e.onCloseAutoFocus,(e=>{s.current||i.triggerRef.current?.focus(),s.current=!1,e.preventDefault()})),onInteractOutside:Au(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;i.modal&&!r||(s.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));Qk.displayName=Kk;var qk=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(Nk,{...o,...r,ref:t})}));qk.displayName="DropdownMenuGroup";o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(Rk,{...o,...r,ref:t})})).displayName="DropdownMenuLabel";var eS=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(Ok,{...o,...r,ref:t})}));eS.displayName="DropdownMenuItem";o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(Tk,{...o,...r,ref:t})})).displayName="DropdownMenuCheckboxItem";var tS=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(Mk,{...o,...r,ref:t})}));tS.displayName="DropdownMenuRadioGroup";var nS=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(Pk,{...o,...r,ref:t})}));nS.displayName="DropdownMenuRadioItem";o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(Dk,{...o,...r,ref:t})})).displayName="DropdownMenuItemIndicator";o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(Bk,{...o,...r,ref:t})})).displayName="DropdownMenuSeparator";o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(jk,{...o,...r,ref:t})})).displayName="DropdownMenuArrow";var rS=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(Lk,{...o,...r,ref:t})}));rS.displayName="DropdownMenuSubTrigger";var oS=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Wk(n);return Lu.jsx(Vk,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));oS.displayName="DropdownMenuSubContent";var iS=$k,aS=Uk,sS=Jk,lS=Qk,cS=qk,uS=eS,dS=tS,pS=nS,fS=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=Wk(t),[s=!1,l]=$u({prop:r,defaultProp:i,onChange:o});return Lu.jsx(Fk,{...a,open:s,onOpenChange:l,children:n})},hS=rS,mS=oS;function gS(e,t){return function(e,t){return new Blob([e],{type:t})}(function(e){const t=window.atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r}(e),t)}function yS(e,t=!0){return new Promise((n=>{const r=new FileReader;r.onload=()=>{const e=r.result;t&&n(e.split(",")[1]),n(e)},r.readAsDataURL(e)}))}function bS(e){return function(e){return new Promise((t=>{const n=document.createElement("input");n.type="file",n.accept=e,n.onchange=()=>{const e=n.files?.[0];e&&t(e)},n.click()}))}(e).then(yS)}const vS=({trigger:t,setOpen:n,open:r})=>{const[i,a]=e.useState(""),s=e.useContext(pF);return s.options.useWorkerManager?o.createElement(Kw,{setOpen:n,open:r,trigger:t,title:"New Worker",description:"Create a new worker"},o.createElement("div",null,"Name:",o.createElement("br",null),o.createElement("input",{className:"styledinput",onChange:e=>{a(e.currentTarget.value)},value:i})),o.createElement("div",null,i&&o.createElement("div",null,o.createElement("button",{className:"styledbtn",onClick:()=>{s.workermanager?.new_worker({name:i}),n(!1)}},"Create")))):null},wS=({trigger:t,setOpen:n,open:r})=>{const i=e.useContext(pF),[a,s]=e.useState(!1),l=i.workers(),c=i.worker?.uuid,u=(c?l[c]?.name:void 0)||c||"worker";return o.createElement(Kw,{setOpen:n,open:r,trigger:t,title:"Export Worker",description:"Export the worker as a .fnw file"},o.createElement("div",null,o.createElement("div",null,o.createElement("input",{type:"checkbox",className:"styledcheckbox",checked:a,onChange:e=>{s(e.currentTarget.checked)}}),"Include Files"),o.createElement("button",{className:"styledbtn",onClick:async()=>{if(!i.worker)return;!function(e,t,n){const r=gS(e,n),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=t,i.click(),URL.revokeObjectURL(o),i.remove()}(await i.worker.export({withFiles:a}),u+".fnw","application/zip"),n(!1)}},"Export")))},xS=()=>{const t=e.useContext(pF).progress_state();return o.createElement("div",{className:"statusbar"},o.createElement("span",{className:"statusbar-progressbar",style:{width:Math.min(100,100*t.progress)+"%"}}),o.createElement("span",{className:"statusbar-message"},t.message))},CS=()=>{const t=e.useContext(pF),n=t.workers(),[r,i]=e.useState(!1),[a,s]=e.useState(!1),l=t.options.useWorkerManager&&t.workermanager&&t.workermanager.open,c=l&&Object.keys(n).length>0,u=t.worker&&t.worker.is_open,d=u&&l;return l||u?o.createElement(o.Fragment,null,o.createElement(iS,null,o.createElement(aS,{asChild:!0},o.createElement("button",{className:"styledbtn"},o.createElement(Tv,{direction:"row",spacing:1},o.createElement(Ov,null,"Worker")," ",o.createElement(kv,null)))),o.createElement(sS,null,o.createElement(lS,{className:"headermenucontent funcnodescontainer"},o.createElement(cS,null,c&&o.createElement(fS,null,o.createElement(hS,{className:"headermenuitem submenuitem"},o.createElement(Tv,{direction:"row",spacing:1},"Select",o.createElement(Mv,null))),o.createElement(sS,null,o.createElement(mS,{className:"headermenucontent funcnodescontainer",sideOffset:2,alignOffset:-5},o.createElement(dS,{value:t.worker?.uuid,onValueChange:e=>{(e=>{if("__select__"!==e&&t.workers&&t.workermanager&&n[e]){if(!n[e].active&&!window.confirm("this is an inactive worker, selecting it will start it, continue?"))return;t.workermanager.set_active(e)}})(e)}},Object.keys(n).sort(((e,t)=>{if(n[e].active&&!n[t].active)return-1;if(!n[e].active&&n[t].active)return 1;const r=n[e].name||e,o=n[t].name||t;return r.localeCompare(o)})).map((e=>o.createElement(pS,{className:"headermenuitem workerselectoption"+(n[e]?.active?" active":" inactive")+" headermenuitem",key:e,value:e,disabled:e===t.worker?.uuid},n[e]?.name||e))))))),u&&o.createElement(o.Fragment,null,d&&o.createElement(uS,{className:"headermenuitem",onClick:()=>{if(t.worker)return t.workermanager?void t.workermanager?.restart_worker(t.worker.uuid):t.logger.error("no workermanager")}},"Restart"),o.createElement(uS,{className:"headermenuitem",onClick:()=>{t.worker&&t.worker.stop()}},"Stop"),o.createElement(uS,{className:"headermenuitem",onClick:()=>s(!0)},"Export"),o.createElement(uS,{className:"headermenuitem",onClick:async()=>{if(!t.worker)return;if(!window.confirm("Updateing the worker might replace the current nodespace, continue?"))return;const e=await bS(".fnw");t.worker.update_from_export(e)}},"Update")),l&&o.createElement(o.Fragment,null,o.createElement(uS,{className:"headermenuitem",onClick:()=>i(!0)},"New")))))),o.createElement(vS,{open:r,setOpen:i}),o.createElement(wS,{open:a,setOpen:s})):null},ES=()=>{const t=e.useContext(pF);return o.createElement(o.Fragment,null,o.createElement(iS,null,o.createElement(aS,{asChild:!0},o.createElement("button",{className:"styledbtn"},o.createElement(Tv,{direction:"row",spacing:1},o.createElement(Ov,null,"Nodespace")," ",o.createElement(kv,null)))),o.createElement(sS,null,o.createElement(lS,{className:"headermenucontent funcnodescontainer"},o.createElement(cS,null,o.createElement(uS,{className:"headermenuitem",onClick:()=>{window.confirm("Are you sure you want to start a new flow?")&&t.worker?.clear()}},"New"),o.createElement(uS,{className:"headermenuitem",onClick:async()=>{const e=await(t.worker?.save());if(!e)return;const n=new Blob([JSON.stringify(e)],{type:"application/json"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download="flow.json",o.click(),URL.revokeObjectURL(r),o.remove()}},"Save"),o.createElement(uS,{className:"headermenuitem",onClick:async()=>{const e=document.createElement("input");e.type="file",e.accept=".json",e.onchange=async e=>{const n=e.target.files?.[0];if(!n)return;const r=new FileReader;r.onload=async e=>{const n=e.target?.result;if(!n)return;const r=JSON.parse(n);await(t.worker?.load(r))},r.readAsText(n)},e.click()}},"Load"))))))},kS=({...t})=>{const n=e.useContext(pF),r=n.workerstate();return Object.keys(t).length>0&&n.logger.debug("headerprops",t),o.createElement("div",{className:"funcnodesreactflowheader"},o.createElement("div",{className:"headerelement"},o.createElement(xS,null)),t.showmenu&&o.createElement(o.Fragment,null,o.createElement("div",{className:"headerelement"},o.createElement(CS,null)),n.worker&&r.is_open&&o.createElement("div",{className:"headerelement"},o.createElement(ES,null))))};const SS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_S={};function AS(e,t){return(_S.jsx?IS:SS).test(e)}const NS=/[ \t\n\f\r]/g;function RS(e){return""===e.replace(NS,"")}class OS{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function TS(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new OS(n,r,t)}function MS(e){return e.toLowerCase()}OS.prototype.property={},OS.prototype.normal={},OS.prototype.space=null;class PS{constructor(e,t){this.property=e,this.attribute=t}}PS.prototype.space=null,PS.prototype.boolean=!1,PS.prototype.booleanish=!1,PS.prototype.overloadedBoolean=!1,PS.prototype.number=!1,PS.prototype.commaSeparated=!1,PS.prototype.spaceSeparated=!1,PS.prototype.commaOrSpaceSeparated=!1,PS.prototype.mustUseProperty=!1,PS.prototype.defined=!1;let DS=0;const BS=HS(),jS=HS(),FS=HS(),LS=HS(),VS=HS(),zS=HS(),GS=HS();function HS(){return 2**++DS}var WS=Object.freeze({__proto__:null,boolean:BS,booleanish:jS,commaOrSpaceSeparated:GS,commaSeparated:zS,number:LS,overloadedBoolean:FS,spaceSeparated:VS});const XS=Object.keys(WS);class ZS extends PS{constructor(e,t,n,r){let o=-1;if(super(e,t),$S(this,"space",r),"number"==typeof n)for(;++o<XS.length;){const e=XS[o];$S(this,XS[o],(n&WS[e])===WS[e])}}}function $S(e,t,n){n&&(e[t]=n)}ZS.prototype.defined=!0;const YS={}.hasOwnProperty;function US(e){const t={},n={};let r;for(r in e.properties)if(YS.call(e.properties,r)){const o=e.properties[r],i=new ZS(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[MS(r)]=r,n[MS(i.attribute)]=r}return new OS(t,n,e.space)}const JS=US({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),KS=US({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function QS(e,t){return t in e?e[t]:t}function qS(e,t){return QS(e,t.toLowerCase())}const eI=US({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:qS,properties:{xmlns:null,xmlnsXLink:null}}),tI=US({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:jS,ariaAutoComplete:null,ariaBusy:jS,ariaChecked:jS,ariaColCount:LS,ariaColIndex:LS,ariaColSpan:LS,ariaControls:VS,ariaCurrent:null,ariaDescribedBy:VS,ariaDetails:null,ariaDisabled:jS,ariaDropEffect:VS,ariaErrorMessage:null,ariaExpanded:jS,ariaFlowTo:VS,ariaGrabbed:jS,ariaHasPopup:null,ariaHidden:jS,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:VS,ariaLevel:LS,ariaLive:null,ariaModal:jS,ariaMultiLine:jS,ariaMultiSelectable:jS,ariaOrientation:null,ariaOwns:VS,ariaPlaceholder:null,ariaPosInSet:LS,ariaPressed:jS,ariaReadOnly:jS,ariaRelevant:null,ariaRequired:jS,ariaRoleDescription:VS,ariaRowCount:LS,ariaRowIndex:LS,ariaRowSpan:LS,ariaSelected:jS,ariaSetSize:LS,ariaSort:null,ariaValueMax:LS,ariaValueMin:LS,ariaValueNow:LS,ariaValueText:null,role:null}}),nI=US({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:qS,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zS,acceptCharset:VS,accessKey:VS,action:null,allow:null,allowFullScreen:BS,allowPaymentRequest:BS,allowUserMedia:BS,alt:null,as:null,async:BS,autoCapitalize:null,autoComplete:VS,autoFocus:BS,autoPlay:BS,blocking:VS,capture:null,charSet:null,checked:BS,cite:null,className:VS,cols:LS,colSpan:null,content:null,contentEditable:jS,controls:BS,controlsList:VS,coords:LS|zS,crossOrigin:null,data:null,dateTime:null,decoding:null,default:BS,defer:BS,dir:null,dirName:null,disabled:BS,download:FS,draggable:jS,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:BS,formTarget:null,headers:VS,height:LS,hidden:BS,high:LS,href:null,hrefLang:null,htmlFor:VS,httpEquiv:VS,id:null,imageSizes:null,imageSrcSet:null,inert:BS,inputMode:null,integrity:null,is:null,isMap:BS,itemId:null,itemProp:VS,itemRef:VS,itemScope:BS,itemType:VS,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:BS,low:LS,manifest:null,max:null,maxLength:LS,media:null,method:null,min:null,minLength:LS,multiple:BS,muted:BS,name:null,nonce:null,noModule:BS,noValidate:BS,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:BS,optimum:LS,pattern:null,ping:VS,placeholder:null,playsInline:BS,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:BS,referrerPolicy:null,rel:VS,required:BS,reversed:BS,rows:LS,rowSpan:LS,sandbox:VS,scope:null,scoped:BS,seamless:BS,selected:BS,shadowRootClonable:BS,shadowRootDelegatesFocus:BS,shadowRootMode:null,shape:null,size:LS,sizes:null,slot:null,span:LS,spellCheck:jS,src:null,srcDoc:null,srcLang:null,srcSet:null,start:LS,step:null,style:null,tabIndex:LS,target:null,title:null,translate:null,type:null,typeMustMatch:BS,useMap:null,value:jS,width:LS,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:VS,axis:null,background:null,bgColor:null,border:LS,borderColor:null,bottomMargin:LS,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:BS,declare:BS,event:null,face:null,frame:null,frameBorder:null,hSpace:LS,leftMargin:LS,link:null,longDesc:null,lowSrc:null,marginHeight:LS,marginWidth:LS,noResize:BS,noHref:BS,noShade:BS,noWrap:BS,object:null,profile:null,prompt:null,rev:null,rightMargin:LS,rules:null,scheme:null,scrolling:jS,standby:null,summary:null,text:null,topMargin:LS,valueType:null,version:null,vAlign:null,vLink:null,vSpace:LS,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:BS,disableRemotePlayback:BS,prefix:null,property:null,results:LS,security:null,unselectable:null}}),rI=US({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:QS,properties:{about:GS,accentHeight:LS,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:LS,amplitude:LS,arabicForm:null,ascent:LS,attributeName:null,attributeType:null,azimuth:LS,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:LS,by:null,calcMode:null,capHeight:LS,className:VS,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:LS,diffuseConstant:LS,direction:null,display:null,dur:null,divisor:LS,dominantBaseline:null,download:BS,dx:null,dy:null,edgeMode:null,editable:null,elevation:LS,enableBackground:null,end:null,event:null,exponent:LS,externalResourcesRequired:null,fill:null,fillOpacity:LS,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:zS,g2:zS,glyphName:zS,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:LS,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:LS,horizOriginX:LS,horizOriginY:LS,id:null,ideographic:LS,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:LS,k:LS,k1:LS,k2:LS,k3:LS,k4:LS,kernelMatrix:GS,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:LS,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:LS,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:LS,overlineThickness:LS,paintOrder:null,panose1:null,path:null,pathLength:LS,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:VS,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:LS,pointsAtY:LS,pointsAtZ:LS,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:GS,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:GS,rev:GS,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:GS,requiredFeatures:GS,requiredFonts:GS,requiredFormats:GS,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:LS,specularExponent:LS,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:LS,strikethroughThickness:LS,string:null,stroke:null,strokeDashArray:GS,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:LS,strokeOpacity:LS,strokeWidth:null,style:null,surfaceScale:LS,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:GS,tabIndex:LS,tableValues:null,target:null,targetX:LS,targetY:LS,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:GS,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:LS,underlineThickness:LS,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:LS,values:null,vAlphabetic:LS,vMathematical:LS,vectorEffect:null,vHanging:LS,vIdeographic:LS,version:null,vertAdvY:LS,vertOriginX:LS,vertOriginY:LS,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:LS,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),oI=/^data[-\w.:]+$/i,iI=/-[a-z]/g,aI=/[A-Z]/g;function sI(e){return"-"+e.toLowerCase()}function lI(e){return e.charAt(1).toUpperCase()}const cI={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},uI=TS([KS,JS,eI,tI,nI],"html"),dI=TS([KS,JS,eI,tI,rI],"svg");var pI,fI,hI,mI={};var gI=function(){if(hI)return mI;hI=1;var e=mI&&mI.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mI,"__esModule",{value:!0}),mI.default=function(e,n){var r=null;if(!e||"string"!=typeof e)return r;var o=(0,t.default)(e),i="function"==typeof n;return o.forEach((function(e){if("declaration"===e.type){var t=e.property,o=e.value;i?n(t,o,e):o&&((r=r||{})[t]=o)}})),r};var t=e(function(){if(fI)return pI;fI=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l="";function c(e){return e?e.replace(s,l):l}return pI=function(s,u){if("string"!=typeof s)throw new TypeError("First argument must be a string");if(!s)return[];u=u||{};var d=1,p=1;function f(e){var n=e.match(t);n&&(d+=n.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function h(){var e={line:d,column:p};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=u.source}function g(e){var t=new Error(u.source+":"+d+":"+p+": "+e);if(t.reason=e,t.filename=u.source,t.line=d,t.column=p,t.source=s,!u.silent)throw t}function y(e){var t=e.exec(s);if(t){var n=t[0];return f(n),s=s.slice(n.length),t}}function b(){y(n)}function v(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=h();if("/"==s.charAt(0)&&"*"==s.charAt(1)){for(var t=2;l!=s.charAt(t)&&("*"!=s.charAt(t)||"/"!=s.charAt(t+1));)++t;if(t+=2,l===s.charAt(t-1))return g("End of comment missing");var n=s.slice(2,t-2);return p+=2,f(n),s=s.slice(t),p+=2,e({type:"comment",comment:n})}}function x(){var t=h(),n=y(r);if(n){if(w(),!y(o))return g("property missing ':'");var s=y(i),u=t({type:"declaration",property:c(n[0].replace(e,l)),value:s?c(s[0].replace(e,l)):l});return y(a),u}}return m.prototype.content=s,b(),function(){var e,t=[];for(v(t);e=x();)!1!==e&&(t.push(e),v(t));return t}()},pI}());return mI}(),yI=l(gI),bI=yI.default||yI;const vI=xI("end"),wI=xI("start");function xI(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function CI(e){return e&&"object"==typeof e?"position"in e||"type"in e?kI(e.position):"start"in e||"end"in e?kI(e):"line"in e||"column"in e?EI(e):"":""}function EI(e){return SI(e&&e.line)+":"+SI(e&&e.column)}function kI(e){return EI(e&&e.start)+"-"+EI(e&&e.end)}function SI(e){return e&&"number"==typeof e?e:1}class II extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=a?a.line:void 0,this.name=CI(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}II.prototype.file="",II.prototype.name="",II.prototype.reason="",II.prototype.message="",II.prototype.stack="",II.prototype.column=void 0,II.prototype.line=void 0,II.prototype.ancestors=void 0,II.prototype.cause=void 0,II.prototype.fatal=void 0,II.prototype.place=void 0,II.prototype.ruleId=void 0,II.prototype.source=void 0;const _I={}.hasOwnProperty,AI=new Map,NI=/[A-Z]/g,RI=/-([a-z])/g,OI=new Set(["table","tbody","thead","tfoot","tr"]),TI=new Set(["td","th"]),MI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function PI(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const a=Array.isArray(o.children),s=wI(n);return t(r,o,i,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const a=Array.isArray(o.children)?n:t;return i?a(r,o,i):a(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?dI:uI,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=DI(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function DI(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=dI,e.schema=o);e.ancestors.push(t);const i=VI(e,t.tagName,!1),a=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&_I.call(t.properties,o)){const i=LI(e,o,t.properties[o]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof a&&TI.has(t.tagName)?r=a:n[o]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=FI(e,t);OI.has(t.tagName)&&(s=s.filter((function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&RS(t.value):RS(t));var t})));return BI(e,a,i,t),jI(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}zI(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=dI,e.schema=o);e.ancestors.push(t);const i=null===t.name?e.Fragment:VI(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];t.type;const o=t.expression;o.type;const i=o.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else zI(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];t.type,i=e.evaluater.evaluateExpression(t.expression)}else zI(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=FI(e,t);return BI(e,a,i,t),jI(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zI(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return jI(r,FI(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function BI(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function jI(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function FI(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:AI;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;a=e+"-"+t,o.set(e,t+1)}}const s=DI(e,i,a);void 0!==s&&n.push(s)}return n}function LI(e,t,n){const r=function(e,t){const n=MS(t);let r=t,o=PS;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&oI.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(iI,lI);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!iI.test(e)){let n=e.replace(aI,sI);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=ZS}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):function(e){return e.join(" ").trim()}(n)),"style"===r.property){let t="object"==typeof n?n:function(e,t){const n={};try{bI(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new II("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=MI+"#cannot-parse-style-attribute",r}}return n;function r(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(RI,HI)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)_I.call(e,n)&&(t[GI(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?cI[r.property]||r.property:r.attribute,n]}}function VI(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=AS(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=AS(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return _I.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);zI(e)}function zI(e,t){const n=new II("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=MI+"#cannot-handle-mdx-estrees-without-createevaluater",n}function GI(e){let t=e.replace(NI,WI);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function HI(e,t){return t.toUpperCase()}function WI(e){return"-"+e.toLowerCase()}const XI={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},ZI={};function $I(e,t){return YI(e,"boolean"!=typeof ZI.includeImageAlt||ZI.includeImageAlt,"boolean"!=typeof ZI.includeHtml||ZI.includeHtml)}function YI(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return UI(e.children,t,n)}return Array.isArray(e)?UI(e,t,n):""}function UI(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=YI(e[o],t,n);return r.join("")}const JI=document.createElement("i");function KI(e){const t="&"+e+";";JI.innerHTML=t;const n=JI.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function QI(e,t,n,r){const o=e.length;let i,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function qI(e,t){return e.length>0?(QI(e,e.length,0,t),e):t}const e_={}.hasOwnProperty;function t_(e){const t={};let n=-1;for(;++n<e.length;)n_(t,e[n]);return t}function n_(e,t){let n;for(n in t){const r=(e_.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){e_.call(r,i)||(r[i]=[]);const e=o[i];r_(r[i],Array.isArray(e)?e:e?[e]:[])}}}function r_(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);QI(e,0,0,r)}function o_(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function i_(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const a_=b_(/[A-Za-z]/),s_=b_(/[\dA-Za-z]/),l_=b_(/[#-'*+\--9=?A-Z^-~]/);function c_(e){return null!==e&&(e<32||127===e)}const u_=b_(/\d/),d_=b_(/[\dA-Fa-f]/),p_=b_(/[!-/:-@[-`{-~]/);function f_(e){return null!==e&&e<-2}function h_(e){return null!==e&&(e<0||32===e)}function m_(e){return-2===e||-1===e||32===e}const g_=b_(/\p{P}|\p{S}/u),y_=b_(/\s/);function b_(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function v_(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(37===i&&s_(e.charCodeAt(n+1))&&s_(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function w_(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(m_(r))return e.enter(n),a(r);return t(r)};function a(r){return m_(r)&&i++<o?(e.consume(r),a):(e.exit(n),t(r))}}const x_={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,(function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),w_(e,t,"linePrefix")}),(function(t){return e.enter("paragraph"),r(t)}));let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):f_(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const C_={tokenize:function(e){const t=this,n=[];let r,o,i,a=0;return s;function s(r){if(a<n.length){const o=n[a];return t.containerState=o[1],e.attempt(o[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&b();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}y(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return QI(t.events,i+1,0,t.events.slice(n)),t.events.length=s,c(e)}return s(e)}function c(o){if(a===n.length){if(!r)return p(o);if(r.currentConstruct&&r.currentConstruct.concrete)return h(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(E_,u,d)(o)}function u(e){return r&&b(),y(a),p(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,h(e)}function p(n){return t.containerState={},e.attempt(E_,f,h)(n)}function f(e){return a++,n.push([t.currentConstruct,t.containerState]),p(e)}function h(n){return null===n?(r&&b(),y(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),y(0),void e.consume(n)):f_(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),m)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){s=t.events[l][1].end;break}o=!0}for(y(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;QI(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function y(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function b(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},E_={tokenize:function(e,t,n){return w_(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function k_(e){return null===e||h_(e)||y_(e)?1:g_(e)?2:void 0}function S_(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const I_={name:"attention",resolveAll:function(e,t){let n,r,o,i,a,s,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},p={...e[u][1].start};__(d,-s),__(p,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=qI(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=qI(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=qI(l,S_(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=qI(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=qI(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,QI(e,n-1,u-n+3,l),u=n+l.length-c-2;break}u=-1;for(;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=k_(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===i)return e.consume(s),a;const l=e.exit("attentionSequence"),c=k_(s),u=!c||2===c&&o||n.includes(s),d=!o||2===o&&c||n.includes(r);return l._open=Boolean(42===i?u:u&&(o||!d)),l._close=Boolean(42===i?d:d&&(c||!u)),t(s)}}};function __(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const A_={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return a_(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||s_(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||s_(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||c_(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),c):l_(t)?(e.consume(t),l):n(t)}function c(e){return s_(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||s_(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}};const N_={partial:!0,tokenize:function(e,t,n){return function(t){return m_(t)?w_(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||f_(e)?t(e):n(e)}}};const R_={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(m_(t))return w_(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(R_,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return m_(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const O_={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return p_(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const T_={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=s_,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=d_,c):(e.enter("characterReferenceValue"),o=7,i=u_,c(t))}function c(s){if(59===s&&a){const o=e.exit("characterReferenceValue");return i!==s_||KI(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++<o?(e.consume(s),c):n(s)}}};const M_={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},P_={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),m_(t)?w_(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===i?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===i?(o++,e.consume(t),u):o>=s?(e.exit("codeFencedFenceSequence"),m_(t)?w_(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||f_(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),m_(t)?w_(e,c,"whitespace")(t):c(t))}function c(n){return null===n||f_(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(M_,f,b)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||f_(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):m_(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),w_(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),u)}function d(t){return null===t||f_(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(t))}function p(t){return null===t||f_(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===i?n(t):(e.consume(t),p)}function f(t){return e.attempt(o,b,h)(t)}function h(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&m_(t)?w_(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||f_(t)?e.check(M_,f,b)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||f_(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function b(n){return e.exit("codeFenced"),t(n)}}};const D_={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),w_(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):f_(t)?e.attempt(B_,i,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||f_(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},B_={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):f_(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):w_(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):f_(e)?o(e):n(e)}}};const j_={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}t=o-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):f_(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||f_(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}};class F_{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&L_(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),L_(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),L_(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);L_(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);L_(this.left,t.reverse())}}}function L_(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function V_(e){const t={};let n,r,o,i,a,s,l,c=-1;const u=new F_(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,z_(u,c)),c=t[c],l=!0);else if(n[1]._container){for(o=c,r=void 0;o--;)if(i=u.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type)break;r&&(n[1].end={...u.get(r)[1].start},a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return QI(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function z_(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[],a=n._tokenizer||r.parser[n.contentType](n.start),s=a.events,l=[],c={};let u,d,p=-1,f=n,h=0,m=0;const g=[m];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++p<s.length;)"exit"===s[p][0]&&"enter"===s[p-1][0]&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(m=p+1,g.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),p=g.length;p--;){const t=s.slice(g[p],g[p+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),p=-1;++p<l.length;)c[h+l[p][0]]=h+l[p][1],h+=l[p][1]-l[p][0]-1;return c}const G_={resolve:function(e){return V_(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):f_(t)?e.check(H_,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},H_={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),w_(e,o,"linePrefix")};function o(o){if(null===o||f_(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function W_(e,t,n,r,o,i,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d;if(null===t||32===t||41===t||c_(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(t)};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||f_(t)?n(t):(e.consume(t),92===t?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(o){return u||null!==o&&41!==o&&!h_(o)?u<c&&40===o?(e.consume(o),u++,h):41===o?(e.consume(o),u--,h):null===o||32===o||40===o||c_(o)?n(o):(e.consume(o),92===o?m:h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function X_(e,t,n,r,o,i){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),c};function c(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):f_(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||f_(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!m_(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function Z_(e,t,n,r,o,i){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):f_(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),w_(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||f_(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function $_(e,t){let n;return function r(o){if(f_(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(m_(o))return w_(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}const Y_={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return X_.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=i_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return h_(t)?$_(e,s)(t):s(t)}function s(t){return W_(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(U_,c,c)(t)}function c(t){return m_(t)?w_(e,u,"whitespace")(t):u(t)}function u(i){return null===i||f_(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},U_={partial:!0,tokenize:function(e,t,n){return function(t){return h_(t)?$_(e,r)(t):n(t)};function r(t){return Z_(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return m_(t)?w_(e,i,"whitespace")(t):i(t)}function i(e){return null===e||f_(e)?t(e):n(e)}}};const J_={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return f_(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const K_={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},QI(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||h_(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||f_(n)?(e.exit("atxHeading"),t(n)):m_(n)?w_(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||h_(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const Q_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],q_=["pre","script","style","textarea"],eA={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let o,i,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),i=!0,f):63===s?(e.consume(s),o=3,r.interrupt?t:P):a_(s)?(e.consume(s),a=String.fromCharCode(s),h):n(s)}function u(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,s=0,p):a_(i)?(e.consume(i),o=4,r.interrupt?t:P):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:P):n(o)}function p(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:I:p):n(o)}function f(t){return a_(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(s){if(null===s||47===s||62===s||h_(s)){const l=47===s,c=a.toLowerCase();return l||i||!q_.includes(c)?Q_.includes(a.toLowerCase())?(o=6,l?(e.consume(s),m):r.interrupt?t(s):I(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):y(s)):(o=1,r.interrupt?t(s):I(s))}return 45===s||s_(s)?(e.consume(s),a+=String.fromCharCode(s),h):n(s)}function m(o){return 62===o?(e.consume(o),r.interrupt?t:I):n(o)}function g(t){return m_(t)?(e.consume(t),g):k(t)}function y(t){return 47===t?(e.consume(t),k):58===t||95===t||a_(t)?(e.consume(t),b):m_(t)?(e.consume(t),y):k(t)}function b(t){return 45===t||46===t||58===t||95===t||s_(t)?(e.consume(t),b):v(t)}function v(t){return 61===t?(e.consume(t),w):m_(t)?(e.consume(t),v):y(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,x):m_(t)?(e.consume(t),w):C(t)}function x(t){return t===l?(e.consume(t),l=null,E):null===t||f_(t)?n(t):(e.consume(t),x)}function C(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||h_(t)?v(t):(e.consume(t),C)}function E(e){return 47===e||62===e||m_(e)?y(e):n(e)}function k(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||f_(t)?I(t):m_(t)?(e.consume(t),S):n(t)}function I(t){return 45===t&&2===o?(e.consume(t),R):60===t&&1===o?(e.consume(t),O):62===t&&4===o?(e.consume(t),D):63===t&&3===o?(e.consume(t),P):93===t&&5===o?(e.consume(t),M):!f_(t)||6!==o&&7!==o?null===t||f_(t)?(e.exit("htmlFlowData"),_(t)):(e.consume(t),I):(e.exit("htmlFlowData"),e.check(tA,B,_)(t))}function _(t){return e.check(nA,A,B)(t)}function A(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N}function N(t){return null===t||f_(t)?_(t):(e.enter("htmlFlowData"),I(t))}function R(t){return 45===t?(e.consume(t),P):I(t)}function O(t){return 47===t?(e.consume(t),a="",T):I(t)}function T(t){if(62===t){const n=a.toLowerCase();return q_.includes(n)?(e.consume(t),D):I(t)}return a_(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),T):I(t)}function M(t){return 93===t?(e.consume(t),P):I(t)}function P(t){return 62===t?(e.consume(t),D):45===t&&2===o?(e.consume(t),P):I(t)}function D(t){return null===t||f_(t)?(e.exit("htmlFlowData"),B(t)):(e.consume(t),D)}function B(n){return e.exit("htmlFlow"),t(n)}}},tA={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(N_,t,n)}}},nA={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(f_(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const rA={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),w):63===t?(e.consume(t),b):a_(t)?(e.consume(t),E):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,f):a_(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):f_(t)?(a=u,T(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?O(e):45===e?d(e):u(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?h:f):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):f_(t)?(a=h,T(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),g):h(t)}function g(t){return 62===t?O(t):93===t?(e.consume(t),g):h(t)}function y(t){return null===t||62===t?O(t):f_(t)?(a=y,T(t)):(e.consume(t),y)}function b(t){return null===t?n(t):63===t?(e.consume(t),v):f_(t)?(a=b,T(t)):(e.consume(t),b)}function v(e){return 62===e?O(e):b(e)}function w(t){return a_(t)?(e.consume(t),x):n(t)}function x(t){return 45===t||s_(t)?(e.consume(t),x):C(t)}function C(t){return f_(t)?(a=C,T(t)):m_(t)?(e.consume(t),C):O(t)}function E(t){return 45===t||s_(t)?(e.consume(t),E):47===t||62===t||h_(t)?k(t):n(t)}function k(t){return 47===t?(e.consume(t),O):58===t||95===t||a_(t)?(e.consume(t),S):f_(t)?(a=k,T(t)):m_(t)?(e.consume(t),k):O(t)}function S(t){return 45===t||46===t||58===t||95===t||s_(t)?(e.consume(t),S):I(t)}function I(t){return 61===t?(e.consume(t),_):f_(t)?(a=I,T(t)):m_(t)?(e.consume(t),I):k(t)}function _(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,A):f_(t)?(a=_,T(t)):m_(t)?(e.consume(t),_):(e.consume(t),N)}function A(t){return t===o?(e.consume(t),o=void 0,R):null===t?n(t):f_(t)?(a=A,T(t)):(e.consume(t),A)}function N(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||h_(t)?k(t):(e.consume(t),N)}function R(e){return 47===e||62===e||h_(e)?k(e):n(e)}function O(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function T(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return m_(t)?w_(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):P(t)}function P(t){return e.enter("htmlTextData"),a(t)}}};const oA={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&QI(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,o,i,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",l,t],["enter",c,t]],i=qI(i,e.slice(r+1,r+s+3)),i=qI(i,[["enter",u,t]]),i=qI(i,S_(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=qI(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=qI(i,e.slice(o+1)),i=qI(i,[["exit",l,t]]),QI(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){o=r.events[a][1];break}return function(t){if(!o)return n(t);if(o._inactive)return u(t);return i=r.parser.defined.includes(i_(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(iA,c,i?c:u)(t):91===t?e.attempt(aA,c,i?l:u)(t):i?c(t):u(t)}function l(t){return e.attempt(sA,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}}},iA={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return h_(t)?$_(e,o)(t):o(t)}function o(t){return 41===t?c(t):W_(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return h_(t)?$_(e,s)(t):c(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?Z_(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return h_(t)?$_(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},aA={tokenize:function(e,t,n){const r=this;return function(t){return X_.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(i_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},sA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const lA={name:"labelStartImage",resolveAll:oA.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const cA={name:"labelStartLink",resolveAll:oA.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const uA={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),w_(e,t,"linePrefix")}}};const dA={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):o>=3&&(null===i||f_(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),o++,a):(e.exit("thematicBreakSequence"),m_(t)?w_(e,i,"whitespace")(t):i(t))}}};const pA={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(N_,o,i);function o(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,w_(e,t,"listItemIndent",r.containerState.size+1)(n)}function i(n){return r.containerState.furtherBlankLines||!m_(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(hA,t,a)(n))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,w_(e,e.attempt(pA,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:u_(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(dA,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return u_(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(N_,r.interrupt?n:c,e.attempt(fA,d,u))}function c(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function u(t){return m_(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},fA={partial:!0,tokenize:function(e,t,n){const r=this;return w_(e,(function(e){const o=r.events[r.events.length-1];return!m_(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},hA={partial:!0,tokenize:function(e,t,n){const r=this;return w_(e,(function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)}};const mA={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a;return e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),m_(t)?w_(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||f_(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const gA={tokenize:function(e){const t=this,n=e.attempt(N_,(function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}),e.attempt(this.parser.constructs.flowInitial,r,w_(e,e.attempt(this.parser.constructs.flow,r,e.attempt(G_,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const yA={resolveAll:xA()},bA=wA("string"),vA=wA("text");function wA(e){return{resolveAll:xA("text"===e?CA:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function xA(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function CA(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,a=o.length,s=-1,l=0;for(;a--;){const e=o[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const EA={42:pA,43:pA,45:pA,48:pA,49:pA,50:pA,51:pA,52:pA,53:pA,54:pA,55:pA,56:pA,57:pA,62:R_},kA={91:Y_},SA={[-2]:D_,[-1]:D_,32:D_},IA={35:K_,42:dA,45:[mA,dA],60:eA,61:mA,95:dA,96:P_,126:P_},_A={38:T_,92:O_},AA={[-5]:uA,[-4]:uA,[-3]:uA,33:lA,38:T_,42:I_,60:[A_,rA],91:cA,92:[J_,O_],93:oA,95:I_,96:j_},NA={null:[I_,yA]};var RA=Object.freeze({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:kA,disable:{null:[]},document:EA,flow:IA,flowInitial:SA,insideSpan:NA,string:_A,text:AA});function OA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],s=[];const l={attempt:g((function(e,t){y(e,t.from)})),check:g(m),consume:function(e){f_(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,b()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));c.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:g(m,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,b()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&o)continue;a=" ";break;default:a=String.fromCharCode(i)}o=-2===i,r.push(a)}return r.join("")}(d(e),t)},sliceStream:d,write:function(e){if(a=qI(a,e),f(),null!==a[a.length-1])return[];return y(t,0),c.events=S_(i,c.events,c),c.events}};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}(a,e)}function p(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function f(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)h(t.charCodeAt(r._bufferIndex));else h(t)}}function h(e){u=u(e)}function m(e,t){t.restore()}function g(e,t){return function(n,o,i){let a,u,d,f;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return h([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function h(e){return a=e,u=0,0===e.length?i:m(e[u])}function m(e){return function(n){f=function(){const e=p(),t=c.previous,n=c.currentConstruct,o=c.events.length,i=Array.from(s);return{from:o,restore:a};function a(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=o,s=i,b()}}(),d=e,e.partial||(c.currentConstruct=e);if(e.name&&c.parser.constructs.disable.null.includes(e.name))return y();return e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,g,y)(n)}}function g(t){return e(d,f),o}function y(e){return f.restore(),++u<a.length?m(a[u]):i}}}function y(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&QI(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function b(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const TA=/[\0\t\n\r]/g;const MA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function PA(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return o_(n.slice(t?2:1),t?16:10)}return KI(n)||e}const DA={}.hasOwnProperty;function BA(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:S,autolinkEmail:S,atxHeading:i(K),blockQuote:i(Z),characterEscape:S,characterReference:S,codeFenced:i($),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i($,a),codeText:i(Y,a),codeTextData:S,data:S,codeFlowValue:S,definition:i(U),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(J),hardBreakEscape:i(Q),hardBreakTrailing:i(Q),htmlFlow:i(q,a),htmlFlowData:S,htmlText:i(q,a),htmlTextData:S,image:i(ee),label:a,link:i(te),listItem:i(re),listItemValue:p,listOrdered:i(ne,d),listUnordered:i(ne),paragraph:i(oe),reference:L,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(K),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:l(),atxHeadingSequence:x,autolink:l(),autolinkEmail:X,autolinkProtocol:W,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:G,characterReference:H,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:h,codeFlowValue:I,codeIndented:l(y),codeText:l(O),codeTextData:I,data:I,definition:l(),definitionDestinationString:w,definitionLabelString:b,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(N),htmlFlowData:I,htmlText:l(R),htmlTextData:I,image:l(M),label:D,labelText:P,lineEnding:_,link:l(T),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:B,resourceTitleString:j,resource:F,setextHeading:l(k),setextHeadingLineSequence:E,setextHeadingText:C,strong:l(),thematicBreak:l()}};FA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},l=[];let d=-1;for(;++d<e.length;)if("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)if("enter"===e[d][0])l.push(d);else{d=o(e,l.pop(),d)}for(d=-1;++d<e.length;){const n=t[e[d][0]];DA.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},i),e[d][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||VA).call(i,void 0,e[0])}for(r.position={start:jA(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:jA(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function o(e,t,n){let r,o,i,a,s=t-1,l=-1,c=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||i||(i=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(o=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",o=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,a=!0}}}return e[t][1]._spread=c,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:jA(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+CI({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||VA).call(this,e,r[0])}n.position.end=jA(e.end)}function u(){return $I(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function f(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function h(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function b(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=i_(this.sliceSerialize(e)).toLowerCase()}function v(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function x(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function E(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function S(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:jA(e.start),end:void 0},t.push(n)),this.stack.push(n)}function I(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=jA(e.end)}function _(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=jA(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(S.call(this,e),I.call(this,e))}function A(){this.data.atHardBreak=!0}function N(){const e=this.resume();this.stack[this.stack.length-1].value=e}function R(){const e=this.resume();this.stack[this.stack.length-1].value=e}function O(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(MA,PA)}(t),n.identifier=i_(t).toLowerCase()}function D(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function B(){const e=this.resume();this.stack[this.stack.length-1].url=e}function j(){const e=this.resume();this.stack[this.stack.length-1].title=e}function F(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function V(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=i_(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function z(e){this.data.characterReferenceType=e.type}function G(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=o_(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=KI(t)}this.stack[this.stack.length-1].value+=r}function H(e){this.stack.pop().position.end=jA(e.end)}function W(e){I.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function X(e){I.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function Z(){return{type:"blockquote",children:[]}}function $(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function U(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function J(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function Q(){return{type:"break"}}function q(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!V_(e););return e}(function(e){const t={constructs:t_([RA,...(e||{}).extensions||[]]),content:n(x_),defined:[],document:n(C_),flow:n(gA),lazy:{},string:n(bA),text:n(vA)};return t;function n(e){return function(n){return OA(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,a){const s=[];let l,c,u,d,p;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);u<o.length;){if(TA.lastIndex=u,l=TA.exec(o),d=l&&void 0!==l.index?l.index:o.length,p=o.charCodeAt(d),!l){n=o.slice(u);break}if(10===p&&u===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),u<d&&(s.push(o.slice(u,d)),t+=d-u),p){case 0:s.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),s.push(-2);t++<c;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function jA(e){return{line:e.line,column:e.column,offset:e.offset}}function FA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?FA(e,r):LA(e,r)}}function LA(e,t){let n;for(n in t)if(DA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function VA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+CI({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+CI({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+CI({start:t.start,end:t.end})+") is still open")}function zA(e){const t=this;t.parser=function(n){return BA(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function GA(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&"text"===a.type?a.value+=r:o.push({type:"text",value:r}),o}function HA(e){const t=e.spread;return null==t?e.children.length>1:t}function WA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(XA(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(XA(t.slice(o),o>0,!1)),i.join("")}function XA(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const ZA={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=v_(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return GA(e,t);const o={src:v_(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:v_(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return GA(e,t);const o={href:v_(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:v_(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=HA(n[r])}return t}(n):HA(t),i={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(o||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=wI(t.children[1]),a=vI(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length;let s=-1;const l=[];for(;++s<a;){const n=t.children[s],r={},a=i?i[s]:void 0;a&&(r.align=a);let c={type:"element",tagName:o,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:WA(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:$A,yaml:$A,definition:$A,footnoteDefinition:$A};function $A(){}const YA="object"==typeof self?self:globalThis,UA=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,a]=t[o];switch(i){case 0:case-1:return n(a,o);case 1:{const e=n([],o);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),o);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new YA[e](t),o)}case 8:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new YA[i](a),o)};return r})(new Map,e)(0),JA="",{toString:KA}={},{keys:QA}=Object,qA=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=KA.call(e).slice(8,-1);switch(n){case"Array":return[1,JA];case"Object":return[2,JA];case"Date":return[3,JA];case"RegExp":return[4,JA];case"Map":return[5,JA];case"Set":return[6,JA];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},eN=([e,t])=>0===e&&("function"===t||"symbol"===t),tN=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[a,s]=qA(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([a,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([a,e],r);for(const t of r)e.push(i(t));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],l=o([a,n],r);for(const t of QA(r))!e&&eN(qA(r[t]))||n.push([i(t),i(r[t])]);return l}case 3:return o([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([a,{source:e,flags:t}],r)}case 5:{const t=[],n=o([a,t],r);for(const[n,o]of r)(e||!eN(qA(n))&&!eN(qA(o)))&&t.push([i(n),i(o)]);return n}case 6:{const t=[],n=o([a,t],r);for(const n of r)!e&&eN(qA(n))||t.push(i(n));return n}}const{message:l}=r;return o([a,{name:s,message:l}],r)};return i})(!(t||n),!!t,new Map,r)(e),r};var nN="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?UA(tN(e,t)):structuredClone(e):(e,t)=>UA(tN(e,t));function rN(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function oN(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const iN=function(e){if(null==e)return sN;if("function"==typeof e)return aN(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=iN(e[n]);return aN(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return aN(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return aN(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function aN(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function sN(){return!0}const lN=[],cN=!0,uN=!1;function dN(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=iN(o),a=r?-1:1;!function e(o,s,l){const c=o&&"object"==typeof o?o:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,d,p=lN;if((!t||i(o,s,l[l.length-1]||void 0))&&(p=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[cN,e];return null==e?lN:[e]}(n(o,l)),p[0]===uN))return p;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==p[0])for(u=(r?t.children.length:-1)+a,d=l.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,d)(),c[0]===uN)return c;u="number"==typeof c[1]?c[1]:u+a}}return p}}(e,void 0,[])()}function pN(e,t,n,r){let o,i,a;"function"==typeof t?(i=void 0,a=t,o=n):(i=t,a=n,o=r),dN(e,i,(function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)}),o)}const fN={}.hasOwnProperty,hN={};function mN(e,t){e.position&&(t.position=function(e){const t=wI(e),n=vI(e);if(t&&n)return{start:t,end:n}}(e))}function gN(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,nN(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function yN(e,t){const n=t.data||{},r=!("value"in t)||fN.call(n,"hProperties")||fN.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function bN(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function vN(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function wN(e,t){const n=function(e,t){const n=t||hN,r=new Map,o=new Map,i=new Map,a={...ZA,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=vN(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=vN(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:gN,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=s.handlers[n];if(fN.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=nN(n);return r.children=s.all(e),r}return nN(e)}return(s.options.unknownHandler||yN)(s,e,t)},options:n,patch:mN,wrap:bN};return pN(e,(function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}})),s}(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rN,r=e.options.footnoteBackLabel||oN,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[l]);if(!o)continue;const i=e.all(o),a=String(o.identifier).toUpperCase(),c=v_(a.toLowerCase());let u=0;const d=[],p=e.footnoteCounts.get(a);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const f=i[i.length-1];if(f&&"element"===f.type&&"p"===f.tagName){const e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...d)}else i.push(...d);const h={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(o,h),s.push(h)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...nN(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function xN(e,t){return e&&"run"in e?async function(n,r){const o=wN(n,{file:r,...t});await e.run(o,r)}:function(n,r){return wN(n,{file:r,...e||t})}}function CN(e){if(e)throw e}var EN,kN;var SN=function(){if(kN)return EN;kN=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),i=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!i)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return EN=function e(){var t,n,r,l,c,u,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(h&&l&&(i(l)||(c=o(l)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&i(r)?r:{},a(d,{name:n,newValue:e(h,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},EN}(),IN=l(SN);function _N(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function AN(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...a){const s=e[++n];let l=-1;if(i)r(i);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let a;r&&t.push(o);try{a=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(a&&a.then&&"function"==typeof a.then?a.then(i,o):a instanceof Error?o(a):i(a))}function o(e,...r){n||(n=!0,t(e,...r))}function i(e){o(null,e)}}(s,o)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const NN={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');RN(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=a));r===o?o=a:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(RN(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){RN(e);let t,n=e.length,r=-1,o=0,i=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1);else if(t){o=n+1;break}}if(i<0||r<0||0===a||1===a&&i===r-1&&i===o+1)return"";return e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)RN(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){RN(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),a=l,s=0;continue}}else if(o.length>0){o="",i=0,a=l,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,l):o=e.slice(a+1,l),i=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function RN(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ON={cwd:function(){return"/"}};function TN(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function MN(e){if("string"==typeof e)e=new URL(e);else if(!TN(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const PN=["history","path","basename","stem","extname","dirname"];class DN{constructor(e){let t;t=e?TN(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":ON.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<PN.length;){const e=PN[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)PN.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?NN.basename(this.path):void 0}set basename(e){jN(e,"basename"),BN(e,"basename"),this.path=NN.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?NN.dirname(this.path):void 0}set dirname(e){FN(this.basename,"dirname"),this.path=NN.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?NN.extname(this.path):void 0}set extname(e){if(BN(e,"extname"),FN(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=NN.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){TN(e)&&(e=MN(e)),jN(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?NN.basename(this.path,this.extname):void 0}set stem(e){jN(e,"stem"),BN(e,"stem"),this.path=NN.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new II(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function BN(e,t){if(e&&e.includes(NN.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+NN.sep+"`")}function jN(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function FN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const LN=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},VN={}.hasOwnProperty;class zN extends LN{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=AN()}copy(){const e=new zN;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(IN(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(XN("data",this.frozen),this.namespace[e]=t,this):VN.call(this.namespace,e)&&this.namespace[e]||void 0:e?(XN("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=YN(e),n=this.parser||this.Parser;return HN("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),HN("process",this.parser||this.Parser),WN("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=YN(e),a=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(a,i,(function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var a;"string"==typeof(a=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=i:r.result=i,s(e,r)}))}}processSync(e){let t,n=!1;return this.freeze(),HN("processSync",this.parser||this.Parser),WN("processSync",this.compiler||this.Compiler),this.process(e,(function(e,r){n=!0,CN(e),t=r})),$N("processSync","process",n),t}run(e,t,n){ZN(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const a=YN(t);r.run(e,a,(function(t,r,a){const s=r||e;t?i(t):o?o(s):n(void 0,s,a)}))}}runSync(e,t){let n,r=!1;return this.run(e,t,(function(e,t){CN(e),n=t,r=!0})),$N("runSync","run",r),n}stringify(e,t){this.freeze();const n=YN(t),r=this.compiler||this.Compiler;return WN("stringify",r),ZN(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(XN("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=IN(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const a=n[o][1];_N(a)&&_N(r)&&(r=IN(!0,a,r)),n[o]=[e,r,...i]}}}}const GN=(new zN).freeze();function HN(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function WN(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function XN(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ZN(e){if(!_N(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function $N(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function YN(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new DN(e)}const UN=[],JN={allowDangerousHtml:!0},KN=/^(https?|ircs?|mailto|xmpp)$/i,QN=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function qN(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,a=e.disallowedElements,s=e.rehypePlugins||UN,l=e.remarkPlugins||UN,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...JN}:JN,u=e.skipHtml,d=e.unwrapDisallowed,p=e.urlTransform||eR,f=GN().use(zA).use(l).use(xN,c).use(s),h=new DN;"string"==typeof r&&(h.value=r);for(const t of QN)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const m=f.parse(h);let g=f.runSync(m,h);return o&&(g={type:"element",tagName:"div",properties:{className:o},children:"root"===g.type?g.children:[g]}),pN(g,(function(e,r,o){if("raw"===e.type&&o&&"number"==typeof r)return u?o.children.splice(r,1):o.children[r]={type:"text",value:e.value},r;if("element"===e.type){let t;for(t in XI)if(Object.hasOwn(XI,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=XI[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=p(String(n||""),t,e))}}if("element"===e.type){let i=t?!t.includes(e.tagName):!!a&&a.includes(e.tagName);if(!i&&n&&"number"==typeof r&&(i=!n(e,r,o)),i&&o&&"number"==typeof r)return d&&e.children?o.children.splice(r,1,...e.children):o.children.splice(r,1),r}})),PI(g,{Fragment:Lu.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Lu.jsx,jsxs:Lu.jsxs,passKeys:!0,passNode:!0})}function eR(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||KN.test(e.slice(0,t))?e:""}function tR(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;-1!==o;)r++,o=n.indexOf(t,o+t.length);return r}function nR(e,t,n){const r=iN((n||{}).ignore||[]),o=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([rR(e[0]),oR(e[1])])}return t}(t);let i=-1;for(;++i<o.length;)dN(e,"text",a);function a(e,t){let n,a=-1;for(;++a<t.length;){const e=t[a],o=n?n.children:void 0;if(r(e,o?o.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=o[i][0],a=o[i][1];let s=0;const l=n.children.indexOf(e);let c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){const n=d.index,o={index:d.index,input:d.input,stack:[...t,e]};let i=a(...d,o);if("string"==typeof i&&(i=i.length>0?{type:"text",value:i}:void 0),!1===i?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(i)?u.push(...i):i&&u.push(i),s=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}c?(s<e.value.length&&u.push({type:"text",value:e.value.slice(s)}),n.children.splice(l,1,...u)):u=[e];return l+u.length}(e,t)}}function rR(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function oR(e){return"function"==typeof e?e:function(){return e}}const iR="phrasing",aR=["autolink","link","image","label"];function sR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function lR(e){this.config.enter.autolinkProtocol.call(this,e)}function cR(e){this.config.exit.autolinkProtocol.call(this,e)}function uR(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function dR(e){this.config.exit.autolinkEmail.call(this,e)}function pR(e){this.exit(e)}function fR(e){nR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,hR],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,mR]],{ignore:["link","linkReference"]})}function hR(e,t,n,r,o){let i="";if(!gR(o))return!1;if(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const a=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=tR(e,"(");let i=tR(e,")");for(;-1!==r&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function mR(e,t,n,r){return!(!gR(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function gR(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||y_(n)||g_(n))&&(!t||47!==n)}function yR(){this.buffer()}function bR(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vR(){this.buffer()}function wR(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function xR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=i_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function CR(e){this.exit(e)}function ER(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=i_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function kR(e){this.exit(e)}function SR(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),a(),i+=o.move("]"),i}function IR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,o){const i=r.createTracker(o);let a=i.move("[^");const s=r.enter("footnoteDefinition"),l=r.enter("label");a+=i.move(r.safe(r.associationId(e),{before:a,after:"]"})),l(),a+=i.move("]:"),e.children&&e.children.length>0&&(i.shift(4),a+=i.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,i.current()),t?AR:_R)));return s(),a},footnoteReference:SR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function _R(e,t,n){return 0===t?e:AR(e,t,n)}function AR(e,t,n){return(n?"":" ")+e}SR.peek=function(){return"["};const NR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function RR(e){this.enter({type:"delete",children:[]},e)}function OR(e){this.exit(e)}function TR(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let a=o.move("~~");return a+=n.containerPhrasing(e,{...o.current(),before:a,after:"~"}),a+=o.move("~~"),i(),a}function MR(e){return e.length}function PR(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function DR(e,t,n){return">"+(n?"":" ")+e}function BR(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function jR(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if("\n"===n.unsafe[o].character&&(i=n.stack,a=n.unsafe[o],BR(i,a.inConstruct,!0)&&!BR(i,a.notInConstruct,!1)))return/[ \t]/.test(r.before)?"":" ";var i,a;return"\\\n"}function FR(e,t,n){return(n?"":" ")+e}function LR(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function VR(e){return"&#x"+e.toString(16).toUpperCase()+";"}function zR(e,t,n){const r=k_(e),o=k_(t);return void 0===r?void 0===o?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function GR(e,t,n,r){const o=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),i=n.enter("emphasis"),a=n.createTracker(r),s=a.move(o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=zR(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=VR(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=zR(r.after.charCodeAt(0),d,o);p.inside&&(l=l.slice(0,-1)+VR(d));const f=a.move(o);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+f}function HR(e){return e.value||""}function WR(e,t,n,r){const o=LR(n),i='"'===o?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),c+=l.move(")"),a(),c}function XR(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function ZR(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=n.compilePattern(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}function $R(e,t){const n=$I(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function YR(e,t,n,r){const o=LR(n),i='"'===o?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if($R(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=a.move("<");return r+=a.move(n.containerPhrasing(e,{before:r,after:">",...a.current()})),r+=a.move(">"),s(),n.stack=t,r}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=a.move(" "+o),c+=a.move(n.safe(e.title,{before:c,after:o,...a.current()})),c+=a.move(o),l()),c+=a.move(")"),s(),c}function UR(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function JR(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function KR(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}TR.peek=function(){return"~"},GR.peek=function(e,t,n){return n.options.emphasis||"*"},HR.peek=function(){return"<"},WR.peek=function(){return"!"},XR.peek=function(){return"!"},ZR.peek=function(){return"`"},YR.peek=function(e,t,n){return $R(e,n)?"<":"["},UR.peek=function(){return"["};const QR=iN(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function qR(e,t,n,r){const o=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),i=n.enter("strong"),a=n.createTracker(r),s=a.move(o+o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=zR(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=VR(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=zR(r.after.charCodeAt(0),d,o);p.inside&&(l=l.slice(0,-1)+VR(d));const f=a.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+f}qR.peek=function(e,t,n){return n.options.strong||"*"};const eO={blockquote:function(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),DR);return o(),a},break:jR,code:function(e,t,n,r){const o=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),i=e.value||"",a="`"===o?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(i,FR);return e(),t}const s=n.createTracker(r),l=o.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,a=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===o?++i>a&&(a=i):i=1,o=r+t.length,r=n.indexOf(t,o);return a}(i,o)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const t=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),i&&(u+=s.move(i+"\n")),u+=s.move(l),c(),u},definition:function(e,t,n,r){const o=LR(n),i='"'===o?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),a(),c},emphasis:GR,hardBreak:jR,heading:function(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(function(e,t){let n=!1;return pN(e,(function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,uN})),Boolean((!e.depth||e.depth<3)&&$I(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),a=n.containerPhrasing(e,{...i.current(),before:"\n",after:"\n"});return r(),t(),a+"\n"+(1===o?"=":"-").repeat(a.length-(Math.max(a.lastIndexOf("\r"),a.lastIndexOf("\n"))+1))}const a="#".repeat(o),s=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...i.current()});return/^[\t ]/.test(c)&&(c=VR(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c},html:HR,image:WR,imageReference:XR,inlineCode:ZR,link:YR,linkReference:UR,list:function(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):JR(n);const s=e.ordered?"."===a?")":".":function(e){const t=JR(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&a===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==a&&"-"!==a||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),KR(n)===a&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,o(),c},listItem:function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||JR(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let a=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));const s=n.createTracker(r);s.move(i+" ".repeat(a-i.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),(function(e,t,n){if(t)return(n?"":" ".repeat(a))+e;return(n?i:i+" ".repeat(a-i.length))+e}));return l(),c},paragraph:function(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),o(),a},root:function(e,t,n,r){return(e.children.some((function(e){return QR(e)}))?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:qR,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(KR(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function tO(e){const t=e._align;this.enter({type:"table",align:t.map((function(e){return"none"===e?null:e})),children:[]},e),this.data.inTable=!0}function nO(e){this.exit(e),this.data.inTable=void 0}function rO(e){this.enter({type:"tableRow",children:[]},e)}function oO(e){this.exit(e)}function iO(e){this.enter({type:"tableCell",children:[]},e)}function aO(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,sO));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function sO(e,t){return"|"===t?t:e}function lO(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=eO.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let o=-1;const i=[],a=t.enter("table");for(;++o<r.length;)i[o]=l(r[o],t,n);return a(),i}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){const o=l(e,n,r),i=s([o]);return i.slice(0,i.indexOf("\n"))}}};function a(e,t,n,r){const o=n.enter("tableCell"),a=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:i,after:i});return a(),o(),s}function s(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||MR,i=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],r=[];let i=-1;for(e[u].length>c&&(c=e[u].length);++i<e[u].length;){const a=null==(d=e[u][i])?"":String(d);if(!1!==n.alignDelimiters){const e=o(a);r[i]=e,(void 0===l[i]||e>l[i])&&(l[i]=e)}t.push(a)}a[u]=t,s[u]=r}var d;let p=-1;if("object"==typeof r&&"length"in r)for(;++p<c;)i[p]=PR(r[p]);else{const e=PR(r);for(;++p<c;)i[p]=e}p=-1;const f=[],h=[];for(;++p<c;){const e=i[p];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let o=!1===n.alignDelimiters?1:Math.max(1,l[p]-t.length-r.length);const a=t+"-".repeat(o)+r;!1!==n.alignDelimiters&&(o=t.length+o+r.length,o>l[p]&&(l[p]=o),h[p]=o),f[p]=a}a.splice(1,0,f),s.splice(1,0,h),u=-1;const m=[];for(;++u<a.length;){const e=a[u],t=s[u];p=-1;const r=[];for(;++p<c;){const o=e[p]||"";let a="",s="";if(!1!==n.alignDelimiters){const e=l[p]-(t[p]||0),n=i[p];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):(a=" ".repeat(e/2),s=a):s=" ".repeat(e)}!1===n.delimiterStart||p||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===o||!1===n.delimiterStart&&!p||r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(o),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&p===c-1||r.push("|")}m.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return m.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:o})}function l(e,t,n){const r=e.children;let o=-1;const i=[],s=t.enter("tableRow");for(;++o<r.length;)i[o]=a(r[o],0,t,n);return s(),i}}function cO(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function uO(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let o,i=-1;for(;++i<r.length;){const e=r[i];if("paragraph"===e.type){o=e;break}}o===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function dO(e,t,n,r){const o=e.children[0],i="boolean"==typeof e.checked&&o&&"paragraph"===o.type,a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);i&&s.move(a);let l=eO.listItem(e,t,n,{...r,...s.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,(function(e){return e+a}))),l}const pO={tokenize:function(e,t,n){let r=0;return function t(i){if((87===i||119===i)&&r<3)return r++,e.consume(i),t;if(46===i&&3===r)return e.consume(i),o;return n(i)};function o(e){return null===e?n(e):t(e)}},partial:!0},fO={tokenize:function(e,t,n){let r,o,i;return a;function a(t){return 46===t||95===t?e.check(mO,l,s)(t):null===t||h_(t)||y_(t)||45!==t&&g_(t)?l(t):(i=!0,e.consume(t),a)}function s(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),a}function l(e){return o||r||!i?n(e):t(e)}},partial:!0},hO={tokenize:function(e,t){let n=0,r=0;return o;function o(a){return 40===a?(n++,e.consume(a),o):41===a&&r<n?i(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(mO,t,i)(a):null===a||h_(a)||y_(a)?t(a):(e.consume(a),o)}function i(t){return 41===t&&r++,e.consume(t),o}},partial:!0},mO={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),i):93===a?(e.consume(a),o):60===a||null===a||h_(a)||y_(a)?t(a):n(a)}function o(e){return null===e||40===e||91===e||h_(e)||y_(e)?t(e):r(e)}function i(e){return a_(e)?a(e):n(e)}function a(t){return 59===t?(e.consume(t),r):a_(t)?(e.consume(t),a):n(t)}},partial:!0},gO={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return s_(e)?n(e):t(e)}},partial:!0},yO={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!CO.call(r,r.previous)||IO(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(pO,e.attempt(fO,e.attempt(hO,o),n),n)(t)};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:CO},bO={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let o="",i=!1;return function(t){if((72===t||104===t)&&EO.call(r,r.previous)&&!IO(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),a;return n(t)};function a(t){if(a_(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),a;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),i?l:(i=!0,s)):n(t)}function l(t){return null===t||c_(t)||h_(t)||y_(t)||g_(t)?n(t):e.attempt(fO,e.attempt(hO,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:EO},vO={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let o,i;return function(t){if(!SO(t)||!kO.call(r,r.previous)||IO(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)};function a(t){return SO(t)?(e.consume(t),a):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(gO,c,l)(t):45===t||95===t||s_(t)?(i=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),o=!0,s}function c(a){return i&&o&&a_(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:kO},wO={};let xO=48;for(;xO<123;)wO[xO]=vO,xO++,58===xO?xO=65:91===xO&&(xO=97);function CO(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||h_(e)}function EO(e){return!a_(e)}function kO(e){return!(47===e||SO(e))}function SO(e){return 43===e||45===e||46===e||95===e||s_(e)}function IO(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}wO[43]=vO,wO[45]=vO,wO[46]=vO,wO[95]=vO,wO[72]=[vO,bO],wO[104]=[vO,bO],wO[87]=[vO,yO],wO[119]=[vO,yO];const _O={tokenize:function(e,t,n){const r=this;return w_(e,(function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function AO(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){a=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!a||!a._balanced)return n(o);const s=i_(r.sliceSerialize({start:a.end,end:r.now()}));if(94!==s.codePointAt(0)||!i.includes(s.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function NO(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function RO(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(a>999||93===s&&!i||null===s||91===s||h_(s))return n(s);if(93===s){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes(i_(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return h_(s)||(i=!0),a++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,l):l(t)}}function OO(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!a||null===t||91===t||h_(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=i_(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return h_(t)||(a=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),w_(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function TO(e,t,n){return e.check(N_,t,e.attempt(_O,t,n))}function MO(e){e.exit("gfmFootnoteDefinition")}function PO(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const o=this.previous,i=this.events;let a=0;return function(t){if(126===o&&"characterEscape"!==i[i.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(i){const l=k_(o);if(126===i)return a>1?r(i):(e.consume(i),a++,s);if(a<2&&!t)return r(i);const c=e.exit("strikethroughSequenceTemporary"),u=k_(i);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(i)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const o={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",o,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],s=t.parser.constructs.insideSpan.null;s&&QI(a,a.length,0,S_(s,e.slice(r+1,n),t)),QI(a,a.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",o,t]]),QI(e,r-1,n-r+3,a),n=r+a.length-2;break}}n=-1;for(;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class DO{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let o=0;if(0===n&&0===r.length)return;for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}(this,e,t,n)}consume(e){if(this.map.sort((function(e,t){return e[0]-t[0]})),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function BO(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}function jO(e,t,n){const r=this;let o,i=0,a=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?w:s;if(i===w&&r.parser.lazy[r.now().line])return n(e);return i(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return o=!0,a+=1,l(e)}(t)}function l(t){return null===t?n(t):f_(t)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):m_(t)?w_(e,l,"whitespace")(t):(a+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||h_(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,m_(t)?w_(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?h(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):v(t)}function f(t){return m_(t)?w_(e,h,"whitespace")(t):h(t)}function h(t){return 58===t?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||f_(t)?b(t):v(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return m_(t)?w_(e,b,"whitespace")(t):b(t)}function b(n){return 124===n?p(n):(null===n||f_(n))&&o&&i===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function w(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||f_(n)?(e.exit("tableRow"),t(n)):m_(n)?w_(e,x,"whitespace")(n):(e.enter("data"),C(n))}function C(t){return null===t||124===t||h_(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?E:C)}function E(t){return 92===t||124===t?(e.consume(t),C):C(t)}}function FO(e,t){let n,r,o,i=-1,a=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new DO;for(;++i<e.length;){const f=e[i],h=f[1];"enter"===f[0]?"tableHead"===h.type?(u=!1,0!==d&&(VO(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===h.type||"tableDelimiterRow"===h.type?(a=!0,o=void 0,l=[0,0,0,0],c=[0,i+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===h.type?2:r?3:1):!s||"data"!==h.type&&"tableDelimiterMarker"!==h.type&&"tableDelimiterFiller"!==h.type?"tableCellDivider"===h.type&&(a?a=!1:(0!==l[1]&&(c[0]=c[1],o=LO(p,t,l,s,void 0,o)),l=c,c=[l[1],i,0,0])):(a=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],o=LO(p,t,l,s,void 0,o),l=[0,0,0,0]),c[2]=i)):"tableHead"===h.type?(u=!0,d=i):"tableRow"===h.type||"tableDelimiterRow"===h.type?(d=i,0!==l[1]?(c[0]=c[1],o=LO(p,t,l,s,i,o)):0!==c[1]&&(o=LO(p,t,c,s,i,o)),s=0):!s||"data"!==h.type&&"tableDelimiterMarker"!==h.type&&"tableDelimiterFiller"!==h.type||(c[3]=i)}for(0!==d&&VO(p,t,d,n,r),p.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=BO(t.events,i))}return e}function LO(e,t,n,r,o,i){const a=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},zO(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const s=zO(t.events,n[1]);if(i={type:a,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=zO(t.events,n[2]),i=zO(t.events,n[3]),a={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==o&&(i.end=Object.assign({},zO(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function VO(e,t,n,r,o){const i=[],a=zO(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function zO(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const GO={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o};function o(t){return h_(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return f_(r)?t(r):m_(r)?e.check({tokenize:HO},t,n)(r):n(r)}}};function HO(e,t,n){return w_(e,(function(e){return null===e?n(e):t(e)}),"whitespace")}const WO={};function XO(e){const t=e||WO,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return t_([{text:wO},{document:{91:{name:"gfmFootnoteDefinition",tokenize:OO,continuation:{tokenize:TO},exit:MO}},text:{91:{name:"gfmFootnoteCall",tokenize:RO},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:AO,resolveTo:NO}}},PO(e),{flow:{null:{name:"table",tokenize:jO,resolveAll:FO}}},{text:{91:GO}}])}(t)),o.push([{transforms:[fR],enter:{literalAutolink:sR,literalAutolinkEmail:lR,literalAutolinkHttp:lR,literalAutolinkWww:lR},exit:{literalAutolink:pR,literalAutolinkEmail:dR,literalAutolinkHttp:cR,literalAutolinkWww:uR}},{enter:{gfmFootnoteCallString:yR,gfmFootnoteCall:bR,gfmFootnoteDefinitionLabelString:vR,gfmFootnoteDefinition:wR},exit:{gfmFootnoteCallString:xR,gfmFootnoteCall:CR,gfmFootnoteDefinitionLabelString:ER,gfmFootnoteDefinition:kR}},{canContainEols:["delete"],enter:{strikethrough:RR},exit:{strikethrough:OR}},{enter:{table:tO,tableData:iO,tableHeader:iO,tableRow:rO},exit:{codeText:aO,table:nO,tableData:oO,tableHeader:oO,tableRow:oO}},{exit:{taskListCheckValueChecked:cO,taskListCheckValueUnchecked:cO,paragraph:uO}}]),i.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:iR,notInConstruct:aR},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:iR,notInConstruct:aR},{character:":",before:"[ps]",after:"\\/",inConstruct:iR,notInConstruct:aR}]},IR(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:NR}],handlers:{delete:TR}},lO(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dO}}]}}(t))}const ZO=({item:t})=>{const n=e.useContext(pF);return o.createElement("div",{className:"libnodeentry",onClick:e=>{2===e.detail&&n.worker?.add_node(t.node_id)},title:t.description},t.node_name||t.node_id)},$O=(e,t)=>{const n=e.nodes?.some((e=>e.node_id.toLowerCase().includes(t.toLowerCase())))??!1,r=e.subshelves?.some((e=>$O(e,t)))??!1;return n||r},YO=({item:t,filter:n,parentkey:r})=>{const[i,a]=e.useState(!1),s=t.nodes?.filter((e=>e.node_id.toLowerCase().includes(n.toLowerCase()))),l=i||n.length>0;return $O(t,n)?o.createElement("div",{className:"shelfcontainer"},o.createElement("div",{className:"shelftitle",onClick:()=>a(!i),style:{cursor:"pointer"},title:t.description},o.createElement("div",{className:"shelftitle_text"},t.name),o.createElement("div",{className:"expandicon "+(l?"open":"close")},o.createElement(jv,null))),o.createElement("div",{className:"libnodecontainer "+(l?"open":"close")},o.createElement("div",{className:"libnodecontainer_inner"},s&&o.createElement(o.Fragment,null,s.map((e=>o.createElement(ZO,{key:e.node_id,item:e})))),t.subshelves&&o.createElement(o.Fragment,null,t.subshelves.map((e=>o.createElement(YO,{key:r+e.name,item:e,filter:n,parentkey:r+e.name})))))),o.createElement("hr",null)):o.createElement(o.Fragment,null)},UO=({filter:e,setFilter:t})=>o.createElement("div",{className:"libfilter"},o.createElement($w,{fontSize:"inherit"}),o.createElement("input",{type:"text",placeholder:"Filter",value:e,onChange:e=>{t(e.target.value)}}),e&&o.createElement(Zw,{fontSize:"inherit",onClick:()=>{t("")}})),JO=({availableModule:e})=>o.createElement("div",{className:"module-links"},e.homepage&&o.createElement(o.Fragment,null,o.createElement("a",{href:e.homepage,target:"_blank",rel:"noopener noreferrer"},"Homepage")),e.source&&e.homepage&&" | ",e.source&&o.createElement(o.Fragment,null,o.createElement("a",{href:e.source,target:"_blank",rel:"noopener noreferrer"},"Source"))),KO=({availableModule:t})=>{const[n,r]=e.useState(!1),i=t.description.length>150?t.description.substring(0,150)+"...":t.description;return o.createElement("div",{className:"module-description"},o.createElement(qN,{remarkPlugins:[XO]},n?t.description.replace(/\\n/g," \n"):i.replace(/\\n/g," \n")),t.description.length>150&&o.createElement("button",{onClick:()=>r(!n),className:"toggle-description"},n?"Show less":"Show more"))},QO=({availableModule:t,on_change:n})=>{const[r,i]=e.useState(t.version||"latest"),[a,s]=e.useState(">=");return t.releases&&!t.releases.includes(r)&&t.releases.unshift(r),o.createElement(o.Fragment,null,o.createElement("select",{value:a,onChange:e=>{s(e.target.value),"latest"!==r&&n(e.target.value+r)}},o.createElement("option",{value:">="},">="),o.createElement("option",{value:"=="},"=="),o.createElement("option",{value:"<="},"<=")),o.createElement("select",{onChange:e=>{const t=e.target.value;i(t),n("latest"!==t?a+t:t)},value:r},t.releases&&t.releases.map((e=>o.createElement("option",{key:e,value:e},e)))))},qO=({availableModule:t,on_remove:n,on_update:r})=>{const[i,a]=e.useState(t.version||"latest");return o.createElement("div",{className:"addable-module"},o.createElement("div",{className:"module-name"},t.name+(t.version?` (${t.version})`:"")),o.createElement(JO,{availableModule:t}),o.createElement(KO,{availableModule:t}),o.createElement("div",null,o.createElement(QO,{availableModule:t,on_change:a}),o.createElement("button",{className:"update-button",disabled:i===t.version,onClick:()=>{r(t,i)}},"Update"),o.createElement("button",{className:"remove-button",onClick:()=>{n(t)}},"Remove")))},eT=({availableModule:t,on_add:n})=>{const[r,i]=e.useState(t.version||"latest");return o.createElement("div",{className:"addable-module"},o.createElement("div",{className:"module-name"},t.name+(t.version?` (${t.version})`:"")),o.createElement(JO,{availableModule:t}),o.createElement(KO,{availableModule:t}),o.createElement("div",null,o.createElement(QO,{availableModule:t,on_change:i}),o.createElement("button",{className:"add-button",onClick:()=>{n(t,r)}},"Add")))},tT=({availableModule:t,on_add:n})=>{const[r,i]=e.useState(t.version||"latest");return o.createElement("div",{className:"addable-module"},o.createElement("div",{className:"module-name"},t.name),o.createElement(JO,{availableModule:t}),o.createElement(KO,{availableModule:t}),o.createElement("div",null,o.createElement(QO,{availableModule:t,on_change:i}),o.createElement("button",{className:"add-button",onClick:()=>{n(t,r)}},"Add")))},nT=({children:t})=>{const[n,r]=e.useState(""),i=e.useContext(pF),[a,s]=e.useState(!0),[l,c]=e.useState(!0),[u,d]=e.useState(!0),[p,f]=e.useState({installed:[],available:[],active:[]}),[h,m]=e.useState(!1);if(!i.worker)return o.createElement(o.Fragment,null);const g=(e,t)=>{m(!1),void 0!==i.worker&&i.worker.add_lib(e.name,t)},y=(e,t)=>{m(!1),void 0!==i.worker&&i.worker.add_lib(e.name,t)},b=e=>{m(!1),void 0!==i.worker&&i.worker.remove_lib(e.name)},v=(e,t)=>{m(!1),void 0!==i.worker&&i.worker.add_lib(e.name,t)},w=e=>e.filter((e=>e.name.toLowerCase().includes(n.toLowerCase())||e.description.toLowerCase().includes(n.toLowerCase()))),x=w(p.available),C=w(p.installed),E=w(p.active);return o.createElement(Kw,{title:"Manage Library",trigger:t,description:"Add or remove libraries to the current worker.",onOpenChange:e=>{e&&void 0!==i.worker&&i.worker.is_open&&i.worker.get_available_modules().then((e=>{f(e)}))},open:h,setOpen:m},o.createElement("input",{className:"filter-input styledinput",type:"text",placeholder:"Filter modules...",value:n,onChange:e=>r(e.target.value)}),o.createElement("div",{className:"packagelist",style:{maxHeight:"70%",overflow:"auto"}},C.length>0&&o.createElement("h3",{onClick:()=>{d(!u)}},"Installed"),u&&C.map((e=>o.createElement(eT,{key:e.name+e.source,availableModule:e,on_add:g}))),x.length>0&&o.createElement("h3",{onClick:()=>{c(!l)}},"Available"),l&&x.map((e=>o.createElement(tT,{key:e.name+e.source,availableModule:e,on_add:y}))),E.length>0&&o.createElement("h3",{onClick:()=>{s(!a)}},"Active"),a&&E.map((e=>o.createElement(qO,{key:e.name+e.source,availableModule:e,on_remove:b,on_update:v})))))},rT=({ins:t})=>{const[n,r]=e.useState(t.name),i=e.useContext(pF);return o.createElement(o.Fragment,null,o.createElement(Kw,{title:t.name,description:"Settings for"+t.name,trigger:o.createElement("div",null,"Settings"),buttons:[{text:"Save",onClick:()=>{i.worker&&(i.worker.update_external_worker(t.uuid,t.nodeclassid,{name:n}),t.name=n)},close:!0},{text:"Delete",onClick:()=>{i.worker&&i.worker.remove_external_worker(t.uuid,t.nodeclassid)},close:!0}]},o.createElement("div",null,o.createElement("div",null,o.createElement("label",{htmlFor:"name"},"Name: "),o.createElement("input",{type:"text",name:"name",value:n,onChange:e=>r(e.target.value),className:"styledinput"})))))},oT=({ins:t,lib:n,filter:r="",parentkey:i})=>{const[a,s]=e.useState(!1),l=n?.nodes?.filter((e=>e.node_id.toLowerCase().includes(r.toLowerCase())));return o.createElement("div",{className:"shelfcontainer"},o.createElement("div",{className:"shelftitle",onClick:()=>s(!a),style:{cursor:"pointer"},title:t.name},o.createElement("div",{className:"shelftitle_text"},t.name),o.createElement("div",{className:"expandicon "+(a?"open":"close")},o.createElement(jv,null))),o.createElement("div",{className:"libnodecontainer "+(a?"open":"close")},o.createElement("div",{className:"libnodecontainer_inner"},a&&o.createElement(o.Fragment,null,o.createElement("div",{className:"libnodeentry",title:t.uuid},o.createElement(rT,{ins:t})),n&&o.createElement(o.Fragment,null,l&&o.createElement(o.Fragment,null,l.map((e=>o.createElement(ZO,{key:e.node_id,item:e})))),n.subshelves.map((e=>o.createElement(YO,{key:i+e.name,item:e,filter:r,parentkey:i+e.name}))))))))},iT=({item:t,mod:n,lib:r})=>{const i=e.useContext(pF),[a,s]=e.useState(!1),l=t.name||t.module+"."+t.class_name;return o.createElement("div",{className:"shelfcontainer"},o.createElement("div",{className:"shelftitle",onClick:()=>s(!a),style:{cursor:"pointer"},title:l},o.createElement("div",{className:"shelftitle_text"},l),o.createElement("div",{className:"expandicon "+(a?"open":"close")},o.createElement(jv,null))),o.createElement("div",{className:"libnodecontainer "+(a?"open":"close")},o.createElement("div",{className:"libnodecontainer_inner"},a&&o.createElement(o.Fragment,null,o.createElement("div",{className:"libnodeentry",onClick:e=>{2===e.detail&&i.worker?.add_external_worker({module:n,cls_module:t.module,cls_name:t.class_name})},title:t.name},"New Instance"),t.instances.map((e=>o.createElement(oT,{key:e.uuid,ins:e,lib:r?.subshelves.find((t=>t.name===e.uuid)),parentkey:e.uuid})))))))},aT=({externalworkermod:t,lib:n})=>{const[r,i]=e.useState(!1),a=r;return o.createElement("div",{className:"shelfcontainer"},o.createElement("div",{className:"shelftitle",onClick:()=>i(!r),style:{cursor:"pointer"},title:t.module},o.createElement("div",{className:"shelftitle_text"},t.module),o.createElement("div",{className:"expandicon "+(a?"open":"close")},o.createElement(jv,null))),o.createElement("div",{className:"libnodecontainer "+(a?"open":"close")},o.createElement("div",{className:"libnodecontainer_inner"},t.worker_classes.map((e=>o.createElement(iT,{key:e.module+e.class_name,item:e,mod:t.module,lib:n}))))),o.createElement("hr",null))},sT=()=>{const t=e.useContext(pF),n=t.lib.libstate(),[r,i]=e.useState(""),a=t.worker?.state((e=>e.is_open))??!1;return o.createElement("div",{className:"libcontainer"},o.createElement("div",{className:"library"},o.createElement("div",{className:"libtitle"},"Lib"),o.createElement("hr",{className:"hr_prominent"}),o.createElement(UO,{filter:r,setFilter:i}),o.createElement("div",{className:"vscrollcontainer"},n.lib.shelves.map((e=>"_external_worker"==e.name?o.createElement(o.Fragment,null):o.createElement(YO,{key:e.name,item:e,filter:r,parentkey:e.name})))),o.createElement("hr",null),o.createElement("div",{className:"libtitle"},"External Worker"),o.createElement("hr",{className:"hr_prominent"}),o.createElement("div",{className:"vscrollcontainer"},n.external_worker?.map((e=>o.createElement(aT,{key:e.module,externalworkermod:e,lib:n.lib.shelves.find((e=>"_external_worker"===e.name))})))),o.createElement("hr",null)),o.createElement("div",{style:{paddingTop:"0.5rem"}}),a&&o.createElement("div",{className:"addlib"},o.createElement(nT,null,o.createElement("button",null,"Manage Libraries"))))};const{useRef:lT}=e;function cT(e){const t=lT();return n=>{const r=e(n);return function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[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(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}(t.current,r)?t.current:t.current=r}}var uT=o.forwardRef(((e,t)=>Lu.jsx(Qu.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));uT.displayName="VisuallyHidden";var dT=uT,[pT,fT]=Vu("Tooltip",[PC]),hT=PC(),mT="TooltipProvider",gT=700,yT="tooltip.open",[bT,vT]=pT(mT),wT=e=>{const{__scopeTooltip:t,delayDuration:n=gT,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,[s,l]=o.useState(!0),c=o.useRef(!1),u=o.useRef(0);return o.useEffect((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),Lu.jsx(bT,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:o.useCallback((()=>{window.clearTimeout(u.current),l(!1)}),[]),onClose:o.useCallback((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>l(!0)),r)}),[r]),isPointerInTransitRef:c,onPointerInTransitChange:o.useCallback((e=>{c.current=e}),[]),disableHoverableContent:i,children:a})};wT.displayName=mT;var xT="Tooltip",[CT,ET]=pT(xT),kT=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:l}=e,c=vT(xT,e.__scopeTooltip),u=hT(t),[d,p]=o.useState(null),f=Xu(),h=o.useRef(0),m=s??c.disableHoverableContent,g=l??c.delayDuration,y=o.useRef(!1),[b=!1,v]=$u({prop:r,defaultProp:i,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(yT))):c.onClose(),a?.(e)}}),w=o.useMemo((()=>b?y.current?"delayed-open":"instant-open":"closed"),[b]),x=o.useCallback((()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,v(!0)}),[v]),C=o.useCallback((()=>{window.clearTimeout(h.current),h.current=0,v(!1)}),[v]),E=o.useCallback((()=>{window.clearTimeout(h.current),h.current=window.setTimeout((()=>{y.current=!0,v(!0),h.current=0}),g)}),[g,v]);return o.useEffect((()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)}),[]),Lu.jsx(JC,{...u,children:Lu.jsx(CT,{scope:t,contentId:f,open:b,stateAttribute:w,trigger:d,onTriggerChange:p,onTriggerEnter:o.useCallback((()=>{c.isOpenDelayed?E():x()}),[c.isOpenDelayed,E,x]),onTriggerLeave:o.useCallback((()=>{m?C():(window.clearTimeout(h.current),h.current=0)}),[C,m]),onOpen:x,onClose:C,disableHoverableContent:m,children:n})})};kT.displayName=xT;var ST="TooltipTrigger",IT=o.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ET(ST,n),a=vT(ST,n),s=hT(n),l=Ou(t,o.useRef(null),i.onTriggerChange),c=o.useRef(!1),u=o.useRef(!1),d=o.useCallback((()=>c.current=!1),[]);return o.useEffect((()=>()=>document.removeEventListener("pointerup",d)),[d]),Lu.jsx(KC,{asChild:!0,...s,children:Lu.jsx(Qu.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Au(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(u.current||a.isPointerInTransitRef.current||(i.onTriggerEnter(),u.current=!0))})),onPointerLeave:Au(e.onPointerLeave,(()=>{i.onTriggerLeave(),u.current=!1})),onPointerDown:Au(e.onPointerDown,(()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})})),onFocus:Au(e.onFocus,(()=>{c.current||i.onOpen()})),onBlur:Au(e.onBlur,i.onClose),onClick:Au(e.onClick,i.onClose)})})}));IT.displayName=ST;var _T="TooltipPortal",[AT,NT]=pT(_T,{forceMount:void 0}),RT=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=ET(_T,t);return Lu.jsx(AT,{scope:t,forceMount:n,children:Lu.jsx(wd,{present:n||i.open,children:Lu.jsx(vd,{asChild:!0,container:o,children:r})})})};RT.displayName=_T;var OT="TooltipContent",TT=o.forwardRef(((e,t)=>{const n=NT(OT,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=ET(OT,e.__scopeTooltip);return Lu.jsx(wd,{present:r||a.open,children:a.disableHoverableContent?Lu.jsx(BT,{side:o,...i,ref:t}):Lu.jsx(MT,{side:o,...i,ref:t})})})),MT=o.forwardRef(((e,t)=>{const n=ET(OT,e.__scopeTooltip),r=vT(OT,e.__scopeTooltip),i=o.useRef(null),a=Ou(t,i),[s,l]=o.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:p}=r,f=o.useCallback((()=>{l(null),p(!1)}),[p]),h=o.useCallback(((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect()),i=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,o),a=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x)))break;t.pop()}t.push(r)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const r=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x)))break;n.pop()}n.push(r)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...i,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);l(a),p(!0)}),[p]);return o.useEffect((()=>()=>f()),[f]),o.useEffect((()=>{if(c&&d){const e=e=>h(e,d),t=e=>h(e,c);return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}}),[c,d,h,f]),o.useEffect((()=>{if(s){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e].x,s=t[e].y,l=t[i].x,c=t[i].y;s>r!=c>r&&n<(l-a)*(r-s)/(c-s)+a&&(o=!o)}return o}(n,s);r?f():o&&(f(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[c,d,s,u,f]),Lu.jsx(BT,{...e,ref:a})})),[PT,DT]=pT(xT,{isInside:!1}),BT=o.forwardRef(((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=e,c=ET(OT,n),u=hT(n),{onClose:d}=c;return o.useEffect((()=>(document.addEventListener(yT,d),()=>document.removeEventListener(yT,d))),[d]),o.useEffect((()=>{if(c.trigger){const e=e=>{const t=e.target;t?.contains(c.trigger)&&d()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[c.trigger,d]),Lu.jsx(id,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:Lu.jsxs(QC,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[Lu.jsx(Ju,{children:r}),Lu.jsx(PT,{scope:n,isInside:!0,children:Lu.jsx(dT,{id:c.contentId,role:"tooltip",children:i||r})})]})})}));TT.displayName=OT;var jT="TooltipArrow",FT=o.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,o=hT(n);return DT(jT,n).isInside?null:Lu.jsx(qC,{...o,...r,ref:t})}));FT.displayName=jT;var LT=wT,VT=kT,zT=IT,GT=RT,HT=TT,WT=FT,XT="Popover",[ZT,$T]=Vu(XT,[PC]),YT=PC(),[UT,JT]=ZT(XT),KT=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!1}=e,l=YT(t),c=o.useRef(null),[u,d]=o.useState(!1),[p=!1,f]=$u({prop:r,defaultProp:i,onChange:a});return Lu.jsx(JC,{...l,children:Lu.jsx(UT,{scope:t,contentId:Xu(),triggerRef:c,open:p,onOpenChange:f,onOpenToggle:o.useCallback((()=>f((e=>!e))),[f]),hasCustomAnchor:u,onCustomAnchorAdd:o.useCallback((()=>d(!0)),[]),onCustomAnchorRemove:o.useCallback((()=>d(!1)),[]),modal:s,children:n})})};KT.displayName=XT;var QT="PopoverAnchor";o.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,i=JT(QT,n),a=YT(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=i;return o.useEffect((()=>(s(),()=>l())),[s,l]),Lu.jsx(KC,{...a,...r,ref:t})})).displayName=QT;var qT="PopoverTrigger",eM=o.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=JT(qT,n),i=YT(n),a=Ou(t,o.triggerRef),s=Lu.jsx(Qu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":dM(o.open),...r,ref:a,onClick:Au(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:Lu.jsx(KC,{asChild:!0,...i,children:s})}));eM.displayName=qT;var tM="PopoverPortal",[nM,rM]=ZT(tM,{forceMount:void 0}),oM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=JT(tM,t);return Lu.jsx(nM,{scope:t,forceMount:n,children:Lu.jsx(wd,{present:n||i.open,children:Lu.jsx(vd,{asChild:!0,container:o,children:r})})})};oM.displayName=tM;var iM="PopoverContent",aM=o.forwardRef(((e,t)=>{const n=rM(iM,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=JT(iM,e.__scopePopover);return Lu.jsx(wd,{present:r||i.open,children:i.modal?Lu.jsx(sM,{...o,ref:t}):Lu.jsx(lM,{...o,ref:t})})}));aM.displayName=iM;var sM=o.forwardRef(((e,t)=>{const n=JT(iM,e.__scopePopover),r=o.useRef(null),i=Ou(t,r),a=o.useRef(!1);return o.useEffect((()=>{const e=r.current;if(e)return vp(e)}),[]),Lu.jsx(pp,{as:Yu,allowPinchZoom:!0,children:Lu.jsx(cM,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Au(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()})),onPointerDownOutside:Au(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;a.current=r}),{checkForDefaultPrevented:!1}),onFocusOutside:Au(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),lM=o.forwardRef(((e,t)=>{const n=JT(iM,e.__scopePopover),r=o.useRef(!1),i=o.useRef(!1);return Lu.jsx(cM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const o=t.target,a=n.triggerRef.current?.contains(o);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})})),cM=o.forwardRef(((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=JT(iM,n),f=YT(n);return Ed(),Lu.jsx(pd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:Lu.jsx(id,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:Lu.jsx(QC,{"data-state":dM(p.open),role:"dialog",id:p.contentId,...f,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),uM="PopoverClose";o.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=JT(uM,n);return Lu.jsx(Qu.button,{type:"button",...r,ref:t,onClick:Au(e.onClick,(()=>o.onOpenChange(!1)))})})).displayName=uM;function dM(e){return e?"open":"closed"}o.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=YT(n);return Lu.jsx(qC,{...o,...r,ref:t})})).displayName="PopoverArrow";var pM,fM,hM,mM,gM,yM,bM,vM,wM=KT,xM=eM,CM=oM,EM=aM;function kM(){if(mM)return hM;mM=1;const e=fM?pM:(fM=1,pM={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),t={};for(const n of Object.keys(e))t[e[n]]=n;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};hM=n;for(const e of Object.keys(n)){if(!("channels"in n[e]))throw new Error("missing channels property: "+e);if(!("labels"in n[e]))throw new Error("missing channel labels property: "+e);if(n[e].labels.length!==n[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:r}=n[e];delete n[e].channels,delete n[e].labels,Object.defineProperty(n[e],"channels",{value:t}),Object.defineProperty(n[e],"labels",{value:r})}return n.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=i-o;let s,l;i===o?s=0:t===i?s=(n-r)/a:n===i?s=2+(r-t)/a:r===i&&(s=4+(t-n)/a),s=Math.min(60*s,360),s<0&&(s+=360);const c=(o+i)/2;return l=i===o?0:c<=.5?a/(i+o):a/(2-i-o),[s,100*l,100*c]},n.rgb.hsv=function(e){let t,n,r,o,i;const a=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),d=function(e){return(c-e)/6/u+.5};return 0===u?(o=0,i=0):(i=u/c,t=d(a),n=d(s),r=d(l),a===c?o=r-n:s===c?o=1/3+t-r:l===c&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*i,100*c]},n.rgb.hwb=function(e){const t=e[0],r=e[1];let o=e[2];const i=n.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(r,o));return o=1-1/255*Math.max(t,Math.max(r,o)),[i,100*a,100*o]},n.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r);return[100*((1-t-o)/(1-o)||0),100*((1-n-o)/(1-o)||0),100*((1-r-o)/(1-o)||0),100*o]},n.rgb.keyword=function(n){const r=t[n];if(r)return r;let o,i=1/0;for(const t of Object.keys(e)){const r=e[t],l=(s=r,((a=n)[0]-s[0])**2+(a[1]-s[1])**2+(a[2]-s[2])**2);l<i&&(i=l,o=t)}var a,s;return o},n.keyword.rgb=function(t){return e[t]},n.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;return[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},n.rgb.lab=function(e){const t=n.rgb.xyz(e);let r=t[0],o=t[1],i=t[2];r/=95.047,o/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*o-16,500*(r-o),200*(o-i)]},n.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,i,a;if(0===n)return a=255*r,[a,a,a];o=r<.5?r*(1+n):r+n-r*n;const s=2*r-o,l=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,a=6*i<1?s+6*(o-s)*i:2*i<1?o:3*i<2?s+(o-s)*(2/3-i)*6:s,l[e]=255*a;return l},n.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const i=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=i<=1?i:2-i;return[t,100*(0===r?2*o/(i+o):2*n/(r+n)),100*((r+n)/2)]},n.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,i=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*i),l=255*r*(1-n*(1-i));switch(r*=255,o){case 0:return[r,l,a];case 1:return[s,r,a];case 2:return[a,r,l];case 3:return[a,s,r];case 4:return[l,a,r];case 5:return[r,a,s]}},n.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let i,a;a=(2-n)*r;const s=(2-n)*o;return i=n*o,i/=s<=1?s:2-s,i=i||0,a/=2,[t,100*i,100*a]},n.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let i;o>1&&(n/=o,r/=o);const a=Math.floor(6*t),s=1-r;i=6*t-a,1&a&&(i=1-i);const l=n+i*(s-n);let c,u,d;switch(a){default:case 6:case 0:c=s,u=l,d=n;break;case 1:c=l,u=s,d=n;break;case 2:c=n,u=s,d=l;break;case 3:c=n,u=l,d=s;break;case 4:c=l,u=n,d=s;break;case 5:c=s,u=n,d=l}return[255*c,255*u,255*d]},n.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o))]},n.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,i,a;return o=3.2406*t+-1.5372*n+-.4986*r,i=-.9689*t+1.8758*n+.0415*r,a=.0557*t+-.204*n+1.057*r,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,o=Math.min(Math.max(0,o),1),i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),[255*o,255*i,255*a]},n.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},n.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const o=n**3,i=t**3,a=r**3;return n=o>.008856?o:(n-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},n.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=360*Math.atan2(r,n)/2/Math.PI,o<0&&(o+=360);return[t,Math.sqrt(n*n+r*r),o]},n.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},n.rgb.ansi16=function(e,t=null){const[r,o,i]=e;let a=null===t?n.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),0===a)return 30;let s=30+(Math.round(i/255)<<2|Math.round(o/255)<<1|Math.round(r/255));return 2===a&&(s+=60),s},n.hsv.ansi16=function(e){return n.rgb.ansi16(n.hsv.rgb(e),e[2])},n.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},n.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},n.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},n.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},n.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map((e=>e+e)).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},n.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),i=Math.min(Math.min(t,n),r),a=o-i;let s,l;return s=a<1?i/(1-a):0,l=a<=0?0:o===t?(n-r)/a%6:o===n?2+(r-t)/a:4+(t-n)/a,l/=6,l%=1,[360*l,100*a,100*s]},n.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],100*r,100*o]},n.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},n.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const o=[0,0,0],i=t%1*6,a=i%1,s=1-a;let l=0;switch(Math.floor(i)){case 0:o[0]=1,o[1]=a,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=a;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=a,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return l=(1-n)*r,[255*(n*o[0]+l),255*(n*o[1]+l),255*(n*o[2]+l)]},n.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},n.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},n.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},n.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},n.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},n.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},n.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},n.gray.hsl=function(e){return[0,0,e[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(e){return[0,100,e[0]]},n.gray.cmyk=function(e){return[0,0,0,e[0]]},n.gray.lab=function(e){return[e[0],0,0]},n.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},n.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},hM}function SM(){if(yM)return gM;yM=1;const e=kM();function t(t){const n=function(){const t={},n=Object.keys(e);for(let e=n.length,r=0;r<e;r++)t[n[r]]={distance:-1,parent:null};return t}(),r=[t];for(n[t].distance=0;r.length;){const t=r.pop(),o=Object.keys(e[t]);for(let e=o.length,i=0;i<e;i++){const e=o[i],a=n[e];-1===a.distance&&(a.distance=n[t].distance+1,a.parent=t,r.unshift(e))}}return n}function n(e,t){return function(n){return t(e(n))}}function r(t,r){const o=[r[t].parent,t];let i=e[r[t].parent][t],a=r[t].parent;for(;r[a].parent;)o.unshift(r[a].parent),i=n(e[r[a].parent][a],i),a=r[a].parent;return i.conversion=o,i}return gM=function(e){const n=t(e),o={},i=Object.keys(n);for(let e=i.length,t=0;t<e;t++){const e=i[t];null!==n[e].parent&&(o[e]=r(e,n))}return o},gM}var IM=function(){if(vM)return bM;vM=1;const e=kM(),t=SM(),n={};return Object.keys(e).forEach((r=>{n[r]={},Object.defineProperty(n[r],"channels",{value:e[r].channels}),Object.defineProperty(n[r],"labels",{value:e[r].labels});const o=t(r);Object.keys(o).forEach((e=>{const t=o[e];n[r][e]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(t),n[r][e].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(t)}))})),bM=n}(),_M=r({__proto__:null,default:l(IM)},[IM]);const AM=(e,t)=>{if(Array.isArray(t)||(t=[t]),void 0===t[0]||null===t[0])return AM("rgb",[0,0,0]);const n=_M[e];if(!n)throw new Error("Unsupported color type: "+e);n[e]=()=>t;const r=n.rgb(t);if(!Array.isArray(r))return AM("rgb",[0,0,0]);if(void 0===r[0]||null===r[0])return AM("rgb",[0,0,0]);const o=n.hsl(t);if(!Array.isArray(o))return AM("rgb",[0,0,0]);if(void 0===o[0]||null===o[0])return AM("rgb",[0,0,0]);const i={};return Object.keys(n).forEach((e=>{const r=n[e];"function"==typeof r&&(i[e]=()=>r.apply(null,t))})),i},NM=({onChange:t,colorconverter:n,allow_null:r=!1})=>{if(null===n&&!r)throw new Error("Color converter is null");const[i,a]=e.useState(n),[s,l]=e.useState([0,0,0]),[c,u]=e.useState([0,0,0]),[d,p]=e.useState([0,0,0]),[f,h]=e.useState("000");e.useEffect((()=>{if(!i){if(!r)throw new Error("Color converter is null");return u([0,0,0]),l([0,0,0]),p([0,0,0]),void h("")}l(i.hsl()),u(i.rgb()),p(i.hsv()),h(i.hex())}),[i]);const m={backgroundColor:`hsl(${s[0]}, ${s[1]}%, ${s[2]}%)`,padding:"10px",margin:"10px 0"};return o.createElement("div",{style:{backgroundColor:"white"}},o.createElement("div",{style:m},"Color Preview"),o.createElement("div",{className:"colorspace"},o.createElement("div",{className:"colorspace_title"},"RGB"),o.createElement("div",null),o.createElement("label",null,"Red"),o.createElement("input",{type:"range",min:"0",max:"255",value:c[0],onChange:e=>{const n=[parseInt(e.target.value),c[1],c[2]],r=AM("rgb",n);a(r),t(r)},style:{background:"linear-gradient(to right, #000, #f00)"}}),o.createElement("label",null,"Green"),o.createElement("input",{type:"range",min:"0",max:"255",value:c[1],onChange:e=>{const n=[c[0],parseInt(e.target.value),c[2]],r=AM("rgb",n);a(r),t(r)},style:{background:"linear-gradient(to right, #000, #0f0)"}}),o.createElement("label",null,"Blue"),o.createElement("input",{type:"range",min:"0",max:"255",value:c[2],onChange:e=>{const n=[c[0],c[1],parseInt(e.target.value)],r=AM("rgb",n);a(r),t(r)},style:{background:"linear-gradient(to right, #000, #00f)"}})),o.createElement("div",{className:"colorspace"},o.createElement("div",{className:"colorspace_title"},"HSL"),o.createElement("div",null),o.createElement("label",null,"Hue"),o.createElement("input",{type:"range",min:"0",max:"360",value:s[0],onChange:e=>{const n=[parseInt(e.target.value),s[1],s[2]],r=AM("hsl",n);a(r),t(r)},style:{background:"linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)"}}),o.createElement("label",null,"Saturation"),o.createElement("input",{type:"range",min:"0",max:"100",value:s[1],onChange:e=>{const n=[s[0],parseInt(e.target.value),s[2]],r=AM("hsl",n);a(r),t(r)},style:{background:`linear-gradient(to right, #fff, hsl(${s[0]}, 100%, 50%))`}}),o.createElement("label",null,"Lightness"),o.createElement("input",{type:"range",min:"0",max:"100",value:s[2],onChange:e=>{const n=[s[0],s[1],parseInt(e.target.value)],r=AM("hsl",n);a(r),t(r)},style:{background:`linear-gradient(to right, #000, hsl(${s[0]}, 100%, 50%), #fff)`}})),o.createElement("div",{className:"colorspace"},o.createElement("div",{className:"colorspace_title"},"HSV"),o.createElement("div",null),o.createElement("label",null,"Hue"),o.createElement("input",{type:"range",min:"0",max:"360",value:d[0],onChange:e=>{const n=[parseInt(e.target.value),d[1],d[2]],r=AM("hsv",n);a(r),t(r)},style:{background:"linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)"}}),o.createElement("label",null,"Saturation"),o.createElement("input",{type:"range",min:"0",max:"100",value:d[1],onChange:e=>{const n=[d[0],parseInt(e.target.value),d[2]],r=AM("hsv",n);a(r),t(r)},style:{background:`linear-gradient(to right, #fff, hsl(${s[0]}, 100%, 50%))`}}),o.createElement("label",null,"Value"),o.createElement("input",{type:"range",min:"0",max:"100",value:d[2],onChange:e=>{const n=[d[0],d[1],parseInt(e.target.value)],r=AM("hsv",n);a(r),t(r)},style:{background:`linear-gradient(to right, #000, hsl(${s[0]}, 100%, 50%))`}})),o.createElement("div",{className:"colorspace"},o.createElement("div",{className:"colorspace_title"},"HEX"),o.createElement("div",null),o.createElement("input",{type:"text",value:f,onChange:e=>{const n=""===e.target.value?null:AM("hex",[e.target.value]);a(n),t(n)}})))},RM=({inicolordata:t,inicolorspace:n="hex",allow_null:r=!1,onChange:i})=>{void 0===t&&(t=[0,0,0],n="rgb"),Array.isArray(t)||(t=[t]);let a=AM(n,t);void 0===a.rgb()&&(a=AM("rgb",[0,0,0]));const[s,l]=e.useState(a),c={background:"#"+s.hex(),borderRadius:"0.3rem",width:"2rem",height:"1rem"};return o.createElement(wM,null,o.createElement(xM,{asChild:!0},o.createElement("button",{style:c})),o.createElement(CM,null,o.createElement(EM,{side:"left"},o.createElement(NM,{onChange:e=>{if(null===e&&!r)throw new Error("Color is null");null!==e&&l(e),i&&i(e)},colorconverter:s,allow_null:r}))))};function OM(e,[t,n]){return Math.min(n,Math.max(t,e))}var TM=["PageUp","PageDown"],MM=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],PM={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},DM="Slider",[BM,jM,FM]=Qw(DM),[LM,VM]=Vu(DM,[FM]),[zM,GM]=LM(DM),HM=o.forwardRef(((e,t)=>{const{name:n,min:r=0,max:i=100,step:a=1,orientation:s="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:d,onValueChange:p=()=>{},onValueCommit:f=()=>{},inverted:h=!1,form:m,...g}=e,y=o.useRef(new Set),b=o.useRef(0),v="horizontal"===s?ZM:$M,[w=[],x]=$u({prop:d,defaultProp:u,onChange:e=>{const t=[...y.current];t[b.current]?.focus(),p(e)}}),C=o.useRef(w);function E(e,t,{commit:n}={commit:!1}){const o=function(e){return(String(e).split(".")[1]||"").length}(a),s=function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}(Math.round((e-r)/a)*a+r,o),l=OM(s,[r,i]);x(((e=[])=>{const r=function(e=[],t,n){const r=[...e];return r[n]=t,r.sort(((e,t)=>e-t))}(e,l,t);if(function(e,t){if(t>0){const n=function(e){return e.slice(0,-1).map(((t,n)=>e[n+1]-t))}(e);return Math.min(...n)>=t}return!0}(r,c*a)){b.current=r.indexOf(l);const t=String(r)!==String(e);return t&&n&&f(r),t?r:e}return e}))}return Lu.jsx(zM,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:i,valueIndexToChangeRef:b,thumbs:y.current,values:w,orientation:s,form:m,children:Lu.jsx(BM.Provider,{scope:e.__scopeSlider,children:Lu.jsx(BM.Slot,{scope:e.__scopeSlider,children:Lu.jsx(v,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:Au(g.onPointerDown,(()=>{l||(C.current=w)})),min:r,max:i,inverted:h,onSlideStart:l?void 0:function(e){const t=function(e,t){if(1===e.length)return 0;const n=e.map((e=>Math.abs(e-t))),r=Math.min(...n);return n.indexOf(r)}(w,e);E(e,t)},onSlideMove:l?void 0:function(e){E(e,b.current)},onSlideEnd:l?void 0:function(){const e=C.current[b.current];w[b.current]!==e&&f(w)},onHomeKeyDown:()=>!l&&E(r,0,{commit:!0}),onEndKeyDown:()=>!l&&E(i,w.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!l){const n=TM.includes(e.key)||e.shiftKey&&MM.includes(e.key)?10:1,r=b.current;E(w[r]+a*n*t,r,{commit:!0})}}})})})})}));HM.displayName=DM;var[WM,XM]=LM(DM,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ZM=o.forwardRef(((e,t)=>{const{min:n,max:r,dir:i,inverted:a,onSlideStart:s,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=e,[p,f]=o.useState(null),h=Ou(t,(e=>f(e))),m=o.useRef(void 0),g=ex(i),y="ltr"===g,b=y&&!a||!y&&a;function v(e){const t=m.current||p.getBoundingClientRect(),o=oP([0,t.width],b?[n,r]:[r,n]);return m.current=t,o(e-t.left)}return Lu.jsx(WM,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:Lu.jsx(YM,{dir:g,"data-orientation":"horizontal",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{const t=v(e.clientX);s?.(t)},onSlideMove:e=>{const t=v(e.clientX);l?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{const t=PM[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})})),$M=o.forwardRef(((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=e,d=o.useRef(null),p=Ou(t,d),f=o.useRef(void 0),h=!i;function m(e){const t=f.current||d.current.getBoundingClientRect(),o=oP([0,t.height],h?[r,n]:[n,r]);return f.current=t,o(e-t.top)}return Lu.jsx(WM,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:Lu.jsx(YM,{"data-orientation":"vertical",...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{const t=m(e.clientY);a?.(t)},onSlideMove:e=>{const t=m(e.clientY);s?.(t)},onSlideEnd:()=>{f.current=void 0,l?.()},onStepKeyDown:e=>{const t=PM[h?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})})),YM=o.forwardRef(((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,u=GM(DM,n);return Lu.jsx(Qu.span,{...c,ref:t,onKeyDown:Au(e.onKeyDown,(e=>{"Home"===e.key?(a(e),e.preventDefault()):"End"===e.key?(s(e),e.preventDefault()):TM.concat(MM).includes(e.key)&&(l(e),e.preventDefault())})),onPointerDown:Au(e.onPointerDown,(e=>{const t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)})),onPointerMove:Au(e.onPointerMove,(e=>{e.target.hasPointerCapture(e.pointerId)&&o(e)})),onPointerUp:Au(e.onPointerUp,(e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),i(e))}))})})),UM="SliderTrack",JM=o.forwardRef(((e,t)=>{const{__scopeSlider:n,...r}=e,o=GM(UM,n);return Lu.jsx(Qu.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})}));JM.displayName=UM;var KM="SliderRange",QM=o.forwardRef(((e,t)=>{const{__scopeSlider:n,...r}=e,i=GM(KM,n),a=XM(KM,n),s=Ou(t,o.useRef(null)),l=i.values.length,c=i.values.map((e=>rP(e,i.min,i.max))),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return Lu.jsx(Qu.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[a.startEdge]:u+"%",[a.endEdge]:d+"%"}})}));QM.displayName=KM;var qM="SliderThumb",eP=o.forwardRef(((e,t)=>{const n=jM(e.__scopeSlider),[r,i]=o.useState(null),a=Ou(t,(e=>i(e))),s=o.useMemo((()=>r?n().findIndex((e=>e.ref.current===r)):-1),[n,r]);return Lu.jsx(tP,{...e,ref:a,index:s})})),tP=o.forwardRef(((e,t)=>{const{__scopeSlider:n,index:r,name:i,...a}=e,s=GM(qM,n),l=XM(qM,n),[c,u]=o.useState(null),d=Ou(t,(e=>u(e))),p=!c||(s.form||!!c.closest("form")),f=OC(c),h=s.values[r],m=void 0===h?0:rP(h,s.min,s.max),g=function(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}(r,s.values.length),y=f?.[l.size],b=y?function(e,t,n){const r=e/2,o=oP([0,50],[0,r]);return(r-o(t)*n)*n}(y,m,l.direction):0;return o.useEffect((()=>{if(c)return s.thumbs.add(c),()=>{s.thumbs.delete(c)}}),[c,s.thumbs]),Lu.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${m}% + ${b}px)`},children:[Lu.jsx(BM.ItemSlot,{scope:e.__scopeSlider,children:Lu.jsx(Qu.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":s.min,"aria-valuenow":h,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...a,ref:d,style:void 0===h?{display:"none"}:e.style,onFocus:Au(e.onFocus,(()=>{s.valueIndexToChangeRef.current=r}))})}),p&&Lu.jsx(nP,{name:i??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:h},r)]})}));eP.displayName=qM;var nP=e=>{const{value:t,...n}=e,r=o.useRef(null),i=function(e){const t=o.useRef({value:e,previous:e});return o.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(t);return o.useEffect((()=>{const e=r.current,n=window.HTMLInputElement.prototype,o=Object.getOwnPropertyDescriptor(n,"value").set;if(i!==t&&o){const n=new Event("input",{bubbles:!0});o.call(e,t),e.dispatchEvent(n)}}),[i,t]),Lu.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function rP(e,t,n){return OM(100/(n-t)*(e-t),[0,100])}function oP(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}var iP=HM,aP=JM,sP=QM,lP=eP;function cP(e){return cP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cP(e)}function uP(e){var t=function(e,t){if("object"!=cP(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=cP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==cP(t)?t:t+""}function dP(e,t,n){return(t=uP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pP(Object(n),!0).forEach((function(t){dP(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function mP(e,t){if(e){if("string"==typeof e)return hP(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hP(e,t):void 0}}function gP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||mP(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yP(e,t){if(null==e)return{};var n,r,o=gw(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var bP=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function vP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,uP(r.key),r)}}function wP(e){return wP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wP(e)}function xP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xP=function(){return!!e})()}function CP(e){var t=xP();return function(){var n,r=wP(e);if(t){var o=wP(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==cP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ww(e)}(this,n)}}function EP(e){return function(e){if(Array.isArray(e))return hP(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||mP(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var kP=e.useLayoutEffect,SP=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],IP=function(){};function _P(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function AP(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&i.push("".concat(_P(e,a)));return i.filter((function(e){return e})).map((function(e){return String(e).trim()})).join(" ")}var NP=function(e){return function(e){return Array.isArray(e)}(e)?e.filter(Boolean):"object"===cP(e)&&null!==e?[e]:[]},RP=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,fP({},yP(e,SP))},OP=function(e,t,n){var r=e.cx,o=e.getStyles,i=e.getClassNames,a=e.className;return{css:o(t,e),className:r(null!=n?n:{},i(t,e),a)}};function TP(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function MP(e){return TP(e)?window.pageYOffset:e.scrollTop}function PP(e,t){TP(e)?window.scrollTo(0,t):e.scrollTop=t}function DP(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:IP,o=MP(e),i=t-o,a=0;!function t(){var s,l=i*((s=(s=a+=10)/n-1)*s*s+1)+o;PP(e,l),a<n?window.requestAnimationFrame(t):r(e)}()}function BP(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?PP(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&PP(e,Math.max(t.offsetTop-o,0))}function jP(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var FP=!1,LP={get passive(){return FP=!0}},VP="undefined"!=typeof window?window:{};VP.addEventListener&&VP.removeEventListener&&(VP.addEventListener("p",IP,LP),VP.removeEventListener("p",IP,!1));var zP=FP;function GP(e){return null!=e}function HP(e,t,n){return e?t:n}var WP=["children","innerProps"],XP=["children","innerProps"];function ZP(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,a=e.isFixedPosition,s=e.controlHeight,l=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u,d=l.getBoundingClientRect().height,p=n.getBoundingClientRect(),f=p.bottom,h=p.height,m=p.top,g=n.offsetParent.getBoundingClientRect().top,y=a?window.innerHeight:TP(u=l)?window.innerHeight:u.clientHeight,b=MP(l),v=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),x=g-w,C=y-m,E=x+b,k=d-b-m,S=f-y+b+v,I=b+m-w,_=160;switch(o){case"auto":case"bottom":if(C>=h)return{placement:"bottom",maxHeight:t};if(k>=h&&!a)return i&&DP(l,S,_),{placement:"bottom",maxHeight:t};if(!a&&k>=r||a&&C>=r)return i&&DP(l,S,_),{placement:"bottom",maxHeight:a?C-v:k-v};if("auto"===o||a){var A=t,N=a?x:E;return N>=r&&(A=Math.min(N-v-s,t)),{placement:"top",maxHeight:A}}if("bottom"===o)return i&&PP(l,S),{placement:"bottom",maxHeight:t};break;case"top":if(x>=h)return{placement:"top",maxHeight:t};if(E>=h&&!a)return i&&DP(l,I,_),{placement:"top",maxHeight:t};if(!a&&E>=r||a&&x>=r){var R=t;return(!a&&E>=r||a&&x>=r)&&(R=a?x-w:E-w),i&&DP(l,I,_),{placement:"top",maxHeight:R}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}var $P,YP=function(e){return"auto"===e?"bottom":e},UP=e.createContext(null),JP=function(t){var n=t.children,r=t.minMenuHeight,o=t.maxMenuHeight,i=t.menuPlacement,a=t.menuPosition,s=t.menuShouldScrollIntoView,l=t.theme,c=(e.useContext(UP)||{}).setPortalPlacement,u=e.useRef(null),d=gP(e.useState(o),2),p=d[0],f=d[1],h=gP(e.useState(null),2),m=h[0],g=h[1],y=l.spacing.controlHeight;return kP((function(){var e=u.current;if(e){var t="fixed"===a,n=ZP({maxHeight:o,menuEl:e,minHeight:r,placement:i,shouldScroll:s&&!t,isFixedPosition:t,controlHeight:y});f(n.maxHeight),g(n.placement),null==c||c(n.placement)}}),[o,i,a,s,r,c,y]),n({ref:u,placerProps:fP(fP({},t),{},{placement:m||YP(i),maxHeight:p})})},KP=function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return ry("div",Im({},OP(e,"menu",{menu:!0}),{ref:n},r),t)},QP=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return fP({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},qP=QP,eD=QP,tD=["size"],nD=["innerProps","isRtl","size"];var rD,oD,iD="production"===process.env.NODE_ENV?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdpdGhMYWJlbCxcbiAgR3JvdXBCYXNlLFxufSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRTdHlsZVByb3BzIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgSWNvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBTdmcgPSAoe1xuICBzaXplLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZTogbnVtYmVyIH0pID0+IChcbiAgPHN2Z1xuICAgIGhlaWdodD17c2l6ZX1cbiAgICB3aWR0aD17c2l6ZX1cbiAgICB2aWV3Qm94PVwiMCAwIDIwIDIwXCJcbiAgICBhcmlhLWhpZGRlbj1cInRydWVcIlxuICAgIGZvY3VzYWJsZT1cImZhbHNlXCJcbiAgICBjc3M9e3tcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgZmlsbDogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBsaW5lSGVpZ2h0OiAxLFxuICAgICAgc3Ryb2tlOiAnY3VycmVudENvbG9yJyxcbiAgICAgIHN0cm9rZVdpZHRoOiAwLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IHR5cGUgQ3Jvc3NJY29uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgQ3Jvc3NJY29uID0gKHByb3BzOiBDcm9zc0ljb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNMTQuMzQ4IDE0Ljg0OWMtMC40NjkgMC40NjktMS4yMjkgMC40NjktMS42OTcgMGwtMi42NTEtMy4wMzAtMi42NTEgMy4wMjljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDAtMC40NjktMC40NjktMC40NjktMS4yMjkgMC0xLjY5N2wyLjc1OC0zLjE1LTIuNzU5LTMuMTUyYy0wLjQ2OS0wLjQ2OS0wLjQ2OS0xLjIyOCAwLTEuNjk3czEuMjI4LTAuNDY5IDEuNjk3IDBsMi42NTIgMy4wMzEgMi42NTEtMy4wMzFjMC40NjktMC40NjkgMS4yMjgtMC40NjkgMS42OTcgMHMwLjQ2OSAxLjIyOSAwIDEuNjk3bC0yLjc1OCAzLjE1MiAyLjc1OCAzLjE1YzAuNDY5IDAuNDY5IDAuNDY5IDEuMjI5IDAgMS42OTh6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuZXhwb3J0IHR5cGUgRG93bkNoZXZyb25Qcm9wcyA9IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU/OiBudW1iZXIgfTtcbmV4cG9ydCBjb25zdCBEb3duQ2hldnJvbiA9IChwcm9wczogRG93bkNoZXZyb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNNC41MTYgNy41NDhjMC40MzYtMC40NDYgMS4wNDMtMC40ODEgMS41NzYgMGwzLjkwOCAzLjc0NyAzLjkwOC0zLjc0N2MwLjUzMy0wLjQ4MSAxLjE0MS0wLjQ0NiAxLjU3NCAwIDAuNDM2IDAuNDQ1IDAuNDA4IDEuMTk3IDAgMS42MTUtMC40MDYgMC40MTgtNC42OTUgNC41MDItNC42OTUgNC41MDItMC4yMTcgMC4yMjMtMC41MDIgMC4zMzUtMC43ODcgMC4zMzVzLTAuNTctMC4xMTItMC43ODktMC4zMzVjMCAwLTQuMjg3LTQuMDg0LTQuNjk1LTQuNTAycy0wLjQzNi0xLjE3IDAtMS42MTV6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgQnV0dG9uc1xuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbmV4cG9ydCBpbnRlcmZhY2UgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBUaGUgY2hpbGRyZW4gdG8gYmUgcmVuZGVyZWQgaW5zaWRlIHRoZSBpbmRpY2F0b3IuICovXG4gIGNoaWxkcmVuPzogUmVhY3ROb2RlO1xuICAvKiogUHJvcHMgdGhhdCB3aWxsIGJlIHBhc3NlZCBvbiB0byB0aGUgY2hpbGRyZW4uICovXG4gIGlubmVyUHJvcHM6IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snZGl2J107XG4gIC8qKiBUaGUgZm9jdXNlZCBzdGF0ZSBvZiB0aGUgc2VsZWN0LiAqL1xuICBpc0ZvY3VzZWQ6IGJvb2xlYW47XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG59XG5cbmNvbnN0IGJhc2VDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgdGhlbWU6IHtcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICAgIGNvbG9ycyxcbiAgICB9LFxuICB9OlxuICAgIHwgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuICAgIHwgQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2luZGljYXRvckNvbnRhaW5lcicsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgdHJhbnNpdGlvbjogJ2NvbG9yIDE1MG1zJyxcbiAgLi4uKHVuc3R5bGVkXG4gICAgPyB7fVxuICAgIDoge1xuICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw2MCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIHBhZGRpbmc6IGJhc2VVbml0ICogMixcbiAgICAgICAgJzpob3Zlcic6IHtcbiAgICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw4MCA6IGNvbG9ycy5uZXV0cmFsNDAsXG4gICAgICAgIH0sXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgZHJvcGRvd25JbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IERyb3Bkb3duSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnZHJvcGRvd25JbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2Ryb3Bkb3duLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8RG93bkNoZXZyb24gLz59XG4gICAgPC9kaXY+XG4gICk7XG59O1xuXG5leHBvcnQgaW50ZXJmYWNlIENsZWFySW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xufVxuXG5leHBvcnQgY29uc3QgY2xlYXJJbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IENsZWFySW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnY2xlYXJJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2NsZWFyLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8Q3Jvc3NJY29uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBTZXBhcmF0b3Jcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIEluZGljYXRvclNlcGFyYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpbm5lclByb3BzPzogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ107XG59XG5cbmV4cG9ydCBjb25zdCBpbmRpY2F0b3JTZXBhcmF0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0Rpc2FibGVkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JTZXBhcmF0b3InLFxuICBhbGlnblNlbGY6ICdzdHJldGNoJyxcbiAgd2lkdGg6IDEsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgYmFja2dyb3VuZENvbG9yOiBpc0Rpc2FibGVkID8gY29sb3JzLm5ldXRyYWwxMCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIG1hcmdpbkJvdHRvbTogYmFzZVVuaXQgKiAyLFxuICAgICAgICBtYXJnaW5Ub3A6IGJhc2VVbml0ICogMixcbiAgICAgIH0pLFxufSk7XG5cbmV4cG9ydCBjb25zdCBJbmRpY2F0b3JTZXBhcmF0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHByb3BzOiBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgaW5uZXJQcm9wcyB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPHNwYW5cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgICAgey4uLmdldFN0eWxlUHJvcHMocHJvcHMsICdpbmRpY2F0b3JTZXBhcmF0b3InLCB7XG4gICAgICAgICdpbmRpY2F0b3Itc2VwYXJhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgIC8+XG4gICk7XG59O1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIExvYWRpbmdcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBsb2FkaW5nRG90QW5pbWF0aW9ucyA9IGtleWZyYW1lc2BcbiAgMCUsIDgwJSwgMTAwJSB7IG9wYWNpdHk6IDA7IH1cbiAgNDAlIHsgb3BhY2l0eTogMTsgfVxuYDtcblxuZXhwb3J0IGNvbnN0IGxvYWRpbmdJbmRpY2F0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgc2l6ZSxcbiAgICB0aGVtZToge1xuICAgICAgY29sb3JzLFxuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgIH0sXG4gIH06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2xvYWRpbmdJbmRpY2F0b3InLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIGFsaWduU2VsZjogJ2NlbnRlcicsXG4gIGZvbnRTaXplOiBzaXplLFxuICBsaW5lSGVpZ2h0OiAxLFxuICBtYXJnaW5SaWdodDogc2l6ZSxcbiAgdGV4dEFsaWduOiAnY2VudGVyJyxcbiAgdmVydGljYWxBbGlnbjogJ21pZGRsZScsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5pbnRlcmZhY2UgTG9hZGluZ0RvdFByb3BzIHtcbiAgZGVsYXk6IG51bWJlcjtcbiAgb2Zmc2V0OiBib29sZWFuO1xufVxuY29uc3QgTG9hZGluZ0RvdCA9ICh7IGRlbGF5LCBvZmZzZXQgfTogTG9hZGluZ0RvdFByb3BzKSA9PiAoXG4gIDxzcGFuXG4gICAgY3NzPXt7XG4gICAgICBhbmltYXRpb246IGAke2xvYWRpbmdEb3RBbmltYXRpb25zfSAxcyBlYXNlLWluLW91dCAke2RlbGF5fW1zIGluZmluaXRlO2AsXG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6ICdjdXJyZW50Q29sb3InLFxuICAgICAgYm9yZGVyUmFkaXVzOiAnMWVtJyxcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgbWFyZ2luTGVmdDogb2Zmc2V0ID8gJzFlbScgOiB1bmRlZmluZWQsXG4gICAgICBoZWlnaHQ6ICcxZW0nLFxuICAgICAgdmVydGljYWxBbGlnbjogJ3RvcCcsXG4gICAgICB3aWR0aDogJzFlbScsXG4gICAgfX1cbiAgLz5cbik7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTG9hZGluZ0luZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xuICAvKiogU2V0IHNpemUgb2YgdGhlIGNvbnRhaW5lci4gKi9cbiAgc2l6ZTogbnVtYmVyO1xufVxuZXhwb3J0IGNvbnN0IExvYWRpbmdJbmRpY2F0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oe1xuICBpbm5lclByb3BzLFxuICBpc1J0bCxcbiAgc2l6ZSA9IDQsXG4gIC4uLnJlc3RQcm9wc1xufTogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPGRpdlxuICAgICAgey4uLmdldFN0eWxlUHJvcHMoXG4gICAgICAgIHsgLi4ucmVzdFByb3BzLCBpbm5lclByb3BzLCBpc1J0bCwgc2l6ZSB9LFxuICAgICAgICAnbG9hZGluZ0luZGljYXRvcicsXG4gICAgICAgIHtcbiAgICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgICAgfVxuICAgICAgKX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXswfSBvZmZzZXQ9e2lzUnRsfSAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}},aD=function(e){var t=e.size,n=yP(e,tD);return ry("svg",Im({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:iD},n))},sD=function(e){return ry(aD,Im({size:20},e),ry("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},lD=function(e){return ry(aD,Im({size:20},e),ry("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},cD=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return fP({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*o,":hover":{color:n?i.neutral80:i.neutral40}})},uD=cD,dD=cD,pD=iy($P||(rD=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],oD||(oD=rD.slice(0)),$P=Object.freeze(Object.defineProperties(rD,{raw:{value:Object.freeze(oD)}})))),fD=function(e){var t=e.delay,n=e.offset;return ry("span",{css:oy({animation:"".concat(pD," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"production"===process.env.NODE_ENV?"":";label:LoadingDot;","production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdpdGhMYWJlbCxcbiAgR3JvdXBCYXNlLFxufSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRTdHlsZVByb3BzIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgSWNvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBTdmcgPSAoe1xuICBzaXplLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZTogbnVtYmVyIH0pID0+IChcbiAgPHN2Z1xuICAgIGhlaWdodD17c2l6ZX1cbiAgICB3aWR0aD17c2l6ZX1cbiAgICB2aWV3Qm94PVwiMCAwIDIwIDIwXCJcbiAgICBhcmlhLWhpZGRlbj1cInRydWVcIlxuICAgIGZvY3VzYWJsZT1cImZhbHNlXCJcbiAgICBjc3M9e3tcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgZmlsbDogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBsaW5lSGVpZ2h0OiAxLFxuICAgICAgc3Ryb2tlOiAnY3VycmVudENvbG9yJyxcbiAgICAgIHN0cm9rZVdpZHRoOiAwLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IHR5cGUgQ3Jvc3NJY29uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgQ3Jvc3NJY29uID0gKHByb3BzOiBDcm9zc0ljb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNMTQuMzQ4IDE0Ljg0OWMtMC40NjkgMC40NjktMS4yMjkgMC40NjktMS42OTcgMGwtMi42NTEtMy4wMzAtMi42NTEgMy4wMjljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDAtMC40NjktMC40NjktMC40NjktMS4yMjkgMC0xLjY5N2wyLjc1OC0zLjE1LTIuNzU5LTMuMTUyYy0wLjQ2OS0wLjQ2OS0wLjQ2OS0xLjIyOCAwLTEuNjk3czEuMjI4LTAuNDY5IDEuNjk3IDBsMi42NTIgMy4wMzEgMi42NTEtMy4wMzFjMC40NjktMC40NjkgMS4yMjgtMC40NjkgMS42OTcgMHMwLjQ2OSAxLjIyOSAwIDEuNjk3bC0yLjc1OCAzLjE1MiAyLjc1OCAzLjE1YzAuNDY5IDAuNDY5IDAuNDY5IDEuMjI5IDAgMS42OTh6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuZXhwb3J0IHR5cGUgRG93bkNoZXZyb25Qcm9wcyA9IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU/OiBudW1iZXIgfTtcbmV4cG9ydCBjb25zdCBEb3duQ2hldnJvbiA9IChwcm9wczogRG93bkNoZXZyb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNNC41MTYgNy41NDhjMC40MzYtMC40NDYgMS4wNDMtMC40ODEgMS41NzYgMGwzLjkwOCAzLjc0NyAzLjkwOC0zLjc0N2MwLjUzMy0wLjQ4MSAxLjE0MS0wLjQ0NiAxLjU3NCAwIDAuNDM2IDAuNDQ1IDAuNDA4IDEuMTk3IDAgMS42MTUtMC40MDYgMC40MTgtNC42OTUgNC41MDItNC42OTUgNC41MDItMC4yMTcgMC4yMjMtMC41MDIgMC4zMzUtMC43ODcgMC4zMzVzLTAuNTctMC4xMTItMC43ODktMC4zMzVjMCAwLTQuMjg3LTQuMDg0LTQuNjk1LTQuNTAycy0wLjQzNi0xLjE3IDAtMS42MTV6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgQnV0dG9uc1xuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbmV4cG9ydCBpbnRlcmZhY2UgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBUaGUgY2hpbGRyZW4gdG8gYmUgcmVuZGVyZWQgaW5zaWRlIHRoZSBpbmRpY2F0b3IuICovXG4gIGNoaWxkcmVuPzogUmVhY3ROb2RlO1xuICAvKiogUHJvcHMgdGhhdCB3aWxsIGJlIHBhc3NlZCBvbiB0byB0aGUgY2hpbGRyZW4uICovXG4gIGlubmVyUHJvcHM6IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snZGl2J107XG4gIC8qKiBUaGUgZm9jdXNlZCBzdGF0ZSBvZiB0aGUgc2VsZWN0LiAqL1xuICBpc0ZvY3VzZWQ6IGJvb2xlYW47XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG59XG5cbmNvbnN0IGJhc2VDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgdGhlbWU6IHtcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICAgIGNvbG9ycyxcbiAgICB9LFxuICB9OlxuICAgIHwgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuICAgIHwgQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2luZGljYXRvckNvbnRhaW5lcicsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgdHJhbnNpdGlvbjogJ2NvbG9yIDE1MG1zJyxcbiAgLi4uKHVuc3R5bGVkXG4gICAgPyB7fVxuICAgIDoge1xuICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw2MCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIHBhZGRpbmc6IGJhc2VVbml0ICogMixcbiAgICAgICAgJzpob3Zlcic6IHtcbiAgICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw4MCA6IGNvbG9ycy5uZXV0cmFsNDAsXG4gICAgICAgIH0sXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgZHJvcGRvd25JbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IERyb3Bkb3duSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnZHJvcGRvd25JbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2Ryb3Bkb3duLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8RG93bkNoZXZyb24gLz59XG4gICAgPC9kaXY+XG4gICk7XG59O1xuXG5leHBvcnQgaW50ZXJmYWNlIENsZWFySW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xufVxuXG5leHBvcnQgY29uc3QgY2xlYXJJbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IENsZWFySW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnY2xlYXJJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2NsZWFyLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8Q3Jvc3NJY29uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBTZXBhcmF0b3Jcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIEluZGljYXRvclNlcGFyYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpbm5lclByb3BzPzogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ107XG59XG5cbmV4cG9ydCBjb25zdCBpbmRpY2F0b3JTZXBhcmF0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0Rpc2FibGVkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JTZXBhcmF0b3InLFxuICBhbGlnblNlbGY6ICdzdHJldGNoJyxcbiAgd2lkdGg6IDEsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgYmFja2dyb3VuZENvbG9yOiBpc0Rpc2FibGVkID8gY29sb3JzLm5ldXRyYWwxMCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIG1hcmdpbkJvdHRvbTogYmFzZVVuaXQgKiAyLFxuICAgICAgICBtYXJnaW5Ub3A6IGJhc2VVbml0ICogMixcbiAgICAgIH0pLFxufSk7XG5cbmV4cG9ydCBjb25zdCBJbmRpY2F0b3JTZXBhcmF0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHByb3BzOiBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgaW5uZXJQcm9wcyB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPHNwYW5cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgICAgey4uLmdldFN0eWxlUHJvcHMocHJvcHMsICdpbmRpY2F0b3JTZXBhcmF0b3InLCB7XG4gICAgICAgICdpbmRpY2F0b3Itc2VwYXJhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgIC8+XG4gICk7XG59O1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIExvYWRpbmdcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBsb2FkaW5nRG90QW5pbWF0aW9ucyA9IGtleWZyYW1lc2BcbiAgMCUsIDgwJSwgMTAwJSB7IG9wYWNpdHk6IDA7IH1cbiAgNDAlIHsgb3BhY2l0eTogMTsgfVxuYDtcblxuZXhwb3J0IGNvbnN0IGxvYWRpbmdJbmRpY2F0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgc2l6ZSxcbiAgICB0aGVtZToge1xuICAgICAgY29sb3JzLFxuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgIH0sXG4gIH06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2xvYWRpbmdJbmRpY2F0b3InLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIGFsaWduU2VsZjogJ2NlbnRlcicsXG4gIGZvbnRTaXplOiBzaXplLFxuICBsaW5lSGVpZ2h0OiAxLFxuICBtYXJnaW5SaWdodDogc2l6ZSxcbiAgdGV4dEFsaWduOiAnY2VudGVyJyxcbiAgdmVydGljYWxBbGlnbjogJ21pZGRsZScsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5pbnRlcmZhY2UgTG9hZGluZ0RvdFByb3BzIHtcbiAgZGVsYXk6IG51bWJlcjtcbiAgb2Zmc2V0OiBib29sZWFuO1xufVxuY29uc3QgTG9hZGluZ0RvdCA9ICh7IGRlbGF5LCBvZmZzZXQgfTogTG9hZGluZ0RvdFByb3BzKSA9PiAoXG4gIDxzcGFuXG4gICAgY3NzPXt7XG4gICAgICBhbmltYXRpb246IGAke2xvYWRpbmdEb3RBbmltYXRpb25zfSAxcyBlYXNlLWluLW91dCAke2RlbGF5fW1zIGluZmluaXRlO2AsXG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6ICdjdXJyZW50Q29sb3InLFxuICAgICAgYm9yZGVyUmFkaXVzOiAnMWVtJyxcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgbWFyZ2luTGVmdDogb2Zmc2V0ID8gJzFlbScgOiB1bmRlZmluZWQsXG4gICAgICBoZWlnaHQ6ICcxZW0nLFxuICAgICAgdmVydGljYWxBbGlnbjogJ3RvcCcsXG4gICAgICB3aWR0aDogJzFlbScsXG4gICAgfX1cbiAgLz5cbik7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTG9hZGluZ0luZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xuICAvKiogU2V0IHNpemUgb2YgdGhlIGNvbnRhaW5lci4gKi9cbiAgc2l6ZTogbnVtYmVyO1xufVxuZXhwb3J0IGNvbnN0IExvYWRpbmdJbmRpY2F0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oe1xuICBpbm5lclByb3BzLFxuICBpc1J0bCxcbiAgc2l6ZSA9IDQsXG4gIC4uLnJlc3RQcm9wc1xufTogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPGRpdlxuICAgICAgey4uLmdldFN0eWxlUHJvcHMoXG4gICAgICAgIHsgLi4ucmVzdFByb3BzLCBpbm5lclByb3BzLCBpc1J0bCwgc2l6ZSB9LFxuICAgICAgICAnbG9hZGluZ0luZGljYXRvcicsXG4gICAgICAgIHtcbiAgICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgICAgfVxuICAgICAgKX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXswfSBvZmZzZXQ9e2lzUnRsfSAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */")})},hD=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return ry("div",Im({ref:o},OP(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},mD=["data"],gD=function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return ry("div",Im({},OP(e,"group",{group:!0}),s),ry(i,Im({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),l),ry("div",null,t))},yD=["innerRef","isDisabled","isHidden","inputClassName"],bD={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},vD={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":fP({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},bD)},wD=function(e){return fP({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},bD)},xD=function(e){var t=e.cx,n=e.value,r=RP(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,s=r.inputClassName,l=yP(r,yD);return ry("div",Im({},OP(e,"input",{"input-container":!0}),{"data-value":n||""}),ry("input",Im({className:t({input:!0},s),ref:o,style:wD(a),disabled:i},l)))},CD=function(e){var t=e.children,n=e.innerProps;return ry("div",n,t)};var ED=function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return ry(l,{data:r,innerProps:fP(fP({},OP(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:s},ry(c,{data:r,innerProps:fP({},OP(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),ry(u,{data:r,innerProps:fP(fP({},OP(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:s}))},kD=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return ry("div",Im({},OP(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},SD=function(e){var t=e.children,n=e.innerProps;return ry("div",Im({},OP(e,"placeholder",{placeholder:!0}),n),t)},ID=function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return ry("div",Im({},OP(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},_D={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return ry("div",Im({},OP(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||ry(sD,null))},Control:hD,DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return ry("div",Im({},OP(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||ry(lD,null))},DownChevron:lD,CrossIcon:sD,Group:gD,GroupHeading:function(e){var t=RP(e);t.data;var n=yP(t,mD);return ry("div",Im({},OP(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return ry("div",Im({},OP(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return ry("span",Im({},t,OP(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:xD,LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=void 0===r?4:r,i=yP(e,nD);return ry("div",Im({},OP(fP(fP({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ry(fD,{delay:0,offset:n}),ry(fD,{delay:160,offset:!0}),ry(fD,{delay:320,offset:!n}))},Menu:KP,MenuList:function(e){var t=e.children,n=e.innerProps,r=e.innerRef,o=e.isMulti;return ry("div",Im({},OP(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},n),t)},MenuPortal:function(n){var r=n.appendTo,o=n.children,i=n.controlElement,a=n.innerProps,s=n.menuPlacement,l=n.menuPosition,c=e.useRef(null),u=e.useRef(null),d=gP(e.useState(YP(s)),2),p=d[0],f=d[1],h=e.useMemo((function(){return{setPortalPlacement:f}}),[]),m=gP(e.useState(null),2),g=m[0],y=m[1],b=e.useCallback((function(){if(i){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(i),t="fixed"===l?0:window.pageYOffset,n=e[p]+t;n===(null==g?void 0:g.offset)&&e.left===(null==g?void 0:g.rect.left)&&e.width===(null==g?void 0:g.rect.width)||y({offset:n,rect:e})}}),[i,l,p,null==g?void 0:g.offset,null==g?void 0:g.rect.left,null==g?void 0:g.rect.width]);kP((function(){b()}),[b]);var v=e.useCallback((function(){"function"==typeof u.current&&(u.current(),u.current=null),i&&c.current&&(u.current=sC(i,c.current,b,{elementResize:"ResizeObserver"in window}))}),[i,b]);kP((function(){v()}),[v]);var w=e.useCallback((function(e){c.current=e,v()}),[v]);if(!r&&"fixed"!==l||!g)return null;var x=ry("div",Im({ref:w},OP(fP(fP({},n),{},{offset:g.offset,position:l,rect:g.rect}),"menuPortal",{"menu-portal":!0}),a),o);return ry(UP.Provider,{value:h},r?t.createPortal(x,r):x)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,o=yP(e,XP);return ry("div",Im({},OP(fP(fP({},o),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,r=e.innerProps,o=yP(e,WP);return ry("div",Im({},OP(fP(fP({},o),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},MultiValue:ED,MultiValueContainer:CD,MultiValueLabel:CD,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return ry("div",Im({role:"button"},n),t||ry(sD,{size:14}))},Option:kD,Placeholder:SD,SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return ry("div",Im({},OP(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},SingleValue:ID,ValueContainer:function(e){var t=e.children,n=e.innerProps,r=e.isMulti,o=e.hasValue;return ry("div",Im({},OP(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)}},AD=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function ND(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],o=t[n],!(r===o||AD(r)&&AD(o)))return!1;var r,o;return!0}for(var RD="production"===process.env.NODE_ENV?{name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"}:{name:"1f43avz-a11yText-A11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IEpTWCB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}},OD=function(e){return ry("span",Im({css:RD},e))},TD={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,r=void 0===n?"":n,o=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(r,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=void 0===o?"":o,a=e.selectValue,s=e.isDisabled,l=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if("menu"===t&&c){var d=s?" disabled":"",p="".concat(l?" selected":"").concat(d);return"".concat(i).concat(p,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},MD=function(t){var n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,i=t.focusableOptions,a=t.isFocused,s=t.selectValue,l=t.selectProps,c=t.id,u=t.isAppleDevice,d=l.ariaLiveMessages,p=l.getOptionLabel,f=l.inputValue,h=l.isMulti,m=l.isOptionDisabled,g=l.isSearchable,y=l.menuIsOpen,b=l.options,v=l.screenReaderStatus,w=l.tabSelectsValue,x=l.isLoading,C=l["aria-label"],E=l["aria-live"],k=e.useMemo((function(){return fP(fP({},TD),d||{})}),[d]),S=e.useMemo((function(){var e,t="";if(n&&k.onChange){var r=n.option,o=n.options,i=n.removedValue,a=n.removedValues,l=n.value,c=i||r||(e=l,Array.isArray(e)?null:e),u=c?p(c):"",d=o||a||void 0,f=d?d.map(p):[],h=fP({isDisabled:c&&m(c,s),label:u,labels:f},n);t=k.onChange(h)}return t}),[n,k,m,s,p]),I=e.useMemo((function(){var e="",t=r||o,n=!!(r&&s&&s.includes(r));if(t&&k.onFocus){var a={focused:t,label:p(t),isDisabled:m(t,s),isSelected:n,options:i,context:t===r?"menu":"value",selectValue:s,isAppleDevice:u};e=k.onFocus(a)}return e}),[r,o,p,m,k,i,s,u]),_=e.useMemo((function(){var e="";if(y&&b.length&&!x&&k.onFilter){var t=v({count:i.length});e=k.onFilter({inputValue:f,resultsMessage:t})}return e}),[i,f,y,k,b,v,x]),A="initial-input-focus"===(null==n?void 0:n.action),N=e.useMemo((function(){var e="";if(k.guidance){var t=o?"value":y?"menu":"input";e=k.guidance({"aria-label":C,context:t,isDisabled:r&&m(r,s),isMulti:h,isSearchable:g,tabSelectsValue:w,isInitialFocus:A})}return e}),[C,r,o,h,m,g,y,k,s,w,A]),R=ry(e.Fragment,null,ry("span",{id:"aria-selection"},S),ry("span",{id:"aria-focused"},I),ry("span",{id:"aria-results"},_),ry("span",{id:"aria-guidance"},N));return ry(e.Fragment,null,ry(OD,{id:c},A&&R),ry(OD,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!A&&R))},PD=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],DD=new RegExp("["+PD.map((function(e){return e.letters})).join("")+"]","g"),BD={},jD=0;jD<PD.length;jD++)for(var FD=PD[jD],LD=0;LD<FD.letters.length;LD++)BD[FD.letters[LD]]=FD.base;var VD=function(e){return e.replace(DD,(function(e){return BD[e]}))},zD=function(e,t){void 0===t&&(t=ND);var n=null;function r(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var i=e.apply(this,r);return n={lastResult:i,lastArgs:r,lastThis:this},i}return r.clear=function(){n=null},r}(VD),GD=function(e){return e.replace(/^\s+|\s+$/g,"")},HD=function(e){return"".concat(e.label," ").concat(e.value)},WD=["innerRef"];function XD(e){var t=e.innerRef,n=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Object.entries(e).filter((function(e){var t=gP(e,1)[0];return!n.includes(t)}));return o.reduce((function(e,t){var n=gP(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})}(yP(e,WD),"onExited","in","enter","exit","appear");return ry("input",Im({ref:t},n,{css:oy({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"production"===process.env.NODE_ENV?"":";label:DummyInput;","production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyByZW1vdmVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gRHVtbXlJbnB1dCh7XG4gIGlubmVyUmVmLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydpbnB1dCddICYge1xuICByZWFkb25seSBpbm5lclJlZjogUmVmPEhUTUxJbnB1dEVsZW1lbnQ+O1xufSkge1xuICAvLyBSZW1vdmUgYW5pbWF0aW9uIHByb3BzIG5vdCBtZWFudCBmb3IgSFRNTCBlbGVtZW50c1xuICBjb25zdCBmaWx0ZXJlZFByb3BzID0gcmVtb3ZlUHJvcHMoXG4gICAgcHJvcHMsXG4gICAgJ29uRXhpdGVkJyxcbiAgICAnaW4nLFxuICAgICdlbnRlcicsXG4gICAgJ2V4aXQnLFxuICAgICdhcHBlYXInXG4gICk7XG5cbiAgcmV0dXJuIChcbiAgICA8aW5wdXRcbiAgICAgIHJlZj17aW5uZXJSZWZ9XG4gICAgICB7Li4uZmlsdGVyZWRQcm9wc31cbiAgICAgIGNzcz17e1xuICAgICAgICBsYWJlbDogJ2R1bW15SW5wdXQnLFxuICAgICAgICAvLyBnZXQgcmlkIG9mIGFueSBkZWZhdWx0IHN0eWxlc1xuICAgICAgICBiYWNrZ3JvdW5kOiAwLFxuICAgICAgICBib3JkZXI6IDAsXG4gICAgICAgIC8vIGltcG9ydGFudCEgdGhpcyBoaWRlcyB0aGUgZmxhc2hpbmcgY3Vyc29yXG4gICAgICAgIGNhcmV0Q29sb3I6ICd0cmFuc3BhcmVudCcsXG4gICAgICAgIGZvbnRTaXplOiAnaW5oZXJpdCcsXG4gICAgICAgIGdyaWRBcmVhOiAnMSAvIDEgLyAyIC8gMycsXG4gICAgICAgIG91dGxpbmU6IDAsXG4gICAgICAgIHBhZGRpbmc6IDAsXG4gICAgICAgIC8vIGltcG9ydGFudCEgd2l0aG91dCBgd2lkdGhgIGJyb3dzZXJzIHdvbid0IGFsbG93IGZvY3VzXG4gICAgICAgIHdpZHRoOiAxLFxuXG4gICAgICAgIC8vIHJlbW92ZSBjdXJzb3Igb24gZGVza3RvcFxuICAgICAgICBjb2xvcjogJ3RyYW5zcGFyZW50JyxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIG1vYmlsZSB3aGlsc3QgbWFpbnRhaW5pbmcgXCJzY3JvbGwgaW50byB2aWV3XCIgYmVoYXZpb3VyXG4gICAgICAgIGxlZnQ6IC0xMDAsXG4gICAgICAgIG9wYWNpdHk6IDAsXG4gICAgICAgIHBvc2l0aW9uOiAncmVsYXRpdmUnLFxuICAgICAgICB0cmFuc2Zvcm06ICdzY2FsZSguMDEpJyxcbiAgICAgIH19XG4gICAgLz5cbiAgKTtcbn1cbiJdfQ== */")}))}var ZD=["boxSizing","height","overflow","paddingRight","position"],$D={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function YD(e){e.cancelable&&e.preventDefault()}function UD(e){e.stopPropagation()}function JD(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function KD(){return"ontouchstart"in window||navigator.maxTouchPoints}var QD=!("undefined"==typeof window||!window.document||!window.document.createElement),qD=0,eB={capture:!1,passive:!1};var tB=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},nB="production"===process.env.NODE_ENV?{name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"}:{name:"bp8cua-ScrollManager",styles:"position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2ssIE1vdXNlRXZlbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG4gIHJlYWRvbmx5IG9uVG9wQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Ub3BMZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG59XG5cbmNvbnN0IGJsdXJTZWxlY3RJbnB1dCA9IChldmVudDogTW91c2VFdmVudDxIVE1MRGl2RWxlbWVudD4pID0+IHtcbiAgY29uc3QgZWxlbWVudCA9IGV2ZW50LnRhcmdldCBhcyBIVE1MRGl2RWxlbWVudDtcbiAgcmV0dXJuIChcbiAgICBlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCAmJlxuICAgIChlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCBhcyBIVE1MRWxlbWVudCkuYmx1cigpXG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBTY3JvbGxNYW5hZ2VyKHtcbiAgY2hpbGRyZW4sXG4gIGxvY2tFbmFibGVkLFxuICBjYXB0dXJlRW5hYmxlZCA9IHRydWUsXG4gIG9uQm90dG9tQXJyaXZlLFxuICBvbkJvdHRvbUxlYXZlLFxuICBvblRvcEFycml2ZSxcbiAgb25Ub3BMZWF2ZSxcbn06IFByb3BzKSB7XG4gIGNvbnN0IHNldFNjcm9sbENhcHR1cmVUYXJnZXQgPSB1c2VTY3JvbGxDYXB0dXJlKHtcbiAgICBpc0VuYWJsZWQ6IGNhcHR1cmVFbmFibGVkLFxuICAgIG9uQm90dG9tQXJyaXZlLFxuICAgIG9uQm90dG9tTGVhdmUsXG4gICAgb25Ub3BBcnJpdmUsXG4gICAgb25Ub3BMZWF2ZSxcbiAgfSk7XG4gIGNvbnN0IHNldFNjcm9sbExvY2tUYXJnZXQgPSB1c2VTY3JvbGxMb2NrKHsgaXNFbmFibGVkOiBsb2NrRW5hYmxlZCB9KTtcblxuICBjb25zdCB0YXJnZXRSZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PiA9IChlbGVtZW50KSA9PiB7XG4gICAgc2V0U2Nyb2xsQ2FwdHVyZVRhcmdldChlbGVtZW50KTtcbiAgICBzZXRTY3JvbGxMb2NrVGFyZ2V0KGVsZW1lbnQpO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPEZyYWdtZW50PlxuICAgICAge2xvY2tFbmFibGVkICYmIChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIG9uQ2xpY2s9e2JsdXJTZWxlY3RJbnB1dH1cbiAgICAgICAgICBjc3M9e3sgcG9zaXRpb246ICdmaXhlZCcsIGxlZnQ6IDAsIGJvdHRvbTogMCwgcmlnaHQ6IDAsIHRvcDogMCB9fVxuICAgICAgICAvPlxuICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}};function rB(t){var n=t.children,r=t.lockEnabled,o=t.captureEnabled,i=function(t){var n=t.isEnabled,r=t.onBottomArrive,o=t.onBottomLeave,i=t.onTopArrive,a=t.onTopLeave,s=e.useRef(!1),l=e.useRef(!1),c=e.useRef(0),u=e.useRef(null),d=e.useCallback((function(e,t){if(null!==u.current){var n=u.current,c=n.scrollTop,d=n.scrollHeight,p=n.clientHeight,f=u.current,h=t>0,m=d-p-c,g=!1;m>t&&s.current&&(o&&o(e),s.current=!1),h&&l.current&&(a&&a(e),l.current=!1),h&&t>m?(r&&!s.current&&r(e),f.scrollTop=d,g=!0,s.current=!0):!h&&-t>c&&(i&&!l.current&&i(e),f.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}}),[r,o,i,a]),p=e.useCallback((function(e){d(e,e.deltaY)}),[d]),f=e.useCallback((function(e){c.current=e.changedTouches[0].clientY}),[]),h=e.useCallback((function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)}),[d]),m=e.useCallback((function(e){if(e){var t=!!zP&&{passive:!1};e.addEventListener("wheel",p,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",h,t)}}),[h,f,p]),g=e.useCallback((function(e){e&&(e.removeEventListener("wheel",p,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",h,!1))}),[h,f,p]);return e.useEffect((function(){if(n){var e=u.current;return m(e),function(){g(e)}}}),[n,m,g]),function(e){u.current=e}}({isEnabled:void 0===o||o,onBottomArrive:t.onBottomArrive,onBottomLeave:t.onBottomLeave,onTopArrive:t.onTopArrive,onTopLeave:t.onTopLeave}),a=function(t){var n=t.isEnabled,r=t.accountForScrollbars,o=void 0===r||r,i=e.useRef({}),a=e.useRef(null),s=e.useCallback((function(e){if(QD){var t=document.body,n=t&&t.style;if(o&&ZD.forEach((function(e){var t=n&&n[e];i.current[e]=t})),o&&qD<1){var r=parseInt(i.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,s=window.innerWidth-a+r||0;Object.keys($D).forEach((function(e){var t=$D[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(s,"px"))}t&&KD()&&(t.addEventListener("touchmove",YD,eB),e&&(e.addEventListener("touchstart",JD,eB),e.addEventListener("touchmove",UD,eB))),qD+=1}}),[o]),l=e.useCallback((function(e){if(QD){var t=document.body,n=t&&t.style;qD=Math.max(qD-1,0),o&&qD<1&&ZD.forEach((function(e){var t=i.current[e];n&&(n[e]=t)})),t&&KD()&&(t.removeEventListener("touchmove",YD,eB),e&&(e.removeEventListener("touchstart",JD,eB),e.removeEventListener("touchmove",UD,eB)))}}),[o]);return e.useEffect((function(){if(n){var e=a.current;return s(e),function(){l(e)}}}),[n,s,l]),function(e){a.current=e}}({isEnabled:r});return ry(e.Fragment,null,r&&ry("div",{onClick:tB,css:nB}),n((function(e){i(e),a(e)})))}var oB="production"===process.env.NODE_ENV?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZT86IHN0cmluZztcbiAgcmVhZG9ubHkgb25Gb2N1czogRm9jdXNFdmVudEhhbmRsZXI8SFRNTElucHV0RWxlbWVudD47XG59PiA9ICh7IG5hbWUsIG9uRm9jdXMgfSkgPT4gKFxuICA8aW5wdXRcbiAgICByZXF1aXJlZFxuICAgIG5hbWU9e25hbWV9XG4gICAgdGFiSW5kZXg9ey0xfVxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}},iB=function(e){var t=e.name,n=e.onFocus;return ry("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:oB,value:"",onChange:function(){}})};function aB(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function sB(){return aB(/^Mac/i)}function lB(){return aB(/^iPhone/i)||aB(/^iPad/i)||sB()&&navigator.maxTouchPoints>1}var cB,uB={clearIndicator:dD,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius;return fP({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},dropdownIndicator:uD,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return fP({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*o.baseUnit,paddingRight:3*o.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return fP({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return fP(fP({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},vD),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return fP({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*a})},loadingMessage:eD,menu:function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,s=o.colors;return fP((dP(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(r),"100%"),dP(n,"position","absolute"),dP(n,"width","100%"),dP(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},menuList:function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return fP({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return fP({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return fP({overflow:"hidden",textOverflow:i||void 0===i?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return fP({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},noOptionsMessage:qP,option:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,s=i.colors;return fP({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?s.primary:r?s.primary25:"transparent",color:n?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(2*a.baseUnit,"px ").concat(3*a.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return fP({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return fP({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return fP({alignItems:"center",display:r&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},dB={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},pB={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:jP(),captureMenuScroll:!jP(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=fP({ignoreCase:!0,ignoreAccents:!0,stringify:HD,trim:!0,matchFrom:"any"},cB),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,s=n.matchFrom,l=a?GD(t):t,c=a?GD(i(e)):i(e);return r&&(l=l.toLowerCase(),c=c.toLowerCase()),o&&(l=zD(l),c=VD(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function fB(e,t,n,r){return{type:"option",data:t,isDisabled:xB(e,t,n),isSelected:CB(e,t,n),label:vB(e,t),value:wB(e,t),index:r}}function hB(e,t){return e.options.map((function(n,r){if("options"in n){var o=n.options.map((function(n,r){return fB(e,n,t,r)})).filter((function(t){return yB(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=fB(e,n,t,r);return yB(e,i)?i:void 0})).filter(GP)}function mB(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,EP(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function gB(e,t){return e.reduce((function(e,n){return"group"===n.type?e.push.apply(e,EP(n.options.map((function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}})))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e}),[])}function yB(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,i=t.isSelected,a=t.label,s=t.value;return(!kB(e)||!i)&&EB(e,{label:a,value:s,data:o},r)}var bB=function(e,t){var n;return(null===(n=e.find((function(e){return e.data===t})))||void 0===n?void 0:n.id)||null},vB=function(e,t){return e.getOptionLabel(t)},wB=function(e,t){return e.getOptionValue(t)};function xB(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function CB(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=wB(e,t);return n.some((function(t){return wB(e,t)===r}))}function EB(e,t,n){return!e.filterOption||e.filterOption(t,n)}var kB=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},SB=1,IB=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yw(e,t)}(n,e.Component);var t=CP(n);function n(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=sB()||lB(),r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,o=n.onChange,i=n.name;t.name=i,r.ariaOnChange(e,t),o(e,t)},r.setValue=function(e,t,n){var o=r.props,i=o.closeMenuOnSelect,a=o.isMulti,s=o.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:s}),i&&(r.setState({inputIsHiddenAfterUpdate:!a}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,o=t.isMulti,i=t.name,a=r.state.selectValue,s=o&&r.isOptionSelected(e,a),l=r.isOptionDisabled(e,a);if(s){var c=r.getOptionValue(e);r.setValue(a.filter((function(e){return r.getOptionValue(e)!==c})),"deselect-option",e)}else{if(l)return void r.ariaOnChange(e,{action:"select-option",option:e,name:i});o?r.setValue([].concat(EP(a),[e]),"select-option",e):r.setValue(e,"select-option")}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,o=r.getOptionValue(e),i=n.filter((function(e){return r.getOptionValue(e)!==o})),a=HP(t,i,i[0]||null);r.onChange(a,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(HP(r.props.isMulti,[],null),{action:"clear",removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],o=t.slice(0,t.length-1),i=HP(e,o,o[0]||null);n&&r.onChange(i,{action:"pop-value",removedValue:n})},r.getFocusedOptionId=function(e){return bB(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return gB(hB(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return AP.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return vB(r.props,e)},r.getOptionValue=function(e){return wB(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,o=uB[e](t,n);o.boxSizing="border-box";var i=r.props.styles[e];return i?i(o,t):o},r.getClassNames=function(e,t){var n,o;return null===(n=(o=r.props.classNames)[e])||void 0===n?void 0:n.call(o,t)},r.getElementId=function(e){return"".concat(r.state.instancePrefix,"-").concat(e)},r.getComponents=function(){return e=r.props,fP(fP({},_D),e.components);var e},r.buildCategorizedOptions=function(){return hB(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return mB(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:fP({value:e},t)})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||r.props.isDisabled)){var t=r.props,n=t.isMulti,o=t.menuIsOpen;r.focusInput(),o?(r.setState({inputIsHiddenAfterUpdate:!n}),r.onMenuClose()):r.openMenu("first"),e.preventDefault()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.preventDefault(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout((function(){return r.focusInput()})))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&TP(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var o=Math.abs(n.clientX-r.initialTouchX),i=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=o>5||i>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:"input-change",prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur",prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){if(!r.blockOptionHover&&r.state.focusedOption!==e){var t=r.getFocusableOptions().indexOf(e);r.setState({focusedOption:e,focusedOptionId:t>-1?r.getFocusedOptionId(e):null})}},r.shouldHideSelectedOptions=function(){return kB(r.props)},r.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),r.focus()},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,o=t.backspaceRemovesValue,i=t.escapeClearsValue,a=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,f=r.state,h=f.focusedOption,m=f.focusedValue,g=f.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||a)return;r.focusValue("previous");break;case"ArrowRight":if(!n||a)return;r.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(m)r.removeValue(m);else{if(!o)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!c||!d||!h||p&&r.isOptionSelected(h,g))return;r.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(c){if(!h)return;if(r.isComposing)return;r.selectOption(h);break}return;case"Escape":c?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:a}),r.onMenuClose()):s&&i&&r.clearValue();break;case" ":if(a)return;if(!c){r.openMenu("first");break}if(!h)return;r.selectOption(h);break;case"ArrowUp":c?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":c?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!c)return;r.focusOption("pageup");break;case"PageDown":if(!c)return;r.focusOption("pagedown");break;case"Home":if(!c)return;r.focusOption("first");break;case"End":if(!c)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++SB),r.state.selectValue=NP(e.value),e.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),a=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=i[a],r.state.focusedOptionId=bB(o,i[a])}return r}return function(e,t,n){t&&vP(e.prototype,t),n&&vP(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&BP(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&r&&!e.menuIsOpen)&&this.focusInput(),o&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):o||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(BP(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,o=n.isFocused,i=this.buildFocusableOptions(),a="first"===e?0:i.length-1;if(!this.props.isMulti){var s=i.indexOf(r[0]);s>-1&&(a=s)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[a],focusedOptionId:this.getFocusedOptionId(i[a])},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(r);r||(o=-1);var i=n.length-1,a=-1;if(n.length){switch(e){case"previous":a=0===o?0:-1===o?i:o-1;break;case"next":o>-1&&o<i&&(a=o+1)}this.setState({inputIsHidden:-1!==a,focusedValue:n[a]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var o=0,i=r.indexOf(n);n||(i=-1),"up"===e?o=i>0?i-1:r.length-1:"down"===e?o=(i+1)%r.length:"pageup"===e?(o=i-t)<0&&(o=0):"pagedown"===e?(o=i+t)>r.length-1&&(o=r.length-1):"last"===e&&(o=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[o],focusedValue:null,focusedOptionId:this.getFocusedOptionId(r[o])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(dB):fP(fP({},dB),this.props.theme):dB}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,o=this.getValue,i=this.selectOption,a=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:o,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:i,selectProps:s,setValue:a,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return xB(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return CB(this.props,e,t)}},{key:"filterOption",value:function(e,t){return EB(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,i=e.inputValue,a=e.tabIndex,s=e.form,l=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,f=d.ariaSelection,h=this.commonProps,m=r||this.getElementId("input"),g=fP(fP(fP({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?o.createElement(u,Im({},h,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:a,form:s,type:"text",value:i},g)):o.createElement(XD,Im({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:IP,onFocus:this.onInputFocus,disabled:t,tabIndex:a,inputMode:"none",form:s,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,i=t.MultiValueLabel,a=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,f=u.isMulti,h=u.inputValue,m=u.placeholder,g=this.state,y=g.selectValue,b=g.focusedValue,v=g.isFocused;if(!this.hasValue()||!d)return h?null:o.createElement(l,Im({},c,{key:"placeholder",isDisabled:p,isFocused:v,innerProps:{id:this.getElementId("placeholder")}}),m);if(f)return y.map((function(t,s){var l=t===b,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return o.createElement(n,Im({},c,{components:{Container:r,Label:i,Remove:a},isFocused:l,isDisabled:p,key:u,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var w=y[0];return o.createElement(s,Im({},c,{data:w,isDisabled:p}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||i)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,Im({},t,{innerProps:s,isFocused:a}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;if(!e||!i)return null;return o.createElement(e,Im({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:a}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,i=this.props.isDisabled,a=this.state.isFocused;return o.createElement(n,Im({},r,{isDisabled:i,isFocused:a}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,Im({},t,{innerProps:i,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,i=t.Menu,a=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,p=this.state.focusedOption,f=this.props,h=f.captureMenuScroll,m=f.inputValue,g=f.isLoading,y=f.loadingMessage,b=f.minMenuHeight,v=f.maxMenuHeight,w=f.menuIsOpen,x=f.menuPlacement,C=f.menuPosition,E=f.menuPortalTarget,k=f.menuShouldBlockScroll,S=f.menuShouldScrollIntoView,I=f.noOptionsMessage,_=f.onMenuScrollToTop,A=f.onMenuScrollToBottom;if(!w)return null;var N,R=function(t,n){var r=t.type,i=t.data,a=t.isDisabled,s=t.isSelected,l=t.label,c=t.value,f=p===i,h=a?void 0:function(){return e.onOptionHover(i)},m=a?void 0:function(){return e.selectOption(i)},g="".concat(e.getElementId("option"),"-").concat(n),y={id:g,onClick:m,onMouseMove:h,onMouseOver:h,tabIndex:-1,role:"option","aria-selected":e.isAppleDevice?void 0:s};return o.createElement(u,Im({},d,{innerProps:y,data:i,isDisabled:a,isSelected:s,key:g,label:l,type:r,value:c,isFocused:f,innerRef:f?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())N=this.getCategorizedOptions().map((function(t){if("group"===t.type){var i=t.data,a=t.options,s=t.index,l="".concat(e.getElementId("group"),"-").concat(s),c="".concat(l,"-heading");return o.createElement(n,Im({},d,{key:l,data:i,options:a,Heading:r,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return R(e,"".concat(s,"-").concat(e.index))})))}if("option"===t.type)return R(t,"".concat(t.index))}));else if(g){var O=y({inputValue:m});if(null===O)return null;N=o.createElement(l,d,O)}else{var T=I({inputValue:m});if(null===T)return null;N=o.createElement(c,d,T)}var M={minMenuHeight:b,maxMenuHeight:v,menuPlacement:x,menuPosition:C,menuShouldScrollIntoView:S},P=o.createElement(JP,Im({},d,M),(function(t){var n=t.ref,r=t.placerProps,s=r.placement,l=r.maxHeight;return o.createElement(i,Im({},d,M,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:s}),o.createElement(rB,{captureEnabled:h,onTopArrive:_,onBottomArrive:A,lockEnabled:k},(function(t){return o.createElement(a,Im({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:l,focusedOption:p}),N)})))}));return E||"fixed"===C?o.createElement(s,Im({},d,{appendTo:E,controlElement:this.controlRef,menuPlacement:x,menuPosition:C}),P):P}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,i=t.isMulti,a=t.name,s=t.required,l=this.state.selectValue;if(s&&!this.hasValue()&&!r)return o.createElement(iB,{name:a,onFocus:this.onValueInputFocus});if(a&&!r){if(i){if(n){var c=l.map((function(t){return e.getOptionValue(t)})).join(n);return o.createElement("input",{name:a,type:"hidden",value:c})}var u=l.length>0?l.map((function(t,n){return o.createElement("input",{key:"i-".concat(n),name:a,type:"hidden",value:e.getOptionValue(t)})})):o.createElement("input",{name:a,type:"hidden",value:""});return o.createElement("div",null,u)}var d=l[0]?this.getOptionValue(l[0]):"";return o.createElement("input",{name:a,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,a=t.isFocused,s=t.selectValue,l=this.getFocusableOptions();return o.createElement(MD,Im({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:i,isFocused:a,selectValue:s,focusableOptions:l,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,i=e.ValueContainer,a=this.props,s=a.className,l=a.id,c=a.isDisabled,u=a.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return o.createElement(r,Im({},p,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),o.createElement(t,Im({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),o.createElement(i,Im({},p,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),o.createElement(n,Im({},p,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,a=t.isFocused,s=t.prevWasFocused,l=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,p=e.inputValue,f=e.isMulti,h=NP(u),m={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var g=d?function(e,t){return mB(hB(e,t))}(e,h):[],y=d?gB(hB(e,h),"".concat(l,"-option")):[],b=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r<t.length)return t[r]}return null}(t,h):null,v=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,g);m={selectValue:h,focusedOption:v,focusedOptionId:bB(y,v),focusableOptionsWithIds:y,focusedValue:b,clearFocusValueOnUpdate:!1}}var w=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},x=i,C=a&&s;return a&&!C&&(x={value:HP(f,h,h[0]||null),options:h,action:"initial-input-focus"},C=!s),"initial-input-focus"===(null==i?void 0:i.action)&&(x=null),fP(fP(fP({},m),w),{},{prevProps:e,ariaSelection:x,prevWasFocused:C})}}]),n}();IB.defaultProps=pB;var _B=e.forwardRef((function(t,n){var r=function(t){var n=t.defaultInputValue,r=void 0===n?"":n,o=t.defaultMenuIsOpen,i=void 0!==o&&o,a=t.defaultValue,s=void 0===a?null:a,l=t.inputValue,c=t.menuIsOpen,u=t.onChange,d=t.onInputChange,p=t.onMenuClose,f=t.onMenuOpen,h=t.value,m=yP(t,bP),g=gP(e.useState(void 0!==l?l:r),2),y=g[0],b=g[1],v=gP(e.useState(void 0!==c?c:i),2),w=v[0],x=v[1],C=gP(e.useState(void 0!==h?h:s),2),E=C[0],k=C[1],S=e.useCallback((function(e,t){"function"==typeof u&&u(e,t),k(e)}),[u]),I=e.useCallback((function(e,t){var n;"function"==typeof d&&(n=d(e,t)),b(void 0!==n?n:e)}),[d]),_=e.useCallback((function(){"function"==typeof f&&f(),x(!0)}),[f]),A=e.useCallback((function(){"function"==typeof p&&p(),x(!1)}),[p]),N=void 0!==l?l:y,R=void 0!==c?c:w,O=void 0!==h?h:E;return fP(fP({},m),{},{inputValue:N,menuIsOpen:R,onChange:S,onInputChange:I,onMenuClose:A,onMenuOpen:_,value:O})}(t);return o.createElement(IB,Im({ref:n},r))})),AB=_B;const NB=({options:t,items_per_page:n,className:r,defaultValue:i,onChange:a})=>{const[s,l]=e.useState(""),[c,u]=e.useState(0),d=t.filter((e=>e.label.toLowerCase().includes(s)||e.value.toLowerCase().includes(s)));var p;p=void 0!==n?d.slice(c*n,(c+1)*n):d;const f={control:e=>({...e,minHeight:void 0})};return o.createElement(AB,{options:p,onInputChange:e=>{l(e.toLowerCase()),u(0)},onChange:a,inputValue:s,isSearchable:!0,placeholder:"Select an option...",className:r,unstyled:!0,styles:f,classNamePrefix:"styled-select",defaultValue:i,value:i})},RB=({io:t,inputconverter:n,parser:r=e=>parseFloat(e)})=>{const i=e.useContext(pF),[a,s]=e.useState(n[1](t.value));e.useEffect((()=>{s(n[1](t.value))}),[t.value]);const l=e=>{e=r(parseFloat(e.toString()).toString()),isNaN(e)?(e="<NoValue>",s("")):(void 0!==t.value_options?.min&&e<t.value_options.min&&(e=t.value_options.min),void 0!==t.value_options?.max&&e>t.value_options.max&&(e=t.value_options.max),s(e.toString()));try{e=n[0](e)}catch(e){}i.worker?.set_io_value({nid:t.node,ioid:t.id,value:e,set_default:t.render_options.set_default})};let c=t.connected?n[1](t.value):a;return void 0===c&&(c=t.value_options?.min),void 0===c&&(c=t.value_options?.max),void 0===c&&(c=""),null===c&&(c=""),void 0!==t.value_options?.max&&void 0!==t.value_options?.min?o.createElement("div",{style:{minWidth:"100px"},className:"SliderContainer"},o.createElement(iP,{className:"SliderRoot",value:[void 0===c?t.value_options?.min:c],min:t.value_options?.min,max:t.value_options?.max,step:t.value_options.step||(t.value_options?.max-t.value_options?.min)/1e3,disabled:t.connected,onValueCommit:e=>{isNaN(e[0])||l(e[0])},onValueChange:e=>{isNaN(e[0])||s(e[0].toString())}},o.createElement(aP,{className:"SliderTrack"},o.createElement(sP,{className:"SliderRange"})),o.createElement(wT,null,o.createElement(VT,{open:!0},o.createElement(zT,{asChild:!0},o.createElement(lP,{className:"SliderThumb"})),o.createElement(HT,{className:"SliderTooltipContent"},c))))):o.createElement("input",{type:"text",className:"nodedatainput styledinput numberinput",value:c,onChange:e=>s(e.target.value),onBlur:e=>{l(e.target.value)},onKeyDown:e=>{if("ArrowUp"!==e.key)if("ArrowDown"!==e.key)/^[0-9.eE+-]$/.test(e.key)||["Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(e.key)||e.preventDefault();else{let n=t.render_options.step||1;e.shiftKey&&(n*=10);let r=(parseFloat(c)||0)-n;l(r)}else{let n=t.render_options.step||1;e.shiftKey&&(n*=10);let r=(parseFloat(c)||0)+n;l(r)}},disabled:t.connected,step:t.render_options.step,min:t.value_options?.min,max:t.value_options?.max})},OB=({io:t,inputconverter:n})=>{const r=e.useContext(pF),[i,a]=e.useState(n[1](t.value));e.useEffect((()=>{a(n[1](t.value))}),[t.value]);let s=t.connected?n[1](t.value):i;return null==s&&(s=""),o.createElement("input",{className:"nodedatainput styledinput stringinput",value:s,onChange:e=>a(e.target.value),onBlur:e=>{let o=e.target.value;o||(o="<NoValue>");try{o=n[0](o)}catch(e){}r.worker?.set_io_value({nid:t.node,ioid:t.id,value:o,set_default:t.render_options.set_default})},disabled:t.connected})},TB=e=>e,MB=e=>parseFloat(e),PB=e=>!!e,DB=e=>"null"===e?null:e,BB=({io:t,inputconverter:n,parser:r})=>{let i=t.value_options?.options||[];Array.isArray(i)&&(i={type:"enum",values:i,keys:i.map((e=>null===e?"None":e.toString())),nullable:!1}),"enum"!==i.type&&(i={type:"enum",values:Object.values(i),keys:Object.keys(i),nullable:!1}),!i.nullable||i.values.includes(null)||i.keys.includes("None")||(i.values.unshift(null),i.keys.unshift("None"));const a=[];for(let e=0;e<i.values.length;e++){const t=null===i.values[e]||void 0===i.values[e]?"undefined":typeof i.values[e];let n=i.values[e];null===n&&(n="null"),void 0===n&&(n="undefined"),a.push([i.keys[e],n.toString(),t])}const s=e.useContext(pF),l=({value:e,datatype:o})=>{const i=r||(e=>"nuinputconvertermber"===e?MB:"boolean"===e?PB:"undefined"===e?DB:TB)(o);let a=i(e);try{a=n[0](e)}catch(e){}s.worker?.set_io_value({nid:t.node,ioid:t.id,value:a,set_default:t.render_options.set_default})};let c=t.value;null===c&&(c="null"),void 0===c&&(c="undefined");const u=a.find((e=>e[1]===c.toString()));let d;void 0!==u&&(d={value:u[1],label:u[0],datatype:u[2]});const p=a.map((e=>({value:e[1],label:e[0],datatype:e[2]})));return o.createElement(NB,{className:"nodedatainput styleddropdown",options:p,defaultValue:d,onChange:e=>{l(null!==e?e:{value:"<NoValue>",datatype:"string"})}})},jB=e=>!!e&&e instanceof Date,FB=e=>!!e&&e instanceof Object&&"function"==typeof e;function LB(e,t){return void 0===t&&(t=!1),!e||t?`"${e}"`:e}function VB(t){let{field:n,value:r,data:o,lastElement:i,openBracket:a,closeBracket:s,level:l,style:c,shouldExpandNode:u,clickToExpandNode:d,outerRef:p}=t;const f=e.useRef(!1),[h,m,g]=function(t){const[n,r]=e.useState(t());return[n,()=>r((e=>!e)),r]}((()=>u(l,r,n))),y=e.useRef(null);e.useEffect((()=>{f.current?g(u(l,r,n)):f.current=!0}),[u]);const b=h?c.collapseIcon:c.expandIcon,v=h?"collapse JSON":"expand JSON",w=e.useId(),x=l+1,C=o.length-1,E=e=>{if("ArrowRight"===e.key||"ArrowLeft"===e.key)e.preventDefault(),g("ArrowRight"===e.key);else if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();const t="ArrowUp"===e.key?-1:1;if(!p.current)return;const n=p.current.querySelectorAll("[role=button]");let r=-1;for(let e=0;e<n.length;e++)if(0===n[e].tabIndex){r=e;break}if(r<0)return;const o=(r+t+n.length)%n.length;n[r].tabIndex=-1,n[o].tabIndex=0,n[o].focus()}},k=()=>{var e;m();const t=y.current;if(!t)return;const n=null===(e=p.current)||void 0===e?void 0:e.querySelector('[role=button][tabindex="0"]');n&&(n.tabIndex=-1),t.tabIndex=0,t.focus()};return e.createElement("div",{className:c.basicChildStyle,role:"treeitem","aria-expanded":h,"aria-selected":void 0},e.createElement("span",{className:b,onClick:k,onKeyDown:E,role:"button","aria-label":v,"aria-expanded":h,"aria-controls":h?w:void 0,ref:y,tabIndex:0===l?0:-1}),(n||""===n)&&(d?e.createElement("span",{className:c.clickableLabel,onClick:k,onKeyDown:E},LB(n,c.quotesForFieldNames),":"):e.createElement("span",{className:c.label},LB(n,c.quotesForFieldNames),":")),e.createElement("span",{className:c.punctuation},a),h?e.createElement("ul",{id:w,role:"group",className:c.childFieldsContainer},o.map(((t,n)=>e.createElement(XB,{key:t[0]||n,field:t[0],value:t[1],style:c,lastElement:n===C,level:x,shouldExpandNode:u,clickToExpandNode:d,outerRef:p})))):e.createElement("span",{className:c.collapsedContent,onClick:k,onKeyDown:E}),e.createElement("span",{className:c.punctuation},s),!i&&e.createElement("span",{className:c.punctuation},","))}function zB(t){let{field:n,openBracket:r,closeBracket:o,lastElement:i,style:a}=t;return e.createElement("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(n||""===n)&&e.createElement("span",{className:a.label},LB(n,a.quotesForFieldNames),":"),e.createElement("span",{className:a.punctuation},r),e.createElement("span",{className:a.punctuation},o),!i&&e.createElement("span",{className:a.punctuation},","))}function GB(e){let{field:t,value:n,style:r,lastElement:o,shouldExpandNode:i,clickToExpandNode:a,level:s,outerRef:l}=e;return 0===Object.keys(n).length?zB({field:t,openBracket:"{",closeBracket:"}",lastElement:o,style:r}):VB({field:t,value:n,lastElement:o||!1,level:s,openBracket:"{",closeBracket:"}",style:r,shouldExpandNode:i,clickToExpandNode:a,data:Object.keys(n).map((e=>[e,n[e]])),outerRef:l})}function HB(e){let{field:t,value:n,style:r,lastElement:o,level:i,shouldExpandNode:a,clickToExpandNode:s,outerRef:l}=e;return 0===n.length?zB({field:t,openBracket:"[",closeBracket:"]",lastElement:o,style:r}):VB({field:t,value:n,lastElement:o||!1,level:i,openBracket:"[",closeBracket:"]",style:r,shouldExpandNode:a,clickToExpandNode:s,data:n.map((e=>[void 0,e])),outerRef:l})}function WB(t){let n,{field:r,value:o,style:i,lastElement:a}=t,s=i.otherValue;var l;return null===o?(n="null",s=i.nullValue):void 0===o?(n="undefined",s=i.undefinedValue):"string"==typeof(l=o)||l instanceof String?(n=function(e,t){return t?`"${e}"`:e}(o,!i.noQuotesForStringValues),s=i.stringValue):(e=>"boolean"==typeof e||e instanceof Boolean)(o)?(n=o?"true":"false",s=i.booleanValue):(e=>"number"==typeof e||e instanceof Number)(o)?(n=o.toString(),s=i.numberValue):(e=>"bigint"==typeof e||e instanceof BigInt)(o)?(n=`${o.toString()}n`,s=i.numberValue):n=jB(o)?o.toISOString():FB(o)?"function() { }":o.toString(),e.createElement("div",{className:i.basicChildStyle,role:"treeitem","aria-selected":void 0},(r||""===r)&&e.createElement("span",{className:i.label},LB(r,i.quotesForFieldNames),":"),e.createElement("span",{className:s},n),!a&&e.createElement("span",{className:i.punctuation},","))}function XB(t){const n=t.value;return r=n,Array.isArray(r)?e.createElement(HB,Object.assign({},t)):!(e=>"object"==typeof e&&null!==e)(n)||jB(n)||FB(n)?e.createElement(WB,Object.assign({},t)):e.createElement(GB,Object.assign({},t));var r}var ZB="_2bkNM",$B="_1BXBN";const YB={container:"_2IvMF _GzYRV",basicChildStyle:ZB,childFieldsContainer:$B,label:"_1MGIk",clickableLabel:"_2YKJg _1MGIk _1MFti",nullValue:"_2T6PJ",undefinedValue:"_1Gho6",stringValue:"_vGjyY",booleanValue:"_3zQKs",numberValue:"_1bQdo",otherValue:"_1xvuR",punctuation:"_3uHL6 _3eOF8",collapseIcon:"_oLqym _f10Tu _1MFti _1LId0",expandIcon:"_2AXVT _f10Tu _1MFti _1UmXx",collapsedContent:"_2KJWg _1pNG9 _1MFti",noQuotesForStringValues:!1,quotesForFieldNames:!1},UB={container:"_11RoI _GzYRV",basicChildStyle:ZB,childFieldsContainer:$B,label:"_2bSDX",clickableLabel:"_1RQEj _2bSDX _1MFti",nullValue:"_LaAZe",undefinedValue:"_GTKgm",stringValue:"_Chy1W",booleanValue:"_2vRm-",numberValue:"_2bveF",otherValue:"_1prJR",punctuation:"_gsbQL _3eOF8",collapseIcon:"_3QHg2 _f10Tu _1MFti _1LId0",expandIcon:"_17H2C _f10Tu _1MFti _1UmXx",collapsedContent:"_3fDAz _1pNG9 _1MFti",noQuotesForStringValues:!1,quotesForFieldNames:!1},JB=()=>!0,KB=e=>e<1,QB=t=>{let{data:n,style:r=YB,shouldExpandNode:o=JB,clickToExpandNode:i=!1,...a}=t;const s=e.useRef(null);return e.createElement("div",Object.assign({"aria-label":"JSON view"},a,{className:r.container,ref:s,role:"tree"}),e.createElement(XB,{value:n,style:{...YB,...r},lastElement:!0,level:0,shouldExpandNode:o,clickToExpandNode:i,outerRef:s}))},qB=({data:e})=>o.createElement(QB,{data:e,style:UB,shouldExpandNode:KB}),ej=({tabledata:t})=>{const n=e.useMemo((()=>(e=>{const t=[];if(void 0===e)return{header:[],rows:[]};void 0===e.data&&(e.data=[]),void 0===e.columns&&(0===e.data.length?e.columns=[]:e.columns=e.data[0].map(((e,t)=>`col${t}`))),void 0===e.index&&(e.index=e.data.map(((e,t)=>`row${t}`)));for(let n=0;n<e.index.length;n++){const r=[e.index[n]];for(let t=0;t<e.columns.length;t++)r.push(e.data[n][t]);t.push(r)}return{header:["index",...e.columns],rows:t}})(t)),[t]),[r,i]=e.useState("asc"),[a,s]=e.useState("index");let l=n.header.indexOf(a);-1===l&&(l=0);const c=((e,t)=>{const n=e.map(((e,t)=>[e,t]));return n.sort(((e,n)=>t(e[0],n[0]))),n.map((e=>e[0]))})(n.rows,(e=>"desc"===e?(e,t)=>t[l]<e[l]?-1:1:(e,t)=>e[l]<t[l]?-1:1)(r));return o.createElement(ow,{className:"tablecontainer"},o.createElement(Xv,{size:"small"},o.createElement(cw,{className:"tableHead"},o.createElement(hw,{className:"tableheadercolor"},n.header.map((e=>o.createElement(tw,{key:e,sortDirection:a===e&&r,className:"tableheadercolor"},o.createElement(Xw,{active:a===e,direction:a===e?r:"asc",onClick:()=>(e=>{i(a===e&&"asc"===r?"desc":"asc"),s(e)})(e),className:"tableheadercolor",sx:{"& .MuiTableSortLabel-icon":{color:"inherit !important"}}},e)))))),o.createElement(Kv,null,c.map(((e,n)=>o.createElement(hw,{key:t.index[n]},e.map(((e,t)=>o.createElement(tw,{key:t,className:0==t?"indexcol":"datacol"},e)))))))))};var tj,nj={};
140
+ `,Mw=o.forwardRef((function(e,t){const n=vv({props:e,name:"MuiTouchRipple"}),{center:r=!1,classes:i={},className:a,...s}=n,[l,c]=o.useState([]),u=o.useRef(0),d=o.useRef(null);o.useEffect((()=>{d.current&&(d.current(),d.current=null)}),[l]);const p=o.useRef(!1),f=dh(),h=o.useRef(null),m=o.useRef(null),g=o.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:a}=e;c((e=>[...e,Lu.jsx(Tw,{classes:{ripple:xh(i.ripple,_w.ripple),rippleVisible:xh(i.rippleVisible,_w.rippleVisible),ripplePulsate:xh(i.ripplePulsate,_w.ripplePulsate),child:xh(i.child,_w.child),childLeaving:xh(i.childLeaving,_w.childLeaving),childPulsate:xh(i.childPulsate,_w.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},u.current)])),u.current+=1,d.current=a}),[i]),y=o.useCallback(((e={},t={},n=()=>{})=>{const{pulsate:o=!1,center:i=r||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===e?.type&&p.current)return void(p.current=!1);"touchstart"===e?.type&&(p.current=!0);const s=a?null:m.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,d;if(i||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(n-l.top)}if(i)d=Math.sqrt((2*l.width**2+l.height**2)/3),d%2==0&&(d+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;d=Math.sqrt(e**2+t**2)}e?.touches?null===h.current&&(h.current=()=>{g({pulsate:o,rippleX:c,rippleY:u,rippleSize:d,cb:n})},f.start(80,(()=>{h.current&&(h.current(),h.current=null)}))):g({pulsate:o,rippleX:c,rippleY:u,rippleSize:d,cb:n})}),[r,g,f]),b=o.useCallback((()=>{y({},{pulsate:!0})}),[y]),v=o.useCallback(((e,t)=>{if(f.clear(),"touchend"===e?.type&&h.current)return h.current(),h.current=null,void f.start(0,(()=>{v(e,t)}));h.current=null,c((e=>e.length>0?e.slice(1):e)),d.current=t}),[f]);return o.useImperativeHandle(t,(()=>({pulsate:b,start:y,stop:v})),[b,y,v]),Lu.jsx(Ow,{className:xh(_w.root,i.root,a),ref:m,...s,children:Lu.jsx(Sw,{component:null,exit:!0,children:l})})}));function Pw(e){return bh("MuiButtonBase",e)}"production"!==process.env.NODE_ENV&&(Mw.propTypes={center:Uf.bool,classes:Uf.object,className:Uf.string});const Dw=vh("MuiButtonBase",["root","disabled","focusVisible"]),Bw=yv("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Dw.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),jw=o.forwardRef((function(e,t){const n=vv({props:e,name:"MuiButtonBase"}),{action:r,centerRipple:i=!1,children:a,className:s,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:p=!1,focusVisibleClassName:f,LinkComponent:h="a",onBlur:m,onClick:g,onContextMenu:y,onDragLeave:b,onFocus:v,onFocusVisible:w,onKeyDown:x,onKeyUp:C,onMouseDown:E,onMouseLeave:k,onMouseUp:S,onTouchEnd:I,onTouchMove:_,onTouchStart:A,tabIndex:N=0,TouchRippleProps:R,touchRippleRef:O,type:T,...M}=n,P=o.useRef(null),D=mw.use(),B=ah(D.ref,O),[j,F]=o.useState(!1);c&&j&&F(!1),o.useImperativeHandle(r,(()=>({focusVisible:()=>{F(!0),P.current.focus()}})),[]);const L=D.shouldMount&&!u&&!c;o.useEffect((()=>{j&&p&&!u&&D.pulsate()}),[u,p,j,D]);const V=Fw(D,"start",E,d),z=Fw(D,"stop",y,d),G=Fw(D,"stop",b,d),H=Fw(D,"stop",S,d),W=Fw(D,"stop",(e=>{j&&e.preventDefault(),k&&k(e)}),d),X=Fw(D,"start",A,d),Z=Fw(D,"stop",I,d),$=Fw(D,"stop",_,d),Y=Fw(D,"stop",(e=>{ph(e.target)||F(!1),m&&m(e)}),!1),U=ih((e=>{P.current||(P.current=e.currentTarget),ph(e.target)&&(F(!0),w&&w(e)),v&&v(e)})),J=()=>{const e=P.current;return l&&"button"!==l&&!("A"===e.tagName&&e.href)},K=ih((e=>{p&&!e.repeat&&j&&" "===e.key&&D.stop(e,(()=>{D.start(e)})),e.target===e.currentTarget&&J()&&" "===e.key&&e.preventDefault(),x&&x(e),e.target===e.currentTarget&&J()&&"Enter"===e.key&&!c&&(e.preventDefault(),g&&g(e))})),Q=ih((e=>{p&&" "===e.key&&j&&!e.defaultPrevented&&D.stop(e,(()=>{D.pulsate(e)})),C&&C(e),g&&e.target===e.currentTarget&&J()&&" "===e.key&&!e.defaultPrevented&&g(e)}));let q=l;"button"===q&&(M.href||M.to)&&(q=h);const ee={};"button"===q?(ee.type=void 0===T?"button":T,ee.disabled=c):(M.href||M.to||(ee.role="button"),c&&(ee["aria-disabled"]=c));const te=ah(t,P),ne={...n,centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:d,focusRipple:p,tabIndex:N,focusVisible:j},re=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,i=hh({root:["root",t&&"disabled",n&&"focusVisible"]},Pw,o);return n&&r&&(i.root+=` ${r}`),i})(ne);return Lu.jsxs(Bw,{as:q,className:xh(re.root,s),ownerState:ne,onBlur:Y,onClick:g,onContextMenu:z,onFocus:U,onKeyDown:K,onKeyUp:Q,onMouseDown:V,onMouseLeave:W,onMouseUp:H,onDragLeave:G,onTouchEnd:Z,onTouchMove:$,onTouchStart:X,ref:te,tabIndex:c?-1:N,type:T,...ee,...M,children:[a,L?Lu.jsx(Mw,{ref:B,center:i,...R}):null]})}));function Fw(e,t,n,r=!1){return ih((o=>(n&&n(o),r||e[t](o),!0)))}"production"!==process.env.NODE_ENV&&(jw.propTypes={action:nh,centerRipple:Uf.bool,children:Uf.node,classes:Uf.object,className:Uf.string,component:Qf,disabled:Uf.bool,disableRipple:Uf.bool,disableTouchRipple:Uf.bool,focusRipple:Uf.bool,focusVisibleClassName:Uf.string,href:Uf.any,LinkComponent:Uf.elementType,onBlur:Uf.func,onClick:Uf.func,onContextMenu:Uf.func,onDragLeave:Uf.func,onFocus:Uf.func,onFocusVisible:Uf.func,onKeyDown:Uf.func,onKeyUp:Uf.func,onMouseDown:Uf.func,onMouseLeave:Uf.func,onMouseUp:Uf.func,onTouchEnd:Uf.func,onTouchMove:Uf.func,onTouchStart:Uf.func,sx:Uf.oneOfType([Uf.arrayOf(Uf.oneOfType([Uf.func,Uf.object,Uf.bool])),Uf.func,Uf.object]),tabIndex:Uf.number,TouchRippleProps:Uf.object,touchRippleRef:Uf.oneOfType([Uf.func,Uf.shape({current:Uf.shape({pulsate:Uf.func.isRequired,start:Uf.func.isRequired,stop:Uf.func.isRequired})})]),type:Uf.oneOfType([Uf.oneOf(["button","reset","submit"]),Uf.string])});var Lw=Ev(Lu.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");function Vw(e){return bh("MuiTableSortLabel",e)}const zw=vh("MuiTableSortLabel",["root","active","icon","iconDirectionDesc","iconDirectionAsc","directionDesc","directionAsc"]);function Gw(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,internalForwardedProps:a,shouldForwardComponentProp:s=!1,...l}=t,{component:c,slots:u={[e]:void 0},slotProps:d={[e]:void 0},...p}=i,f=u[e]||r,h=function(e,t,n){return"function"==typeof e?e(t,n):e}(d[e],o),{props:{component:m,...g},internalRef:y}=Eh({className:n,...l,externalForwardedProps:"root"===e?p:void 0,externalSlotProps:h}),b=ah(y,h?.ref,t.ref),v="root"===e?m||c:m,w=function(e,t,n){return void 0===e||function(e){return"string"==typeof e}(e)?t:{...t,ownerState:{...t.ownerState,...n}}}(f,{..."root"===e&&!c&&!u[e]&&a,..."root"!==e&&!u[e]&&a,...g,...v&&!s&&{as:v},...v&&s&&{component:v},ref:b},o);return[f,w]}const Hw=yv(jw,{name:"MuiTableSortLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.active&&t.active]}})(bv((({theme:e})=>({cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:(e.vars||e).palette.text.secondary},"&:hover":{color:(e.vars||e).palette.text.secondary,[`& .${zw.icon}`]:{opacity:.5}},[`&.${zw.active}`]:{color:(e.vars||e).palette.text.primary,[`& .${zw.icon}`]:{opacity:1,color:(e.vars||e).palette.text.secondary}}})))),Ww=yv("span",{name:"MuiTableSortLabel",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,t[`iconDirection${rh(n.direction)}`]]}})(bv((({theme:e})=>({fontSize:18,marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none",variants:[{props:{direction:"desc"},style:{transform:"rotate(0deg)"}},{props:{direction:"asc"},style:{transform:"rotate(180deg)"}}]})))),Xw=o.forwardRef((function(e,t){const n=vv({props:e,name:"MuiTableSortLabel"}),{active:r=!1,children:o,className:i,direction:a="asc",hideSortIcon:s=!1,IconComponent:l=Lw,slots:c={},slotProps:u={},...d}=n,p={...n,active:r,direction:a,hideSortIcon:s,IconComponent:l},f=(e=>{const{classes:t,direction:n,active:r}=e;return hh({root:["root",r&&"active",`direction${rh(n)}`],icon:["icon",`iconDirection${rh(n)}`]},Vw,t)})(p),h={slots:c,slotProps:u},[m,g]=Gw("root",{elementType:Hw,externalForwardedProps:h,ownerState:p,className:xh(f.root,i),ref:t}),[y,b]=Gw("icon",{elementType:Ww,externalForwardedProps:h,ownerState:p,className:f.icon});return Lu.jsxs(m,{disableRipple:!0,component:"span",...g,...d,children:[o,s&&!r?null:Lu.jsx(y,{as:l,...b})]})}));"production"!==process.env.NODE_ENV&&(Xw.propTypes={active:Uf.bool,children:Uf.node,classes:Uf.object,className:Uf.string,direction:Uf.oneOf(["asc","desc"]),hideSortIcon:Uf.bool,IconComponent:Uf.elementType,slotProps:Uf.shape({icon:Uf.oneOfType([Uf.func,Uf.object]),root:Uf.oneOfType([Uf.func,Uf.object])}),slots:Uf.shape({icon:Uf.elementType,root:Uf.elementType}),sx:Uf.oneOfType([Uf.arrayOf(Uf.oneOfType([Uf.func,Uf.object,Uf.bool])),Uf.func,Uf.object])});var Zw=Ev(Lu.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),$w=Ev(Lu.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),Yw=Ev(Lu.jsx("path",{d:"M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"}),"FullscreenExit"),Uw=Ev(Lu.jsx("path",{d:"M22 3.41 16.71 8.7 20 12h-8V4l3.29 3.29L20.59 2zM3.41 22l5.29-5.29L12 20v-8H4l3.29 3.29L2 20.59z"}),"CloseFullscreen"),Jw=Ev(Lu.jsx("path",{d:"M21 11V3h-8l3.29 3.29-10 10L3 13v8h8l-3.29-3.29 10-10z"}),"OpenInFull");const Kw=({trigger:e,title:t,description:n,children:r,closebutton:i=!0,onOpenChange:a,buttons:s=[],open:l,setOpen:c,modal:u=!0})=>o.createElement(Qp,{open:l,onOpenChange:e=>{c&&c(e),a&&a(e)},modal:u},e&&o.createElement(qp,{asChild:!0},e),o.createElement(ef,null,o.createElement(tf,{className:"dialogoverlay funcnodescontainer"}),o.createElement(nf,{className:"dialogconent funcnodescontainer "},t&&o.createElement(rf,{className:"dialogtitle"},t),n&&o.createElement(of,{className:"dialogdescription"},n),o.createElement("div",{className:"dialogchildren"},r),o.createElement("div",{style:{display:"flex",marginTop:25,justifyContent:"flex-end"}},(s||[]).map(((e,t)=>o.createElement(af,{asChild:!0,key:t},o.createElement("button",{className:"dialogsendbutton",onClick:e.onClick},e.text))))),i&&o.createElement(af,{asChild:!0},o.createElement("button",{className:"dialogclosebutton","aria-label":"Close"},o.createElement(Zw,null))))));function Qw(t){const n=t+"CollectionProvider",[r,o]=Vu(n),[i,a]=r(n,{collectionRef:{current:null},itemMap:new Map}),s=t=>{const{scope:n,children:r}=t,o=e.useRef(null),a=e.useRef(new Map).current;return Lu.jsx(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=n;const l=t+"CollectionSlot",c=e.forwardRef(((e,t)=>{const{scope:n,children:r}=e,o=Ou(t,a(l,n).collectionRef);return Lu.jsx(Yu,{ref:o,children:r})}));c.displayName=l;const u=t+"CollectionItemSlot",d="data-radix-collection-item",p=e.forwardRef(((t,n)=>{const{scope:r,children:o,...i}=t,s=e.useRef(null),l=Ou(n,s),c=a(u,r);return e.useEffect((()=>(c.itemMap.set(s,{ref:s,...i}),()=>{c.itemMap.delete(s)}))),Lu.jsx(Yu,{[d]:"",ref:l,children:o})}));return p.displayName=u,[{Provider:s,Slot:c,ItemSlot:p},function(n){const r=a(t+"CollectionConsumer",n);return e.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[r.collectionRef,r.itemMap])},o]}var qw=o.createContext(void 0);function ex(e){const t=o.useContext(qw);return e||t||"ltr"}const tx=["top","right","bottom","left"],nx=Math.min,rx=Math.max,ox=Math.round,ix=Math.floor,ax=e=>({x:e,y:e}),sx={left:"right",right:"left",bottom:"top",top:"bottom"},lx={start:"end",end:"start"};function cx(e,t,n){return rx(e,nx(t,n))}function ux(e,t){return"function"==typeof e?e(t):e}function dx(e){return e.split("-")[0]}function px(e){return e.split("-")[1]}function fx(e){return"x"===e?"y":"x"}function hx(e){return"y"===e?"height":"width"}function mx(e){return["top","bottom"].includes(dx(e))?"y":"x"}function gx(e){return fx(mx(e))}function yx(e){return e.replace(/start|end/g,(e=>lx[e]))}function bx(e){return e.replace(/left|right|bottom|top/g,(e=>sx[e]))}function vx(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function wx(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function xx(e,t,n){let{reference:r,floating:o}=e;const i=mx(t),a=gx(t),s=hx(a),l=dx(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(px(t)){case"start":f[a]-=p*(n&&c?-1:1);break;case"end":f[a]+=p*(n&&c?-1:1)}return f}async function Cx(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=ux(t,e),h=vx(f),m=s[p?"floating"===d?"reference":"floating":d],g=wx(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),v=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},w=wx(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:l}):y);return{top:(g.top-w.top+h.top)/v.y,bottom:(w.bottom-g.bottom+h.bottom)/v.y,left:(g.left-w.left+h.left)/v.x,right:(w.right-g.right+h.right)/v.x}}function Ex(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kx(e){return tx.some((t=>e[t]>=0))}function Sx(){return"undefined"!=typeof window}function Ix(e){return Nx(e)?(e.nodeName||"").toLowerCase():"#document"}function _x(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ax(e){var t;return null==(t=(Nx(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Nx(e){return!!Sx()&&(e instanceof Node||e instanceof _x(e).Node)}function Rx(e){return!!Sx()&&(e instanceof Element||e instanceof _x(e).Element)}function Ox(e){return!!Sx()&&(e instanceof HTMLElement||e instanceof _x(e).HTMLElement)}function Tx(e){return!(!Sx()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof _x(e).ShadowRoot)}function Mx(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Lx(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Px(e){return["table","td","th"].includes(Ix(e))}function Dx(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Bx(e){const t=jx(),n=Rx(e)?Lx(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function jx(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Fx(e){return["html","body","#document"].includes(Ix(e))}function Lx(e){return _x(e).getComputedStyle(e)}function Vx(e){return Rx(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zx(e){if("html"===Ix(e))return e;const t=e.assignedSlot||e.parentNode||Tx(e)&&e.host||Ax(e);return Tx(t)?t.host:t}function Gx(e){const t=zx(e);return Fx(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ox(t)&&Mx(t)?t:Gx(t)}function Hx(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Gx(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=_x(o);if(i){const e=Wx(a);return t.concat(a,a.visualViewport||[],Mx(o)?o:[],e&&n?Hx(e):[])}return t.concat(o,Hx(o,[],n))}function Wx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xx(e){const t=Lx(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ox(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=ox(n)!==i||ox(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Zx(e){return Rx(e)?e:e.contextElement}function $x(e){const t=Zx(e);if(!Ox(t))return ax(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Xx(t);let a=(i?ox(n.width):n.width)/r,s=(i?ox(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Yx=ax(0);function Ux(e){const t=_x(e);return jx()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Yx}function Jx(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Zx(e);let a=ax(1);t&&(r?Rx(r)&&(a=$x(r)):a=$x(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==_x(e))&&t}(i,n,r)?Ux(i):ax(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=_x(i),t=r&&Rx(r)?_x(r):r;let n=e,o=Wx(n);for(;o&&r&&t!==n;){const e=$x(o),t=o.getBoundingClientRect(),r=Lx(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=_x(o),o=Wx(n)}}return wx({width:u,height:d,x:l,y:c})}function Kx(e,t){const n=Vx(e).scrollLeft;return t?t.left+n:Jx(Ax(e)).left+n}function Qx(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Kx(e,r)),y:r.top+t.scrollTop}}function qx(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=_x(e),r=Ax(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=jx();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Ax(e),n=Vx(e),r=e.ownerDocument.body,o=rx(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=rx(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Kx(e);const s=-n.scrollTop;return"rtl"===Lx(r).direction&&(a+=rx(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(Ax(e));else if(Rx(t))r=function(e,t){const n=Jx(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ox(e)?$x(e):ax(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Ux(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wx(r)}function eC(e,t){const n=zx(e);return!(n===t||!Rx(n)||Fx(n))&&("fixed"===Lx(n).position||eC(n,t))}function tC(e,t,n){const r=Ox(t),o=Ax(t),i="fixed"===n,a=Jx(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=ax(0);if(r||!r&&!i)if(("body"!==Ix(t)||Mx(o))&&(s=Vx(t)),r){const e=Jx(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Kx(o));const c=!o||r||i?ax(0):Qx(o,s);return{x:a.left+s.scrollLeft-l.x-c.x,y:a.top+s.scrollTop-l.y-c.y,width:a.width,height:a.height}}function nC(e){return"static"===Lx(e).position}function rC(e,t){if(!Ox(e)||"fixed"===Lx(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Ax(e)===n&&(n=n.ownerDocument.body),n}function oC(e,t){const n=_x(e);if(Dx(e))return n;if(!Ox(e)){let t=zx(e);for(;t&&!Fx(t);){if(Rx(t)&&!nC(t))return t;t=zx(t)}return n}let r=rC(e,t);for(;r&&Px(r)&&nC(r);)r=rC(r,t);return r&&Fx(r)&&nC(r)&&!Bx(r)?n:r||function(e){let t=zx(e);for(;Ox(t)&&!Fx(t);){if(Bx(t))return t;if(Dx(t))return null;t=zx(t)}return null}(e)||n}const iC={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Ax(r),s=!!t&&Dx(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=ax(1);const u=ax(0),d=Ox(r);if((d||!d&&!i)&&(("body"!==Ix(r)||Mx(a))&&(l=Vx(r)),Ox(r))){const e=Jx(r);c=$x(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!a||d||i?ax(0):Qx(a,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:Ax,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?Dx(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Hx(e,[],!1).filter((e=>Rx(e)&&"body"!==Ix(e))),o=null;const i="fixed"===Lx(e).position;let a=i?zx(e):e;for(;Rx(a)&&!Fx(a);){const t=Lx(a),n=Bx(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||Mx(a)&&!n&&eC(e,a))?r=r.filter((e=>e!==a)):o=t,a=zx(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce(((e,n)=>{const r=qx(t,n,o);return e.top=rx(r.top,e.top),e.right=nx(r.right,e.right),e.bottom=nx(r.bottom,e.bottom),e.left=rx(r.left,e.left),e}),qx(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:oC,getElementRects:async function(e){const t=this.getOffsetParent||oC,n=this.getDimensions,r=await n(e.floating);return{reference:tC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Xx(e);return{width:t,height:n}},getScale:$x,isElement:Rx,isRTL:function(e){return"rtl"===Lx(e).direction}};function aC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sC(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Zx(e),u=o||i?[...c?Hx(c):[],...Hx(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=Ax(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=c;if(s||t(),!p||!f)return;const h={rootMargin:-ix(d)+"px "+-ix(o.clientWidth-(u+p))+"px "+-ix(o.clientHeight-(d+f))+"px "+-ix(u)+"px",threshold:rx(0,nx(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return a();r?a(!1,r):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==r||aC(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?Jx(e):null;return l&&function t(){const r=Jx(e);m&&!aC(m,r)&&n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const lC=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=dx(n),s=px(n),l="y"===mx(n),c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,d=ux(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},cC=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ux(e,t),c={x:n,y:r},u=await Cx(t,l),d=mx(dx(o)),p=fx(d);let f=c[p],h=c[d];if(i){const e="y"===p?"bottom":"right";f=cx(f+u["y"===p?"top":"left"],f,f-u[e])}if(a){const e="y"===d?"bottom":"right";h=cx(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:a}}}}}},uC=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=ux(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=dx(o),b=mx(s),v=dx(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=p||(v||!m?[bx(s)]:function(e){const t=bx(e);return[yx(e),t,yx(t)]}(s)),C="none"!==h;!p&&C&&x.push(...function(e,t,n,r){const o=px(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}(dx(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(yx)))),i}(s,m,h,w));const E=[s,...x],k=await Cx(t,g),S=[];let I=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&S.push(k[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=px(e),o=gx(e),i=hx(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=bx(a)),[a,bx(a)]}(o,a,w);S.push(k[e[0]],k[e[1]])}if(I=[...I,{placement:o,overflows:S}],!S.every((e=>e<=0))){var _,A;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=E[e];if(t)return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(A=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=I.filter((e=>{if(C){const t=mx(e.placement);return t===b||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},dC=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=ux(e,t),u=await Cx(t,c),d=dx(o),p=px(o),f="y"===mx(o),{width:h,height:m}=i.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===p?"top":"bottom");const b=m-u.top-u.bottom,v=h-u.left-u.right,w=nx(m-u[g],b),x=nx(h-u[y],v),C=!t.middlewareData.shift;let E=w,k=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=v),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=b),C&&!p){const e=rx(u.left,0),t=rx(u.right,0),n=rx(u.top,0),r=rx(u.bottom,0);f?k=h-2*(0!==e||0!==t?e+t:rx(u.left,u.right)):E=m-2*(0!==n||0!==r?n+r:rx(u.top,u.bottom))}await l({...t,availableWidth:k,availableHeight:E});const S=await a.getDimensions(s.floating);return h!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},pC=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ux(e,t);switch(r){case"referenceHidden":{const e=Ex(await Cx(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:kx(e)}}}case"escaped":{const e=Ex(await Cx(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:kx(e)}}}default:return{}}}}},fC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=ux(e,t)||{};if(null==c)return{};const d=vx(u),p={x:n,y:r},f=gx(o),h=hx(f),m=await a.getDimensions(c),g="y"===f,y=g?"top":"left",b=g?"bottom":"right",v=g?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-p[f]-i.floating[h],x=p[f]-i.reference[f],C=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let E=C?C[v]:0;E&&await(null==a.isElement?void 0:a.isElement(C))||(E=s.floating[v]||i.floating[h]);const k=w/2-x/2,S=E/2-m[h]/2-1,I=nx(d[y],S),_=nx(d[b],S),A=I,N=E-m[h]-_,R=E/2-m[h]/2+k,O=cx(A,R,N),T=!l.arrow&&null!=px(o)&&R!==O&&i.reference[h]/2-(R<A?I:_)-m[h]/2<0,M=T?R<A?R-A:R-N:0;return{[f]:p[f]+M,data:{[f]:O,centerOffset:R-O-M,...T&&{alignmentOffset:M}},reset:T}}}),hC=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=ux(e,t),u={x:n,y:r},d=mx(o),p=fx(d);let f=u[p],h=u[d];const m=ux(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var y,b;const e="y"===p?"width":"height",t=["top","left"].includes(dx(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(y=a.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(b=a.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},mC=(e,t,n)=>{const r=new Map,o={platform:iC,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=xx(c,r,l),p=r,f={},h=0;for(let n=0;n<s.length;n++){const{name:i,fn:m}=s[n],{x:g,y:y,data:b,reset:v}=await m({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,f={...f,[i]:{...f[i],...b}},v&&h<=50&&(h++,"object"==typeof v&&(v.placement&&(p=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):v.rects),({x:u,y:d}=xx(c,p,l))),n=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};var gC="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function yC(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!yC(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!yC(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function bC(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vC(e,t){const n=bC(e);return Math.round(t*n)/n}function wC(e){const t=o.useRef(e);return gC((()=>{t.current=e})),t}const xC=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?fC({element:n.current,padding:r}).fn(t):{}:n?fC({element:n,padding:r}).fn(t):{};var o}}),CC=(e,t)=>({...lC(e),options:[e,t]}),EC=(e,t)=>({...cC(e),options:[e,t]}),kC=(e,t)=>({...hC(e),options:[e,t]}),SC=(e,t)=>({...uC(e),options:[e,t]}),IC=(e,t)=>({...dC(e),options:[e,t]}),_C=(e,t)=>({...pC(e),options:[e,t]}),AC=(e,t)=>({...xC(e),options:[e,t]});var NC=o.forwardRef(((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return Lu.jsx(Qu.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:Lu.jsx("polygon",{points:"0,0 30,0 15,10"})})}));NC.displayName="Arrow";var RC=NC;function OC(e){const[t,n]=o.useState(void 0);return Gu((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}var TC="Popper",[MC,PC]=Vu(TC),[DC,BC]=MC(TC),jC=e=>{const{__scopePopper:t,children:n}=e,[r,i]=o.useState(null);return Lu.jsx(DC,{scope:t,anchor:r,onAnchorChange:i,children:n})};jC.displayName=TC;var FC="PopperAnchor",LC=o.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,a=BC(FC,n),s=o.useRef(null),l=Ou(t,s);return o.useEffect((()=>{a.onAnchorChange(r?.current||s.current)})),r?null:Lu.jsx(Qu.div,{...i,ref:l})}));LC.displayName=FC;var VC="PopperContent",[zC,GC]=MC(VC),HC=o.forwardRef(((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=e,b=BC(VC,n),[v,w]=o.useState(null),x=Ou(t,(e=>w(e))),[C,E]=o.useState(null),k=OC(C),S=k?.width??0,I=k?.height??0,_=r+("center"!==s?"-"+s:""),A="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},N=Array.isArray(d)?d:[d],R=N.length>0,O={padding:A,boundary:N.filter($C),altBoundary:R},{refs:T,floatingStyles:M,placement:P,isPositioned:D,middlewareData:B}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,f]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=o.useState(r);yC(h,r)||m(r);const[g,y]=o.useState(null),[b,v]=o.useState(null),w=o.useCallback((e=>{e!==k.current&&(k.current=e,y(e))}),[]),x=o.useCallback((e=>{e!==S.current&&(S.current=e,v(e))}),[]),C=s||g,E=l||b,k=o.useRef(null),S=o.useRef(null),I=o.useRef(p),_=null!=u,A=wC(u),N=wC(a),R=wC(d),O=o.useCallback((()=>{if(!k.current||!S.current)return;const e={placement:t,strategy:n,middleware:h};N.current&&(e.platform=N.current),mC(k.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==R.current};T.current&&!yC(I.current,t)&&(I.current=t,i.flushSync((()=>{f(t)})))}))}),[h,t,n,N,R]);gC((()=>{!1===d&&I.current.isPositioned&&(I.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const T=o.useRef(!1);gC((()=>(T.current=!0,()=>{T.current=!1})),[]),gC((()=>{if(C&&(k.current=C),E&&(S.current=E),C&&E){if(A.current)return A.current(C,E,O);O()}}),[C,E,O,A,_]);const M=o.useMemo((()=>({reference:k,floating:S,setReference:w,setFloating:x})),[w,x]),P=o.useMemo((()=>({reference:C,floating:E})),[C,E]),D=o.useMemo((()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=vC(P.floating,p.x),r=vC(P.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...bC(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,P.floating,p.x,p.y]);return o.useMemo((()=>({...p,update:O,refs:M,elements:P,floatingStyles:D})),[p,O,M,P,D])}({strategy:"fixed",placement:_,whileElementsMounted:(...e)=>sC(...e,{animationFrame:"always"===m}),elements:{reference:b.anchor},middleware:[CC({mainAxis:a+I,alignmentAxis:l}),u&&EC({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?kC():void 0,...O}),u&&SC({...O}),IC({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),C&&AC({element:C,padding:c}),YC({arrowWidth:S,arrowHeight:I}),h&&_C({strategy:"referenceHidden",...O})]}),[j,F]=UC(P),L=Zu(g);Gu((()=>{D&&L?.()}),[D,L]);const V=B.arrow?.x,z=B.arrow?.y,G=0!==B.arrow?.centerOffset,[H,W]=o.useState();return Gu((()=>{v&&W(window.getComputedStyle(v).zIndex)}),[v]),Lu.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:D?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:Lu.jsx(zC,{scope:n,placedSide:j,onArrowChange:E,arrowX:V,arrowY:z,shouldHideArrow:G,children:Lu.jsx(Qu.div,{"data-side":j,"data-align":F,...y,ref:x,style:{...y.style,animation:D?void 0:"none"}})})})}));HC.displayName=VC;var WC="PopperArrow",XC={top:"bottom",right:"left",bottom:"top",left:"right"},ZC=o.forwardRef((function(e,t){const{__scopePopper:n,...r}=e,o=GC(WC,n),i=XC[o.placedSide];return Lu.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:Lu.jsx(RC,{...r,ref:t,style:{...r.style,display:"block"}})})}));function $C(e){return null!==e}ZC.displayName=WC;var YC=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[l,c]=UC(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+a/2,p=(o.arrow?.y??0)+s/2;let f="",h="";return"bottom"===l?(f=i?u:`${d}px`,h=-s+"px"):"top"===l?(f=i?u:`${d}px`,h=`${r.floating.height+s}px`):"right"===l?(f=-s+"px",h=i?u:`${p}px`):"left"===l&&(f=`${r.floating.width+s}px`,h=i?u:`${p}px`),{data:{x:f,y:h}}}});function UC(e){const[t,n="center"]=e.split("-");return[t,n]}var JC=jC,KC=LC,QC=HC,qC=ZC,eE="rovingFocusGroup.onEntryFocus",tE={bubbles:!1,cancelable:!0},nE="RovingFocusGroup",[rE,oE,iE]=Qw(nE),[aE,sE]=Vu(nE,[iE]),[lE,cE]=aE(nE),uE=o.forwardRef(((e,t)=>Lu.jsx(rE.Provider,{scope:e.__scopeRovingFocusGroup,children:Lu.jsx(rE.Slot,{scope:e.__scopeRovingFocusGroup,children:Lu.jsx(dE,{...e,ref:t})})})));uE.displayName=nE;var dE=o.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...p}=e,f=o.useRef(null),h=Ou(t,f),m=ex(a),[g=null,y]=$u({prop:s,defaultProp:l,onChange:c}),[b,v]=o.useState(!1),w=Zu(u),x=oE(n),C=o.useRef(!1),[E,k]=o.useState(0);return o.useEffect((()=>{const e=f.current;if(e)return e.addEventListener(eE,w),()=>e.removeEventListener(eE,w)}),[w]),Lu.jsx(lE,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:o.useCallback((e=>y(e)),[y]),onItemShiftTab:o.useCallback((()=>v(!0)),[]),onFocusableItemAdd:o.useCallback((()=>k((e=>e+1))),[]),onFocusableItemRemove:o.useCallback((()=>k((e=>e-1))),[]),children:Lu.jsx(Qu.div,{tabIndex:b||0===E?-1:0,"data-orientation":r,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:Au(e.onMouseDown,(()=>{C.current=!0})),onFocus:Au(e.onFocus,(e=>{const t=!C.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(eE,tE);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));mE([e.find((e=>e.active)),e.find((e=>e.id===g)),...e].filter(Boolean).map((e=>e.ref.current)),d)}}C.current=!1})),onBlur:Au(e.onBlur,(()=>v(!1)))})})})),pE="RovingFocusGroupItem",fE=o.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,...s}=e,l=Xu(),c=a||l,u=cE(pE,n),d=u.currentTabStopId===c,p=oE(n),{onFocusableItemAdd:f,onFocusableItemRemove:h}=u;return o.useEffect((()=>{if(r)return f(),()=>h()}),[r,f,h]),Lu.jsx(rE.ItemSlot,{scope:n,id:c,focusable:r,active:i,children:Lu.jsx(Qu.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Au(e.onMouseDown,(e=>{r?u.onItemFocus(c):e.preventDefault()})),onFocus:Au(e.onFocus,(()=>u.onItemFocus(c))),onKeyDown:Au(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void u.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:hE[r]}(e,u.orientation,u.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();const r=n.indexOf(e.currentTarget);n=u.loop?function(e,t){return e.map(((n,r)=>e[(t+r)%e.length]))}(n,r+1):n.slice(r+1)}setTimeout((()=>mE(n)))}}))})})}));fE.displayName=pE;var hE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mE(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var gE=uE,yE=fE,bE=["Enter"," "],vE=["ArrowUp","PageDown","End"],wE=["ArrowDown","PageUp","Home",...vE],xE={ltr:[...bE,"ArrowRight"],rtl:[...bE,"ArrowLeft"]},CE={ltr:["ArrowLeft"],rtl:["ArrowRight"]},EE="Menu",[kE,SE,IE]=Qw(EE),[_E,AE]=Vu(EE,[IE,PC,sE]),NE=PC(),RE=sE(),[OE,TE]=_E(EE),[ME,PE]=_E(EE),DE=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:s=!0}=e,l=NE(t),[c,u]=o.useState(null),d=o.useRef(!1),p=Zu(a),f=ex(i);return o.useEffect((()=>{const e=()=>{d.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),Lu.jsx(JC,{...l,children:Lu.jsx(OE,{scope:t,open:n,onOpenChange:p,content:c,onContentChange:u,children:Lu.jsx(ME,{scope:t,onClose:o.useCallback((()=>p(!1)),[p]),isUsingKeyboardRef:d,dir:f,modal:s,children:r})})})};DE.displayName=EE;var BE=o.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=NE(n);return Lu.jsx(KC,{...o,...r,ref:t})}));BE.displayName="MenuAnchor";var[jE,FE]=_E("MenuPortal",{forceMount:void 0}),LE="MenuContent",[VE,zE]=_E(LE),GE=o.forwardRef(((e,t)=>{const n=FE(LE,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=TE(LE,e.__scopeMenu),a=PE(LE,e.__scopeMenu);return Lu.jsx(kE.Provider,{scope:e.__scopeMenu,children:Lu.jsx(wd,{present:r||i.open,children:Lu.jsx(kE.Slot,{scope:e.__scopeMenu,children:a.modal?Lu.jsx(HE,{...o,ref:t}):Lu.jsx(WE,{...o,ref:t})})})})})),HE=o.forwardRef(((e,t)=>{const n=TE(LE,e.__scopeMenu),r=o.useRef(null),i=Ou(t,r);return o.useEffect((()=>{const e=r.current;if(e)return vp(e)}),[]),Lu.jsx(XE,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Au(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})})),WE=o.forwardRef(((e,t)=>{const n=TE(LE,e.__scopeMenu);return Lu.jsx(XE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),XE=o.forwardRef(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:h,disableOutsideScroll:m,...g}=e,y=TE(LE,n),b=PE(LE,n),v=NE(n),w=RE(n),x=SE(n),[C,E]=o.useState(null),k=o.useRef(null),S=Ou(t,k,y.onContentChange),I=o.useRef(0),_=o.useRef(""),A=o.useRef(0),N=o.useRef(null),R=o.useRef("right"),O=o.useRef(0),T=m?pp:o.Fragment,M=m?{as:Yu,allowPinchZoom:!0}:void 0,P=e=>{const t=_.current+e,n=x().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=function(e,t){return e.map(((n,r)=>e[(t+r)%e.length]))}(e,Math.max(i,0));1===o.length&&(a=a.filter((e=>e!==n)));const s=a.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return s!==n?s:void 0}(n.map((e=>e.textValue)),t,o),a=n.find((e=>e.textValue===i))?.ref.current;!function e(t){_.current=t,window.clearTimeout(I.current),""!==t&&(I.current=window.setTimeout((()=>e("")),1e3))}(t),a&&setTimeout((()=>a.focus()))};o.useEffect((()=>()=>window.clearTimeout(I.current)),[]),Ed();const D=o.useCallback((e=>R.current===N.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e].x,s=t[e].y,l=t[i].x,c=t[i].y;s>r!=c>r&&n<(l-a)*(r-s)/(c-s)+a&&(o=!o)}return o}(n,t)}(e,N.current?.area)),[]);return Lu.jsx(VE,{scope:n,searchRef:_,onItemEnter:o.useCallback((e=>{D(e)&&e.preventDefault()}),[D]),onItemLeave:o.useCallback((e=>{D(e)||(k.current?.focus(),E(null))}),[D]),onTriggerLeave:o.useCallback((e=>{D(e)&&e.preventDefault()}),[D]),pointerGraceTimerRef:A,onPointerGraceIntentChange:o.useCallback((e=>{N.current=e}),[]),children:Lu.jsx(T,{...M,children:Lu.jsx(pd,{asChild:!0,trapped:i,onMountAutoFocus:Au(a,(e=>{e.preventDefault(),k.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:s,children:Lu.jsx(id,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:f,onDismiss:h,children:Lu.jsx(gE,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:E,onEntryFocus:Au(c,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:Lu.jsx(QC,{role:"menu","aria-orientation":"vertical","data-state":vk(y.open),"data-radix-menu-content":"",dir:b.dir,...v,...g,ref:S,style:{outline:"none",...g.style},onKeyDown:Au(g.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&P(e.key));const o=k.current;if(e.target!==o)return;if(!wE.includes(e.key))return;e.preventDefault();const i=x().filter((e=>!e.disabled)).map((e=>e.ref.current));vE.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:Au(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(I.current),_.current="")})),onPointerMove:Au(e.onPointerMove,Ck((e=>{const t=e.target,n=O.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>O.current?"right":"left";R.current=t,O.current=e.clientX}})))})})})})})})}));GE.displayName=LE;var ZE=o.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return Lu.jsx(Qu.div,{role:"group",...r,ref:t})}));ZE.displayName="MenuGroup";var $E=o.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return Lu.jsx(Qu.div,{...r,ref:t})}));$E.displayName="MenuLabel";var YE="MenuItem",UE="menu.itemSelect",JE=o.forwardRef(((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,a=o.useRef(null),s=PE(YE,e.__scopeMenu),l=zE(YE,e.__scopeMenu),c=Ou(t,a),u=o.useRef(!1);return Lu.jsx(KE,{...i,ref:c,disabled:n,onClick:Au(e.onClick,(()=>{const e=a.current;if(!n&&e){const t=new CustomEvent(UE,{bubbles:!0,cancelable:!0});e.addEventListener(UE,(e=>r?.(e)),{once:!0}),qu(e,t),t.defaultPrevented?u.current=!1:s.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:Au(e.onPointerUp,(e=>{u.current||e.currentTarget?.click()})),onKeyDown:Au(e.onKeyDown,(e=>{const t=""!==l.searchRef.current;n||t&&" "===e.key||bE.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));JE.displayName=YE;var KE=o.forwardRef(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,s=zE(YE,n),l=RE(n),c=o.useRef(null),u=Ou(t,c),[d,p]=o.useState(!1),[f,h]=o.useState("");return o.useEffect((()=>{const e=c.current;e&&h((e.textContent??"").trim())}),[a.children]),Lu.jsx(kE.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:Lu.jsx(yE,{asChild:!0,...l,focusable:!r,children:Lu.jsx(Qu.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:u,onPointerMove:Au(e.onPointerMove,Ck((e=>{if(r)s.onItemLeave(e);else if(s.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:Au(e.onPointerLeave,Ck((e=>s.onItemLeave(e)))),onFocus:Au(e.onFocus,(()=>p(!0))),onBlur:Au(e.onBlur,(()=>p(!1)))})})})})),QE=o.forwardRef(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return Lu.jsx(ak,{scope:e.__scopeMenu,checked:n,children:Lu.jsx(JE,{role:"menuitemcheckbox","aria-checked":wk(n)?"mixed":n,...o,ref:t,"data-state":xk(n),onSelect:Au(o.onSelect,(()=>r?.(!!wk(n)||!n)),{checkForDefaultPrevented:!1})})})}));QE.displayName="MenuCheckboxItem";var qE="MenuRadioGroup",[ek,tk]=_E(qE,{value:void 0,onValueChange:()=>{}}),nk=o.forwardRef(((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Zu(r);return Lu.jsx(ek,{scope:e.__scopeMenu,value:n,onValueChange:i,children:Lu.jsx(ZE,{...o,ref:t})})}));nk.displayName=qE;var rk="MenuRadioItem",ok=o.forwardRef(((e,t)=>{const{value:n,...r}=e,o=tk(rk,e.__scopeMenu),i=n===o.value;return Lu.jsx(ak,{scope:e.__scopeMenu,checked:i,children:Lu.jsx(JE,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":xk(i),onSelect:Au(r.onSelect,(()=>o.onValueChange?.(n)),{checkForDefaultPrevented:!1})})})}));ok.displayName=rk;var ik="MenuItemIndicator",[ak,sk]=_E(ik,{checked:!1}),lk=o.forwardRef(((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=sk(ik,n);return Lu.jsx(wd,{present:r||wk(i.checked)||!0===i.checked,children:Lu.jsx(Qu.span,{...o,ref:t,"data-state":xk(i.checked)})})}));lk.displayName=ik;var ck=o.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e;return Lu.jsx(Qu.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));ck.displayName="MenuSeparator";var uk=o.forwardRef(((e,t)=>{const{__scopeMenu:n,...r}=e,o=NE(n);return Lu.jsx(qC,{...o,...r,ref:t})}));uk.displayName="MenuArrow";var dk="MenuSub",[pk,fk]=_E(dk),hk=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=TE(dk,t),s=NE(t),[l,c]=o.useState(null),[u,d]=o.useState(null),p=Zu(i);return o.useEffect((()=>(!1===a.open&&p(!1),()=>p(!1))),[a.open,p]),Lu.jsx(JC,{...s,children:Lu.jsx(OE,{scope:t,open:r,onOpenChange:p,content:u,onContentChange:d,children:Lu.jsx(pk,{scope:t,contentId:Xu(),triggerId:Xu(),trigger:l,onTriggerChange:c,children:n})})})};hk.displayName=dk;var mk="MenuSubTrigger",gk=o.forwardRef(((e,t)=>{const n=TE(mk,e.__scopeMenu),r=PE(mk,e.__scopeMenu),i=fk(mk,e.__scopeMenu),a=zE(mk,e.__scopeMenu),s=o.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=a,u={__scopeMenu:e.__scopeMenu},d=o.useCallback((()=>{s.current&&window.clearTimeout(s.current),s.current=null}),[]);return o.useEffect((()=>d),[d]),o.useEffect((()=>{const e=l.current;return()=>{window.clearTimeout(e),c(null)}}),[l,c]),Lu.jsx(BE,{asChild:!0,...u,children:Lu.jsx(KE,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":vk(n.open),...e,ref:Ru(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Au(e.onPointerMove,Ck((t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||s.current||(a.onPointerGraceIntentChange(null),s.current=window.setTimeout((()=>{n.onOpenChange(!0),d()}),100))}))),onPointerLeave:Au(e.onPointerLeave,Ck((e=>{d();const t=n.content?.getBoundingClientRect();if(t){const r=n.content?.dataset.side,o="right"===r,i=o?-5:5,s=t[o?"left":"right"],c=t[o?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+i,y:e.clientY},{x:s,y:t.top},{x:c,y:t.top},{x:c,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(l.current),l.current=window.setTimeout((()=>a.onPointerGraceIntentChange(null)),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}}))),onKeyDown:Au(e.onKeyDown,(t=>{const o=""!==a.searchRef.current;e.disabled||o&&" "===t.key||xE[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())}))})})}));gk.displayName=mk;var yk="MenuSubContent",bk=o.forwardRef(((e,t)=>{const n=FE(LE,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=TE(LE,e.__scopeMenu),s=PE(LE,e.__scopeMenu),l=fk(yk,e.__scopeMenu),c=o.useRef(null),u=Ou(t,c);return Lu.jsx(kE.Provider,{scope:e.__scopeMenu,children:Lu.jsx(wd,{present:r||a.open,children:Lu.jsx(kE.Slot,{scope:e.__scopeMenu,children:Lu.jsx(XE,{id:l.contentId,"aria-labelledby":l.triggerId,...i,ref:u,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Au(e.onFocusOutside,(e=>{e.target!==l.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:Au(e.onEscapeKeyDown,(e=>{s.onClose(),e.preventDefault()})),onKeyDown:Au(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=CE[s.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())}))})})})})}));function vk(e){return e?"open":"closed"}function wk(e){return"indeterminate"===e}function xk(e){return wk(e)?"indeterminate":e?"checked":"unchecked"}function Ck(e){return t=>"mouse"===t.pointerType?e(t):void 0}bk.displayName=yk;var Ek=DE,kk=BE,Sk=GE,Ik=ZE,_k=$E,Ak=JE,Nk=QE,Rk=nk,Ok=ok,Tk=lk,Mk=ck,Pk=uk,Dk=hk,Bk=gk,jk=bk,Fk="DropdownMenu",[Lk,Vk]=Vu(Fk,[AE]),zk=AE(),[Gk,Hk]=Lk(Fk),Wk=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:s,modal:l=!0}=e,c=zk(t),u=o.useRef(null),[d=!1,p]=$u({prop:i,defaultProp:a,onChange:s});return Lu.jsx(Gk,{scope:t,triggerId:Xu(),triggerRef:u,contentId:Xu(),open:d,onOpenChange:p,onOpenToggle:o.useCallback((()=>p((e=>!e))),[p]),modal:l,children:Lu.jsx(Ek,{...c,open:d,onOpenChange:p,dir:r,modal:l,children:n})})};Wk.displayName=Fk;var Xk="DropdownMenuTrigger",Zk=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=Hk(Xk,n),a=zk(n);return Lu.jsx(kk,{asChild:!0,...a,children:Lu.jsx(Qu.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Ru(t,i.triggerRef),onPointerDown:Au(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())})),onKeyDown:Au(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));Zk.displayName=Xk;var $k="DropdownMenuContent",Yk=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Hk($k,n),a=zk(n),s=o.useRef(!1);return Lu.jsx(Sk,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Au(e.onCloseAutoFocus,(e=>{s.current||i.triggerRef.current?.focus(),s.current=!1,e.preventDefault()})),onInteractOutside:Au(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;i.modal&&!r||(s.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));Yk.displayName=$k;var Uk=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(Ik,{...o,...r,ref:t})}));Uk.displayName="DropdownMenuGroup";o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(_k,{...o,...r,ref:t})})).displayName="DropdownMenuLabel";var Jk=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(Ak,{...o,...r,ref:t})}));Jk.displayName="DropdownMenuItem";o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(Nk,{...o,...r,ref:t})})).displayName="DropdownMenuCheckboxItem";var Kk=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(Rk,{...o,...r,ref:t})}));Kk.displayName="DropdownMenuRadioGroup";var Qk=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(Ok,{...o,...r,ref:t})}));Qk.displayName="DropdownMenuRadioItem";o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(Tk,{...o,...r,ref:t})})).displayName="DropdownMenuItemIndicator";o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(Mk,{...o,...r,ref:t})})).displayName="DropdownMenuSeparator";o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(Pk,{...o,...r,ref:t})})).displayName="DropdownMenuArrow";var qk=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(Bk,{...o,...r,ref:t})}));qk.displayName="DropdownMenuSubTrigger";var eS=o.forwardRef(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zk(n);return Lu.jsx(jk,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));eS.displayName="DropdownMenuSubContent";var tS=Wk,nS=Zk,rS=Yk,oS=Uk,iS=Jk,aS=Kk,sS=Qk,lS=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,a=zk(t),[s=!1,l]=$u({prop:r,defaultProp:i,onChange:o});return Lu.jsx(Dk,{...a,open:s,onOpenChange:l,children:n})},cS=qk,uS=eS;function dS(e,t){return function(e,t){return new Blob([e],{type:t})}(function(e){const t=window.atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r}(e),t)}function pS(e,t=!0){return new Promise((n=>{const r=new FileReader;r.onload=()=>{const e=r.result;t&&n(e.split(",")[1]),n(e)},r.readAsDataURL(e)}))}function fS(e){return function(e){return new Promise((t=>{const n=document.createElement("input");n.type="file",n.accept=e,n.onchange=()=>{const e=n.files?.[0];e&&t(e)},n.click()}))}(e).then(pS)}const hS=({trigger:t,setOpen:n,open:r})=>{const[i,a]=e.useState(""),s=e.useContext(sF);return s.options.useWorkerManager?o.createElement(Kw,{setOpen:n,open:r,trigger:t,title:"New Worker",description:"Create a new worker"},o.createElement("div",null,"Name:",o.createElement("br",null),o.createElement("input",{className:"styledinput",onChange:e=>{a(e.currentTarget.value)},value:i})),o.createElement("div",null,i&&o.createElement("div",null,o.createElement("button",{className:"styledbtn",onClick:()=>{s.workermanager?.new_worker({name:i}),n(!1)}},"Create")))):null},mS=({trigger:t,setOpen:n,open:r})=>{const i=e.useContext(sF),[a,s]=e.useState(!1),l=i.workers(),c=i.worker?.uuid,u=(c?l[c]?.name:void 0)||c||"worker";return o.createElement(Kw,{setOpen:n,open:r,trigger:t,title:"Export Worker",description:"Export the worker as a .fnw file"},o.createElement("div",null,o.createElement("div",null,o.createElement("input",{type:"checkbox",className:"styledcheckbox",checked:a,onChange:e=>{s(e.currentTarget.checked)}}),"Include Files"),o.createElement("button",{className:"styledbtn",onClick:async()=>{if(!i.worker)return;!function(e,t,n){const r=dS(e,n),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=t,i.click(),URL.revokeObjectURL(o),i.remove()}(await i.worker.export({withFiles:a}),u+".fnw","application/zip"),n(!1)}},"Export")))},gS=()=>{const t=e.useContext(sF).progress_state();return o.createElement("div",{className:"statusbar"},o.createElement("span",{className:"statusbar-progressbar",style:{width:Math.min(100,100*t.progress)+"%"}}),o.createElement("span",{className:"statusbar-message"},t.message))},yS=()=>{const t=e.useContext(sF),n=t.workers(),[r,i]=e.useState(!1),[a,s]=e.useState(!1),l=t.options.useWorkerManager&&t.workermanager&&t.workermanager.open,c=l&&Object.keys(n).length>0,u=t.worker&&t.worker.is_open,d=u&&l;return l||u?o.createElement(o.Fragment,null,o.createElement(tS,null,o.createElement(nS,{asChild:!0},o.createElement("button",{className:"styledbtn"},o.createElement(Tv,{direction:"row",spacing:1},o.createElement(Ov,null,"Worker")," ",o.createElement(kv,null)))),o.createElement(rS,{className:"headermenucontent funcnodescontainer"},o.createElement(oS,null,c&&o.createElement(lS,null,o.createElement(cS,{className:"headermenuitem submenuitem"},o.createElement(Tv,{direction:"row",spacing:1},"Select",o.createElement(Mv,null))),o.createElement(uS,{className:"headermenucontent funcnodescontainer",sideOffset:2,alignOffset:-5},o.createElement(aS,{value:t.worker?.uuid,onValueChange:e=>{(e=>{if("__select__"!==e&&t.workers&&t.workermanager&&n[e]){if(!n[e].active&&!window.confirm("this is an inactive worker, selecting it will start it, continue?"))return;t.workermanager.set_active(e)}})(e)}},Object.keys(n).sort(((e,t)=>{if(n[e].active&&!n[t].active)return-1;if(!n[e].active&&n[t].active)return 1;const r=n[e].name||e,o=n[t].name||t;return r.localeCompare(o)})).map((e=>o.createElement(sS,{className:"headermenuitem workerselectoption"+(n[e]?.active?" active":" inactive")+" headermenuitem",key:e,value:e,disabled:e===t.worker?.uuid},n[e]?.name||e)))))),u&&o.createElement(o.Fragment,null,d&&o.createElement(iS,{className:"headermenuitem",onClick:()=>{if(t.worker)return t.workermanager?void t.workermanager?.restart_worker(t.worker.uuid):t.logger.error("no workermanager")}},"Restart"),o.createElement(iS,{className:"headermenuitem",onClick:()=>{t.worker&&t.worker.stop()}},"Stop"),o.createElement(iS,{className:"headermenuitem",onClick:()=>s(!0)},"Export"),o.createElement(iS,{className:"headermenuitem",onClick:async()=>{if(!t.worker)return;if(!window.confirm("Updateing the worker might replace the current nodespace, continue?"))return;const e=await fS(".fnw");t.worker.update_from_export(e)}},"Update")),l&&o.createElement(o.Fragment,null,o.createElement(iS,{className:"headermenuitem",onClick:()=>i(!0)},"New"))))),o.createElement(hS,{open:r,setOpen:i}),o.createElement(mS,{open:a,setOpen:s})):null},bS=()=>{const t=e.useContext(sF);return o.createElement(o.Fragment,null,o.createElement(tS,null,o.createElement(nS,{asChild:!0},o.createElement("button",{className:"styledbtn"},o.createElement(Tv,{direction:"row",spacing:1},o.createElement(Ov,null,"Nodespace")," ",o.createElement(kv,null)))),o.createElement(rS,{className:"headermenucontent funcnodescontainer"},o.createElement(oS,null,o.createElement(iS,{className:"headermenuitem",onClick:()=>{window.confirm("Are you sure you want to start a new flow?")&&t.worker?.clear()}},"New"),o.createElement(iS,{className:"headermenuitem",onClick:async()=>{const e=await(t.worker?.save());if(!e)return;const n=new Blob([JSON.stringify(e)],{type:"application/json"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download="flow.json",o.click(),URL.revokeObjectURL(r),o.remove()}},"Save"),o.createElement(iS,{className:"headermenuitem",onClick:async()=>{const e=document.createElement("input");e.type="file",e.accept=".json",e.onchange=async e=>{const n=e.target.files?.[0];if(!n)return;const r=new FileReader;r.onload=async e=>{const n=e.target?.result;if(!n)return;const r=JSON.parse(n);await(t.worker?.load(r))},r.readAsText(n)},e.click()}},"Load")))))},vS=({...t})=>{const n=e.useContext(sF),r=n.workerstate();return Object.keys(t).length>0&&n.logger.debug("headerprops",t),o.createElement("div",{className:"funcnodesreactflowheader"},o.createElement("div",{className:"headerelement"},o.createElement(gS,null)),t.showmenu&&o.createElement(o.Fragment,null,o.createElement("div",{className:"headerelement"},o.createElement(yS,null)),n.worker&&r.is_open&&o.createElement("div",{className:"headerelement"},o.createElement(bS,null))))};const wS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,CS={};function ES(e,t){return(CS.jsx?xS:wS).test(e)}const kS=/[ \t\n\f\r]/g;function SS(e){return""===e.replace(kS,"")}class IS{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function _S(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new IS(n,r,t)}function AS(e){return e.toLowerCase()}IS.prototype.property={},IS.prototype.normal={},IS.prototype.space=null;class NS{constructor(e,t){this.property=e,this.attribute=t}}NS.prototype.space=null,NS.prototype.boolean=!1,NS.prototype.booleanish=!1,NS.prototype.overloadedBoolean=!1,NS.prototype.number=!1,NS.prototype.commaSeparated=!1,NS.prototype.spaceSeparated=!1,NS.prototype.commaOrSpaceSeparated=!1,NS.prototype.mustUseProperty=!1,NS.prototype.defined=!1;let RS=0;const OS=FS(),TS=FS(),MS=FS(),PS=FS(),DS=FS(),BS=FS(),jS=FS();function FS(){return 2**++RS}var LS=Object.freeze({__proto__:null,boolean:OS,booleanish:TS,commaOrSpaceSeparated:jS,commaSeparated:BS,number:PS,overloadedBoolean:MS,spaceSeparated:DS});const VS=Object.keys(LS);class zS extends NS{constructor(e,t,n,r){let o=-1;if(super(e,t),GS(this,"space",r),"number"==typeof n)for(;++o<VS.length;){const e=VS[o];GS(this,VS[o],(n&LS[e])===LS[e])}}}function GS(e,t,n){n&&(e[t]=n)}zS.prototype.defined=!0;const HS={}.hasOwnProperty;function WS(e){const t={},n={};let r;for(r in e.properties)if(HS.call(e.properties,r)){const o=e.properties[r],i=new zS(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[AS(r)]=r,n[AS(i.attribute)]=r}return new IS(t,n,e.space)}const XS=WS({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),ZS=WS({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function $S(e,t){return t in e?e[t]:t}function YS(e,t){return $S(e,t.toLowerCase())}const US=WS({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:YS,properties:{xmlns:null,xmlnsXLink:null}}),JS=WS({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:TS,ariaAutoComplete:null,ariaBusy:TS,ariaChecked:TS,ariaColCount:PS,ariaColIndex:PS,ariaColSpan:PS,ariaControls:DS,ariaCurrent:null,ariaDescribedBy:DS,ariaDetails:null,ariaDisabled:TS,ariaDropEffect:DS,ariaErrorMessage:null,ariaExpanded:TS,ariaFlowTo:DS,ariaGrabbed:TS,ariaHasPopup:null,ariaHidden:TS,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:DS,ariaLevel:PS,ariaLive:null,ariaModal:TS,ariaMultiLine:TS,ariaMultiSelectable:TS,ariaOrientation:null,ariaOwns:DS,ariaPlaceholder:null,ariaPosInSet:PS,ariaPressed:TS,ariaReadOnly:TS,ariaRelevant:null,ariaRequired:TS,ariaRoleDescription:DS,ariaRowCount:PS,ariaRowIndex:PS,ariaRowSpan:PS,ariaSelected:TS,ariaSetSize:PS,ariaSort:null,ariaValueMax:PS,ariaValueMin:PS,ariaValueNow:PS,ariaValueText:null,role:null}}),KS=WS({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:YS,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:BS,acceptCharset:DS,accessKey:DS,action:null,allow:null,allowFullScreen:OS,allowPaymentRequest:OS,allowUserMedia:OS,alt:null,as:null,async:OS,autoCapitalize:null,autoComplete:DS,autoFocus:OS,autoPlay:OS,blocking:DS,capture:null,charSet:null,checked:OS,cite:null,className:DS,cols:PS,colSpan:null,content:null,contentEditable:TS,controls:OS,controlsList:DS,coords:PS|BS,crossOrigin:null,data:null,dateTime:null,decoding:null,default:OS,defer:OS,dir:null,dirName:null,disabled:OS,download:MS,draggable:TS,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:OS,formTarget:null,headers:DS,height:PS,hidden:OS,high:PS,href:null,hrefLang:null,htmlFor:DS,httpEquiv:DS,id:null,imageSizes:null,imageSrcSet:null,inert:OS,inputMode:null,integrity:null,is:null,isMap:OS,itemId:null,itemProp:DS,itemRef:DS,itemScope:OS,itemType:DS,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:OS,low:PS,manifest:null,max:null,maxLength:PS,media:null,method:null,min:null,minLength:PS,multiple:OS,muted:OS,name:null,nonce:null,noModule:OS,noValidate:OS,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:OS,optimum:PS,pattern:null,ping:DS,placeholder:null,playsInline:OS,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:OS,referrerPolicy:null,rel:DS,required:OS,reversed:OS,rows:PS,rowSpan:PS,sandbox:DS,scope:null,scoped:OS,seamless:OS,selected:OS,shadowRootClonable:OS,shadowRootDelegatesFocus:OS,shadowRootMode:null,shape:null,size:PS,sizes:null,slot:null,span:PS,spellCheck:TS,src:null,srcDoc:null,srcLang:null,srcSet:null,start:PS,step:null,style:null,tabIndex:PS,target:null,title:null,translate:null,type:null,typeMustMatch:OS,useMap:null,value:TS,width:PS,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:DS,axis:null,background:null,bgColor:null,border:PS,borderColor:null,bottomMargin:PS,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:OS,declare:OS,event:null,face:null,frame:null,frameBorder:null,hSpace:PS,leftMargin:PS,link:null,longDesc:null,lowSrc:null,marginHeight:PS,marginWidth:PS,noResize:OS,noHref:OS,noShade:OS,noWrap:OS,object:null,profile:null,prompt:null,rev:null,rightMargin:PS,rules:null,scheme:null,scrolling:TS,standby:null,summary:null,text:null,topMargin:PS,valueType:null,version:null,vAlign:null,vLink:null,vSpace:PS,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:OS,disableRemotePlayback:OS,prefix:null,property:null,results:PS,security:null,unselectable:null}}),QS=WS({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:$S,properties:{about:jS,accentHeight:PS,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:PS,amplitude:PS,arabicForm:null,ascent:PS,attributeName:null,attributeType:null,azimuth:PS,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:PS,by:null,calcMode:null,capHeight:PS,className:DS,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:PS,diffuseConstant:PS,direction:null,display:null,dur:null,divisor:PS,dominantBaseline:null,download:OS,dx:null,dy:null,edgeMode:null,editable:null,elevation:PS,enableBackground:null,end:null,event:null,exponent:PS,externalResourcesRequired:null,fill:null,fillOpacity:PS,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:BS,g2:BS,glyphName:BS,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:PS,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:PS,horizOriginX:PS,horizOriginY:PS,id:null,ideographic:PS,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:PS,k:PS,k1:PS,k2:PS,k3:PS,k4:PS,kernelMatrix:jS,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:PS,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:PS,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:PS,overlineThickness:PS,paintOrder:null,panose1:null,path:null,pathLength:PS,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:DS,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:PS,pointsAtY:PS,pointsAtZ:PS,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:jS,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:jS,rev:jS,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:jS,requiredFeatures:jS,requiredFonts:jS,requiredFormats:jS,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:PS,specularExponent:PS,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:PS,strikethroughThickness:PS,string:null,stroke:null,strokeDashArray:jS,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:PS,strokeOpacity:PS,strokeWidth:null,style:null,surfaceScale:PS,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:jS,tabIndex:PS,tableValues:null,target:null,targetX:PS,targetY:PS,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:jS,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:PS,underlineThickness:PS,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:PS,values:null,vAlphabetic:PS,vMathematical:PS,vectorEffect:null,vHanging:PS,vIdeographic:PS,version:null,vertAdvY:PS,vertOriginX:PS,vertOriginY:PS,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:PS,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),qS=/^data[-\w.:]+$/i,eI=/-[a-z]/g,tI=/[A-Z]/g;function nI(e){return"-"+e.toLowerCase()}function rI(e){return e.charAt(1).toUpperCase()}const oI={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},iI=_S([ZS,XS,US,JS,KS],"html"),aI=_S([ZS,XS,US,JS,QS],"svg");var sI,lI,cI,uI={};var dI=function(){if(cI)return uI;cI=1;var e=uI&&uI.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(uI,"__esModule",{value:!0}),uI.default=function(e,n){var r=null;if(!e||"string"!=typeof e)return r;var o=(0,t.default)(e),i="function"==typeof n;return o.forEach((function(e){if("declaration"===e.type){var t=e.property,o=e.value;i?n(t,o,e):o&&((r=r||{})[t]=o)}})),r};var t=e(function(){if(lI)return sI;lI=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,s=/^\s+|\s+$/g,l="";function c(e){return e?e.replace(s,l):l}return sI=function(s,u){if("string"!=typeof s)throw new TypeError("First argument must be a string");if(!s)return[];u=u||{};var d=1,p=1;function f(e){var n=e.match(t);n&&(d+=n.length);var r=e.lastIndexOf("\n");p=~r?e.length-r:p+e.length}function h(){var e={line:d,column:p};return function(t){return t.position=new m(e),b(),t}}function m(e){this.start=e,this.end={line:d,column:p},this.source=u.source}function g(e){var t=new Error(u.source+":"+d+":"+p+": "+e);if(t.reason=e,t.filename=u.source,t.line=d,t.column=p,t.source=s,!u.silent)throw t}function y(e){var t=e.exec(s);if(t){var n=t[0];return f(n),s=s.slice(n.length),t}}function b(){y(n)}function v(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=h();if("/"==s.charAt(0)&&"*"==s.charAt(1)){for(var t=2;l!=s.charAt(t)&&("*"!=s.charAt(t)||"/"!=s.charAt(t+1));)++t;if(t+=2,l===s.charAt(t-1))return g("End of comment missing");var n=s.slice(2,t-2);return p+=2,f(n),s=s.slice(t),p+=2,e({type:"comment",comment:n})}}function x(){var t=h(),n=y(r);if(n){if(w(),!y(o))return g("property missing ':'");var s=y(i),u=t({type:"declaration",property:c(n[0].replace(e,l)),value:s?c(s[0].replace(e,l)):l});return y(a),u}}return m.prototype.content=s,b(),function(){var e,t=[];for(v(t);e=x();)!1!==e&&(t.push(e),v(t));return t}()},sI}());return uI}(),pI=l(dI),fI=pI.default||pI;const hI=gI("end"),mI=gI("start");function gI(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function yI(e){return e&&"object"==typeof e?"position"in e||"type"in e?vI(e.position):"start"in e||"end"in e?vI(e):"line"in e||"column"in e?bI(e):"":""}function bI(e){return wI(e&&e.line)+":"+wI(e&&e.column)}function vI(e){return bI(e&&e.start)+"-"+bI(e&&e.end)}function wI(e){return e&&"number"==typeof e?e:1}class xI extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=a?a.line:void 0,this.name=yI(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}xI.prototype.file="",xI.prototype.name="",xI.prototype.reason="",xI.prototype.message="",xI.prototype.stack="",xI.prototype.column=void 0,xI.prototype.line=void 0,xI.prototype.ancestors=void 0,xI.prototype.cause=void 0,xI.prototype.fatal=void 0,xI.prototype.place=void 0,xI.prototype.ruleId=void 0,xI.prototype.source=void 0;const CI={}.hasOwnProperty,EI=new Map,kI=/[A-Z]/g,SI=/-([a-z])/g,II=new Set(["table","tbody","thead","tfoot","tr"]),_I=new Set(["td","th"]),AI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function NI(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const a=Array.isArray(o.children),s=mI(n);return t(r,o,i,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const a=Array.isArray(o.children)?n:t;return i?a(r,o,i):a(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?aI:iI,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=RI(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function RI(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=aI,e.schema=o);e.ancestors.push(t);const i=DI(e,t.tagName,!1),a=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&CI.call(t.properties,o)){const i=PI(e,o,t.properties[o]);if(i){const[o,a]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof a&&_I.has(t.tagName)?r=a:n[o]=a}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=MI(e,t);II.has(t.tagName)&&(s=s.filter((function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&SS(t.value):SS(t));var t})));return OI(e,a,i,t),TI(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}BI(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=aI,e.schema=o);e.ancestors.push(t);const i=null===t.name?e.Fragment:DI(e,t.name,!0),a=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];t.type;const o=t.expression;o.type;const i=o.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else BI(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];t.type,i=e.evaluater.evaluateExpression(t.expression)}else BI(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=MI(e,t);return OI(e,a,i,t),TI(a,s),e.ancestors.pop(),e.schema=r,e.create(t,i,a,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);BI(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return TI(r,MI(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function OI(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function TI(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function MI(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:EI;for(;++r<t.children.length;){const i=t.children[r];let a;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;a=e+"-"+t,o.set(e,t+1)}}const s=RI(e,i,a);void 0!==s&&n.push(s)}return n}function PI(e,t,n){const r=function(e,t){const n=AS(t);let r=t,o=NS;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&qS.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(eI,rI);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!eI.test(e)){let n=e.replace(tI,nI);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=zS}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):function(e){return e.join(" ").trim()}(n)),"style"===r.property){let t="object"==typeof n?n:function(e,t){const n={};try{fI(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new xI("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=AI+"#cannot-parse-style-attribute",r}}return n;function r(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(SI,FI)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)CI.call(e,n)&&(t[jI(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?oI[r.property]||r.property:r.attribute,n]}}function DI(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=ES(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=ES(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return CI.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);BI(e)}function BI(e,t){const n=new xI("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=AI+"#cannot-handle-mdx-estrees-without-createevaluater",n}function jI(e){let t=e.replace(kI,LI);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function FI(e,t){return t.toUpperCase()}function LI(e){return"-"+e.toLowerCase()}const VI={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},zI={};function GI(e,t){return HI(e,"boolean"!=typeof zI.includeImageAlt||zI.includeImageAlt,"boolean"!=typeof zI.includeHtml||zI.includeHtml)}function HI(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return WI(e.children,t,n)}return Array.isArray(e)?WI(e,t,n):""}function WI(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=HI(e[o],t,n);return r.join("")}const XI=document.createElement("i");function ZI(e){const t="&"+e+";";XI.innerHTML=t;const n=XI.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function $I(e,t,n,r){const o=e.length;let i,a=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);a<r.length;)i=r.slice(a,a+1e4),i.unshift(t,0),e.splice(...i),a+=1e4,t+=1e4}function YI(e,t){return e.length>0?($I(e,e.length,0,t),e):t}const UI={}.hasOwnProperty;function JI(e){const t={};let n=-1;for(;++n<e.length;)KI(t,e[n]);return t}function KI(e,t){let n;for(n in t){const r=(UI.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){UI.call(r,i)||(r[i]=[]);const e=o[i];QI(r[i],Array.isArray(e)?e:e?[e]:[])}}}function QI(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);$I(e,0,0,r)}function qI(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function e_(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const t_=f_(/[A-Za-z]/),n_=f_(/[\dA-Za-z]/),r_=f_(/[#-'*+\--9=?A-Z^-~]/);function o_(e){return null!==e&&(e<32||127===e)}const i_=f_(/\d/),a_=f_(/[\dA-Fa-f]/),s_=f_(/[!-/:-@[-`{-~]/);function l_(e){return null!==e&&e<-2}function c_(e){return null!==e&&(e<0||32===e)}function u_(e){return-2===e||-1===e||32===e}const d_=f_(/\p{P}|\p{S}/u),p_=f_(/\s/);function f_(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function h_(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(37===i&&n_(e.charCodeAt(n+1))&&n_(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(a=String.fromCharCode(i,t),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function m_(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(u_(r))return e.enter(n),a(r);return t(r)};function a(r){return u_(r)&&i++<o?(e.consume(r),a):(e.exit(n),t(r))}}const g_={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,(function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),m_(e,t,"linePrefix")}),(function(t){return e.enter("paragraph"),r(t)}));let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):l_(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const y_={tokenize:function(e){const t=this,n=[];let r,o,i,a=0;return s;function s(r){if(a<n.length){const o=n[a];return t.containerState=o[1],e.attempt(o[0].continuation,l,c)(r)}return c(r)}function l(e){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&b();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}y(a);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return $I(t.events,i+1,0,t.events.slice(n)),t.events.length=s,c(e)}return s(e)}function c(o){if(a===n.length){if(!r)return p(o);if(r.currentConstruct&&r.currentConstruct.concrete)return h(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(b_,u,d)(o)}function u(e){return r&&b(),y(a),p(e)}function d(e){return t.parser.lazy[t.now().line]=a!==n.length,i=t.now().offset,h(e)}function p(n){return t.containerState={},e.attempt(b_,f,h)(n)}function f(e){return a++,n.push([t.currentConstruct,t.containerState]),p(e)}function h(n){return null===n?(r&&b(),y(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),m(n))}function m(n){return null===n?(g(e.exit("chunkFlow"),!0),y(0),void e.consume(n)):l_(n)?(e.consume(n),g(e.exit("chunkFlow")),a=0,t.interrupt=void 0,s):(e.consume(n),m)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,l=n;for(;l--;)if("exit"===t.events[l][0]&&"chunkFlow"===t.events[l][1].type){if(o){s=t.events[l][1].end;break}o=!0}for(y(a),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;$I(t.events,l+1,0,t.events.slice(n)),t.events.length=e}}function y(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function b(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},b_={tokenize:function(e,t,n){return m_(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function v_(e){return null===e||c_(e)||p_(e)?1:d_(e)?2:void 0}function w_(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const x_={name:"attention",resolveAll:function(e,t){let n,r,o,i,a,s,l,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d={...e[n][1].end},p={...e[u][1].start};C_(d,-s),C_(p,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[n][1].end={...i.start},e[u][1].start={...a.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=YI(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=YI(l,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),l=YI(l,w_(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),l=YI(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=YI(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,$I(e,n-1,u-n+3,l),u=n+l.length-c-2;break}u=-1;for(;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=v_(r);let i;return function(t){return i=t,e.enter("attentionSequence"),a(t)};function a(s){if(s===i)return e.consume(s),a;const l=e.exit("attentionSequence"),c=v_(s),u=!c||2===c&&o||n.includes(s),d=!o||2===o&&c||n.includes(r);return l._open=Boolean(42===i?u:u&&(o||!d)),l._close=Boolean(42===i?d:d&&(c||!u)),t(s)}}};function C_(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const E_={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return t_(t)?(e.consume(t),i):64===t?n(t):l(t)}function i(e){return 43===e||45===e||46===e||n_(e)?(r=1,a(e)):l(e)}function a(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||n_(t))&&r++<32?(e.consume(t),a):(r=0,l(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||o_(r)?n(r):(e.consume(r),s)}function l(t){return 64===t?(e.consume(t),c):r_(t)?(e.consume(t),l):n(t)}function c(e){return n_(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):d(n)}function d(t){if((45===t||n_(t))&&r++<63){const n=45===t?d:u;return e.consume(t),n}return n(t)}}};const k_={partial:!0,tokenize:function(e,t,n){return function(t){return u_(t)?m_(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||l_(e)?t(e):n(e)}}};const S_={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(u_(t))return m_(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(S_,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return u_(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const I_={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return s_(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const __={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,a=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,i=n_,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=a_,c):(e.enter("characterReferenceValue"),o=7,i=i_,c(t))}function c(s){if(59===s&&a){const o=e.exit("characterReferenceValue");return i!==n_||ZI(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&a++<o?(e.consume(s),c):n(s)}}};const A_={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},N_={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return a;function a(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l}function l(t){return e.enter("codeFencedFence"),u_(t)?m_(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===i?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===i?(o++,e.consume(t),u):o>=s?(e.exit("codeFencedFenceSequence"),u_(t)?m_(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||l_(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,a=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return a=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),l(t)}(t)};function l(t){return t===i?(s++,e.consume(t),l):s<3?n(t):(e.exit("codeFencedFenceSequence"),u_(t)?m_(e,c,"whitespace")(t):c(t))}function c(n){return null===n||l_(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(A_,f,b)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||l_(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):u_(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m_(e,d,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),u)}function d(t){return null===t||l_(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(t))}function p(t){return null===t||l_(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===i?n(t):(e.consume(t),p)}function f(t){return e.attempt(o,b,h)(t)}function h(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return a>0&&u_(t)?m_(e,g,"linePrefix",a+1)(t):g(t)}function g(t){return null===t||l_(t)?e.check(A_,f,b)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||l_(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function b(n){return e.exit("codeFenced"),t(n)}}};const R_={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),m_(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):l_(t)?e.attempt(O_,i,s)(t):(e.enter("codeFlowValue"),a(t))}function a(t){return null===t||l_(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),a)}function s(n){return e.exit("codeIndented"),t(n)}}},O_={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):l_(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):m_(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):l_(e)?o(e):n(e)}}};const T_={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}t=o-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),a(t)};function a(t){return 96===t?(e.consume(t),i++,a):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):l_(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),l(t))}function l(t){return null===t||32===t||96===t||l_(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),l)}function c(n){return 96===n?(e.consume(n),r++,c):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",l(n))}}};class M_{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&P_(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),P_(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),P_(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);P_(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);P_(this.left,t.reverse())}}}function P_(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function D_(e){const t={};let n,r,o,i,a,s,l,c=-1;const u=new M_(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,B_(u,c)),c=t[c],l=!0);else if(n[1]._container){for(o=c,r=void 0;o--;)if(i=u.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type)break;r&&(n[1].end={...u.get(r)[1].start},a=u.slice(r,c),a.unshift(n),u.splice(r,c-r+1,a))}}return $I(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!l}function B_(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[],a=n._tokenizer||r.parser[n.contentType](n.start),s=a.events,l=[],c={};let u,d,p=-1,f=n,h=0,m=0;const g=[m];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++p<s.length;)"exit"===s[p][0]&&"enter"===s[p-1][0]&&s[p][1].type===s[p-1][1].type&&s[p][1].start.line!==s[p][1].end.line&&(m=p+1,g.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),p=g.length;p--;){const t=s.slice(g[p],g[p+1]),n=i.pop();l.push([n,n+t.length-1]),e.splice(n,2,t)}for(l.reverse(),p=-1;++p<l.length;)c[h+l[p][0]]=h+l[p][1],h+=l[p][1]-l[p][0]-1;return c}const j_={resolve:function(e){return D_(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):l_(t)?e.check(F_,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},F_={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m_(e,o,"linePrefix")};function o(o){if(null===o||l_(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function L_(e,t,n,r,o,i,a,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),d;if(null===t||32===t||41===t||o_(t))return n(t);return e.enter(r),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(t)};function d(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(n))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||l_(t)?n(t):(e.consume(t),92===t?f:p)}function f(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function h(o){return u||null!==o&&41!==o&&!c_(o)?u<c&&40===o?(e.consume(o),u++,h):41===o?(e.consume(o),u--,h):null===o||32===o||40===o||o_(o)?n(o):(e.consume(o),92===o?m:h):(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(r),t(o))}function m(t){return 40===t||41===t||92===t?(e.consume(t),h):h(t)}}function V_(e,t,n,r,o,i){const a=this;let s,l=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),c};function c(d){return l>999||null===d||91===d||93===d&&!s||94===d&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(i),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):l_(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||l_(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),s||(s=!u_(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function z_(e,t,n,r,o,i){let a;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),a=40===t?41:t,s;return n(t)};function s(n){return n===a?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),l(n))}function l(t){return t===a?(e.exit(i),s(a)):null===t?n(t):l_(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m_(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===a||null===t||l_(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===a||92===t?(e.consume(t),c):c(t)}}function G_(e,t){let n;return function r(o){if(l_(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(u_(o))return m_(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}const H_={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return V_.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=e_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),a):n(t)}function a(t){return c_(t)?G_(e,s)(t):s(t)}function s(t){return L_(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(W_,c,c)(t)}function c(t){return u_(t)?m_(e,u,"whitespace")(t):u(t)}function u(i){return null===i||l_(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},W_={partial:!0,tokenize:function(e,t,n){return function(t){return c_(t)?G_(e,r)(t):n(t)};function r(t){return z_(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return u_(t)?m_(e,i,"whitespace")(t):i(t)}function i(e){return null===e||l_(e)?t(e):n(e)}}};const X_={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return l_(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Z_={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},$I(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||c_(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),a(n)):null===n||l_(n)?(e.exit("atxHeading"),t(n)):u_(n)?m_(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function a(t){return 35===t?(e.consume(t),a):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||c_(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const $_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Y_=["pre","script","style","textarea"],U_={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let o,i,a,s,l;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(s){return 33===s?(e.consume(s),u):47===s?(e.consume(s),i=!0,f):63===s?(e.consume(s),o=3,r.interrupt?t:P):t_(s)?(e.consume(s),a=String.fromCharCode(s),h):n(s)}function u(i){return 45===i?(e.consume(i),o=2,d):91===i?(e.consume(i),o=5,s=0,p):t_(i)?(e.consume(i),o=4,r.interrupt?t:P):n(i)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:P):n(o)}function p(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:I:p):n(o)}function f(t){return t_(t)?(e.consume(t),a=String.fromCharCode(t),h):n(t)}function h(s){if(null===s||47===s||62===s||c_(s)){const l=47===s,c=a.toLowerCase();return l||i||!Y_.includes(c)?$_.includes(a.toLowerCase())?(o=6,l?(e.consume(s),m):r.interrupt?t(s):I(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):y(s)):(o=1,r.interrupt?t(s):I(s))}return 45===s||n_(s)?(e.consume(s),a+=String.fromCharCode(s),h):n(s)}function m(o){return 62===o?(e.consume(o),r.interrupt?t:I):n(o)}function g(t){return u_(t)?(e.consume(t),g):k(t)}function y(t){return 47===t?(e.consume(t),k):58===t||95===t||t_(t)?(e.consume(t),b):u_(t)?(e.consume(t),y):k(t)}function b(t){return 45===t||46===t||58===t||95===t||n_(t)?(e.consume(t),b):v(t)}function v(t){return 61===t?(e.consume(t),w):u_(t)?(e.consume(t),v):y(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),l=t,x):u_(t)?(e.consume(t),w):C(t)}function x(t){return t===l?(e.consume(t),l=null,E):null===t||l_(t)?n(t):(e.consume(t),x)}function C(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||c_(t)?v(t):(e.consume(t),C)}function E(e){return 47===e||62===e||u_(e)?y(e):n(e)}function k(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||l_(t)?I(t):u_(t)?(e.consume(t),S):n(t)}function I(t){return 45===t&&2===o?(e.consume(t),R):60===t&&1===o?(e.consume(t),O):62===t&&4===o?(e.consume(t),D):63===t&&3===o?(e.consume(t),P):93===t&&5===o?(e.consume(t),M):!l_(t)||6!==o&&7!==o?null===t||l_(t)?(e.exit("htmlFlowData"),_(t)):(e.consume(t),I):(e.exit("htmlFlowData"),e.check(J_,B,_)(t))}function _(t){return e.check(K_,A,B)(t)}function A(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),N}function N(t){return null===t||l_(t)?_(t):(e.enter("htmlFlowData"),I(t))}function R(t){return 45===t?(e.consume(t),P):I(t)}function O(t){return 47===t?(e.consume(t),a="",T):I(t)}function T(t){if(62===t){const n=a.toLowerCase();return Y_.includes(n)?(e.consume(t),D):I(t)}return t_(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),T):I(t)}function M(t){return 93===t?(e.consume(t),P):I(t)}function P(t){return 62===t?(e.consume(t),D):45===t&&2===o?(e.consume(t),P):I(t)}function D(t){return null===t||l_(t)?(e.exit("htmlFlowData"),B(t)):(e.consume(t),D)}function B(n){return e.exit("htmlFlow"),t(n)}}},J_={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(k_,t,n)}}},K_={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(l_(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const Q_={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,a;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),w):63===t?(e.consume(t),b):t_(t)?(e.consume(t),E):n(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,f):t_(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),p):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),d):l_(t)?(a=u,T(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?O(e):45===e?d(e):u(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?h:f):n(t)}function h(t){return null===t?n(t):93===t?(e.consume(t),m):l_(t)?(a=h,T(t)):(e.consume(t),h)}function m(t){return 93===t?(e.consume(t),g):h(t)}function g(t){return 62===t?O(t):93===t?(e.consume(t),g):h(t)}function y(t){return null===t||62===t?O(t):l_(t)?(a=y,T(t)):(e.consume(t),y)}function b(t){return null===t?n(t):63===t?(e.consume(t),v):l_(t)?(a=b,T(t)):(e.consume(t),b)}function v(e){return 62===e?O(e):b(e)}function w(t){return t_(t)?(e.consume(t),x):n(t)}function x(t){return 45===t||n_(t)?(e.consume(t),x):C(t)}function C(t){return l_(t)?(a=C,T(t)):u_(t)?(e.consume(t),C):O(t)}function E(t){return 45===t||n_(t)?(e.consume(t),E):47===t||62===t||c_(t)?k(t):n(t)}function k(t){return 47===t?(e.consume(t),O):58===t||95===t||t_(t)?(e.consume(t),S):l_(t)?(a=k,T(t)):u_(t)?(e.consume(t),k):O(t)}function S(t){return 45===t||46===t||58===t||95===t||n_(t)?(e.consume(t),S):I(t)}function I(t){return 61===t?(e.consume(t),_):l_(t)?(a=I,T(t)):u_(t)?(e.consume(t),I):k(t)}function _(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,A):l_(t)?(a=_,T(t)):u_(t)?(e.consume(t),_):(e.consume(t),N)}function A(t){return t===o?(e.consume(t),o=void 0,R):null===t?n(t):l_(t)?(a=A,T(t)):(e.consume(t),A)}function N(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||c_(t)?k(t):(e.consume(t),N)}function R(e){return 47===e||62===e||c_(e)?k(e):n(e)}function O(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function T(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return u_(t)?m_(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):P(t)}function P(t){return e.enter("htmlTextData"),a(t)}}};const q_={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&$I(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,o,i,a=e.length,s=0;for(;a--;)if(n=e[a][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[a][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[a][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=a,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=a);const l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",l,t],["enter",c,t]],i=YI(i,e.slice(r+1,r+s+3)),i=YI(i,[["enter",u,t]]),i=YI(i,w_(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=YI(i,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),i=YI(i,e.slice(o+1)),i=YI(i,[["exit",l,t]]),$I(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,a=r.events.length;for(;a--;)if(("labelImage"===r.events[a][1].type||"labelLink"===r.events[a][1].type)&&!r.events[a][1]._balanced){o=r.events[a][1];break}return function(t){if(!o)return n(t);if(o._inactive)return u(t);return i=r.parser.defined.includes(e_(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(eA,c,i?c:u)(t):91===t?e.attempt(tA,c,i?l:u)(t):i?c(t):u(t)}function l(t){return e.attempt(nA,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}}},eA={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return c_(t)?G_(e,o)(t):o(t)}function o(t){return 41===t?c(t):L_(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return c_(t)?G_(e,s)(t):c(t)}function a(e){return n(e)}function s(t){return 34===t||39===t||40===t?z_(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function l(t){return c_(t)?G_(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},tA={tokenize:function(e,t,n){const r=this;return function(t){return V_.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(e_(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},nA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const rA={name:"labelStartImage",resolveAll:q_.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const oA={name:"labelStartLink",resolveAll:q_.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const iA={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),m_(e,t,"linePrefix")}}};const aA={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),a(i)):o>=3&&(null===i||l_(i))?(e.exit("thematicBreak"),t(i)):n(i)}function a(t){return t===r?(e.consume(t),o++,a):(e.exit("thematicBreakSequence"),u_(t)?m_(e,i,"whitespace")(t):i(t))}}};const sA={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(k_,o,i);function o(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,m_(e,t,"listItemIndent",r.containerState.size+1)(n)}function i(n){return r.containerState.furtherBlankLines||!u_(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(cA,t,a)(n))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,m_(e,e.attempt(sA,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,a=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:i_(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(aA,n,l)(t):l(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return i_(t)&&++a<10?(e.consume(t),s):(!r.interrupt||a<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),l(t)):n(t)}function l(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(k_,r.interrupt?n:c,e.attempt(lA,d,u))}function c(e){return r.containerState.initialBlankLine=!0,i++,d(e)}function u(t){return u_(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},lA={partial:!0,tokenize:function(e,t,n){const r=this;return m_(e,(function(e){const o=r.events[r.events.length-1];return!u_(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},cA={partial:!0,tokenize:function(e,t,n){const r=this;return m_(e,(function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)}};const uA={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",a,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=a;return e.push(["exit",a,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let a,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){a="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||a))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),u_(t)?m_(e,a,"lineSuffix")(t):a(t))}function a(r){return null===r||l_(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const dA={tokenize:function(e){const t=this,n=e.attempt(k_,(function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}),e.attempt(this.parser.constructs.flowInitial,r,m_(e,e.attempt(this.parser.constructs.flow,r,e.attempt(j_,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const pA={resolveAll:gA()},fA=mA("string"),hA=mA("text");function mA(e){return{resolveAll:gA("text"===e?yA:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,a);return i;function i(e){return l(e)?o(e):a(e)}function a(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return l(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function gA(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function yA(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,a=o.length,s=-1,l=0;for(;a--;){const e=o[a];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)i=!0,l++;else if(-1!==e){a++;break}}if(l){const o={type:n===e.length||i||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const bA={42:sA,43:sA,45:sA,48:sA,49:sA,50:sA,51:sA,52:sA,53:sA,54:sA,55:sA,56:sA,57:sA,62:S_},vA={91:H_},wA={[-2]:R_,[-1]:R_,32:R_},xA={35:Z_,42:aA,45:[uA,aA],60:U_,61:uA,95:aA,96:N_,126:N_},CA={38:__,92:I_},EA={[-5]:iA,[-4]:iA,[-3]:iA,33:rA,38:__,42:x_,60:[E_,Q_],91:oA,92:[X_,I_],93:q_,95:x_,96:T_},kA={null:[x_,pA]};var SA=Object.freeze({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:vA,disable:{null:[]},document:bA,flow:xA,flowInitial:wA,insideSpan:kA,string:CA,text:EA});function IA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let a=[],s=[];const l={attempt:g((function(e,t){y(e,t.from)})),check:g(m),consume:function(e){l_(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,b()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++));c.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=p(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:g(m,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,b()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if("string"==typeof i)a=i;else switch(i){case-5:a="\r";break;case-4:a="\n";break;case-3:a="\r\n";break;case-2:a=t?" ":"\t";break;case-1:if(!t&&o)continue;a=" ";break;default:a=String.fromCharCode(i)}o=-2===i,r.push(a)}return r.join("")}(d(e),t)},sliceStream:d,write:function(e){if(a=YI(a,e),f(),null!==a[a.length-1])return[];return y(t,0),c.events=w_(i,c.events,c),c.events}};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const e=a[0];"string"==typeof e?a[0]=e.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}(a,e)}function p(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function f(){let e;for(;r._index<a.length;){const t=a[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)h(t.charCodeAt(r._bufferIndex));else h(t)}}function h(e){u=u(e)}function m(e,t){t.restore()}function g(e,t){return function(n,o,i){let a,u,d,f;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return h([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function h(e){return a=e,u=0,0===e.length?i:m(e[u])}function m(e){return function(n){f=function(){const e=p(),t=c.previous,n=c.currentConstruct,o=c.events.length,i=Array.from(s);return{from:o,restore:a};function a(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=o,s=i,b()}}(),d=e,e.partial||(c.currentConstruct=e);if(e.name&&c.parser.constructs.disable.null.includes(e.name))return y();return e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,g,y)(n)}}function g(t){return e(d,f),o}function y(e){return f.restore(),++u<a.length?m(a[u]):i}}}function y(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&$I(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function b(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const _A=/[\0\t\n\r]/g;const AA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function NA(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return qI(n.slice(t?2:1),t?16:10)}return ZI(n)||e}const RA={}.hasOwnProperty;function OA(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:S,autolinkEmail:S,atxHeading:i(K),blockQuote:i(Z),characterEscape:S,characterReference:S,codeFenced:i($),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i($,a),codeText:i(Y,a),codeTextData:S,data:S,codeFlowValue:S,definition:i(U),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(J),hardBreakEscape:i(Q),hardBreakTrailing:i(Q),htmlFlow:i(q,a),htmlFlowData:S,htmlText:i(q,a),htmlTextData:S,image:i(ee),label:a,link:i(te),listItem:i(re),listItemValue:p,listOrdered:i(ne,d),listUnordered:i(ne),paragraph:i(oe),reference:L,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(K),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:l(),atxHeadingSequence:x,autolink:l(),autolinkEmail:X,autolinkProtocol:W,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:G,characterReference:H,codeFenced:l(g),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:h,codeFlowValue:I,codeIndented:l(y),codeText:l(O),codeTextData:I,data:I,definition:l(),definitionDestinationString:w,definitionLabelString:b,definitionTitleString:v,emphasis:l(),hardBreakEscape:l(A),hardBreakTrailing:l(A),htmlFlow:l(N),htmlFlowData:I,htmlText:l(R),htmlTextData:I,image:l(M),label:D,labelText:P,lineEnding:_,link:l(T),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:B,resourceTitleString:j,resource:F,setextHeading:l(k),setextHeadingLineSequence:E,setextHeadingText:C,strong:l(),thematicBreak:l()}};MA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:n},l=[];let d=-1;for(;++d<e.length;)if("listOrdered"===e[d][1].type||"listUnordered"===e[d][1].type)if("enter"===e[d][0])l.push(d);else{d=o(e,l.pop(),d)}for(d=-1;++d<e.length;){const n=t[e[d][0]];RA.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},i),e[d][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||DA).call(i,void 0,e[0])}for(r.position={start:TA(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:TA(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function o(e,t,n){let r,o,i,a,s=t-1,l=-1,c=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,a=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||a||l||i||(i=s),a=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:a=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let a=s;for(o=void 0;a--;){const t=e[a];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",o=a}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,a=!0}}}return e[t][1]._spread=c,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:TA(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+yI({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||DA).call(this,e,r[0])}n.position.end=TA(e.end)}function u(){return GI(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function f(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function h(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function b(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=e_(this.sliceSerialize(e)).toLowerCase()}function v(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function x(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function E(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function S(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=ae(),n.position={start:TA(e.start),end:void 0},t.push(n)),this.stack.push(n)}function I(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=TA(e.end)}function _(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=TA(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(S.call(this,e),I.call(this,e))}function A(){this.data.atHardBreak=!0}function N(){const e=this.resume();this.stack[this.stack.length-1].value=e}function R(){const e=this.resume();this.stack[this.stack.length-1].value=e}function O(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(AA,NA)}(t),n.identifier=e_(t).toLowerCase()}function D(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function B(){const e=this.resume();this.stack[this.stack.length-1].url=e}function j(){const e=this.resume();this.stack[this.stack.length-1].title=e}function F(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function V(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=e_(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function z(e){this.data.characterReferenceType=e.type}function G(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=qI(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=ZI(t)}this.stack[this.stack.length-1].value+=r}function H(e){this.stack.pop().position.end=TA(e.end)}function W(e){I.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function X(e){I.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function Z(){return{type:"blockquote",children:[]}}function $(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function U(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function J(){return{type:"emphasis",children:[]}}function K(){return{type:"heading",depth:0,children:[]}}function Q(){return{type:"break"}}function q(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function ae(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!D_(e););return e}(function(e){const t={constructs:JI([SA,...(e||{}).extensions||[]]),content:n(g_),defined:[],document:n(y_),flow:n(dA),lazy:{},string:n(fA),text:n(hA)};return t;function n(e){return function(n){return IA(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,a){const s=[];let l,c,u,d,p;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);u<o.length;){if(_A.lastIndex=u,l=_A.exec(o),d=l&&void 0!==l.index?l.index:o.length,p=o.charCodeAt(d),!l){n=o.slice(u);break}if(10===p&&u===d&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),u<d&&(s.push(o.slice(u,d)),t+=d-u),p){case 0:s.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),s.push(-2);t++<c;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}u=d+1}return a&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function TA(e){return{line:e.line,column:e.column,offset:e.offset}}function MA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?MA(e,r):PA(e,r)}}function PA(e,t){let n;for(n in t)if(RA.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function DA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+yI({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yI({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+yI({start:t.start,end:t.end})+") is still open")}function BA(e){const t=this;t.parser=function(n){return OA(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function jA(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&"text"===a.type?a.value+=r:o.push({type:"text",value:r}),o}function FA(e){const t=e.spread;return null==t?e.children.length>1:t}function LA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(VA(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(VA(t.slice(o),o>0,!1)),i.join("")}function VA(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const zA={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=h_(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let a,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=i+1,s+=1,e.footnoteCounts.set(r,s);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jA(e,t);const o={src:h_(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:h_(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jA(e,t);const o={href:h_(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:h_(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=FA(n[r])}return t}(n):FA(t),i={},a=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&a.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?a.push(e):a.push(...e.children)}const l=r[r.length-1];l&&(o||"element"!==l.type||"p"!==l.tagName)&&a.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=mI(t.children[1]),a=hI(t.children[t.children.length-1]);i&&a&&(r.position={start:i,end:a}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,a=i?i.length:t.children.length;let s=-1;const l=[];for(;++s<a;){const n=t.children[s],r={},a=i?i[s]:void 0;a&&(r.align=a);let c={type:"element",tagName:o,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),l.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:LA(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:GA,yaml:GA,definition:GA,footnoteDefinition:GA};function GA(){}const HA="object"==typeof self?self:globalThis,WA=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,a]=t[o];switch(i){case 0:case-1:return n(a,o);case 1:{const e=n([],o);for(const t of a)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),o);case 4:{const{source:e,flags:t}=a;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of a)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of a)e.add(r(t));return e}case 7:{const{name:e,message:t}=a;return n(new HA[e](t),o)}case 8:return n(BigInt(a),o);case"BigInt":return n(Object(BigInt(a)),o);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new HA[i](a),o)};return r})(new Map,e)(0),XA="",{toString:ZA}={},{keys:$A}=Object,YA=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=ZA.call(e).slice(8,-1);switch(n){case"Array":return[1,XA];case"Object":return[2,XA];case"Date":return[3,XA];case"RegExp":return[4,XA];case"Map":return[5,XA];case"Set":return[6,XA];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},UA=([e,t])=>0===e&&("function"===t||"symbol"===t),JA=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[a,s]=YA(r);switch(a){case 0:{let t=r;switch(s){case"bigint":a=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([a,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([a,e],r);for(const t of r)e.push(i(t));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],l=o([a,n],r);for(const t of $A(r))!e&&UA(YA(r[t]))||n.push([i(t),i(r[t])]);return l}case 3:return o([a,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([a,{source:e,flags:t}],r)}case 5:{const t=[],n=o([a,t],r);for(const[n,o]of r)(e||!UA(YA(n))&&!UA(YA(o)))&&t.push([i(n),i(o)]);return n}case 6:{const t=[],n=o([a,t],r);for(const n of r)!e&&UA(YA(n))||t.push(i(n));return n}}const{message:l}=r;return o([a,{name:s,message:l}],r)};return i})(!(t||n),!!t,new Map,r)(e),r};var KA="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?WA(JA(e,t)):structuredClone(e):(e,t)=>WA(JA(e,t));function QA(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function qA(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const eN=function(e){if(null==e)return nN;if("function"==typeof e)return tN(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=eN(e[n]);return tN(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return tN(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return tN(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function tN(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function nN(){return!0}const rN=[],oN=!0,iN=!1;function aN(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=eN(o),a=r?-1:1;!function e(o,s,l){const c=o&&"object"==typeof o?o:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,d,p=rN;if((!t||i(o,s,l[l.length-1]||void 0))&&(p=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[oN,e];return null==e?rN:[e]}(n(o,l)),p[0]===iN))return p;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==p[0])for(u=(r?t.children.length:-1)+a,d=l.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,d)(),c[0]===iN)return c;u="number"==typeof c[1]?c[1]:u+a}}return p}}(e,void 0,[])()}function sN(e,t,n,r){let o,i,a;"function"==typeof t?(i=void 0,a=t,o=n):(i=t,a=n,o=r),aN(e,i,(function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return a(e,r,n)}),o)}const lN={}.hasOwnProperty,cN={};function uN(e,t){e.position&&(t.position=function(e){const t=mI(e),n=hI(e);if(t&&n)return{start:t,end:n}}(e))}function dN(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,KA(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function pN(e,t){const n=t.data||{},r=!("value"in t)||lN.call(n,"hProperties")||lN.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function fN(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function hN(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function mN(e,t){const n=function(e,t){const n=t||cN,r=new Map,o=new Map,i=new Map,a={...zA,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=hN(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=hN(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:dN,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:a,one:function(e,t){const n=e.type,r=s.handlers[n];if(lN.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=KA(n);return r.children=s.all(e),r}return KA(e)}return(s.options.unknownHandler||pN)(s,e,t)},options:n,patch:uN,wrap:fN};return sN(e,(function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}})),s}(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||QA,r=e.options.footnoteBackLabel||qA,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let l=-1;for(;++l<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[l]);if(!o)continue;const i=e.all(o),a=String(o.identifier).toUpperCase(),c=h_(a.toLowerCase());let u=0;const d=[],p=e.footnoteCounts.get(a);for(;void 0!==p&&++u<=p;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const f=i[i.length-1];if(f&&"element"===f.type&&"p"===f.tagName){const e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...d)}else i.push(...d);const h={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(o,h),s.push(h)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...KA(a),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function gN(e,t){return e&&"run"in e?async function(n,r){const o=mN(n,{file:r,...t});await e.run(o,r)}:function(n,r){return mN(n,{file:r,...e||t})}}function yN(e){if(e)throw e}var bN,vN;var wN=function(){if(vN)return bN;vN=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),i=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!i)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return bN=function e(){var t,n,r,l,c,u,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(h&&l&&(i(l)||(c=o(l)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&i(r)?r:{},a(d,{name:n,newValue:e(h,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},bN}(),xN=l(wN);function CN(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function EN(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...a){const s=e[++n];let l=-1;if(i)r(i);else{for(;++l<t.length;)null!==a[l]&&void 0!==a[l]||(a[l]=t[l]);t=a,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let a;r&&t.push(o);try{a=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(a&&a.then&&"function"==typeof a.then?a.then(i,o):a instanceof Error?o(a):i(a))}function o(e,...r){n||(n=!0,t(e,...r))}function i(e){o(null,e)}}(s,o)(...a):r(null,...a)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const kN={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');SN(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let a=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else a<0&&(n=!0,a=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=a));r===o?o=a:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(SN(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){SN(e);let t,n=e.length,r=-1,o=0,i=-1,a=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==a&&(a=1):i>-1&&(a=-1);else if(t){o=n+1;break}}if(i<0||r<0||0===a||1===a&&i===r-1&&i===o+1)return"";return e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)SN(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){SN(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,a=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else{if(47===n)break;n=47}if(47===n){if(a===l-1||1===s);else if(a!==l-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),a=l,s=0;continue}}else if(o.length>0){o="",i=0,a=l,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(a+1,l):o=e.slice(a+1,l),i=l-a-1;a=l,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function SN(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const IN={cwd:function(){return"/"}};function _N(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function AN(e){if("string"==typeof e)e=new URL(e);else if(!_N(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const NN=["history","path","basename","stem","extname","dirname"];class RN{constructor(e){let t;t=e?_N(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":IN.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<NN.length;){const e=NN[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)NN.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?kN.basename(this.path):void 0}set basename(e){TN(e,"basename"),ON(e,"basename"),this.path=kN.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?kN.dirname(this.path):void 0}set dirname(e){MN(this.basename,"dirname"),this.path=kN.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?kN.extname(this.path):void 0}set extname(e){if(ON(e,"extname"),MN(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=kN.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){_N(e)&&(e=AN(e)),TN(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?kN.basename(this.path,this.extname):void 0}set stem(e){TN(e,"stem"),ON(e,"stem"),this.path=kN.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new xI(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function ON(e,t){if(e&&e.includes(kN.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+kN.sep+"`")}function TN(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function MN(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const PN=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},DN={}.hasOwnProperty;class BN extends PN{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=EN()}copy(){const e=new BN;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(xN(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(VN("data",this.frozen),this.namespace[e]=t,this):DN.call(this.namespace,e)&&this.namespace[e]||void 0:e?(VN("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=HN(e),n=this.parser||this.Parser;return FN("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),FN("process",this.parser||this.Parser),LN("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=HN(e),a=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(a,i,(function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var a;"string"==typeof(a=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(a)?r.value=i:r.result=i,s(e,r)}))}}processSync(e){let t,n=!1;return this.freeze(),FN("processSync",this.parser||this.Parser),LN("processSync",this.compiler||this.Compiler),this.process(e,(function(e,r){n=!0,yN(e),t=r})),GN("processSync","process",n),t}run(e,t,n){zN(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const a=HN(t);r.run(e,a,(function(t,r,a){const s=r||e;t?i(t):o?o(s):n(void 0,s,a)}))}}runSync(e,t){let n,r=!1;return this.run(e,t,(function(e,t){yN(e),n=t,r=!0})),GN("runSync","run",r),n}stringify(e,t){this.freeze();const n=HN(t),r=this.compiler||this.Compiler;return LN("stringify",r),zN(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(VN("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?a(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=xN(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const a=n[o][1];CN(a)&&CN(r)&&(r=xN(!0,a,r)),n[o]=[e,r,...i]}}}}const jN=(new BN).freeze();function FN(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function LN(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function VN(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zN(e){if(!CN(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function GN(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function HN(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new RN(e)}const WN=[],XN={allowDangerousHtml:!0},ZN=/^(https?|ircs?|mailto|xmpp)$/i,$N=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function YN(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,a=e.disallowedElements,s=e.rehypePlugins||WN,l=e.remarkPlugins||WN,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...XN}:XN,u=e.skipHtml,d=e.unwrapDisallowed,p=e.urlTransform||UN,f=jN().use(BA).use(l).use(gN,c).use(s),h=new RN;"string"==typeof r&&(h.value=r);for(const t of $N)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const m=f.parse(h);let g=f.runSync(m,h);return o&&(g={type:"element",tagName:"div",properties:{className:o},children:"root"===g.type?g.children:[g]}),sN(g,(function(e,r,o){if("raw"===e.type&&o&&"number"==typeof r)return u?o.children.splice(r,1):o.children[r]={type:"text",value:e.value},r;if("element"===e.type){let t;for(t in VI)if(Object.hasOwn(VI,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=VI[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=p(String(n||""),t,e))}}if("element"===e.type){let i=t?!t.includes(e.tagName):!!a&&a.includes(e.tagName);if(!i&&n&&"number"==typeof r&&(i=!n(e,r,o)),i&&o&&"number"==typeof r)return d&&e.children?o.children.splice(r,1,...e.children):o.children.splice(r,1),r}})),NI(g,{Fragment:Lu.Fragment,components:i,ignoreInvalidStyle:!0,jsx:Lu.jsx,jsxs:Lu.jsxs,passKeys:!0,passNode:!0})}function UN(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||ZN.test(e.slice(0,t))?e:""}function JN(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;-1!==o;)r++,o=n.indexOf(t,o+t.length);return r}function KN(e,t,n){const r=eN((n||{}).ignore||[]),o=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([QN(e[0]),qN(e[1])])}return t}(t);let i=-1;for(;++i<o.length;)aN(e,"text",a);function a(e,t){let n,a=-1;for(;++a<t.length;){const e=t[a],o=n?n.children:void 0;if(r(e,o?o.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=o[i][0],a=o[i][1];let s=0;const l=n.children.indexOf(e);let c=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){const n=d.index,o={index:d.index,input:d.input,stack:[...t,e]};let i=a(...d,o);if("string"==typeof i&&(i=i.length>0?{type:"text",value:i}:void 0),!1===i?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(i)?u.push(...i):i&&u.push(i),s=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}c?(s<e.value.length&&u.push({type:"text",value:e.value.slice(s)}),n.children.splice(l,1,...u)):u=[e];return l+u.length}(e,t)}}function QN(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function qN(e){return"function"==typeof e?e:function(){return e}}const eR="phrasing",tR=["autolink","link","image","label"];function nR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rR(e){this.config.enter.autolinkProtocol.call(this,e)}function oR(e){this.config.exit.autolinkProtocol.call(this,e)}function iR(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function aR(e){this.config.exit.autolinkEmail.call(this,e)}function sR(e){this.exit(e)}function lR(e){KN(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cR],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,uR]],{ignore:["link","linkReference"]})}function cR(e,t,n,r,o){let i="";if(!dR(o))return!1;if(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const a=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=JN(e,"(");let i=JN(e,")");for(;-1!==r&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}(n+r);if(!a[0])return!1;const s={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function uR(e,t,n,r){return!(!dR(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function dR(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||p_(n)||d_(n))&&(!t||47!==n)}function pR(){this.buffer()}function fR(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function hR(){this.buffer()}function mR(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=e_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yR(e){this.exit(e)}function bR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=e_(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vR(e){this.exit(e)}function wR(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const a=n.enter("footnoteReference"),s=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),a(),i+=o.move("]"),i}function xR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,o){const i=r.createTracker(o);let a=i.move("[^");const s=r.enter("footnoteDefinition"),l=r.enter("label");a+=i.move(r.safe(r.associationId(e),{before:a,after:"]"})),l(),a+=i.move("]:"),e.children&&e.children.length>0&&(i.shift(4),a+=i.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,i.current()),t?ER:CR)));return s(),a},footnoteReference:wR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function CR(e,t,n){return 0===t?e:ER(e,t,n)}function ER(e,t,n){return(n?"":" ")+e}wR.peek=function(){return"["};const kR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function SR(e){this.enter({type:"delete",children:[]},e)}function IR(e){this.exit(e)}function _R(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let a=o.move("~~");return a+=n.containerPhrasing(e,{...o.current(),before:a,after:"~"}),a+=o.move("~~"),i(),a}function AR(e){return e.length}function NR(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function RR(e,t,n){return">"+(n?"":" ")+e}function OR(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function TR(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if("\n"===n.unsafe[o].character&&(i=n.stack,a=n.unsafe[o],OR(i,a.inConstruct,!0)&&!OR(i,a.notInConstruct,!1)))return/[ \t]/.test(r.before)?"":" ";var i,a;return"\\\n"}function MR(e,t,n){return(n?"":" ")+e}function PR(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function DR(e){return"&#x"+e.toString(16).toUpperCase()+";"}function BR(e,t,n){const r=v_(e),o=v_(t);return void 0===r?void 0===o?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function jR(e,t,n,r){const o=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),i=n.enter("emphasis"),a=n.createTracker(r),s=a.move(o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=BR(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=DR(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=BR(r.after.charCodeAt(0),d,o);p.inside&&(l=l.slice(0,-1)+DR(d));const f=a.move(o);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+f}function FR(e){return e.value||""}function LR(e,t,n,r){const o=PR(n),i='"'===o?"Quote":"Apostrophe",a=n.enter("image");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),c+=l.move(")"),a(),c}function VR(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("![");const c=n.safe(e.alt,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function zR(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=n.compilePattern(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}function GR(e,t){const n=GI(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function HR(e,t,n,r){const o=PR(n),i='"'===o?"Quote":"Apostrophe",a=n.createTracker(r);let s,l;if(GR(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=a.move("<");return r+=a.move(n.containerPhrasing(e,{before:r,after:">",...a.current()})),r+=a.move(">"),s(),n.stack=t,r}s=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${i}`),c+=a.move(" "+o),c+=a.move(n.safe(e.title,{before:c,after:o,...a.current()})),c+=a.move(o),l()),c+=a.move(")"),s(),c}function WR(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let a=n.enter("label");const s=n.createTracker(r);let l=s.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...s.current()});l+=s.move(c+"]["),a();const u=n.stack;n.stack=[],a=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...s.current()});return a(),n.stack=u,i(),"full"!==o&&c&&c===d?"shortcut"===o?l=l.slice(0,-1):l+=s.move("]"):l+=s.move(d+"]"),l}function XR(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function ZR(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}_R.peek=function(){return"~"},jR.peek=function(e,t,n){return n.options.emphasis||"*"},FR.peek=function(){return"<"},LR.peek=function(){return"!"},VR.peek=function(){return"!"},zR.peek=function(){return"`"},HR.peek=function(e,t,n){return GR(e,n)?"<":"["},WR.peek=function(){return"["};const $R=eN(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function YR(e,t,n,r){const o=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),i=n.enter("strong"),a=n.createTracker(r),s=a.move(o+o);let l=a.move(n.containerPhrasing(e,{after:o,before:s,...a.current()}));const c=l.charCodeAt(0),u=BR(r.before.charCodeAt(r.before.length-1),c,o);u.inside&&(l=DR(c)+l.slice(1));const d=l.charCodeAt(l.length-1),p=BR(r.after.charCodeAt(0),d,o);p.inside&&(l=l.slice(0,-1)+DR(d));const f=a.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:u.outside},s+l+f}YR.peek=function(e,t,n){return n.options.strong||"*"};const UR={blockquote:function(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(e,i.current()),RR);return o(),a},break:TR,code:function(e,t,n,r){const o=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),i=e.value||"",a="`"===o?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(i,MR);return e(),t}const s=n.createTracker(r),l=o.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,a=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===o?++i>a&&(a=i):i=1,o=r+t.length,r=n.indexOf(t,o);return a}(i,o)+1,3)),c=n.enter("codeFenced");let u=s.move(l);if(e.lang){const t=n.enter(`codeFencedLang${a}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${a}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),i&&(u+=s.move(i+"\n")),u+=s.move(l),c(),u},definition:function(e,t,n,r){const o=PR(n),i='"'===o?"Quote":"Apostrophe",a=n.enter("definition");let s=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(s=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...l.current()}))),s(),e.title&&(s=n.enter(`title${i}`),c+=l.move(" "+o),c+=l.move(n.safe(e.title,{before:c,after:o,...l.current()})),c+=l.move(o),s()),a(),c},emphasis:jR,hardBreak:TR,heading:function(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(function(e,t){let n=!1;return sN(e,(function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,iN})),Boolean((!e.depth||e.depth<3)&&GI(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),a=n.containerPhrasing(e,{...i.current(),before:"\n",after:"\n"});return r(),t(),a+"\n"+(1===o?"=":"-").repeat(a.length-(Math.max(a.lastIndexOf("\r"),a.lastIndexOf("\n"))+1))}const a="#".repeat(o),s=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...i.current()});return/^[\t ]/.test(c)&&(c=DR(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),s(),c},html:FR,image:LR,imageReference:VR,inlineCode:zR,link:HR,linkReference:WR,list:function(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let a=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):XR(n);const s=e.ordered?"."===a?")":".":function(e){const t=XR(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let l=!(!t||!n.bulletLastUsed)&&a===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==a&&"-"!==a||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(l=!0),ZR(n)===a&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){l=!0;break}}}}l&&(a=s),n.bulletCurrent=a;const c=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=i,o(),c},listItem:function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||XR(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let a=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(a=4*Math.ceil(a/4));const s=n.createTracker(r);s.move(i+" ".repeat(a-i.length)),s.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),(function(e,t,n){if(t)return(n?"":" ".repeat(a))+e;return(n?i:i+" ".repeat(a-i.length))+e}));return l(),c},paragraph:function(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(e,r);return i(),o(),a},root:function(e,t,n,r){return(e.children.some((function(e){return $R(e)}))?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:YR,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(ZR(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function JR(e){const t=e._align;this.enter({type:"table",align:t.map((function(e){return"none"===e?null:e})),children:[]},e),this.data.inTable=!0}function KR(e){this.exit(e),this.data.inTable=void 0}function QR(e){this.enter({type:"tableRow",children:[]},e)}function qR(e){this.exit(e)}function eO(e){this.enter({type:"tableCell",children:[]},e)}function tO(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,nO));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function nO(e,t){return"|"===t?t:e}function rO(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=UR.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let o=-1;const i=[],a=t.enter("table");for(;++o<r.length;)i[o]=l(r[o],t,n);return a(),i}(e,n,r),e.align)},tableCell:a,tableRow:function(e,t,n,r){const o=l(e,n,r),i=s([o]);return i.slice(0,i.indexOf("\n"))}}};function a(e,t,n,r){const o=n.enter("tableCell"),a=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:i,after:i});return a(),o(),s}function s(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||AR,i=[],a=[],s=[],l=[];let c=0,u=-1;for(;++u<e.length;){const t=[],r=[];let i=-1;for(e[u].length>c&&(c=e[u].length);++i<e[u].length;){const a=null==(d=e[u][i])?"":String(d);if(!1!==n.alignDelimiters){const e=o(a);r[i]=e,(void 0===l[i]||e>l[i])&&(l[i]=e)}t.push(a)}a[u]=t,s[u]=r}var d;let p=-1;if("object"==typeof r&&"length"in r)for(;++p<c;)i[p]=NR(r[p]);else{const e=NR(r);for(;++p<c;)i[p]=e}p=-1;const f=[],h=[];for(;++p<c;){const e=i[p];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let o=!1===n.alignDelimiters?1:Math.max(1,l[p]-t.length-r.length);const a=t+"-".repeat(o)+r;!1!==n.alignDelimiters&&(o=t.length+o+r.length,o>l[p]&&(l[p]=o),h[p]=o),f[p]=a}a.splice(1,0,f),s.splice(1,0,h),u=-1;const m=[];for(;++u<a.length;){const e=a[u],t=s[u];p=-1;const r=[];for(;++p<c;){const o=e[p]||"";let a="",s="";if(!1!==n.alignDelimiters){const e=l[p]-(t[p]||0),n=i[p];114===n?a=" ".repeat(e):99===n?e%2?(a=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):(a=" ".repeat(e/2),s=a):s=" ".repeat(e)}!1===n.delimiterStart||p||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===o||!1===n.delimiterStart&&!p||r.push(" "),!1!==n.alignDelimiters&&r.push(a),r.push(o),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&p===c-1||r.push("|")}m.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return m.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:o})}function l(e,t,n){const r=e.children;let o=-1;const i=[],s=t.enter("tableRow");for(;++o<r.length;)i[o]=a(r[o],0,t,n);return s(),i}}function oO(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function iO(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let o,i=-1;for(;++i<r.length;){const e=r[i];if("paragraph"===e.type){o=e;break}}o===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function aO(e,t,n,r){const o=e.children[0],i="boolean"==typeof e.checked&&o&&"paragraph"===o.type,a="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);i&&s.move(a);let l=UR.listItem(e,t,n,{...r,...s.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,(function(e){return e+a}))),l}const sO={tokenize:function(e,t,n){let r=0;return function t(i){if((87===i||119===i)&&r<3)return r++,e.consume(i),t;if(46===i&&3===r)return e.consume(i),o;return n(i)};function o(e){return null===e?n(e):t(e)}},partial:!0},lO={tokenize:function(e,t,n){let r,o,i;return a;function a(t){return 46===t||95===t?e.check(uO,l,s)(t):null===t||c_(t)||p_(t)||45!==t&&d_(t)?l(t):(i=!0,e.consume(t),a)}function s(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),a}function l(e){return o||r||!i?n(e):t(e)}},partial:!0},cO={tokenize:function(e,t){let n=0,r=0;return o;function o(a){return 40===a?(n++,e.consume(a),o):41===a&&r<n?i(a):33===a||34===a||38===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||60===a||63===a||93===a||95===a||126===a?e.check(uO,t,i)(a):null===a||c_(a)||p_(a)?t(a):(e.consume(a),o)}function i(t){return 41===t&&r++,e.consume(t),o}},partial:!0},uO={tokenize:function(e,t,n){return r;function r(a){return 33===a||34===a||39===a||41===a||42===a||44===a||46===a||58===a||59===a||63===a||95===a||126===a?(e.consume(a),r):38===a?(e.consume(a),i):93===a?(e.consume(a),o):60===a||null===a||c_(a)||p_(a)?t(a):n(a)}function o(e){return null===e||40===e||91===e||c_(e)||p_(e)?t(e):r(e)}function i(e){return t_(e)?a(e):n(e)}function a(t){return 59===t?(e.consume(t),r):t_(t)?(e.consume(t),a):n(t)}},partial:!0},dO={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return n_(e)?n(e):t(e)}},partial:!0},pO={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!yO.call(r,r.previous)||xO(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(sO,e.attempt(lO,e.attempt(cO,o),n),n)(t)};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:yO},fO={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let o="",i=!1;return function(t){if((72===t||104===t)&&bO.call(r,r.previous)&&!xO(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),a;return n(t)};function a(t){if(t_(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),a;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),i?l:(i=!0,s)):n(t)}function l(t){return null===t||o_(t)||c_(t)||p_(t)||d_(t)?n(t):e.attempt(lO,e.attempt(cO,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:bO},hO={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let o,i;return function(t){if(!wO(t)||!vO.call(r,r.previous)||xO(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(t)};function a(t){return wO(t)?(e.consume(t),a):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(dO,c,l)(t):45===t||95===t||n_(t)?(i=!0,e.consume(t),s):c(t)}function l(t){return e.consume(t),o=!0,s}function c(a){return i&&o&&t_(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(a)):n(a)}},previous:vO},mO={};let gO=48;for(;gO<123;)mO[gO]=hO,gO++,58===gO?gO=65:91===gO&&(gO=97);function yO(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||c_(e)}function bO(e){return!t_(e)}function vO(e){return!(47===e||wO(e))}function wO(e){return 43===e||45===e||46===e||95===e||n_(e)}function xO(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}mO[43]=hO,mO[45]=hO,mO[46]=hO,mO[95]=hO,mO[72]=[hO,fO],mO[104]=[hO,fO],mO[87]=[hO,pO],mO[119]=[hO,pO];const CO={tokenize:function(e,t,n){const r=this;return m_(e,(function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function EO(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){a=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!a||!a._balanced)return n(o);const s=e_(r.sliceSerialize({start:a.end,end:r.now()}));if(94!==s.codePointAt(0)||!i.includes(s.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function kO(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function SO(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(s){if(a>999||93===s&&!i||null===s||91===s||c_(s))return n(s);if(93===s){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes(e_(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return c_(s)||(i=!0),a++,e.consume(s),92===s?c:l}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,l):l(t)}}function IO(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!a||null===t||91===t||c_(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=e_(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return c_(t)||(a=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),m_(e,p,"gfmFootnoteDefinitionWhitespace")):n(t)}function p(e){return t(e)}}function _O(e,t,n){return e.check(k_,t,e.attempt(CO,t,n))}function AO(e){e.exit("gfmFootnoteDefinition")}function NO(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const o=this.previous,i=this.events;let a=0;return function(t){if(126===o&&"characterEscape"!==i[i.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(i){const l=v_(o);if(126===i)return a>1?r(i):(e.consume(i),a++,s);if(a<2&&!t)return r(i);const c=e.exit("strikethroughSequenceTemporary"),u=v_(i);return c._open=!u||2===u&&Boolean(l),c._close=!l||2===l&&Boolean(u),n(i)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const o={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a=[["enter",o,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],s=t.parser.constructs.insideSpan.null;s&&$I(a,a.length,0,w_(s,e.slice(r+1,n),t)),$I(a,a.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",o,t]]),$I(e,r-1,n-r+3,a),n=r+a.length-2;break}}n=-1;for(;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class RO{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let o=0;if(0===n&&0===r.length)return;for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}(this,e,t,n)}consume(e){if(this.map.sort((function(e,t){return e[0]-t[0]})),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function OO(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}function TO(e,t,n){const r=this;let o,i=0,a=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?w:s;if(i===w&&r.parser.lazy[r.now().line])return n(e);return i(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return l(e);return o=!0,a+=1,l(e)}(t)}function l(t){return null===t?n(t):l_(t)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):u_(t)?m_(e,l,"whitespace")(t):(a+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,l):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||c_(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,u_(t)?m_(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):p(t))}function p(t){return 45===t||58===t?h(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):v(t)}function f(t){return u_(t)?m_(e,h,"whitespace")(t):h(t)}function h(t){return 58===t?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(a+=1,m(t)):null===t||l_(t)?b(t):v(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):v(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return u_(t)?m_(e,b,"whitespace")(t):b(t)}function b(n){return 124===n?p(n):(null===n||l_(n))&&o&&i===a?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):v(n)}function v(e){return n(e)}function w(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||l_(n)?(e.exit("tableRow"),t(n)):u_(n)?m_(e,x,"whitespace")(n):(e.enter("data"),C(n))}function C(t){return null===t||124===t||c_(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?E:C)}function E(t){return 92===t||124===t?(e.consume(t),C):C(t)}}function MO(e,t){let n,r,o,i=-1,a=!0,s=0,l=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const p=new RO;for(;++i<e.length;){const f=e[i],h=f[1];"enter"===f[0]?"tableHead"===h.type?(u=!1,0!==d&&(DO(p,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(i,0,[["enter",n,t]])):"tableRow"===h.type||"tableDelimiterRow"===h.type?(a=!0,o=void 0,l=[0,0,0,0],c=[0,i+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},h.start),end:Object.assign({},h.end)},p.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===h.type?2:r?3:1):!s||"data"!==h.type&&"tableDelimiterMarker"!==h.type&&"tableDelimiterFiller"!==h.type?"tableCellDivider"===h.type&&(a?a=!1:(0!==l[1]&&(c[0]=c[1],o=PO(p,t,l,s,void 0,o)),l=c,c=[l[1],i,0,0])):(a=!1,0===c[2]&&(0!==l[1]&&(c[0]=c[1],o=PO(p,t,l,s,void 0,o),l=[0,0,0,0]),c[2]=i)):"tableHead"===h.type?(u=!0,d=i):"tableRow"===h.type||"tableDelimiterRow"===h.type?(d=i,0!==l[1]?(c[0]=c[1],o=PO(p,t,l,s,i,o)):0!==c[1]&&(o=PO(p,t,c,s,i,o)),s=0):!s||"data"!==h.type&&"tableDelimiterMarker"!==h.type&&"tableDelimiterFiller"!==h.type||(c[3]=i)}for(0!==d&&DO(p,t,d,n,r),p.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=OO(t.events,i))}return e}function PO(e,t,n,r,o,i){const a=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},BO(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const s=BO(t.events,n[1]);if(i={type:a,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=BO(t.events,n[2]),i=BO(t.events,n[3]),a={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",a,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",a,t]])}return void 0!==o&&(i.end=Object.assign({},BO(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function DO(e,t,n,r,o){const i=[],a=BO(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function BO(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const jO={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o};function o(t){return c_(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(t)}function a(r){return l_(r)?t(r):u_(r)?e.check({tokenize:FO},t,n)(r):n(r)}}};function FO(e,t,n){return m_(e,(function(e){return null===e?n(e):t(e)}),"whitespace")}const LO={};function VO(e){const t=e||LO,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return JI([{text:mO},{document:{91:{name:"gfmFootnoteDefinition",tokenize:IO,continuation:{tokenize:_O},exit:AO}},text:{91:{name:"gfmFootnoteCall",tokenize:SO},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:EO,resolveTo:kO}}},NO(e),{flow:{null:{name:"table",tokenize:TO,resolveAll:MO}}},{text:{91:jO}}])}(t)),o.push([{transforms:[lR],enter:{literalAutolink:nR,literalAutolinkEmail:rR,literalAutolinkHttp:rR,literalAutolinkWww:rR},exit:{literalAutolink:sR,literalAutolinkEmail:aR,literalAutolinkHttp:oR,literalAutolinkWww:iR}},{enter:{gfmFootnoteCallString:pR,gfmFootnoteCall:fR,gfmFootnoteDefinitionLabelString:hR,gfmFootnoteDefinition:mR},exit:{gfmFootnoteCallString:gR,gfmFootnoteCall:yR,gfmFootnoteDefinitionLabelString:bR,gfmFootnoteDefinition:vR}},{canContainEols:["delete"],enter:{strikethrough:SR},exit:{strikethrough:IR}},{enter:{table:JR,tableData:eO,tableHeader:eO,tableRow:QR},exit:{codeText:tO,table:KR,tableData:qR,tableHeader:qR,tableRow:qR}},{exit:{taskListCheckValueChecked:oO,taskListCheckValueUnchecked:oO,paragraph:iO}}]),i.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:eR,notInConstruct:tR},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:eR,notInConstruct:tR},{character:":",before:"[ps]",after:"\\/",inConstruct:eR,notInConstruct:tR}]},xR(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:kR}],handlers:{delete:_R}},rO(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:aO}}]}}(t))}const zO=({item:t})=>{const n=e.useContext(sF);return o.createElement("div",{className:"libnodeentry",onClick:e=>{2===e.detail&&n.worker?.add_node(t.node_id)},title:t.description},t.node_name||t.node_id)},GO=(e,t)=>{const n=e.nodes?.some((e=>e.node_id.toLowerCase().includes(t.toLowerCase())))??!1,r=e.subshelves?.some((e=>GO(e,t)))??!1;return n||r},HO=({item:t,filter:n,parentkey:r})=>{const[i,a]=e.useState(!1),s=t.nodes?.filter((e=>e.node_id.toLowerCase().includes(n.toLowerCase()))),l=i||n.length>0;return GO(t,n)?o.createElement("div",{className:"shelfcontainer"},o.createElement("div",{className:"shelftitle",onClick:()=>a(!i),style:{cursor:"pointer"},title:t.description},o.createElement("div",{className:"shelftitle_text"},t.name),o.createElement("div",{className:"expandicon "+(l?"open":"close")},o.createElement(jv,null))),o.createElement("div",{className:"libnodecontainer "+(l?"open":"close")},o.createElement("div",{className:"libnodecontainer_inner"},s&&o.createElement(o.Fragment,null,s.map((e=>o.createElement(zO,{key:e.node_id,item:e})))),t.subshelves&&o.createElement(o.Fragment,null,t.subshelves.map((e=>o.createElement(HO,{key:r+e.name,item:e,filter:n,parentkey:r+e.name})))))),o.createElement("hr",null)):o.createElement(o.Fragment,null)},WO=({filter:e,setFilter:t})=>o.createElement("div",{className:"libfilter"},o.createElement($w,{fontSize:"inherit"}),o.createElement("input",{type:"text",placeholder:"Filter",value:e,onChange:e=>{t(e.target.value)}}),e&&o.createElement(Zw,{fontSize:"inherit",onClick:()=>{t("")}})),XO=({availableModule:e})=>o.createElement("div",{className:"module-links"},e.homepage&&o.createElement(o.Fragment,null,o.createElement("a",{href:e.homepage,target:"_blank",rel:"noopener noreferrer"},"Homepage")),e.source&&e.homepage&&" | ",e.source&&o.createElement(o.Fragment,null,o.createElement("a",{href:e.source,target:"_blank",rel:"noopener noreferrer"},"Source"))),ZO=({availableModule:t})=>{const[n,r]=e.useState(!1),i=t.description.length>150?t.description.substring(0,150)+"...":t.description;return o.createElement("div",{className:"module-description"},o.createElement(YN,{remarkPlugins:[VO]},n?t.description.replace(/\\n/g," \n"):i.replace(/\\n/g," \n")),t.description.length>150&&o.createElement("button",{onClick:()=>r(!n),className:"toggle-description"},n?"Show less":"Show more"))},$O=({availableModule:t,on_change:n})=>{const[r,i]=e.useState(t.version||"latest"),[a,s]=e.useState(">=");return t.releases&&!t.releases.includes(r)&&t.releases.unshift(r),o.createElement(o.Fragment,null,o.createElement("select",{value:a,onChange:e=>{s(e.target.value),"latest"!==r&&n(e.target.value+r)}},o.createElement("option",{value:">="},">="),o.createElement("option",{value:"=="},"=="),o.createElement("option",{value:"<="},"<=")),o.createElement("select",{onChange:e=>{const t=e.target.value;i(t),n("latest"!==t?a+t:t)},value:r},t.releases&&t.releases.map((e=>o.createElement("option",{key:e,value:e},e)))))},YO=({availableModule:t,on_remove:n,on_update:r})=>{const[i,a]=e.useState(t.version||"latest");return o.createElement("div",{className:"addable-module"},o.createElement("div",{className:"module-name"},t.name+(t.version?` (${t.version})`:"")),o.createElement(XO,{availableModule:t}),o.createElement(ZO,{availableModule:t}),o.createElement("div",null,o.createElement($O,{availableModule:t,on_change:a}),o.createElement("button",{className:"update-button",disabled:i===t.version,onClick:()=>{r(t,i)}},"Update"),o.createElement("button",{className:"remove-button",onClick:()=>{n(t)}},"Remove")))},UO=({availableModule:t,on_add:n})=>{const[r,i]=e.useState(t.version||"latest");return o.createElement("div",{className:"addable-module"},o.createElement("div",{className:"module-name"},t.name+(t.version?` (${t.version})`:"")),o.createElement(XO,{availableModule:t}),o.createElement(ZO,{availableModule:t}),o.createElement("div",null,o.createElement($O,{availableModule:t,on_change:i}),o.createElement("button",{className:"add-button",onClick:()=>{n(t,r)}},"Add")))},JO=({availableModule:t,on_add:n})=>{const[r,i]=e.useState(t.version||"latest");return o.createElement("div",{className:"addable-module"},o.createElement("div",{className:"module-name"},t.name),o.createElement(XO,{availableModule:t}),o.createElement(ZO,{availableModule:t}),o.createElement("div",null,o.createElement($O,{availableModule:t,on_change:i}),o.createElement("button",{className:"add-button",onClick:()=>{n(t,r)}},"Add")))},KO=({children:t})=>{const[n,r]=e.useState(""),i=e.useContext(sF),[a,s]=e.useState(!0),[l,c]=e.useState(!0),[u,d]=e.useState(!0),[p,f]=e.useState({installed:[],available:[],active:[]}),[h,m]=e.useState(!1);if(!i.worker)return o.createElement(o.Fragment,null);const g=(e,t)=>{m(!1),void 0!==i.worker&&i.worker.add_lib(e.name,t)},y=(e,t)=>{m(!1),void 0!==i.worker&&i.worker.add_lib(e.name,t)},b=e=>{m(!1),void 0!==i.worker&&i.worker.remove_lib(e.name)},v=(e,t)=>{m(!1),void 0!==i.worker&&i.worker.add_lib(e.name,t)},w=e=>e.filter((e=>e.name.toLowerCase().includes(n.toLowerCase())||e.description.toLowerCase().includes(n.toLowerCase()))),x=w(p.available),C=w(p.installed),E=w(p.active);return o.createElement(Kw,{title:"Manage Library",trigger:t,description:"Add or remove libraries to the current worker.",onOpenChange:e=>{e&&void 0!==i.worker&&i.worker.is_open&&i.worker.get_available_modules().then((e=>{f(e)}))},open:h,setOpen:m},o.createElement("input",{className:"filter-input styledinput",type:"text",placeholder:"Filter modules...",value:n,onChange:e=>r(e.target.value)}),o.createElement("div",{className:"packagelist",style:{maxHeight:"70%",overflow:"auto"}},C.length>0&&o.createElement("h3",{onClick:()=>{d(!u)}},"Installed"),u&&C.map((e=>o.createElement(UO,{key:e.name+e.source,availableModule:e,on_add:g}))),x.length>0&&o.createElement("h3",{onClick:()=>{c(!l)}},"Available"),l&&x.map((e=>o.createElement(JO,{key:e.name+e.source,availableModule:e,on_add:y}))),E.length>0&&o.createElement("h3",{onClick:()=>{s(!a)}},"Active"),a&&E.map((e=>o.createElement(YO,{key:e.name+e.source,availableModule:e,on_remove:b,on_update:v})))))},QO=({ins:t})=>{const[n,r]=e.useState(t.name),i=e.useContext(sF);return o.createElement(o.Fragment,null,o.createElement(Kw,{title:t.name,description:"Settings for"+t.name,trigger:o.createElement("div",null,"Settings"),buttons:[{text:"Save",onClick:()=>{i.worker&&(i.worker.update_external_worker(t.uuid,t.nodeclassid,{name:n}),t.name=n)},close:!0},{text:"Delete",onClick:()=>{i.worker&&i.worker.remove_external_worker(t.uuid,t.nodeclassid)},close:!0}]},o.createElement("div",null,o.createElement("div",null,o.createElement("label",{htmlFor:"name"},"Name: "),o.createElement("input",{type:"text",name:"name",value:n,onChange:e=>r(e.target.value),className:"styledinput"})))))},qO=({ins:t,lib:n,filter:r="",parentkey:i})=>{const[a,s]=e.useState(!1),l=n?.nodes?.filter((e=>e.node_id.toLowerCase().includes(r.toLowerCase())));return o.createElement("div",{className:"shelfcontainer"},o.createElement("div",{className:"shelftitle",onClick:()=>s(!a),style:{cursor:"pointer"},title:t.name},o.createElement("div",{className:"shelftitle_text"},t.name),o.createElement("div",{className:"expandicon "+(a?"open":"close")},o.createElement(jv,null))),o.createElement("div",{className:"libnodecontainer "+(a?"open":"close")},o.createElement("div",{className:"libnodecontainer_inner"},a&&o.createElement(o.Fragment,null,o.createElement("div",{className:"libnodeentry",title:t.uuid},o.createElement(QO,{ins:t})),n&&o.createElement(o.Fragment,null,l&&o.createElement(o.Fragment,null,l.map((e=>o.createElement(zO,{key:e.node_id,item:e})))),n.subshelves.map((e=>o.createElement(HO,{key:i+e.name,item:e,filter:r,parentkey:i+e.name}))))))))},eT=({item:t,mod:n,lib:r})=>{const i=e.useContext(sF),[a,s]=e.useState(!1),l=t.name||t.module+"."+t.class_name;return o.createElement("div",{className:"shelfcontainer"},o.createElement("div",{className:"shelftitle",onClick:()=>s(!a),style:{cursor:"pointer"},title:l},o.createElement("div",{className:"shelftitle_text"},l),o.createElement("div",{className:"expandicon "+(a?"open":"close")},o.createElement(jv,null))),o.createElement("div",{className:"libnodecontainer "+(a?"open":"close")},o.createElement("div",{className:"libnodecontainer_inner"},a&&o.createElement(o.Fragment,null,o.createElement("div",{className:"libnodeentry",onClick:e=>{2===e.detail&&i.worker?.add_external_worker({module:n,cls_module:t.module,cls_name:t.class_name})},title:t.name},"New Instance"),t.instances.map((e=>o.createElement(qO,{key:e.uuid,ins:e,lib:r?.subshelves.find((t=>t.name===e.uuid)),parentkey:e.uuid})))))))},tT=({externalworkermod:t,lib:n})=>{const[r,i]=e.useState(!1),a=r;return o.createElement("div",{className:"shelfcontainer"},o.createElement("div",{className:"shelftitle",onClick:()=>i(!r),style:{cursor:"pointer"},title:t.module},o.createElement("div",{className:"shelftitle_text"},t.module),o.createElement("div",{className:"expandicon "+(a?"open":"close")},o.createElement(jv,null))),o.createElement("div",{className:"libnodecontainer "+(a?"open":"close")},o.createElement("div",{className:"libnodecontainer_inner"},t.worker_classes.map((e=>o.createElement(eT,{key:e.module+e.class_name,item:e,mod:t.module,lib:n}))))),o.createElement("hr",null))},nT=()=>{const t=e.useContext(sF),n=t.lib.libstate(),[r,i]=e.useState(""),a=t.worker?.state((e=>e.is_open))??!1;return o.createElement("div",{className:"libcontainer"},o.createElement("div",{className:"library"},o.createElement("div",{className:"libtitle"},"Lib"),o.createElement("hr",{className:"hr_prominent"}),o.createElement(WO,{filter:r,setFilter:i}),o.createElement("div",{className:"vscrollcontainer"},n.lib.shelves.map((e=>"_external_worker"==e.name?o.createElement(o.Fragment,null):o.createElement(HO,{key:e.name,item:e,filter:r,parentkey:e.name})))),o.createElement("hr",null),o.createElement("div",{className:"libtitle"},"External Worker"),o.createElement("hr",{className:"hr_prominent"}),o.createElement("div",{className:"vscrollcontainer"},n.external_worker?.map((e=>o.createElement(tT,{key:e.module,externalworkermod:e,lib:n.lib.shelves.find((e=>"_external_worker"===e.name))})))),o.createElement("hr",null)),o.createElement("div",{style:{paddingTop:"0.5rem"}}),a&&o.createElement("div",{className:"addlib"},o.createElement(KO,null,o.createElement("button",null,"Manage Libraries"))))};const{useRef:rT}=e;function oT(e){const t=rT();return n=>{const r=e(n);return function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[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(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}(t.current,r)?t.current:t.current=r}}var iT=o.forwardRef(((e,t)=>Lu.jsx(Qu.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));iT.displayName="VisuallyHidden";var aT=iT,[sT,lT]=Vu("Tooltip",[PC]),cT=PC(),uT="TooltipProvider",dT=700,pT="tooltip.open",[fT,hT]=sT(uT),mT=e=>{const{__scopeTooltip:t,delayDuration:n=dT,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,[s,l]=o.useState(!0),c=o.useRef(!1),u=o.useRef(0);return o.useEffect((()=>{const e=u.current;return()=>window.clearTimeout(e)}),[]),Lu.jsx(fT,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:o.useCallback((()=>{window.clearTimeout(u.current),l(!1)}),[]),onClose:o.useCallback((()=>{window.clearTimeout(u.current),u.current=window.setTimeout((()=>l(!0)),r)}),[r]),isPointerInTransitRef:c,onPointerInTransitChange:o.useCallback((e=>{c.current=e}),[]),disableHoverableContent:i,children:a})};mT.displayName=uT;var gT="Tooltip",[yT,bT]=sT(gT),vT=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:a,disableHoverableContent:s,delayDuration:l}=e,c=hT(gT,e.__scopeTooltip),u=cT(t),[d,p]=o.useState(null),f=Xu(),h=o.useRef(0),m=s??c.disableHoverableContent,g=l??c.delayDuration,y=o.useRef(!1),[b=!1,v]=$u({prop:r,defaultProp:i,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(pT))):c.onClose(),a?.(e)}}),w=o.useMemo((()=>b?y.current?"delayed-open":"instant-open":"closed"),[b]),x=o.useCallback((()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,v(!0)}),[v]),C=o.useCallback((()=>{window.clearTimeout(h.current),h.current=0,v(!1)}),[v]),E=o.useCallback((()=>{window.clearTimeout(h.current),h.current=window.setTimeout((()=>{y.current=!0,v(!0),h.current=0}),g)}),[g,v]);return o.useEffect((()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)}),[]),Lu.jsx(JC,{...u,children:Lu.jsx(yT,{scope:t,contentId:f,open:b,stateAttribute:w,trigger:d,onTriggerChange:p,onTriggerEnter:o.useCallback((()=>{c.isOpenDelayed?E():x()}),[c.isOpenDelayed,E,x]),onTriggerLeave:o.useCallback((()=>{m?C():(window.clearTimeout(h.current),h.current=0)}),[C,m]),onOpen:x,onClose:C,disableHoverableContent:m,children:n})})};vT.displayName=gT;var wT="TooltipTrigger",xT=o.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,i=bT(wT,n),a=hT(wT,n),s=cT(n),l=Ou(t,o.useRef(null),i.onTriggerChange),c=o.useRef(!1),u=o.useRef(!1),d=o.useCallback((()=>c.current=!1),[]);return o.useEffect((()=>()=>document.removeEventListener("pointerup",d)),[d]),Lu.jsx(KC,{asChild:!0,...s,children:Lu.jsx(Qu.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Au(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(u.current||a.isPointerInTransitRef.current||(i.onTriggerEnter(),u.current=!0))})),onPointerLeave:Au(e.onPointerLeave,(()=>{i.onTriggerLeave(),u.current=!1})),onPointerDown:Au(e.onPointerDown,(()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})})),onFocus:Au(e.onFocus,(()=>{c.current||i.onOpen()})),onBlur:Au(e.onBlur,i.onClose),onClick:Au(e.onClick,i.onClose)})})}));xT.displayName=wT;var CT="TooltipPortal",[ET,kT]=sT(CT,{forceMount:void 0}),ST=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=bT(CT,t);return Lu.jsx(ET,{scope:t,forceMount:n,children:Lu.jsx(wd,{present:n||i.open,children:Lu.jsx(vd,{asChild:!0,container:o,children:r})})})};ST.displayName=CT;var IT="TooltipContent",_T=o.forwardRef(((e,t)=>{const n=kT(IT,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=bT(IT,e.__scopeTooltip);return Lu.jsx(wd,{present:r||a.open,children:a.disableHoverableContent?Lu.jsx(OT,{side:o,...i,ref:t}):Lu.jsx(AT,{side:o,...i,ref:t})})})),AT=o.forwardRef(((e,t)=>{const n=bT(IT,e.__scopeTooltip),r=hT(IT,e.__scopeTooltip),i=o.useRef(null),a=Ou(t,i),[s,l]=o.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:p}=r,f=o.useCallback((()=>{l(null),p(!1)}),[p]),h=o.useCallback(((e,t)=>{const n=e.currentTarget,r={x:e.clientX,y:e.clientY},o=function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(r,n.getBoundingClientRect()),i=function(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,o),a=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x)))break;t.pop()}t.push(r)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const r=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x)))break;n.pop()}n.push(r)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...i,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);l(a),p(!0)}),[p]);return o.useEffect((()=>()=>f()),[f]),o.useEffect((()=>{if(c&&d){const e=e=>h(e,d),t=e=>h(e,c);return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}}),[c,d,h,f]),o.useEffect((()=>{if(s){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e].x,s=t[e].y,l=t[i].x,c=t[i].y;s>r!=c>r&&n<(l-a)*(r-s)/(c-s)+a&&(o=!o)}return o}(n,s);r?f():o&&(f(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[c,d,s,u,f]),Lu.jsx(OT,{...e,ref:a})})),[NT,RT]=sT(gT,{isInside:!1}),OT=o.forwardRef(((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:s,...l}=e,c=bT(IT,n),u=cT(n),{onClose:d}=c;return o.useEffect((()=>(document.addEventListener(pT,d),()=>document.removeEventListener(pT,d))),[d]),o.useEffect((()=>{if(c.trigger){const e=e=>{const t=e.target;t?.contains(c.trigger)&&d()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[c.trigger,d]),Lu.jsx(id,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:Lu.jsxs(QC,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[Lu.jsx(Ju,{children:r}),Lu.jsx(NT,{scope:n,isInside:!0,children:Lu.jsx(aT,{id:c.contentId,role:"tooltip",children:i||r})})]})})}));_T.displayName=IT;var TT="TooltipArrow",MT=o.forwardRef(((e,t)=>{const{__scopeTooltip:n,...r}=e,o=cT(n);return RT(TT,n).isInside?null:Lu.jsx(qC,{...o,...r,ref:t})}));MT.displayName=TT;var PT=mT,DT=vT,BT=xT,jT=ST,FT=_T,LT=MT,VT="Popover",[zT,GT]=Vu(VT,[PC]),HT=PC(),[WT,XT]=zT(VT),ZT=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!1}=e,l=HT(t),c=o.useRef(null),[u,d]=o.useState(!1),[p=!1,f]=$u({prop:r,defaultProp:i,onChange:a});return Lu.jsx(JC,{...l,children:Lu.jsx(WT,{scope:t,contentId:Xu(),triggerRef:c,open:p,onOpenChange:f,onOpenToggle:o.useCallback((()=>f((e=>!e))),[f]),hasCustomAnchor:u,onCustomAnchorAdd:o.useCallback((()=>d(!0)),[]),onCustomAnchorRemove:o.useCallback((()=>d(!1)),[]),modal:s,children:n})})};ZT.displayName=VT;var $T="PopoverAnchor";o.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,i=XT($T,n),a=HT(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=i;return o.useEffect((()=>(s(),()=>l())),[s,l]),Lu.jsx(KC,{...a,...r,ref:t})})).displayName=$T;var YT="PopoverTrigger",UT=o.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=XT(YT,n),i=HT(n),a=Ou(t,o.triggerRef),s=Lu.jsx(Qu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":aM(o.open),...r,ref:a,onClick:Au(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?s:Lu.jsx(KC,{asChild:!0,...i,children:s})}));UT.displayName=YT;var JT="PopoverPortal",[KT,QT]=zT(JT,{forceMount:void 0}),qT=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=XT(JT,t);return Lu.jsx(KT,{scope:t,forceMount:n,children:Lu.jsx(wd,{present:n||i.open,children:Lu.jsx(vd,{asChild:!0,container:o,children:r})})})};qT.displayName=JT;var eM="PopoverContent",tM=o.forwardRef(((e,t)=>{const n=QT(eM,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=XT(eM,e.__scopePopover);return Lu.jsx(wd,{present:r||i.open,children:i.modal?Lu.jsx(nM,{...o,ref:t}):Lu.jsx(rM,{...o,ref:t})})}));tM.displayName=eM;var nM=o.forwardRef(((e,t)=>{const n=XT(eM,e.__scopePopover),r=o.useRef(null),i=Ou(t,r),a=o.useRef(!1);return o.useEffect((()=>{const e=r.current;if(e)return vp(e)}),[]),Lu.jsx(pp,{as:Yu,allowPinchZoom:!0,children:Lu.jsx(oM,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Au(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()})),onPointerDownOutside:Au(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;a.current=r}),{checkForDefaultPrevented:!1}),onFocusOutside:Au(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),rM=o.forwardRef(((e,t)=>{const n=XT(eM,e.__scopePopover),r=o.useRef(!1),i=o.useRef(!1);return Lu.jsx(oM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));const o=t.target,a=n.triggerRef.current?.contains(o);a&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})})),oM=o.forwardRef(((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=XT(eM,n),f=HT(n);return Ed(),Lu.jsx(pd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:Lu.jsx(id,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:Lu.jsx(QC,{"data-state":aM(p.open),role:"dialog",id:p.contentId,...f,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),iM="PopoverClose";o.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=XT(iM,n);return Lu.jsx(Qu.button,{type:"button",...r,ref:t,onClick:Au(e.onClick,(()=>o.onOpenChange(!1)))})})).displayName=iM;function aM(e){return e?"open":"closed"}o.forwardRef(((e,t)=>{const{__scopePopover:n,...r}=e,o=HT(n);return Lu.jsx(qC,{...o,...r,ref:t})})).displayName="PopoverArrow";var sM,lM,cM,uM,dM,pM,fM,hM,mM=ZT,gM=UT,yM=qT,bM=tM;function vM(){if(uM)return cM;uM=1;const e=lM?sM:(lM=1,sM={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),t={};for(const n of Object.keys(e))t[e[n]]=n;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};cM=n;for(const e of Object.keys(n)){if(!("channels"in n[e]))throw new Error("missing channels property: "+e);if(!("labels"in n[e]))throw new Error("missing channel labels property: "+e);if(n[e].labels.length!==n[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:r}=n[e];delete n[e].channels,delete n[e].labels,Object.defineProperty(n[e],"channels",{value:t}),Object.defineProperty(n[e],"labels",{value:r})}return n.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=i-o;let s,l;i===o?s=0:t===i?s=(n-r)/a:n===i?s=2+(r-t)/a:r===i&&(s=4+(t-n)/a),s=Math.min(60*s,360),s<0&&(s+=360);const c=(o+i)/2;return l=i===o?0:c<=.5?a/(i+o):a/(2-i-o),[s,100*l,100*c]},n.rgb.hsv=function(e){let t,n,r,o,i;const a=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),d=function(e){return(c-e)/6/u+.5};return 0===u?(o=0,i=0):(i=u/c,t=d(a),n=d(s),r=d(l),a===c?o=r-n:s===c?o=1/3+t-r:l===c&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[360*o,100*i,100*c]},n.rgb.hwb=function(e){const t=e[0],r=e[1];let o=e[2];const i=n.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(r,o));return o=1-1/255*Math.max(t,Math.max(r,o)),[i,100*a,100*o]},n.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r);return[100*((1-t-o)/(1-o)||0),100*((1-n-o)/(1-o)||0),100*((1-r-o)/(1-o)||0),100*o]},n.rgb.keyword=function(n){const r=t[n];if(r)return r;let o,i=1/0;for(const t of Object.keys(e)){const r=e[t],l=(s=r,((a=n)[0]-s[0])**2+(a[1]-s[1])**2+(a[2]-s[2])**2);l<i&&(i=l,o=t)}var a,s;return o},n.keyword.rgb=function(t){return e[t]},n.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;return[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},n.rgb.lab=function(e){const t=n.rgb.xyz(e);let r=t[0],o=t[1],i=t[2];r/=95.047,o/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*o-16,500*(r-o),200*(o-i)]},n.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,i,a;if(0===n)return a=255*r,[a,a,a];o=r<.5?r*(1+n):r+n-r*n;const s=2*r-o,l=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,a=6*i<1?s+6*(o-s)*i:2*i<1?o:3*i<2?s+(o-s)*(2/3-i)*6:s,l[e]=255*a;return l},n.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const i=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=i<=1?i:2-i;return[t,100*(0===r?2*o/(i+o):2*n/(r+n)),100*((r+n)/2)]},n.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,i=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*i),l=255*r*(1-n*(1-i));switch(r*=255,o){case 0:return[r,l,a];case 1:return[s,r,a];case 2:return[a,r,l];case 3:return[a,s,r];case 4:return[l,a,r];case 5:return[r,a,s]}},n.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let i,a;a=(2-n)*r;const s=(2-n)*o;return i=n*o,i/=s<=1?s:2-s,i=i||0,a/=2,[t,100*i,100*a]},n.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let i;o>1&&(n/=o,r/=o);const a=Math.floor(6*t),s=1-r;i=6*t-a,1&a&&(i=1-i);const l=n+i*(s-n);let c,u,d;switch(a){default:case 6:case 0:c=s,u=l,d=n;break;case 1:c=l,u=s,d=n;break;case 2:c=n,u=s,d=l;break;case 3:c=n,u=l,d=s;break;case 4:c=l,u=n,d=s;break;case 5:c=s,u=n,d=l}return[255*c,255*u,255*d]},n.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,t*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o))]},n.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,i,a;return o=3.2406*t+-1.5372*n+-.4986*r,i=-.9689*t+1.8758*n+.0415*r,a=.0557*t+-.204*n+1.057*r,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,o=Math.min(Math.max(0,o),1),i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),[255*o,255*i,255*a]},n.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;return[116*n-16,500*(t-n),200*(n-r)]},n.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const o=n**3,i=t**3,a=r**3;return n=o>.008856?o:(n-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},n.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=360*Math.atan2(r,n)/2/Math.PI,o<0&&(o+=360);return[t,Math.sqrt(n*n+r*r),o]},n.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},n.rgb.ansi16=function(e,t=null){const[r,o,i]=e;let a=null===t?n.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),0===a)return 30;let s=30+(Math.round(i/255)<<2|Math.round(o/255)<<1|Math.round(r/255));return 2===a&&(s+=60),s},n.hsv.ansi16=function(e){return n.rgb.ansi16(n.hsv.rgb(e),e[2])},n.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},n.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},n.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},n.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},n.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map((e=>e+e)).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},n.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),i=Math.min(Math.min(t,n),r),a=o-i;let s,l;return s=a<1?i/(1-a):0,l=a<=0?0:o===t?(n-r)/a%6:o===n?2+(r-t)/a:4+(t-n)/a,l/=6,l%=1,[360*l,100*a,100*s]},n.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],100*r,100*o]},n.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},n.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const o=[0,0,0],i=t%1*6,a=i%1,s=1-a;let l=0;switch(Math.floor(i)){case 0:o[0]=1,o[1]=a,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=a;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=a,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return l=(1-n)*r,[255*(n*o[0]+l),255*(n*o[1]+l),255*(n*o[2]+l)]},n.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},n.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},n.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},n.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],100*r,100*o]},n.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},n.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},n.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},n.gray.hsl=function(e){return[0,0,e[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(e){return[0,100,e[0]]},n.gray.cmyk=function(e){return[0,0,0,e[0]]},n.gray.lab=function(e){return[e[0],0,0]},n.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},n.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},cM}function wM(){if(pM)return dM;pM=1;const e=vM();function t(t){const n=function(){const t={},n=Object.keys(e);for(let e=n.length,r=0;r<e;r++)t[n[r]]={distance:-1,parent:null};return t}(),r=[t];for(n[t].distance=0;r.length;){const t=r.pop(),o=Object.keys(e[t]);for(let e=o.length,i=0;i<e;i++){const e=o[i],a=n[e];-1===a.distance&&(a.distance=n[t].distance+1,a.parent=t,r.unshift(e))}}return n}function n(e,t){return function(n){return t(e(n))}}function r(t,r){const o=[r[t].parent,t];let i=e[r[t].parent][t],a=r[t].parent;for(;r[a].parent;)o.unshift(r[a].parent),i=n(e[r[a].parent][a],i),a=r[a].parent;return i.conversion=o,i}return dM=function(e){const n=t(e),o={},i=Object.keys(n);for(let e=i.length,t=0;t<e;t++){const e=i[t];null!==n[e].parent&&(o[e]=r(e,n))}return o},dM}var xM=function(){if(hM)return fM;hM=1;const e=vM(),t=wM(),n={};return Object.keys(e).forEach((r=>{n[r]={},Object.defineProperty(n[r],"channels",{value:e[r].channels}),Object.defineProperty(n[r],"labels",{value:e[r].labels});const o=t(r);Object.keys(o).forEach((e=>{const t=o[e];n[r][e]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(t),n[r][e].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(t)}))})),fM=n}(),CM=r({__proto__:null,default:l(xM)},[xM]);const EM=(e,t)=>{if(Array.isArray(t)||(t=[t]),void 0===t[0]||null===t[0])return EM("rgb",[0,0,0]);const n=CM[e];if(!n)throw new Error("Unsupported color type: "+e);n[e]=()=>t;const r=n.rgb(t);if(!Array.isArray(r))return EM("rgb",[0,0,0]);if(void 0===r[0]||null===r[0])return EM("rgb",[0,0,0]);const o=n.hsl(t);if(!Array.isArray(o))return EM("rgb",[0,0,0]);if(void 0===o[0]||null===o[0])return EM("rgb",[0,0,0]);const i={};return Object.keys(n).forEach((e=>{const r=n[e];"function"==typeof r&&(i[e]=()=>r.apply(null,t))})),i},kM=({onChange:t,colorconverter:n,allow_null:r=!1})=>{if(null===n&&!r)throw new Error("Color converter is null");const[i,a]=e.useState(n),[s,l]=e.useState([0,0,0]),[c,u]=e.useState([0,0,0]),[d,p]=e.useState([0,0,0]),[f,h]=e.useState("000");e.useEffect((()=>{if(!i){if(!r)throw new Error("Color converter is null");return u([0,0,0]),l([0,0,0]),p([0,0,0]),void h("")}l(i.hsl()),u(i.rgb()),p(i.hsv()),h(i.hex())}),[i]);const m={backgroundColor:`hsl(${s[0]}, ${s[1]}%, ${s[2]}%)`,padding:"10px",margin:"10px 0"};return o.createElement("div",{style:{backgroundColor:"white"}},o.createElement("div",{style:m},"Color Preview"),o.createElement("div",{className:"colorspace"},o.createElement("div",{className:"colorspace_title"},"RGB"),o.createElement("div",null),o.createElement("label",null,"Red"),o.createElement("input",{type:"range",min:"0",max:"255",value:c[0],onChange:e=>{const n=[parseInt(e.target.value),c[1],c[2]],r=EM("rgb",n);a(r),t(r)},style:{background:"linear-gradient(to right, #000, #f00)"}}),o.createElement("label",null,"Green"),o.createElement("input",{type:"range",min:"0",max:"255",value:c[1],onChange:e=>{const n=[c[0],parseInt(e.target.value),c[2]],r=EM("rgb",n);a(r),t(r)},style:{background:"linear-gradient(to right, #000, #0f0)"}}),o.createElement("label",null,"Blue"),o.createElement("input",{type:"range",min:"0",max:"255",value:c[2],onChange:e=>{const n=[c[0],c[1],parseInt(e.target.value)],r=EM("rgb",n);a(r),t(r)},style:{background:"linear-gradient(to right, #000, #00f)"}})),o.createElement("div",{className:"colorspace"},o.createElement("div",{className:"colorspace_title"},"HSL"),o.createElement("div",null),o.createElement("label",null,"Hue"),o.createElement("input",{type:"range",min:"0",max:"360",value:s[0],onChange:e=>{const n=[parseInt(e.target.value),s[1],s[2]],r=EM("hsl",n);a(r),t(r)},style:{background:"linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)"}}),o.createElement("label",null,"Saturation"),o.createElement("input",{type:"range",min:"0",max:"100",value:s[1],onChange:e=>{const n=[s[0],parseInt(e.target.value),s[2]],r=EM("hsl",n);a(r),t(r)},style:{background:`linear-gradient(to right, #fff, hsl(${s[0]}, 100%, 50%))`}}),o.createElement("label",null,"Lightness"),o.createElement("input",{type:"range",min:"0",max:"100",value:s[2],onChange:e=>{const n=[s[0],s[1],parseInt(e.target.value)],r=EM("hsl",n);a(r),t(r)},style:{background:`linear-gradient(to right, #000, hsl(${s[0]}, 100%, 50%), #fff)`}})),o.createElement("div",{className:"colorspace"},o.createElement("div",{className:"colorspace_title"},"HSV"),o.createElement("div",null),o.createElement("label",null,"Hue"),o.createElement("input",{type:"range",min:"0",max:"360",value:d[0],onChange:e=>{const n=[parseInt(e.target.value),d[1],d[2]],r=EM("hsv",n);a(r),t(r)},style:{background:"linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)"}}),o.createElement("label",null,"Saturation"),o.createElement("input",{type:"range",min:"0",max:"100",value:d[1],onChange:e=>{const n=[d[0],parseInt(e.target.value),d[2]],r=EM("hsv",n);a(r),t(r)},style:{background:`linear-gradient(to right, #fff, hsl(${s[0]}, 100%, 50%))`}}),o.createElement("label",null,"Value"),o.createElement("input",{type:"range",min:"0",max:"100",value:d[2],onChange:e=>{const n=[d[0],d[1],parseInt(e.target.value)],r=EM("hsv",n);a(r),t(r)},style:{background:`linear-gradient(to right, #000, hsl(${s[0]}, 100%, 50%))`}})),o.createElement("div",{className:"colorspace"},o.createElement("div",{className:"colorspace_title"},"HEX"),o.createElement("div",null),o.createElement("input",{type:"text",value:f,onChange:e=>{const n=""===e.target.value?null:EM("hex",[e.target.value]);a(n),t(n)}})))},SM=({inicolordata:t,inicolorspace:n="hex",allow_null:r=!1,onChange:i})=>{void 0===t&&(t=[0,0,0],n="rgb"),Array.isArray(t)||(t=[t]);let a=EM(n,t);void 0===a.rgb()&&(a=EM("rgb",[0,0,0]));const[s,l]=e.useState(a),c={background:"#"+s.hex(),borderRadius:"0.3rem",width:"2rem",height:"1rem"};return o.createElement(mM,null,o.createElement(gM,{asChild:!0},o.createElement("button",{style:c})),o.createElement(yM,null,o.createElement(bM,{side:"left"},o.createElement(kM,{onChange:e=>{if(null===e&&!r)throw new Error("Color is null");null!==e&&l(e),i&&i(e)},colorconverter:s,allow_null:r}))))};function IM(e,[t,n]){return Math.min(n,Math.max(t,e))}var _M=["PageUp","PageDown"],AM=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],NM={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},RM="Slider",[OM,TM,MM]=Qw(RM),[PM,DM]=Vu(RM,[MM]),[BM,jM]=PM(RM),FM=o.forwardRef(((e,t)=>{const{name:n,min:r=0,max:i=100,step:a=1,orientation:s="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:d,onValueChange:p=()=>{},onValueCommit:f=()=>{},inverted:h=!1,form:m,...g}=e,y=o.useRef(new Set),b=o.useRef(0),v="horizontal"===s?zM:GM,[w=[],x]=$u({prop:d,defaultProp:u,onChange:e=>{const t=[...y.current];t[b.current]?.focus(),p(e)}}),C=o.useRef(w);function E(e,t,{commit:n}={commit:!1}){const o=function(e){return(String(e).split(".")[1]||"").length}(a),s=function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}(Math.round((e-r)/a)*a+r,o),l=IM(s,[r,i]);x(((e=[])=>{const r=function(e=[],t,n){const r=[...e];return r[n]=t,r.sort(((e,t)=>e-t))}(e,l,t);if(function(e,t){if(t>0){const n=function(e){return e.slice(0,-1).map(((t,n)=>e[n+1]-t))}(e);return Math.min(...n)>=t}return!0}(r,c*a)){b.current=r.indexOf(l);const t=String(r)!==String(e);return t&&n&&f(r),t?r:e}return e}))}return Lu.jsx(BM,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:i,valueIndexToChangeRef:b,thumbs:y.current,values:w,orientation:s,form:m,children:Lu.jsx(OM.Provider,{scope:e.__scopeSlider,children:Lu.jsx(OM.Slot,{scope:e.__scopeSlider,children:Lu.jsx(v,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:Au(g.onPointerDown,(()=>{l||(C.current=w)})),min:r,max:i,inverted:h,onSlideStart:l?void 0:function(e){const t=function(e,t){if(1===e.length)return 0;const n=e.map((e=>Math.abs(e-t))),r=Math.min(...n);return n.indexOf(r)}(w,e);E(e,t)},onSlideMove:l?void 0:function(e){E(e,b.current)},onSlideEnd:l?void 0:function(){const e=C.current[b.current];w[b.current]!==e&&f(w)},onHomeKeyDown:()=>!l&&E(r,0,{commit:!0}),onEndKeyDown:()=>!l&&E(i,w.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!l){const n=_M.includes(e.key)||e.shiftKey&&AM.includes(e.key)?10:1,r=b.current;E(w[r]+a*n*t,r,{commit:!0})}}})})})})}));FM.displayName=RM;var[LM,VM]=PM(RM,{startEdge:"left",endEdge:"right",size:"width",direction:1}),zM=o.forwardRef(((e,t)=>{const{min:n,max:r,dir:i,inverted:a,onSlideStart:s,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=e,[p,f]=o.useState(null),h=Ou(t,(e=>f(e))),m=o.useRef(void 0),g=ex(i),y="ltr"===g,b=y&&!a||!y&&a;function v(e){const t=m.current||p.getBoundingClientRect(),o=qM([0,t.width],b?[n,r]:[r,n]);return m.current=t,o(e-t.left)}return Lu.jsx(LM,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:Lu.jsx(HM,{dir:g,"data-orientation":"horizontal",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{const t=v(e.clientX);s?.(t)},onSlideMove:e=>{const t=v(e.clientX);l?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{const t=NM[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})})),GM=o.forwardRef(((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:s,onSlideEnd:l,onStepKeyDown:c,...u}=e,d=o.useRef(null),p=Ou(t,d),f=o.useRef(void 0),h=!i;function m(e){const t=f.current||d.current.getBoundingClientRect(),o=qM([0,t.height],h?[r,n]:[n,r]);return f.current=t,o(e-t.top)}return Lu.jsx(LM,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:Lu.jsx(HM,{"data-orientation":"vertical",...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{const t=m(e.clientY);a?.(t)},onSlideMove:e=>{const t=m(e.clientY);s?.(t)},onSlideEnd:()=>{f.current=void 0,l?.()},onStepKeyDown:e=>{const t=NM[h?"from-bottom":"from-top"].includes(e.key);c?.({event:e,direction:t?-1:1})}})})})),HM=o.forwardRef(((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:s,onStepKeyDown:l,...c}=e,u=jM(RM,n);return Lu.jsx(Qu.span,{...c,ref:t,onKeyDown:Au(e.onKeyDown,(e=>{"Home"===e.key?(a(e),e.preventDefault()):"End"===e.key?(s(e),e.preventDefault()):_M.concat(AM).includes(e.key)&&(l(e),e.preventDefault())})),onPointerDown:Au(e.onPointerDown,(e=>{const t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)})),onPointerMove:Au(e.onPointerMove,(e=>{e.target.hasPointerCapture(e.pointerId)&&o(e)})),onPointerUp:Au(e.onPointerUp,(e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),i(e))}))})})),WM="SliderTrack",XM=o.forwardRef(((e,t)=>{const{__scopeSlider:n,...r}=e,o=jM(WM,n);return Lu.jsx(Qu.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})}));XM.displayName=WM;var ZM="SliderRange",$M=o.forwardRef(((e,t)=>{const{__scopeSlider:n,...r}=e,i=jM(ZM,n),a=VM(ZM,n),s=Ou(t,o.useRef(null)),l=i.values.length,c=i.values.map((e=>QM(e,i.min,i.max))),u=l>1?Math.min(...c):0,d=100-Math.max(...c);return Lu.jsx(Qu.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:s,style:{...e.style,[a.startEdge]:u+"%",[a.endEdge]:d+"%"}})}));$M.displayName=ZM;var YM="SliderThumb",UM=o.forwardRef(((e,t)=>{const n=TM(e.__scopeSlider),[r,i]=o.useState(null),a=Ou(t,(e=>i(e))),s=o.useMemo((()=>r?n().findIndex((e=>e.ref.current===r)):-1),[n,r]);return Lu.jsx(JM,{...e,ref:a,index:s})})),JM=o.forwardRef(((e,t)=>{const{__scopeSlider:n,index:r,name:i,...a}=e,s=jM(YM,n),l=VM(YM,n),[c,u]=o.useState(null),d=Ou(t,(e=>u(e))),p=!c||(s.form||!!c.closest("form")),f=OC(c),h=s.values[r],m=void 0===h?0:QM(h,s.min,s.max),g=function(e,t){return t>2?`Value ${e+1} of ${t}`:2===t?["Minimum","Maximum"][e]:void 0}(r,s.values.length),y=f?.[l.size],b=y?function(e,t,n){const r=e/2,o=qM([0,50],[0,r]);return(r-o(t)*n)*n}(y,m,l.direction):0;return o.useEffect((()=>{if(c)return s.thumbs.add(c),()=>{s.thumbs.delete(c)}}),[c,s.thumbs]),Lu.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${m}% + ${b}px)`},children:[Lu.jsx(OM.ItemSlot,{scope:e.__scopeSlider,children:Lu.jsx(Qu.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":s.min,"aria-valuenow":h,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...a,ref:d,style:void 0===h?{display:"none"}:e.style,onFocus:Au(e.onFocus,(()=>{s.valueIndexToChangeRef.current=r}))})}),p&&Lu.jsx(KM,{name:i??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:h},r)]})}));UM.displayName=YM;var KM=e=>{const{value:t,...n}=e,r=o.useRef(null),i=function(e){const t=o.useRef({value:e,previous:e});return o.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(t);return o.useEffect((()=>{const e=r.current,n=window.HTMLInputElement.prototype,o=Object.getOwnPropertyDescriptor(n,"value").set;if(i!==t&&o){const n=new Event("input",{bubbles:!0});o.call(e,t),e.dispatchEvent(n)}}),[i,t]),Lu.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:t})};function QM(e,t,n){return IM(100/(n-t)*(e-t),[0,100])}function qM(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}var eP=FM,tP=XM,nP=$M,rP=UM;function oP(e){return oP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oP(e)}function iP(e){var t=function(e,t){if("object"!=oP(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=oP(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==oP(t)?t:t+""}function aP(e,t,n){return(t=iP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sP(Object(n),!0).forEach((function(t){aP(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uP(e,t){if(e){if("string"==typeof e)return cP(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cP(e,t):void 0}}function dP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||uP(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pP(e,t){if(null==e)return{};var n,r,o=gw(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var fP=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function hP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iP(r.key),r)}}function mP(e){return mP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mP(e)}function gP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(gP=function(){return!!e})()}function yP(e){var t=gP();return function(){var n,r=mP(e);if(t){var o=mP(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==oP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ww(e)}(this,n)}}function bP(e){return function(e){if(Array.isArray(e))return cP(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||uP(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var vP=e.useLayoutEffect,wP=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],xP=function(){};function CP(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function EP(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];var i=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&i.push("".concat(CP(e,a)));return i.filter((function(e){return e})).map((function(e){return String(e).trim()})).join(" ")}var kP=function(e){return function(e){return Array.isArray(e)}(e)?e.filter(Boolean):"object"===oP(e)&&null!==e?[e]:[]},SP=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,lP({},pP(e,wP))},IP=function(e,t,n){var r=e.cx,o=e.getStyles,i=e.getClassNames,a=e.className;return{css:o(t,e),className:r(null!=n?n:{},i(t,e),a)}};function _P(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function AP(e){return _P(e)?window.pageYOffset:e.scrollTop}function NP(e,t){_P(e)?window.scrollTo(0,t):e.scrollTop=t}function RP(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:xP,o=AP(e),i=t-o,a=0;!function t(){var s,l=i*((s=(s=a+=10)/n-1)*s*s+1)+o;NP(e,l),a<n?window.requestAnimationFrame(t):r(e)}()}function OP(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=t.offsetHeight/3;r.bottom+o>n.bottom?NP(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):r.top-o<n.top&&NP(e,Math.max(t.offsetTop-o,0))}function TP(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var MP=!1,PP={get passive(){return MP=!0}},DP="undefined"!=typeof window?window:{};DP.addEventListener&&DP.removeEventListener&&(DP.addEventListener("p",xP,PP),DP.removeEventListener("p",xP,!1));var BP=MP;function jP(e){return null!=e}function FP(e,t,n){return e?t:n}var LP=["children","innerProps"],VP=["children","innerProps"];function zP(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,o=e.placement,i=e.shouldScroll,a=e.isFixedPosition,s=e.controlHeight,l=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var o=e;o=o.parentElement;)if(t=getComputedStyle(o),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return o;return document.documentElement}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u,d=l.getBoundingClientRect().height,p=n.getBoundingClientRect(),f=p.bottom,h=p.height,m=p.top,g=n.offsetParent.getBoundingClientRect().top,y=a?window.innerHeight:_P(u=l)?window.innerHeight:u.clientHeight,b=AP(l),v=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),x=g-w,C=y-m,E=x+b,k=d-b-m,S=f-y+b+v,I=b+m-w,_=160;switch(o){case"auto":case"bottom":if(C>=h)return{placement:"bottom",maxHeight:t};if(k>=h&&!a)return i&&RP(l,S,_),{placement:"bottom",maxHeight:t};if(!a&&k>=r||a&&C>=r)return i&&RP(l,S,_),{placement:"bottom",maxHeight:a?C-v:k-v};if("auto"===o||a){var A=t,N=a?x:E;return N>=r&&(A=Math.min(N-v-s,t)),{placement:"top",maxHeight:A}}if("bottom"===o)return i&&NP(l,S),{placement:"bottom",maxHeight:t};break;case"top":if(x>=h)return{placement:"top",maxHeight:t};if(E>=h&&!a)return i&&RP(l,I,_),{placement:"top",maxHeight:t};if(!a&&E>=r||a&&x>=r){var R=t;return(!a&&E>=r||a&&x>=r)&&(R=a?x-w:E-w),i&&RP(l,I,_),{placement:"top",maxHeight:R}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return c}var GP,HP=function(e){return"auto"===e?"bottom":e},WP=e.createContext(null),XP=function(t){var n=t.children,r=t.minMenuHeight,o=t.maxMenuHeight,i=t.menuPlacement,a=t.menuPosition,s=t.menuShouldScrollIntoView,l=t.theme,c=(e.useContext(WP)||{}).setPortalPlacement,u=e.useRef(null),d=dP(e.useState(o),2),p=d[0],f=d[1],h=dP(e.useState(null),2),m=h[0],g=h[1],y=l.spacing.controlHeight;return vP((function(){var e=u.current;if(e){var t="fixed"===a,n=zP({maxHeight:o,menuEl:e,minHeight:r,placement:i,shouldScroll:s&&!t,isFixedPosition:t,controlHeight:y});f(n.maxHeight),g(n.placement),null==c||c(n.placement)}}),[o,i,a,s,r,c,y]),n({ref:u,placerProps:lP(lP({},t),{},{placement:m||HP(i),maxHeight:p})})},ZP=function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return ry("div",Im({},IP(e,"menu",{menu:!0}),{ref:n},r),t)},$P=function(e,t){var n=e.theme,r=n.spacing.baseUnit,o=n.colors;return lP({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},YP=$P,UP=$P,JP=["size"],KP=["innerProps","isRtl","size"];var QP,qP,eD="production"===process.env.NODE_ENV?{name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"}:{name:"tj5bde-Svg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdpdGhMYWJlbCxcbiAgR3JvdXBCYXNlLFxufSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRTdHlsZVByb3BzIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgSWNvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBTdmcgPSAoe1xuICBzaXplLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZTogbnVtYmVyIH0pID0+IChcbiAgPHN2Z1xuICAgIGhlaWdodD17c2l6ZX1cbiAgICB3aWR0aD17c2l6ZX1cbiAgICB2aWV3Qm94PVwiMCAwIDIwIDIwXCJcbiAgICBhcmlhLWhpZGRlbj1cInRydWVcIlxuICAgIGZvY3VzYWJsZT1cImZhbHNlXCJcbiAgICBjc3M9e3tcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgZmlsbDogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBsaW5lSGVpZ2h0OiAxLFxuICAgICAgc3Ryb2tlOiAnY3VycmVudENvbG9yJyxcbiAgICAgIHN0cm9rZVdpZHRoOiAwLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IHR5cGUgQ3Jvc3NJY29uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgQ3Jvc3NJY29uID0gKHByb3BzOiBDcm9zc0ljb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNMTQuMzQ4IDE0Ljg0OWMtMC40NjkgMC40NjktMS4yMjkgMC40NjktMS42OTcgMGwtMi42NTEtMy4wMzAtMi42NTEgMy4wMjljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDAtMC40NjktMC40NjktMC40NjktMS4yMjkgMC0xLjY5N2wyLjc1OC0zLjE1LTIuNzU5LTMuMTUyYy0wLjQ2OS0wLjQ2OS0wLjQ2OS0xLjIyOCAwLTEuNjk3czEuMjI4LTAuNDY5IDEuNjk3IDBsMi42NTIgMy4wMzEgMi42NTEtMy4wMzFjMC40NjktMC40NjkgMS4yMjgtMC40NjkgMS42OTcgMHMwLjQ2OSAxLjIyOSAwIDEuNjk3bC0yLjc1OCAzLjE1MiAyLjc1OCAzLjE1YzAuNDY5IDAuNDY5IDAuNDY5IDEuMjI5IDAgMS42OTh6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuZXhwb3J0IHR5cGUgRG93bkNoZXZyb25Qcm9wcyA9IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU/OiBudW1iZXIgfTtcbmV4cG9ydCBjb25zdCBEb3duQ2hldnJvbiA9IChwcm9wczogRG93bkNoZXZyb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNNC41MTYgNy41NDhjMC40MzYtMC40NDYgMS4wNDMtMC40ODEgMS41NzYgMGwzLjkwOCAzLjc0NyAzLjkwOC0zLjc0N2MwLjUzMy0wLjQ4MSAxLjE0MS0wLjQ0NiAxLjU3NCAwIDAuNDM2IDAuNDQ1IDAuNDA4IDEuMTk3IDAgMS42MTUtMC40MDYgMC40MTgtNC42OTUgNC41MDItNC42OTUgNC41MDItMC4yMTcgMC4yMjMtMC41MDIgMC4zMzUtMC43ODcgMC4zMzVzLTAuNTctMC4xMTItMC43ODktMC4zMzVjMCAwLTQuMjg3LTQuMDg0LTQuNjk1LTQuNTAycy0wLjQzNi0xLjE3IDAtMS42MTV6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgQnV0dG9uc1xuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbmV4cG9ydCBpbnRlcmZhY2UgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBUaGUgY2hpbGRyZW4gdG8gYmUgcmVuZGVyZWQgaW5zaWRlIHRoZSBpbmRpY2F0b3IuICovXG4gIGNoaWxkcmVuPzogUmVhY3ROb2RlO1xuICAvKiogUHJvcHMgdGhhdCB3aWxsIGJlIHBhc3NlZCBvbiB0byB0aGUgY2hpbGRyZW4uICovXG4gIGlubmVyUHJvcHM6IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snZGl2J107XG4gIC8qKiBUaGUgZm9jdXNlZCBzdGF0ZSBvZiB0aGUgc2VsZWN0LiAqL1xuICBpc0ZvY3VzZWQ6IGJvb2xlYW47XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG59XG5cbmNvbnN0IGJhc2VDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgdGhlbWU6IHtcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICAgIGNvbG9ycyxcbiAgICB9LFxuICB9OlxuICAgIHwgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuICAgIHwgQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2luZGljYXRvckNvbnRhaW5lcicsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgdHJhbnNpdGlvbjogJ2NvbG9yIDE1MG1zJyxcbiAgLi4uKHVuc3R5bGVkXG4gICAgPyB7fVxuICAgIDoge1xuICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw2MCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIHBhZGRpbmc6IGJhc2VVbml0ICogMixcbiAgICAgICAgJzpob3Zlcic6IHtcbiAgICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw4MCA6IGNvbG9ycy5uZXV0cmFsNDAsXG4gICAgICAgIH0sXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgZHJvcGRvd25JbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IERyb3Bkb3duSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnZHJvcGRvd25JbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2Ryb3Bkb3duLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8RG93bkNoZXZyb24gLz59XG4gICAgPC9kaXY+XG4gICk7XG59O1xuXG5leHBvcnQgaW50ZXJmYWNlIENsZWFySW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xufVxuXG5leHBvcnQgY29uc3QgY2xlYXJJbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IENsZWFySW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnY2xlYXJJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2NsZWFyLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8Q3Jvc3NJY29uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBTZXBhcmF0b3Jcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIEluZGljYXRvclNlcGFyYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpbm5lclByb3BzPzogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ107XG59XG5cbmV4cG9ydCBjb25zdCBpbmRpY2F0b3JTZXBhcmF0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0Rpc2FibGVkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JTZXBhcmF0b3InLFxuICBhbGlnblNlbGY6ICdzdHJldGNoJyxcbiAgd2lkdGg6IDEsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgYmFja2dyb3VuZENvbG9yOiBpc0Rpc2FibGVkID8gY29sb3JzLm5ldXRyYWwxMCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIG1hcmdpbkJvdHRvbTogYmFzZVVuaXQgKiAyLFxuICAgICAgICBtYXJnaW5Ub3A6IGJhc2VVbml0ICogMixcbiAgICAgIH0pLFxufSk7XG5cbmV4cG9ydCBjb25zdCBJbmRpY2F0b3JTZXBhcmF0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHByb3BzOiBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgaW5uZXJQcm9wcyB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPHNwYW5cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgICAgey4uLmdldFN0eWxlUHJvcHMocHJvcHMsICdpbmRpY2F0b3JTZXBhcmF0b3InLCB7XG4gICAgICAgICdpbmRpY2F0b3Itc2VwYXJhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgIC8+XG4gICk7XG59O1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIExvYWRpbmdcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBsb2FkaW5nRG90QW5pbWF0aW9ucyA9IGtleWZyYW1lc2BcbiAgMCUsIDgwJSwgMTAwJSB7IG9wYWNpdHk6IDA7IH1cbiAgNDAlIHsgb3BhY2l0eTogMTsgfVxuYDtcblxuZXhwb3J0IGNvbnN0IGxvYWRpbmdJbmRpY2F0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgc2l6ZSxcbiAgICB0aGVtZToge1xuICAgICAgY29sb3JzLFxuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgIH0sXG4gIH06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2xvYWRpbmdJbmRpY2F0b3InLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIGFsaWduU2VsZjogJ2NlbnRlcicsXG4gIGZvbnRTaXplOiBzaXplLFxuICBsaW5lSGVpZ2h0OiAxLFxuICBtYXJnaW5SaWdodDogc2l6ZSxcbiAgdGV4dEFsaWduOiAnY2VudGVyJyxcbiAgdmVydGljYWxBbGlnbjogJ21pZGRsZScsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5pbnRlcmZhY2UgTG9hZGluZ0RvdFByb3BzIHtcbiAgZGVsYXk6IG51bWJlcjtcbiAgb2Zmc2V0OiBib29sZWFuO1xufVxuY29uc3QgTG9hZGluZ0RvdCA9ICh7IGRlbGF5LCBvZmZzZXQgfTogTG9hZGluZ0RvdFByb3BzKSA9PiAoXG4gIDxzcGFuXG4gICAgY3NzPXt7XG4gICAgICBhbmltYXRpb246IGAke2xvYWRpbmdEb3RBbmltYXRpb25zfSAxcyBlYXNlLWluLW91dCAke2RlbGF5fW1zIGluZmluaXRlO2AsXG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6ICdjdXJyZW50Q29sb3InLFxuICAgICAgYm9yZGVyUmFkaXVzOiAnMWVtJyxcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgbWFyZ2luTGVmdDogb2Zmc2V0ID8gJzFlbScgOiB1bmRlZmluZWQsXG4gICAgICBoZWlnaHQ6ICcxZW0nLFxuICAgICAgdmVydGljYWxBbGlnbjogJ3RvcCcsXG4gICAgICB3aWR0aDogJzFlbScsXG4gICAgfX1cbiAgLz5cbik7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTG9hZGluZ0luZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xuICAvKiogU2V0IHNpemUgb2YgdGhlIGNvbnRhaW5lci4gKi9cbiAgc2l6ZTogbnVtYmVyO1xufVxuZXhwb3J0IGNvbnN0IExvYWRpbmdJbmRpY2F0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oe1xuICBpbm5lclByb3BzLFxuICBpc1J0bCxcbiAgc2l6ZSA9IDQsXG4gIC4uLnJlc3RQcm9wc1xufTogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPGRpdlxuICAgICAgey4uLmdldFN0eWxlUHJvcHMoXG4gICAgICAgIHsgLi4ucmVzdFByb3BzLCBpbm5lclByb3BzLCBpc1J0bCwgc2l6ZSB9LFxuICAgICAgICAnbG9hZGluZ0luZGljYXRvcicsXG4gICAgICAgIHtcbiAgICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgICAgfVxuICAgICAgKX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXswfSBvZmZzZXQ9e2lzUnRsfSAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}},tD=function(e){var t=e.size,n=pP(e,JP);return ry("svg",Im({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:eD},n))},nD=function(e){return ry(tD,Im({size:20},e),ry("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},rD=function(e){return ry(tD,Im({size:20},e),ry("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},oD=function(e,t){var n=e.isFocused,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return lP({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*o,":hover":{color:n?i.neutral80:i.neutral40}})},iD=oD,aD=oD,sD=iy(GP||(QP=["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"],qP||(qP=QP.slice(0)),GP=Object.freeze(Object.defineProperties(QP,{raw:{value:Object.freeze(qP)}})))),lD=function(e){var t=e.delay,n=e.offset;return ry("span",{css:oy({animation:"".concat(sD," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"production"===process.env.NODE_ENV?"":";label:LoadingDot;","production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1RSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3gsIGtleWZyYW1lcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHtcbiAgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWUsXG4gIENTU09iamVjdFdpdGhMYWJlbCxcbiAgR3JvdXBCYXNlLFxufSBmcm9tICcuLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRTdHlsZVByb3BzIH0gZnJvbSAnLi4vdXRpbHMnO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgSWNvbnNcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBTdmcgPSAoe1xuICBzaXplLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzdmcnXSAmIHsgc2l6ZTogbnVtYmVyIH0pID0+IChcbiAgPHN2Z1xuICAgIGhlaWdodD17c2l6ZX1cbiAgICB3aWR0aD17c2l6ZX1cbiAgICB2aWV3Qm94PVwiMCAwIDIwIDIwXCJcbiAgICBhcmlhLWhpZGRlbj1cInRydWVcIlxuICAgIGZvY3VzYWJsZT1cImZhbHNlXCJcbiAgICBjc3M9e3tcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgZmlsbDogJ2N1cnJlbnRDb2xvcicsXG4gICAgICBsaW5lSGVpZ2h0OiAxLFxuICAgICAgc3Ryb2tlOiAnY3VycmVudENvbG9yJyxcbiAgICAgIHN0cm9rZVdpZHRoOiAwLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IHR5cGUgQ3Jvc3NJY29uUHJvcHMgPSBKU1guSW50cmluc2ljRWxlbWVudHNbJ3N2ZyddICYgeyBzaXplPzogbnVtYmVyIH07XG5leHBvcnQgY29uc3QgQ3Jvc3NJY29uID0gKHByb3BzOiBDcm9zc0ljb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNMTQuMzQ4IDE0Ljg0OWMtMC40NjkgMC40NjktMS4yMjkgMC40NjktMS42OTcgMGwtMi42NTEtMy4wMzAtMi42NTEgMy4wMjljLTAuNDY5IDAuNDY5LTEuMjI5IDAuNDY5LTEuNjk3IDAtMC40NjktMC40NjktMC40NjktMS4yMjkgMC0xLjY5N2wyLjc1OC0zLjE1LTIuNzU5LTMuMTUyYy0wLjQ2OS0wLjQ2OS0wLjQ2OS0xLjIyOCAwLTEuNjk3czEuMjI4LTAuNDY5IDEuNjk3IDBsMi42NTIgMy4wMzEgMi42NTEtMy4wMzFjMC40NjktMC40NjkgMS4yMjgtMC40NjkgMS42OTcgMHMwLjQ2OSAxLjIyOSAwIDEuNjk3bC0yLjc1OCAzLjE1MiAyLjc1OCAzLjE1YzAuNDY5IDAuNDY5IDAuNDY5IDEuMjI5IDAgMS42OTh6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuZXhwb3J0IHR5cGUgRG93bkNoZXZyb25Qcm9wcyA9IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU/OiBudW1iZXIgfTtcbmV4cG9ydCBjb25zdCBEb3duQ2hldnJvbiA9IChwcm9wczogRG93bkNoZXZyb25Qcm9wcykgPT4gKFxuICA8U3ZnIHNpemU9ezIwfSB7Li4ucHJvcHN9PlxuICAgIDxwYXRoIGQ9XCJNNC41MTYgNy41NDhjMC40MzYtMC40NDYgMS4wNDMtMC40ODEgMS41NzYgMGwzLjkwOCAzLjc0NyAzLjkwOC0zLjc0N2MwLjUzMy0wLjQ4MSAxLjE0MS0wLjQ0NiAxLjU3NCAwIDAuNDM2IDAuNDQ1IDAuNDA4IDEuMTk3IDAgMS42MTUtMC40MDYgMC40MTgtNC42OTUgNC41MDItNC42OTUgNC41MDItMC4yMTcgMC4yMjMtMC41MDIgMC4zMzUtMC43ODcgMC4zMzVzLTAuNTctMC4xMTItMC43ODktMC4zMzVjMCAwLTQuMjg3LTQuMDg0LTQuNjk1LTQuNTAycy0wLjQzNi0xLjE3IDAtMS42MTV6XCIgLz5cbiAgPC9Tdmc+XG4pO1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIERyb3Bkb3duICYgQ2xlYXIgQnV0dG9uc1xuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbmV4cG9ydCBpbnRlcmZhY2UgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxcbiAgT3B0aW9uID0gdW5rbm93bixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4gPSBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+ID0gR3JvdXBCYXNlPE9wdGlvbj5cbj4gZXh0ZW5kcyBDb21tb25Qcm9wc0FuZENsYXNzTmFtZTxPcHRpb24sIElzTXVsdGksIEdyb3VwPiB7XG4gIC8qKiBUaGUgY2hpbGRyZW4gdG8gYmUgcmVuZGVyZWQgaW5zaWRlIHRoZSBpbmRpY2F0b3IuICovXG4gIGNoaWxkcmVuPzogUmVhY3ROb2RlO1xuICAvKiogUHJvcHMgdGhhdCB3aWxsIGJlIHBhc3NlZCBvbiB0byB0aGUgY2hpbGRyZW4uICovXG4gIGlubmVyUHJvcHM6IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snZGl2J107XG4gIC8qKiBUaGUgZm9jdXNlZCBzdGF0ZSBvZiB0aGUgc2VsZWN0LiAqL1xuICBpc0ZvY3VzZWQ6IGJvb2xlYW47XG4gIGlzRGlzYWJsZWQ6IGJvb2xlYW47XG59XG5cbmNvbnN0IGJhc2VDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgdGhlbWU6IHtcbiAgICAgIHNwYWNpbmc6IHsgYmFzZVVuaXQgfSxcbiAgICAgIGNvbG9ycyxcbiAgICB9LFxuICB9OlxuICAgIHwgRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuICAgIHwgQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2luZGljYXRvckNvbnRhaW5lcicsXG4gIGRpc3BsYXk6ICdmbGV4JyxcbiAgdHJhbnNpdGlvbjogJ2NvbG9yIDE1MG1zJyxcbiAgLi4uKHVuc3R5bGVkXG4gICAgPyB7fVxuICAgIDoge1xuICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw2MCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIHBhZGRpbmc6IGJhc2VVbml0ICogMixcbiAgICAgICAgJzpob3Zlcic6IHtcbiAgICAgICAgICBjb2xvcjogaXNGb2N1c2VkID8gY29sb3JzLm5ldXRyYWw4MCA6IGNvbG9ycy5uZXV0cmFsNDAsXG4gICAgICAgIH0sXG4gICAgICB9KSxcbn0pO1xuXG5leHBvcnQgY29uc3QgZHJvcGRvd25JbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IERyb3Bkb3duSW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogRHJvcGRvd25JbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnZHJvcGRvd25JbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2Ryb3Bkb3duLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8RG93bkNoZXZyb24gLz59XG4gICAgPC9kaXY+XG4gICk7XG59O1xuXG5leHBvcnQgaW50ZXJmYWNlIENsZWFySW5kaWNhdG9yUHJvcHM8XG4gIE9wdGlvbiA9IHVua25vd24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuID0gYm9vbGVhbixcbiAgR3JvdXAgZXh0ZW5kcyBHcm91cEJhc2U8T3B0aW9uPiA9IEdyb3VwQmFzZTxPcHRpb24+XG4+IGV4dGVuZHMgQ29tbW9uUHJvcHNBbmRDbGFzc05hbWU8T3B0aW9uLCBJc011bHRpLCBHcm91cD4ge1xuICAvKiogVGhlIGNoaWxkcmVuIHRvIGJlIHJlbmRlcmVkIGluc2lkZSB0aGUgaW5kaWNhdG9yLiAqL1xuICBjaGlsZHJlbj86IFJlYWN0Tm9kZTtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xufVxuXG5leHBvcnQgY29uc3QgY2xlYXJJbmRpY2F0b3JDU1MgPSBiYXNlQ1NTO1xuZXhwb3J0IGNvbnN0IENsZWFySW5kaWNhdG9yID0gPFxuICBPcHRpb24sXG4gIElzTXVsdGkgZXh0ZW5kcyBib29sZWFuLFxuICBHcm91cCBleHRlbmRzIEdyb3VwQmFzZTxPcHRpb24+XG4+KFxuICBwcm9wczogQ2xlYXJJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgY2hpbGRyZW4sIGlubmVyUHJvcHMgfSA9IHByb3BzO1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKHByb3BzLCAnY2xlYXJJbmRpY2F0b3InLCB7XG4gICAgICAgIGluZGljYXRvcjogdHJ1ZSxcbiAgICAgICAgJ2NsZWFyLWluZGljYXRvcic6IHRydWUsXG4gICAgICB9KX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbiB8fCA8Q3Jvc3NJY29uIC8+fVxuICAgIDwvZGl2PlxuICApO1xufTtcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBTZXBhcmF0b3Jcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5leHBvcnQgaW50ZXJmYWNlIEluZGljYXRvclNlcGFyYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgaXNEaXNhYmxlZDogYm9vbGVhbjtcbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpbm5lclByb3BzPzogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ107XG59XG5cbmV4cG9ydCBjb25zdCBpbmRpY2F0b3JTZXBhcmF0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0Rpc2FibGVkLFxuICAgIHRoZW1lOiB7XG4gICAgICBzcGFjaW5nOiB7IGJhc2VVbml0IH0sXG4gICAgICBjb2xvcnMsXG4gICAgfSxcbiAgfTogSW5kaWNhdG9yU2VwYXJhdG9yUHJvcHM8T3B0aW9uLCBJc011bHRpLCBHcm91cD4sXG4gIHVuc3R5bGVkOiBib29sZWFuXG4pOiBDU1NPYmplY3RXaXRoTGFiZWwgPT4gKHtcbiAgbGFiZWw6ICdpbmRpY2F0b3JTZXBhcmF0b3InLFxuICBhbGlnblNlbGY6ICdzdHJldGNoJyxcbiAgd2lkdGg6IDEsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgYmFja2dyb3VuZENvbG9yOiBpc0Rpc2FibGVkID8gY29sb3JzLm5ldXRyYWwxMCA6IGNvbG9ycy5uZXV0cmFsMjAsXG4gICAgICAgIG1hcmdpbkJvdHRvbTogYmFzZVVuaXQgKiAyLFxuICAgICAgICBtYXJnaW5Ub3A6IGJhc2VVbml0ICogMixcbiAgICAgIH0pLFxufSk7XG5cbmV4cG9ydCBjb25zdCBJbmRpY2F0b3JTZXBhcmF0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHByb3BzOiBJbmRpY2F0b3JTZXBhcmF0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPlxuKSA9PiB7XG4gIGNvbnN0IHsgaW5uZXJQcm9wcyB9ID0gcHJvcHM7XG4gIHJldHVybiAoXG4gICAgPHNwYW5cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgICAgey4uLmdldFN0eWxlUHJvcHMocHJvcHMsICdpbmRpY2F0b3JTZXBhcmF0b3InLCB7XG4gICAgICAgICdpbmRpY2F0b3Itc2VwYXJhdG9yJzogdHJ1ZSxcbiAgICAgIH0pfVxuICAgIC8+XG4gICk7XG59O1xuXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbi8vIExvYWRpbmdcbi8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG5jb25zdCBsb2FkaW5nRG90QW5pbWF0aW9ucyA9IGtleWZyYW1lc2BcbiAgMCUsIDgwJSwgMTAwJSB7IG9wYWNpdHk6IDA7IH1cbiAgNDAlIHsgb3BhY2l0eTogMTsgfVxuYDtcblxuZXhwb3J0IGNvbnN0IGxvYWRpbmdJbmRpY2F0b3JDU1MgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oXG4gIHtcbiAgICBpc0ZvY3VzZWQsXG4gICAgc2l6ZSxcbiAgICB0aGVtZToge1xuICAgICAgY29sb3JzLFxuICAgICAgc3BhY2luZzogeyBiYXNlVW5pdCB9LFxuICAgIH0sXG4gIH06IExvYWRpbmdJbmRpY2F0b3JQcm9wczxPcHRpb24sIElzTXVsdGksIEdyb3VwPixcbiAgdW5zdHlsZWQ6IGJvb2xlYW5cbik6IENTU09iamVjdFdpdGhMYWJlbCA9PiAoe1xuICBsYWJlbDogJ2xvYWRpbmdJbmRpY2F0b3InLFxuICBkaXNwbGF5OiAnZmxleCcsXG4gIHRyYW5zaXRpb246ICdjb2xvciAxNTBtcycsXG4gIGFsaWduU2VsZjogJ2NlbnRlcicsXG4gIGZvbnRTaXplOiBzaXplLFxuICBsaW5lSGVpZ2h0OiAxLFxuICBtYXJnaW5SaWdodDogc2l6ZSxcbiAgdGV4dEFsaWduOiAnY2VudGVyJyxcbiAgdmVydGljYWxBbGlnbjogJ21pZGRsZScsXG4gIC4uLih1bnN0eWxlZFxuICAgID8ge31cbiAgICA6IHtcbiAgICAgICAgY29sb3I6IGlzRm9jdXNlZCA/IGNvbG9ycy5uZXV0cmFsNjAgOiBjb2xvcnMubmV1dHJhbDIwLFxuICAgICAgICBwYWRkaW5nOiBiYXNlVW5pdCAqIDIsXG4gICAgICB9KSxcbn0pO1xuXG5pbnRlcmZhY2UgTG9hZGluZ0RvdFByb3BzIHtcbiAgZGVsYXk6IG51bWJlcjtcbiAgb2Zmc2V0OiBib29sZWFuO1xufVxuY29uc3QgTG9hZGluZ0RvdCA9ICh7IGRlbGF5LCBvZmZzZXQgfTogTG9hZGluZ0RvdFByb3BzKSA9PiAoXG4gIDxzcGFuXG4gICAgY3NzPXt7XG4gICAgICBhbmltYXRpb246IGAke2xvYWRpbmdEb3RBbmltYXRpb25zfSAxcyBlYXNlLWluLW91dCAke2RlbGF5fW1zIGluZmluaXRlO2AsXG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6ICdjdXJyZW50Q29sb3InLFxuICAgICAgYm9yZGVyUmFkaXVzOiAnMWVtJyxcbiAgICAgIGRpc3BsYXk6ICdpbmxpbmUtYmxvY2snLFxuICAgICAgbWFyZ2luTGVmdDogb2Zmc2V0ID8gJzFlbScgOiB1bmRlZmluZWQsXG4gICAgICBoZWlnaHQ6ICcxZW0nLFxuICAgICAgdmVydGljYWxBbGlnbjogJ3RvcCcsXG4gICAgICB3aWR0aDogJzFlbScsXG4gICAgfX1cbiAgLz5cbik7XG5cbmV4cG9ydCBpbnRlcmZhY2UgTG9hZGluZ0luZGljYXRvclByb3BzPFxuICBPcHRpb24gPSB1bmtub3duLFxuICBJc011bHRpIGV4dGVuZHMgYm9vbGVhbiA9IGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj4gPSBHcm91cEJhc2U8T3B0aW9uPlxuPiBleHRlbmRzIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+IHtcbiAgLyoqIFByb3BzIHRoYXQgd2lsbCBiZSBwYXNzZWQgb24gdG8gdGhlIGNoaWxkcmVuLiAqL1xuICBpbm5lclByb3BzOiBKU1guSW50cmluc2ljRWxlbWVudHNbJ2RpdiddO1xuICAvKiogVGhlIGZvY3VzZWQgc3RhdGUgb2YgdGhlIHNlbGVjdC4gKi9cbiAgaXNGb2N1c2VkOiBib29sZWFuO1xuICBpc0Rpc2FibGVkOiBib29sZWFuO1xuICAvKiogU2V0IHNpemUgb2YgdGhlIGNvbnRhaW5lci4gKi9cbiAgc2l6ZTogbnVtYmVyO1xufVxuZXhwb3J0IGNvbnN0IExvYWRpbmdJbmRpY2F0b3IgPSA8XG4gIE9wdGlvbixcbiAgSXNNdWx0aSBleHRlbmRzIGJvb2xlYW4sXG4gIEdyb3VwIGV4dGVuZHMgR3JvdXBCYXNlPE9wdGlvbj5cbj4oe1xuICBpbm5lclByb3BzLFxuICBpc1J0bCxcbiAgc2l6ZSA9IDQsXG4gIC4uLnJlc3RQcm9wc1xufTogTG9hZGluZ0luZGljYXRvclByb3BzPE9wdGlvbiwgSXNNdWx0aSwgR3JvdXA+KSA9PiB7XG4gIHJldHVybiAoXG4gICAgPGRpdlxuICAgICAgey4uLmdldFN0eWxlUHJvcHMoXG4gICAgICAgIHsgLi4ucmVzdFByb3BzLCBpbm5lclByb3BzLCBpc1J0bCwgc2l6ZSB9LFxuICAgICAgICAnbG9hZGluZ0luZGljYXRvcicsXG4gICAgICAgIHtcbiAgICAgICAgICBpbmRpY2F0b3I6IHRydWUsXG4gICAgICAgICAgJ2xvYWRpbmctaW5kaWNhdG9yJzogdHJ1ZSxcbiAgICAgICAgfVxuICAgICAgKX1cbiAgICAgIHsuLi5pbm5lclByb3BzfVxuICAgID5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXswfSBvZmZzZXQ9e2lzUnRsfSAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezE2MH0gb2Zmc2V0IC8+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MzIwfSBvZmZzZXQ9eyFpc1J0bH0gLz5cbiAgICA8L2Rpdj5cbiAgKTtcbn07XG4iXX0= */")})},cD=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return ry("div",Im({ref:o},IP(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),t)},uD=["data"],dD=function(e){var t=e.children,n=e.cx,r=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return ry("div",Im({},IP(e,"group",{group:!0}),s),ry(i,Im({},a,{selectProps:u,theme:c,getStyles:r,getClassNames:o,cx:n}),l),ry("div",null,t))},pD=["innerRef","isDisabled","isHidden","inputClassName"],fD={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},hD={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":lP({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},fD)},mD=function(e){return lP({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},fD)},gD=function(e){var t=e.cx,n=e.value,r=SP(e),o=r.innerRef,i=r.isDisabled,a=r.isHidden,s=r.inputClassName,l=pP(r,pD);return ry("div",Im({},IP(e,"input",{"input-container":!0}),{"data-value":n||""}),ry("input",Im({className:t({input:!0},s),ref:o,style:mD(a),disabled:i},l)))},yD=function(e){var t=e.children,n=e.innerProps;return ry("div",n,t)};var bD=function(e){var t=e.children,n=e.components,r=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return ry(l,{data:r,innerProps:lP(lP({},IP(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:s},ry(c,{data:r,innerProps:lP({},IP(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),ry(u,{data:r,innerProps:lP(lP({},IP(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:s}))},vD=function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.innerRef,a=e.innerProps;return ry("div",Im({},IP(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":o}),{ref:i,"aria-disabled":n},a),t)},wD=function(e){var t=e.children,n=e.innerProps;return ry("div",Im({},IP(e,"placeholder",{placeholder:!0}),n),t)},xD=function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return ry("div",Im({},IP(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},CD={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return ry("div",Im({},IP(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||ry(nD,null))},Control:cD,DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return ry("div",Im({},IP(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||ry(rD,null))},DownChevron:rD,CrossIcon:nD,Group:dD,GroupHeading:function(e){var t=SP(e);t.data;var n=pP(t,uD);return ry("div",Im({},IP(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return ry("div",Im({},IP(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return ry("span",Im({},t,IP(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:gD,LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,o=void 0===r?4:r,i=pP(e,KP);return ry("div",Im({},IP(lP(lP({},i),{},{innerProps:t,isRtl:n,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ry(lD,{delay:0,offset:n}),ry(lD,{delay:160,offset:!0}),ry(lD,{delay:320,offset:!n}))},Menu:ZP,MenuList:function(e){var t=e.children,n=e.innerProps,r=e.innerRef,o=e.isMulti;return ry("div",Im({},IP(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},n),t)},MenuPortal:function(n){var r=n.appendTo,o=n.children,i=n.controlElement,a=n.innerProps,s=n.menuPlacement,l=n.menuPosition,c=e.useRef(null),u=e.useRef(null),d=dP(e.useState(HP(s)),2),p=d[0],f=d[1],h=e.useMemo((function(){return{setPortalPlacement:f}}),[]),m=dP(e.useState(null),2),g=m[0],y=m[1],b=e.useCallback((function(){if(i){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(i),t="fixed"===l?0:window.pageYOffset,n=e[p]+t;n===(null==g?void 0:g.offset)&&e.left===(null==g?void 0:g.rect.left)&&e.width===(null==g?void 0:g.rect.width)||y({offset:n,rect:e})}}),[i,l,p,null==g?void 0:g.offset,null==g?void 0:g.rect.left,null==g?void 0:g.rect.width]);vP((function(){b()}),[b]);var v=e.useCallback((function(){"function"==typeof u.current&&(u.current(),u.current=null),i&&c.current&&(u.current=sC(i,c.current,b,{elementResize:"ResizeObserver"in window}))}),[i,b]);vP((function(){v()}),[v]);var w=e.useCallback((function(e){c.current=e,v()}),[v]);if(!r&&"fixed"!==l||!g)return null;var x=ry("div",Im({ref:w},IP(lP(lP({},n),{},{offset:g.offset,position:l,rect:g.rect}),"menuPortal",{"menu-portal":!0}),a),o);return ry(WP.Provider,{value:h},r?t.createPortal(x,r):x)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,o=pP(e,VP);return ry("div",Im({},IP(lP(lP({},o),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,r=e.innerProps,o=pP(e,LP);return ry("div",Im({},IP(lP(lP({},o),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},MultiValue:bD,MultiValueContainer:yD,MultiValueLabel:yD,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return ry("div",Im({role:"button"},n),t||ry(nD,{size:14}))},Option:vD,Placeholder:wD,SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,o=e.isRtl;return ry("div",Im({},IP(e,"container",{"--is-disabled":r,"--is-rtl":o}),n),t)},SingleValue:xD,ValueContainer:function(e){var t=e.children,n=e.innerProps,r=e.isMulti,o=e.hasValue;return ry("div",Im({},IP(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),n),t)}},ED=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function kD(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],o=t[n],!(r===o||ED(r)&&ED(o)))return!1;var r,o;return!0}for(var SD="production"===process.env.NODE_ENV?{name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"}:{name:"1f43avz-a11yText-A11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap;label:A11yText;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkExMXlUZXh0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPSSIsImZpbGUiOiJBMTF5VGV4dC50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKiogQGpzeCBqc3ggKi9cbmltcG9ydCB7IEpTWCB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCB7IGpzeCB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuLy8gQXNzaXN0aXZlIHRleHQgdG8gZGVzY3JpYmUgdmlzdWFsIGVsZW1lbnRzLiBIaWRkZW4gZm9yIHNpZ2h0ZWQgdXNlcnMuXG5jb25zdCBBMTF5VGV4dCA9IChwcm9wczogSlNYLkludHJpbnNpY0VsZW1lbnRzWydzcGFuJ10pID0+IChcbiAgPHNwYW5cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAnYTExeVRleHQnLFxuICAgICAgekluZGV4OiA5OTk5LFxuICAgICAgYm9yZGVyOiAwLFxuICAgICAgY2xpcDogJ3JlY3QoMXB4LCAxcHgsIDFweCwgMXB4KScsXG4gICAgICBoZWlnaHQ6IDEsXG4gICAgICB3aWR0aDogMSxcbiAgICAgIHBvc2l0aW9uOiAnYWJzb2x1dGUnLFxuICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nLFxuICAgICAgcGFkZGluZzogMCxcbiAgICAgIHdoaXRlU3BhY2U6ICdub3dyYXAnLFxuICAgIH19XG4gICAgey4uLnByb3BzfVxuICAvPlxuKTtcblxuZXhwb3J0IGRlZmF1bHQgQTExeVRleHQ7XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}},ID=function(e){return ry("span",Im({css:SD},e))},_D={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,o=e.context,i=e.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,r=void 0===n?"":n,o=e.labels,i=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(r,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=void 0===o?"":o,a=e.selectValue,s=e.isDisabled,l=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if("menu"===t&&c){var d=s?" disabled":"",p="".concat(l?" selected":"").concat(d);return"".concat(i).concat(p,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},AD=function(t){var n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,i=t.focusableOptions,a=t.isFocused,s=t.selectValue,l=t.selectProps,c=t.id,u=t.isAppleDevice,d=l.ariaLiveMessages,p=l.getOptionLabel,f=l.inputValue,h=l.isMulti,m=l.isOptionDisabled,g=l.isSearchable,y=l.menuIsOpen,b=l.options,v=l.screenReaderStatus,w=l.tabSelectsValue,x=l.isLoading,C=l["aria-label"],E=l["aria-live"],k=e.useMemo((function(){return lP(lP({},_D),d||{})}),[d]),S=e.useMemo((function(){var e,t="";if(n&&k.onChange){var r=n.option,o=n.options,i=n.removedValue,a=n.removedValues,l=n.value,c=i||r||(e=l,Array.isArray(e)?null:e),u=c?p(c):"",d=o||a||void 0,f=d?d.map(p):[],h=lP({isDisabled:c&&m(c,s),label:u,labels:f},n);t=k.onChange(h)}return t}),[n,k,m,s,p]),I=e.useMemo((function(){var e="",t=r||o,n=!!(r&&s&&s.includes(r));if(t&&k.onFocus){var a={focused:t,label:p(t),isDisabled:m(t,s),isSelected:n,options:i,context:t===r?"menu":"value",selectValue:s,isAppleDevice:u};e=k.onFocus(a)}return e}),[r,o,p,m,k,i,s,u]),_=e.useMemo((function(){var e="";if(y&&b.length&&!x&&k.onFilter){var t=v({count:i.length});e=k.onFilter({inputValue:f,resultsMessage:t})}return e}),[i,f,y,k,b,v,x]),A="initial-input-focus"===(null==n?void 0:n.action),N=e.useMemo((function(){var e="";if(k.guidance){var t=o?"value":y?"menu":"input";e=k.guidance({"aria-label":C,context:t,isDisabled:r&&m(r,s),isMulti:h,isSearchable:g,tabSelectsValue:w,isInitialFocus:A})}return e}),[C,r,o,h,m,g,y,k,s,w,A]),R=ry(e.Fragment,null,ry("span",{id:"aria-selection"},S),ry("span",{id:"aria-focused"},I),ry("span",{id:"aria-results"},_),ry("span",{id:"aria-guidance"},N));return ry(e.Fragment,null,ry(ID,{id:c},A&&R),ry(ID,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!A&&R))},ND=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],RD=new RegExp("["+ND.map((function(e){return e.letters})).join("")+"]","g"),OD={},TD=0;TD<ND.length;TD++)for(var MD=ND[TD],PD=0;PD<MD.letters.length;PD++)OD[MD.letters[PD]]=MD.base;var DD=function(e){return e.replace(RD,(function(e){return OD[e]}))},BD=function(e,t){void 0===t&&(t=kD);var n=null;function r(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var i=e.apply(this,r);return n={lastResult:i,lastArgs:r,lastThis:this},i}return r.clear=function(){n=null},r}(DD),jD=function(e){return e.replace(/^\s+|\s+$/g,"")},FD=function(e){return"".concat(e.label," ").concat(e.value)},LD=["innerRef"];function VD(e){var t=e.innerRef,n=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=Object.entries(e).filter((function(e){var t=dP(e,1)[0];return!n.includes(t)}));return o.reduce((function(e,t){var n=dP(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})}(pP(e,LD),"onExited","in","enter","exit","appear");return ry("input",Im({ref:t},n,{css:oy({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"production"===process.env.NODE_ENV?"":";label:DummyInput;","production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkR1bW15SW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCTSIsImZpbGUiOiJEdW1teUlucHV0LnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgSlNYLCBSZWYgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5pbXBvcnQgeyByZW1vdmVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gRHVtbXlJbnB1dCh7XG4gIGlubmVyUmVmLFxuICAuLi5wcm9wc1xufTogSlNYLkludHJpbnNpY0VsZW1lbnRzWydpbnB1dCddICYge1xuICByZWFkb25seSBpbm5lclJlZjogUmVmPEhUTUxJbnB1dEVsZW1lbnQ+O1xufSkge1xuICAvLyBSZW1vdmUgYW5pbWF0aW9uIHByb3BzIG5vdCBtZWFudCBmb3IgSFRNTCBlbGVtZW50c1xuICBjb25zdCBmaWx0ZXJlZFByb3BzID0gcmVtb3ZlUHJvcHMoXG4gICAgcHJvcHMsXG4gICAgJ29uRXhpdGVkJyxcbiAgICAnaW4nLFxuICAgICdlbnRlcicsXG4gICAgJ2V4aXQnLFxuICAgICdhcHBlYXInXG4gICk7XG5cbiAgcmV0dXJuIChcbiAgICA8aW5wdXRcbiAgICAgIHJlZj17aW5uZXJSZWZ9XG4gICAgICB7Li4uZmlsdGVyZWRQcm9wc31cbiAgICAgIGNzcz17e1xuICAgICAgICBsYWJlbDogJ2R1bW15SW5wdXQnLFxuICAgICAgICAvLyBnZXQgcmlkIG9mIGFueSBkZWZhdWx0IHN0eWxlc1xuICAgICAgICBiYWNrZ3JvdW5kOiAwLFxuICAgICAgICBib3JkZXI6IDAsXG4gICAgICAgIC8vIGltcG9ydGFudCEgdGhpcyBoaWRlcyB0aGUgZmxhc2hpbmcgY3Vyc29yXG4gICAgICAgIGNhcmV0Q29sb3I6ICd0cmFuc3BhcmVudCcsXG4gICAgICAgIGZvbnRTaXplOiAnaW5oZXJpdCcsXG4gICAgICAgIGdyaWRBcmVhOiAnMSAvIDEgLyAyIC8gMycsXG4gICAgICAgIG91dGxpbmU6IDAsXG4gICAgICAgIHBhZGRpbmc6IDAsXG4gICAgICAgIC8vIGltcG9ydGFudCEgd2l0aG91dCBgd2lkdGhgIGJyb3dzZXJzIHdvbid0IGFsbG93IGZvY3VzXG4gICAgICAgIHdpZHRoOiAxLFxuXG4gICAgICAgIC8vIHJlbW92ZSBjdXJzb3Igb24gZGVza3RvcFxuICAgICAgICBjb2xvcjogJ3RyYW5zcGFyZW50JyxcblxuICAgICAgICAvLyByZW1vdmUgY3Vyc29yIG9uIG1vYmlsZSB3aGlsc3QgbWFpbnRhaW5pbmcgXCJzY3JvbGwgaW50byB2aWV3XCIgYmVoYXZpb3VyXG4gICAgICAgIGxlZnQ6IC0xMDAsXG4gICAgICAgIG9wYWNpdHk6IDAsXG4gICAgICAgIHBvc2l0aW9uOiAncmVsYXRpdmUnLFxuICAgICAgICB0cmFuc2Zvcm06ICdzY2FsZSguMDEpJyxcbiAgICAgIH19XG4gICAgLz5cbiAgKTtcbn1cbiJdfQ== */")}))}var zD=["boxSizing","height","overflow","paddingRight","position"],GD={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function HD(e){e.cancelable&&e.preventDefault()}function WD(e){e.stopPropagation()}function XD(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function ZD(){return"ontouchstart"in window||navigator.maxTouchPoints}var $D=!("undefined"==typeof window||!window.document||!window.document.createElement),YD=0,UD={capture:!1,passive:!1};var JD=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},KD="production"===process.env.NODE_ENV?{name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"}:{name:"bp8cua-ScrollManager",styles:"position:fixed;left:0;bottom:0;right:0;top:0;label:ScrollManager;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlNjcm9sbE1hbmFnZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW9EVSIsImZpbGUiOiJTY3JvbGxNYW5hZ2VyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsganN4IH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHsgRnJhZ21lbnQsIFJlYWN0RWxlbWVudCwgUmVmQ2FsbGJhY2ssIE1vdXNlRXZlbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgdXNlU2Nyb2xsQ2FwdHVyZSBmcm9tICcuL3VzZVNjcm9sbENhcHR1cmUnO1xuaW1wb3J0IHVzZVNjcm9sbExvY2sgZnJvbSAnLi91c2VTY3JvbGxMb2NrJztcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgcmVhZG9ubHkgY2hpbGRyZW46IChyZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PikgPT4gUmVhY3RFbGVtZW50O1xuICByZWFkb25seSBsb2NrRW5hYmxlZDogYm9vbGVhbjtcbiAgcmVhZG9ubHkgY2FwdHVyZUVuYWJsZWQ6IGJvb2xlYW47XG4gIHJlYWRvbmx5IG9uQm90dG9tQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Cb3R0b21MZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG4gIHJlYWRvbmx5IG9uVG9wQXJyaXZlPzogKGV2ZW50OiBXaGVlbEV2ZW50IHwgVG91Y2hFdmVudCkgPT4gdm9pZDtcbiAgcmVhZG9ubHkgb25Ub3BMZWF2ZT86IChldmVudDogV2hlZWxFdmVudCB8IFRvdWNoRXZlbnQpID0+IHZvaWQ7XG59XG5cbmNvbnN0IGJsdXJTZWxlY3RJbnB1dCA9IChldmVudDogTW91c2VFdmVudDxIVE1MRGl2RWxlbWVudD4pID0+IHtcbiAgY29uc3QgZWxlbWVudCA9IGV2ZW50LnRhcmdldCBhcyBIVE1MRGl2RWxlbWVudDtcbiAgcmV0dXJuIChcbiAgICBlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCAmJlxuICAgIChlbGVtZW50Lm93bmVyRG9jdW1lbnQuYWN0aXZlRWxlbWVudCBhcyBIVE1MRWxlbWVudCkuYmx1cigpXG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBTY3JvbGxNYW5hZ2VyKHtcbiAgY2hpbGRyZW4sXG4gIGxvY2tFbmFibGVkLFxuICBjYXB0dXJlRW5hYmxlZCA9IHRydWUsXG4gIG9uQm90dG9tQXJyaXZlLFxuICBvbkJvdHRvbUxlYXZlLFxuICBvblRvcEFycml2ZSxcbiAgb25Ub3BMZWF2ZSxcbn06IFByb3BzKSB7XG4gIGNvbnN0IHNldFNjcm9sbENhcHR1cmVUYXJnZXQgPSB1c2VTY3JvbGxDYXB0dXJlKHtcbiAgICBpc0VuYWJsZWQ6IGNhcHR1cmVFbmFibGVkLFxuICAgIG9uQm90dG9tQXJyaXZlLFxuICAgIG9uQm90dG9tTGVhdmUsXG4gICAgb25Ub3BBcnJpdmUsXG4gICAgb25Ub3BMZWF2ZSxcbiAgfSk7XG4gIGNvbnN0IHNldFNjcm9sbExvY2tUYXJnZXQgPSB1c2VTY3JvbGxMb2NrKHsgaXNFbmFibGVkOiBsb2NrRW5hYmxlZCB9KTtcblxuICBjb25zdCB0YXJnZXRSZWY6IFJlZkNhbGxiYWNrPEhUTUxFbGVtZW50PiA9IChlbGVtZW50KSA9PiB7XG4gICAgc2V0U2Nyb2xsQ2FwdHVyZVRhcmdldChlbGVtZW50KTtcbiAgICBzZXRTY3JvbGxMb2NrVGFyZ2V0KGVsZW1lbnQpO1xuICB9O1xuXG4gIHJldHVybiAoXG4gICAgPEZyYWdtZW50PlxuICAgICAge2xvY2tFbmFibGVkICYmIChcbiAgICAgICAgPGRpdlxuICAgICAgICAgIG9uQ2xpY2s9e2JsdXJTZWxlY3RJbnB1dH1cbiAgICAgICAgICBjc3M9e3sgcG9zaXRpb246ICdmaXhlZCcsIGxlZnQ6IDAsIGJvdHRvbTogMCwgcmlnaHQ6IDAsIHRvcDogMCB9fVxuICAgICAgICAvPlxuICAgICAgKX1cbiAgICAgIHtjaGlsZHJlbih0YXJnZXRSZWYpfVxuICAgIDwvRnJhZ21lbnQ+XG4gICk7XG59XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}};function QD(t){var n=t.children,r=t.lockEnabled,o=t.captureEnabled,i=function(t){var n=t.isEnabled,r=t.onBottomArrive,o=t.onBottomLeave,i=t.onTopArrive,a=t.onTopLeave,s=e.useRef(!1),l=e.useRef(!1),c=e.useRef(0),u=e.useRef(null),d=e.useCallback((function(e,t){if(null!==u.current){var n=u.current,c=n.scrollTop,d=n.scrollHeight,p=n.clientHeight,f=u.current,h=t>0,m=d-p-c,g=!1;m>t&&s.current&&(o&&o(e),s.current=!1),h&&l.current&&(a&&a(e),l.current=!1),h&&t>m?(r&&!s.current&&r(e),f.scrollTop=d,g=!0,s.current=!0):!h&&-t>c&&(i&&!l.current&&i(e),f.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}}),[r,o,i,a]),p=e.useCallback((function(e){d(e,e.deltaY)}),[d]),f=e.useCallback((function(e){c.current=e.changedTouches[0].clientY}),[]),h=e.useCallback((function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)}),[d]),m=e.useCallback((function(e){if(e){var t=!!BP&&{passive:!1};e.addEventListener("wheel",p,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",h,t)}}),[h,f,p]),g=e.useCallback((function(e){e&&(e.removeEventListener("wheel",p,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",h,!1))}),[h,f,p]);return e.useEffect((function(){if(n){var e=u.current;return m(e),function(){g(e)}}}),[n,m,g]),function(e){u.current=e}}({isEnabled:void 0===o||o,onBottomArrive:t.onBottomArrive,onBottomLeave:t.onBottomLeave,onTopArrive:t.onTopArrive,onTopLeave:t.onTopLeave}),a=function(t){var n=t.isEnabled,r=t.accountForScrollbars,o=void 0===r||r,i=e.useRef({}),a=e.useRef(null),s=e.useCallback((function(e){if($D){var t=document.body,n=t&&t.style;if(o&&zD.forEach((function(e){var t=n&&n[e];i.current[e]=t})),o&&YD<1){var r=parseInt(i.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,s=window.innerWidth-a+r||0;Object.keys(GD).forEach((function(e){var t=GD[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(s,"px"))}t&&ZD()&&(t.addEventListener("touchmove",HD,UD),e&&(e.addEventListener("touchstart",XD,UD),e.addEventListener("touchmove",WD,UD))),YD+=1}}),[o]),l=e.useCallback((function(e){if($D){var t=document.body,n=t&&t.style;YD=Math.max(YD-1,0),o&&YD<1&&zD.forEach((function(e){var t=i.current[e];n&&(n[e]=t)})),t&&ZD()&&(t.removeEventListener("touchmove",HD,UD),e&&(e.removeEventListener("touchstart",XD,UD),e.removeEventListener("touchmove",WD,UD)))}}),[o]);return e.useEffect((function(){if(n){var e=a.current;return s(e),function(){l(e)}}}),[n,s,l]),function(e){a.current=e}}({isEnabled:r});return ry(e.Fragment,null,r&&ry("div",{onClick:JD,css:KD}),n((function(e){i(e),a(e)})))}var qD="production"===process.env.NODE_ENV?{name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"}:{name:"5kkxb2-requiredInput-RequiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%;label:RequiredInput;",map:"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlcXVpcmVkSW5wdXQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWNJIiwiZmlsZSI6IlJlcXVpcmVkSW5wdXQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqIEBqc3gganN4ICovXG5pbXBvcnQgeyBGb2N1c0V2ZW50SGFuZGxlciwgRnVuY3Rpb25Db21wb25lbnQgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgeyBqc3ggfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmNvbnN0IFJlcXVpcmVkSW5wdXQ6IEZ1bmN0aW9uQ29tcG9uZW50PHtcbiAgcmVhZG9ubHkgbmFtZT86IHN0cmluZztcbiAgcmVhZG9ubHkgb25Gb2N1czogRm9jdXNFdmVudEhhbmRsZXI8SFRNTElucHV0RWxlbWVudD47XG59PiA9ICh7IG5hbWUsIG9uRm9jdXMgfSkgPT4gKFxuICA8aW5wdXRcbiAgICByZXF1aXJlZFxuICAgIG5hbWU9e25hbWV9XG4gICAgdGFiSW5kZXg9ey0xfVxuICAgIGFyaWEtaGlkZGVuPVwidHJ1ZVwiXG4gICAgb25Gb2N1cz17b25Gb2N1c31cbiAgICBjc3M9e3tcbiAgICAgIGxhYmVsOiAncmVxdWlyZWRJbnB1dCcsXG4gICAgICBvcGFjaXR5OiAwLFxuICAgICAgcG9pbnRlckV2ZW50czogJ25vbmUnLFxuICAgICAgcG9zaXRpb246ICdhYnNvbHV0ZScsXG4gICAgICBib3R0b206IDAsXG4gICAgICBsZWZ0OiAwLFxuICAgICAgcmlnaHQ6IDAsXG4gICAgICB3aWR0aDogJzEwMCUnLFxuICAgIH19XG4gICAgLy8gUHJldmVudCBgU3dpdGNoaW5nIGZyb20gdW5jb250cm9sbGVkIHRvIGNvbnRyb2xsZWRgIGVycm9yXG4gICAgdmFsdWU9XCJcIlxuICAgIG9uQ2hhbmdlPXsoKSA9PiB7fX1cbiAgLz5cbik7XG5cbmV4cG9ydCBkZWZhdWx0IFJlcXVpcmVkSW5wdXQ7XG4iXX0= */",toString:function(){return"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."}},eB=function(e){var t=e.name,n=e.onFocus;return ry("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:qD,value:"",onChange:function(){}})};function tB(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function nB(){return tB(/^Mac/i)}function rB(){return tB(/^iPhone/i)||tB(/^iPad/i)||nB()&&navigator.maxTouchPoints>1}var oB,iB={clearIndicator:aD,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius;return lP({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},dropdownIndicator:iD,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,r=n.colors,o=n.spacing;return lP({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*o.baseUnit,paddingRight:3*o.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,i=r.colors;return lP({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,r=e.value,o=e.theme,i=o.spacing,a=o.colors;return lP(lP({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},hD),t?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,r=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return lP({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?i.neutral60:i.neutral20,padding:2*a})},loadingMessage:UP,menu:function(e,t){var n,r=e.placement,o=e.theme,i=o.borderRadius,a=o.spacing,s=o.colors;return lP((aP(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(r),"100%"),aP(n,"position","absolute"),aP(n,"width","100%"),aP(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},menuList:function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return lP({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors;return lP({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,r=n.borderRadius,o=n.colors,i=e.cropWithEllipsis;return lP({overflow:"hidden",textOverflow:i||void 0===i?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,r=n.spacing,o=n.borderRadius,i=n.colors,a=e.isFocused;return lP({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},noOptionsMessage:YP,option:function(e,t){var n=e.isDisabled,r=e.isFocused,o=e.isSelected,i=e.theme,a=i.spacing,s=i.colors;return lP({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?s.primary:r?s.primary25:"transparent",color:n?s.neutral20:o?s.neutral0:"inherit",padding:"".concat(2*a.baseUnit,"px ").concat(3*a.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,r=n.spacing,o=n.colors;return lP({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,r=e.theme,o=r.spacing,i=r.colors;return lP({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?i.neutral40:i.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,r=e.isMulti,o=e.hasValue,i=e.selectProps.controlShouldRenderValue;return lP({alignItems:"center",display:r&&o&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},aB={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},sB={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:TP(),captureMenuScroll:!TP(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=lP({ignoreCase:!0,ignoreAccents:!0,stringify:FD,trim:!0,matchFrom:"any"},oB),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,s=n.matchFrom,l=a?jD(t):t,c=a?jD(i(e)):i(e);return r&&(l=l.toLowerCase(),c=c.toLowerCase()),o&&(l=BD(l),c=DD(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function lB(e,t,n,r){return{type:"option",data:t,isDisabled:gB(e,t,n),isSelected:yB(e,t,n),label:hB(e,t),value:mB(e,t),index:r}}function cB(e,t){return e.options.map((function(n,r){if("options"in n){var o=n.options.map((function(n,r){return lB(e,n,t,r)})).filter((function(t){return pB(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=lB(e,n,t,r);return pB(e,i)?i:void 0})).filter(jP)}function uB(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,bP(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function dB(e,t){return e.reduce((function(e,n){return"group"===n.type?e.push.apply(e,bP(n.options.map((function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}})))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e}),[])}function pB(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,i=t.isSelected,a=t.label,s=t.value;return(!vB(e)||!i)&&bB(e,{label:a,value:s,data:o},r)}var fB=function(e,t){var n;return(null===(n=e.find((function(e){return e.data===t})))||void 0===n?void 0:n.id)||null},hB=function(e,t){return e.getOptionLabel(t)},mB=function(e,t){return e.getOptionValue(t)};function gB(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function yB(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=mB(e,t);return n.some((function(t){return mB(e,t)===r}))}function bB(e,t,n){return!e.filterOption||e.filterOption(t,n)}var vB=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},wB=1,xB=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yw(e,t)}(n,e.Component);var t=yP(n);function n(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=nB()||rB(),r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,o=n.onChange,i=n.name;t.name=i,r.ariaOnChange(e,t),o(e,t)},r.setValue=function(e,t,n){var o=r.props,i=o.closeMenuOnSelect,a=o.isMulti,s=o.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:s}),i&&(r.setState({inputIsHiddenAfterUpdate:!a}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,o=t.isMulti,i=t.name,a=r.state.selectValue,s=o&&r.isOptionSelected(e,a),l=r.isOptionDisabled(e,a);if(s){var c=r.getOptionValue(e);r.setValue(a.filter((function(e){return r.getOptionValue(e)!==c})),"deselect-option",e)}else{if(l)return void r.ariaOnChange(e,{action:"select-option",option:e,name:i});o?r.setValue([].concat(bP(a),[e]),"select-option",e):r.setValue(e,"select-option")}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,o=r.getOptionValue(e),i=n.filter((function(e){return r.getOptionValue(e)!==o})),a=FP(t,i,i[0]||null);r.onChange(a,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(FP(r.props.isMulti,[],null),{action:"clear",removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],o=t.slice(0,t.length-1),i=FP(e,o,o[0]||null);n&&r.onChange(i,{action:"pop-value",removedValue:n})},r.getFocusedOptionId=function(e){return fB(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return dB(cB(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return EP.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return hB(r.props,e)},r.getOptionValue=function(e){return mB(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,o=iB[e](t,n);o.boxSizing="border-box";var i=r.props.styles[e];return i?i(o,t):o},r.getClassNames=function(e,t){var n,o;return null===(n=(o=r.props.classNames)[e])||void 0===n?void 0:n.call(o,t)},r.getElementId=function(e){return"".concat(r.state.instancePrefix,"-").concat(e)},r.getComponents=function(){return e=r.props,lP(lP({},CD),e.components);var e},r.buildCategorizedOptions=function(){return cB(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return uB(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:lP({value:e},t)})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||r.props.isDisabled)){var t=r.props,n=t.isMulti,o=t.menuIsOpen;r.focusInput(),o?(r.setState({inputIsHiddenAfterUpdate:!n}),r.onMenuClose()):r.openMenu("first"),e.preventDefault()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.preventDefault(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout((function(){return r.focusInput()})))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&_P(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var o=Math.abs(n.clientX-r.initialTouchX),i=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=o>5||i>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:"input-change",prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur",prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){if(!r.blockOptionHover&&r.state.focusedOption!==e){var t=r.getFocusableOptions().indexOf(e);r.setState({focusedOption:e,focusedOptionId:t>-1?r.getFocusedOptionId(e):null})}},r.shouldHideSelectedOptions=function(){return vB(r.props)},r.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),r.focus()},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,o=t.backspaceRemovesValue,i=t.escapeClearsValue,a=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,p=t.openMenuOnFocus,f=r.state,h=f.focusedOption,m=f.focusedValue,g=f.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||a)return;r.focusValue("previous");break;case"ArrowRight":if(!n||a)return;r.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(m)r.removeValue(m);else{if(!o)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!c||!d||!h||p&&r.isOptionSelected(h,g))return;r.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(c){if(!h)return;if(r.isComposing)return;r.selectOption(h);break}return;case"Escape":c?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:a}),r.onMenuClose()):s&&i&&r.clearValue();break;case" ":if(a)return;if(!c){r.openMenu("first");break}if(!h)return;r.selectOption(h);break;case"ArrowUp":c?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":c?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!c)return;r.focusOption("pageup");break;case"PageDown":if(!c)return;r.focusOption("pagedown");break;case"Home":if(!c)return;r.focusOption("first");break;case"End":if(!c)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++wB),r.state.selectValue=kP(e.value),e.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),a=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=i[a],r.state.focusedOptionId=fB(o,i[a])}return r}return function(e,t,n){t&&hP(e.prototype,t),n&&hP(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&OP(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&r&&!e.menuIsOpen)&&this.focusInput(),o&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):o||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(OP(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,o=n.isFocused,i=this.buildFocusableOptions(),a="first"===e?0:i.length-1;if(!this.props.isMulti){var s=i.indexOf(r[0]);s>-1&&(a=s)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[a],focusedOptionId:this.getFocusedOptionId(i[a])},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(r);r||(o=-1);var i=n.length-1,a=-1;if(n.length){switch(e){case"previous":a=0===o?0:-1===o?i:o-1;break;case"next":o>-1&&o<i&&(a=o+1)}this.setState({inputIsHidden:-1!==a,focusedValue:n[a]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var o=0,i=r.indexOf(n);n||(i=-1),"up"===e?o=i>0?i-1:r.length-1:"down"===e?o=(i+1)%r.length:"pageup"===e?(o=i-t)<0&&(o=0):"pagedown"===e?(o=i+t)>r.length-1&&(o=r.length-1):"last"===e&&(o=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[o],focusedValue:null,focusedOptionId:this.getFocusedOptionId(r[o])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(aB):lP(lP({},aB),this.props.theme):aB}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,o=this.getValue,i=this.selectOption,a=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:o,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:i,selectProps:s,setValue:a,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return gB(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return yB(this.props,e,t)}},{key:"filterOption",value:function(e,t){return bB(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,i=e.inputValue,a=e.tabIndex,s=e.form,l=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,f=d.ariaSelection,h=this.commonProps,m=r||this.getElementId("input"),g=lP(lP(lP({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?o.createElement(u,Im({},h,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:a,form:s,type:"text",value:i},g)):o.createElement(VD,Im({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:xP,onFocus:this.onInputFocus,disabled:t,tabIndex:a,inputMode:"none",form:s,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,i=t.MultiValueLabel,a=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,f=u.isMulti,h=u.inputValue,m=u.placeholder,g=this.state,y=g.selectValue,b=g.focusedValue,v=g.isFocused;if(!this.hasValue()||!d)return h?null:o.createElement(l,Im({},c,{key:"placeholder",isDisabled:p,isFocused:v,innerProps:{id:this.getElementId("placeholder")}}),m);if(f)return y.map((function(t,s){var l=t===b,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return o.createElement(n,Im({},c,{components:{Container:r,Label:i,Remove:a},isFocused:l,isDisabled:p,key:u,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var w=y[0];return o.createElement(s,Im({},c,{data:w,isDisabled:p}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||i)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,Im({},t,{innerProps:s,isFocused:a}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,i=n.isLoading,a=this.state.isFocused;if(!e||!i)return null;return o.createElement(e,Im({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:a}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,i=this.props.isDisabled,a=this.state.isFocused;return o.createElement(n,Im({},r,{isDisabled:i,isFocused:a}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,i={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return o.createElement(e,Im({},t,{innerProps:i,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,i=t.Menu,a=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,p=this.state.focusedOption,f=this.props,h=f.captureMenuScroll,m=f.inputValue,g=f.isLoading,y=f.loadingMessage,b=f.minMenuHeight,v=f.maxMenuHeight,w=f.menuIsOpen,x=f.menuPlacement,C=f.menuPosition,E=f.menuPortalTarget,k=f.menuShouldBlockScroll,S=f.menuShouldScrollIntoView,I=f.noOptionsMessage,_=f.onMenuScrollToTop,A=f.onMenuScrollToBottom;if(!w)return null;var N,R=function(t,n){var r=t.type,i=t.data,a=t.isDisabled,s=t.isSelected,l=t.label,c=t.value,f=p===i,h=a?void 0:function(){return e.onOptionHover(i)},m=a?void 0:function(){return e.selectOption(i)},g="".concat(e.getElementId("option"),"-").concat(n),y={id:g,onClick:m,onMouseMove:h,onMouseOver:h,tabIndex:-1,role:"option","aria-selected":e.isAppleDevice?void 0:s};return o.createElement(u,Im({},d,{innerProps:y,data:i,isDisabled:a,isSelected:s,key:g,label:l,type:r,value:c,isFocused:f,innerRef:f?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())N=this.getCategorizedOptions().map((function(t){if("group"===t.type){var i=t.data,a=t.options,s=t.index,l="".concat(e.getElementId("group"),"-").concat(s),c="".concat(l,"-heading");return o.createElement(n,Im({},d,{key:l,data:i,options:a,Heading:r,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return R(e,"".concat(s,"-").concat(e.index))})))}if("option"===t.type)return R(t,"".concat(t.index))}));else if(g){var O=y({inputValue:m});if(null===O)return null;N=o.createElement(l,d,O)}else{var T=I({inputValue:m});if(null===T)return null;N=o.createElement(c,d,T)}var M={minMenuHeight:b,maxMenuHeight:v,menuPlacement:x,menuPosition:C,menuShouldScrollIntoView:S},P=o.createElement(XP,Im({},d,M),(function(t){var n=t.ref,r=t.placerProps,s=r.placement,l=r.maxHeight;return o.createElement(i,Im({},d,M,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:s}),o.createElement(QD,{captureEnabled:h,onTopArrive:_,onBottomArrive:A,lockEnabled:k},(function(t){return o.createElement(a,Im({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:l,focusedOption:p}),N)})))}));return E||"fixed"===C?o.createElement(s,Im({},d,{appendTo:E,controlElement:this.controlRef,menuPlacement:x,menuPosition:C}),P):P}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,i=t.isMulti,a=t.name,s=t.required,l=this.state.selectValue;if(s&&!this.hasValue()&&!r)return o.createElement(eB,{name:a,onFocus:this.onValueInputFocus});if(a&&!r){if(i){if(n){var c=l.map((function(t){return e.getOptionValue(t)})).join(n);return o.createElement("input",{name:a,type:"hidden",value:c})}var u=l.length>0?l.map((function(t,n){return o.createElement("input",{key:"i-".concat(n),name:a,type:"hidden",value:e.getOptionValue(t)})})):o.createElement("input",{name:a,type:"hidden",value:""});return o.createElement("div",null,u)}var d=l[0]?this.getOptionValue(l[0]):"";return o.createElement("input",{name:a,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,a=t.isFocused,s=t.selectValue,l=this.getFocusableOptions();return o.createElement(AD,Im({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:i,isFocused:a,selectValue:s,focusableOptions:l,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,i=e.ValueContainer,a=this.props,s=a.className,l=a.id,c=a.isDisabled,u=a.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return o.createElement(r,Im({},p,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),o.createElement(t,Im({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),o.createElement(i,Im({},p,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),o.createElement(n,Im({},p,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,a=t.isFocused,s=t.prevWasFocused,l=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,p=e.inputValue,f=e.isMulti,h=kP(u),m={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||p!==n.inputValue)){var g=d?function(e,t){return uB(cB(e,t))}(e,h):[],y=d?dB(cB(e,h),"".concat(l,"-option")):[],b=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r<t.length)return t[r]}return null}(t,h):null,v=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,g);m={selectValue:h,focusedOption:v,focusedOptionId:fB(y,v),focusableOptionsWithIds:y,focusedValue:b,clearFocusValueOnUpdate:!1}}var w=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},x=i,C=a&&s;return a&&!C&&(x={value:FP(f,h,h[0]||null),options:h,action:"initial-input-focus"},C=!s),"initial-input-focus"===(null==i?void 0:i.action)&&(x=null),lP(lP(lP({},m),w),{},{prevProps:e,ariaSelection:x,prevWasFocused:C})}}]),n}();xB.defaultProps=sB;var CB=e.forwardRef((function(t,n){var r=function(t){var n=t.defaultInputValue,r=void 0===n?"":n,o=t.defaultMenuIsOpen,i=void 0!==o&&o,a=t.defaultValue,s=void 0===a?null:a,l=t.inputValue,c=t.menuIsOpen,u=t.onChange,d=t.onInputChange,p=t.onMenuClose,f=t.onMenuOpen,h=t.value,m=pP(t,fP),g=dP(e.useState(void 0!==l?l:r),2),y=g[0],b=g[1],v=dP(e.useState(void 0!==c?c:i),2),w=v[0],x=v[1],C=dP(e.useState(void 0!==h?h:s),2),E=C[0],k=C[1],S=e.useCallback((function(e,t){"function"==typeof u&&u(e,t),k(e)}),[u]),I=e.useCallback((function(e,t){var n;"function"==typeof d&&(n=d(e,t)),b(void 0!==n?n:e)}),[d]),_=e.useCallback((function(){"function"==typeof f&&f(),x(!0)}),[f]),A=e.useCallback((function(){"function"==typeof p&&p(),x(!1)}),[p]),N=void 0!==l?l:y,R=void 0!==c?c:w,O=void 0!==h?h:E;return lP(lP({},m),{},{inputValue:N,menuIsOpen:R,onChange:S,onInputChange:I,onMenuClose:A,onMenuOpen:_,value:O})}(t);return o.createElement(xB,Im({ref:n},r))})),EB=CB;const kB=({options:t,items_per_page:n,className:r,defaultValue:i,onChange:a})=>{const[s,l]=e.useState(""),[c,u]=e.useState(0),d=t.filter((e=>e.label.toLowerCase().includes(s)||e.value.toLowerCase().includes(s)));var p;p=void 0!==n?d.slice(c*n,(c+1)*n):d;const f={control:e=>({...e,minHeight:void 0})};return o.createElement(EB,{options:p,onInputChange:e=>{l(e.toLowerCase()),u(0)},onChange:a,inputValue:s,isSearchable:!0,placeholder:"Select an option...",className:r,unstyled:!0,styles:f,classNamePrefix:"styled-select",defaultValue:i,value:i})},SB=({io:t,inputconverter:n,parser:r=e=>parseFloat(e)})=>{const i=e.useContext(sF),[a,s]=e.useState(n[1](t.value));e.useEffect((()=>{s(n[1](t.value))}),[t.value]);const l=e=>{e=r(parseFloat(e.toString()).toString()),isNaN(e)?(e="<NoValue>",s("")):(void 0!==t.value_options?.min&&e<t.value_options.min&&(e=t.value_options.min),void 0!==t.value_options?.max&&e>t.value_options.max&&(e=t.value_options.max),s(e.toString()));try{e=n[0](e)}catch(e){}i.worker?.set_io_value({nid:t.node,ioid:t.id,value:e,set_default:t.render_options.set_default})};let c=t.connected?n[1](t.value):a;return void 0===c&&(c=t.value_options?.min),void 0===c&&(c=t.value_options?.max),void 0===c&&(c=""),null===c&&(c=""),void 0!==t.value_options?.max&&void 0!==t.value_options?.min?o.createElement("div",{style:{minWidth:"100px"},className:"SliderContainer"},o.createElement(eP,{className:"SliderRoot",value:[void 0===c?t.value_options?.min:c],min:t.value_options?.min,max:t.value_options?.max,step:t.value_options.step||(t.value_options?.max-t.value_options?.min)/1e3,disabled:t.connected,onValueCommit:e=>{isNaN(e[0])||l(e[0])},onValueChange:e=>{isNaN(e[0])||s(e[0].toString())}},o.createElement(tP,{className:"SliderTrack"},o.createElement(nP,{className:"SliderRange"})),o.createElement(mT,null,o.createElement(DT,{open:!0},o.createElement(BT,{asChild:!0},o.createElement(rP,{className:"SliderThumb"})),o.createElement(FT,{className:"SliderTooltipContent"},c))))):o.createElement("input",{type:"text",className:"nodedatainput styledinput numberinput",value:c,onChange:e=>s(e.target.value),onBlur:e=>{l(e.target.value)},onKeyDown:e=>{if("ArrowUp"!==e.key)if("ArrowDown"!==e.key)/^[0-9.eE+-]$/.test(e.key)||["Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(e.key)||e.preventDefault();else{let n=t.value_options?.step||1;e.shiftKey&&(n*=10);let r=(parseFloat(c)||0)-n;l(r)}else{let n=t.value_options?.step||1;e.shiftKey&&(n*=10);let r=(parseFloat(c)||0)+n;l(r)}},disabled:t.connected,step:t.value_options?.step,min:t.value_options?.min,max:t.value_options?.max})},IB=({io:t,inputconverter:n})=>{const r=e.useContext(sF),[i,a]=e.useState(n[1](t.value));e.useEffect((()=>{a(n[1](t.value))}),[t.value]);let s=t.connected?n[1](t.value):i;return null==s&&(s=""),o.createElement("input",{className:"nodedatainput styledinput stringinput",value:s,onChange:e=>a(e.target.value),onBlur:e=>{let o=e.target.value;o||(o="<NoValue>");try{o=n[0](o)}catch(e){}r.worker?.set_io_value({nid:t.node,ioid:t.id,value:o,set_default:t.render_options.set_default})},disabled:t.connected})},_B=e=>e,AB=e=>parseFloat(e),NB=e=>!!e,RB=e=>"null"===e?null:e,OB=({io:t,inputconverter:n,parser:r})=>{let i=t.value_options?.options||[];Array.isArray(i)&&(i={type:"enum",values:i,keys:i.map((e=>null===e?"None":e.toString())),nullable:!1}),"enum"!==i.type&&(i={type:"enum",values:Object.values(i),keys:Object.keys(i),nullable:!1}),!i.nullable||i.values.includes(null)||i.keys.includes("None")||(i.values.unshift(null),i.keys.unshift("None"));const a=[];for(let e=0;e<i.values.length;e++){const t=null===i.values[e]||void 0===i.values[e]?"undefined":typeof i.values[e];let n=i.values[e];null===n&&(n="null"),void 0===n&&(n="undefined"),a.push([i.keys[e],n.toString(),t])}const s=e.useContext(sF),l=({value:e,datatype:o})=>{const i=r||(e=>"nuinputconvertermber"===e?AB:"boolean"===e?NB:"undefined"===e?RB:_B)(o);let a=i(e);try{a=n[0](e)}catch(e){}s.worker?.set_io_value({nid:t.node,ioid:t.id,value:a,set_default:t.render_options.set_default})};let c=t.value;null===c&&(c="null"),void 0===c&&(c="undefined");const u=a.find((e=>e[1]===c.toString()));let d;void 0!==u&&(d={value:u[1],label:u[0],datatype:u[2]});const p=a.map((e=>({value:e[1],label:e[0],datatype:e[2]})));return o.createElement(kB,{className:"nodedatainput styleddropdown",options:p,defaultValue:d,onChange:e=>{l(null!==e?e:{value:"<NoValue>",datatype:"string"})}})},TB=e=>!!e&&e instanceof Date,MB=e=>!!e&&e instanceof Object&&"function"==typeof e;function PB(e,t){return void 0===t&&(t=!1),!e||t?`"${e}"`:e}function DB(t){let{field:n,value:r,data:o,lastElement:i,openBracket:a,closeBracket:s,level:l,style:c,shouldExpandNode:u,clickToExpandNode:d,outerRef:p}=t;const f=e.useRef(!1),[h,m,g]=function(t){const[n,r]=e.useState(t());return[n,()=>r((e=>!e)),r]}((()=>u(l,r,n))),y=e.useRef(null);e.useEffect((()=>{f.current?g(u(l,r,n)):f.current=!0}),[u]);const b=h?c.collapseIcon:c.expandIcon,v=h?"collapse JSON":"expand JSON",w=e.useId(),x=l+1,C=o.length-1,E=e=>{if("ArrowRight"===e.key||"ArrowLeft"===e.key)e.preventDefault(),g("ArrowRight"===e.key);else if("ArrowUp"===e.key||"ArrowDown"===e.key){e.preventDefault();const t="ArrowUp"===e.key?-1:1;if(!p.current)return;const n=p.current.querySelectorAll("[role=button]");let r=-1;for(let e=0;e<n.length;e++)if(0===n[e].tabIndex){r=e;break}if(r<0)return;const o=(r+t+n.length)%n.length;n[r].tabIndex=-1,n[o].tabIndex=0,n[o].focus()}},k=()=>{var e;m();const t=y.current;if(!t)return;const n=null===(e=p.current)||void 0===e?void 0:e.querySelector('[role=button][tabindex="0"]');n&&(n.tabIndex=-1),t.tabIndex=0,t.focus()};return e.createElement("div",{className:c.basicChildStyle,role:"treeitem","aria-expanded":h,"aria-selected":void 0},e.createElement("span",{className:b,onClick:k,onKeyDown:E,role:"button","aria-label":v,"aria-expanded":h,"aria-controls":h?w:void 0,ref:y,tabIndex:0===l?0:-1}),(n||""===n)&&(d?e.createElement("span",{className:c.clickableLabel,onClick:k,onKeyDown:E},PB(n,c.quotesForFieldNames),":"):e.createElement("span",{className:c.label},PB(n,c.quotesForFieldNames),":")),e.createElement("span",{className:c.punctuation},a),h?e.createElement("ul",{id:w,role:"group",className:c.childFieldsContainer},o.map(((t,n)=>e.createElement(VB,{key:t[0]||n,field:t[0],value:t[1],style:c,lastElement:n===C,level:x,shouldExpandNode:u,clickToExpandNode:d,outerRef:p})))):e.createElement("span",{className:c.collapsedContent,onClick:k,onKeyDown:E}),e.createElement("span",{className:c.punctuation},s),!i&&e.createElement("span",{className:c.punctuation},","))}function BB(t){let{field:n,openBracket:r,closeBracket:o,lastElement:i,style:a}=t;return e.createElement("div",{className:a.basicChildStyle,role:"treeitem","aria-selected":void 0},(n||""===n)&&e.createElement("span",{className:a.label},PB(n,a.quotesForFieldNames),":"),e.createElement("span",{className:a.punctuation},r),e.createElement("span",{className:a.punctuation},o),!i&&e.createElement("span",{className:a.punctuation},","))}function jB(e){let{field:t,value:n,style:r,lastElement:o,shouldExpandNode:i,clickToExpandNode:a,level:s,outerRef:l}=e;return 0===Object.keys(n).length?BB({field:t,openBracket:"{",closeBracket:"}",lastElement:o,style:r}):DB({field:t,value:n,lastElement:o||!1,level:s,openBracket:"{",closeBracket:"}",style:r,shouldExpandNode:i,clickToExpandNode:a,data:Object.keys(n).map((e=>[e,n[e]])),outerRef:l})}function FB(e){let{field:t,value:n,style:r,lastElement:o,level:i,shouldExpandNode:a,clickToExpandNode:s,outerRef:l}=e;return 0===n.length?BB({field:t,openBracket:"[",closeBracket:"]",lastElement:o,style:r}):DB({field:t,value:n,lastElement:o||!1,level:i,openBracket:"[",closeBracket:"]",style:r,shouldExpandNode:a,clickToExpandNode:s,data:n.map((e=>[void 0,e])),outerRef:l})}function LB(t){let n,{field:r,value:o,style:i,lastElement:a}=t,s=i.otherValue;var l;return null===o?(n="null",s=i.nullValue):void 0===o?(n="undefined",s=i.undefinedValue):"string"==typeof(l=o)||l instanceof String?(n=function(e,t){return t?`"${e}"`:e}(o,!i.noQuotesForStringValues),s=i.stringValue):(e=>"boolean"==typeof e||e instanceof Boolean)(o)?(n=o?"true":"false",s=i.booleanValue):(e=>"number"==typeof e||e instanceof Number)(o)?(n=o.toString(),s=i.numberValue):(e=>"bigint"==typeof e||e instanceof BigInt)(o)?(n=`${o.toString()}n`,s=i.numberValue):n=TB(o)?o.toISOString():MB(o)?"function() { }":o.toString(),e.createElement("div",{className:i.basicChildStyle,role:"treeitem","aria-selected":void 0},(r||""===r)&&e.createElement("span",{className:i.label},PB(r,i.quotesForFieldNames),":"),e.createElement("span",{className:s},n),!a&&e.createElement("span",{className:i.punctuation},","))}function VB(t){const n=t.value;return r=n,Array.isArray(r)?e.createElement(FB,Object.assign({},t)):!(e=>"object"==typeof e&&null!==e)(n)||TB(n)||MB(n)?e.createElement(LB,Object.assign({},t)):e.createElement(jB,Object.assign({},t));var r}var zB="_2bkNM",GB="_1BXBN";const HB={container:"_2IvMF _GzYRV",basicChildStyle:zB,childFieldsContainer:GB,label:"_1MGIk",clickableLabel:"_2YKJg _1MGIk _1MFti",nullValue:"_2T6PJ",undefinedValue:"_1Gho6",stringValue:"_vGjyY",booleanValue:"_3zQKs",numberValue:"_1bQdo",otherValue:"_1xvuR",punctuation:"_3uHL6 _3eOF8",collapseIcon:"_oLqym _f10Tu _1MFti _1LId0",expandIcon:"_2AXVT _f10Tu _1MFti _1UmXx",collapsedContent:"_2KJWg _1pNG9 _1MFti",noQuotesForStringValues:!1,quotesForFieldNames:!1},WB={container:"_11RoI _GzYRV",basicChildStyle:zB,childFieldsContainer:GB,label:"_2bSDX",clickableLabel:"_1RQEj _2bSDX _1MFti",nullValue:"_LaAZe",undefinedValue:"_GTKgm",stringValue:"_Chy1W",booleanValue:"_2vRm-",numberValue:"_2bveF",otherValue:"_1prJR",punctuation:"_gsbQL _3eOF8",collapseIcon:"_3QHg2 _f10Tu _1MFti _1LId0",expandIcon:"_17H2C _f10Tu _1MFti _1UmXx",collapsedContent:"_3fDAz _1pNG9 _1MFti",noQuotesForStringValues:!1,quotesForFieldNames:!1},XB=()=>!0,ZB=e=>e<1,$B=t=>{let{data:n,style:r=HB,shouldExpandNode:o=XB,clickToExpandNode:i=!1,...a}=t;const s=e.useRef(null);return e.createElement("div",Object.assign({"aria-label":"JSON view"},a,{className:r.container,ref:s,role:"tree"}),e.createElement(VB,{value:n,style:{...HB,...r},lastElement:!0,level:0,shouldExpandNode:o,clickToExpandNode:i,outerRef:s}))},YB=({data:e})=>o.createElement($B,{data:e,style:WB,shouldExpandNode:ZB}),UB=({tabledata:t})=>{const n=e.useMemo((()=>(e=>{const t=[];if(void 0===e)return{header:[],rows:[]};void 0===e.data&&(e.data=[]),void 0===e.columns&&(0===e.data.length?e.columns=[]:e.columns=e.data[0].map(((e,t)=>`col${t}`))),void 0===e.index&&(e.index=e.data.map(((e,t)=>`row${t}`)));for(let n=0;n<e.index.length;n++){const r=[e.index[n]];for(let t=0;t<e.columns.length;t++)r.push(e.data[n][t]);t.push(r)}return{header:["index",...e.columns],rows:t}})(t)),[t]),[r,i]=e.useState("asc"),[a,s]=e.useState("index");let l=n.header.indexOf(a);-1===l&&(l=0);const c=((e,t)=>{const n=e.map(((e,t)=>[e,t]));return n.sort(((e,n)=>t(e[0],n[0]))),n.map((e=>e[0]))})(n.rows,(e=>"desc"===e?(e,t)=>t[l]<e[l]?-1:1:(e,t)=>e[l]<t[l]?-1:1)(r));return o.createElement(ow,{className:"tablecontainer"},o.createElement(Xv,{size:"small"},o.createElement(cw,{className:"tableHead"},o.createElement(hw,{className:"tableheadercolor"},n.header.map((e=>o.createElement(tw,{key:e,sortDirection:a===e&&r,className:"tableheadercolor"},o.createElement(Xw,{active:a===e,direction:a===e?r:"asc",onClick:()=>(e=>{i(a===e&&"asc"===r?"desc":"asc"),s(e)})(e),className:"tableheadercolor",sx:{"& .MuiTableSortLabel-icon":{color:"inherit !important"}}},e)))))),o.createElement(Kv,null,c.map(((e,n)=>o.createElement(hw,{key:t.index[n]},e.map(((e,t)=>o.createElement(tw,{key:t,className:0==t?"indexcol":"datacol"},e)))))))))};var JB,KB={};
141
141
  /*!
142
142
  * content-type
143
143
  * Copyright(c) 2015 Douglas Christopher Wilson
144
144
  * MIT Licensed
145
- */var rj=function(){if(tj)return nj;tj=1;var e=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,t=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,r=/\\([\u000b\u0020-\u00ff])/g,o=/([\\"])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function a(e){var r=String(e);if(n.test(r))return r;if(r.length>0&&!t.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(o,"\\$1")+'"'}function s(e){this.parameters=Object.create(null),this.type=e}return nj.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!i.test(r))throw new TypeError("invalid type");var o=r;if(t&&"object"==typeof t)for(var s,l=Object.keys(t).sort(),c=0;c<l.length;c++){if(s=l[c],!n.test(s))throw new TypeError("invalid parameter name");o+="; "+s+"="+a(t[s])}return o},nj.parse=function(t){if(!t)throw new TypeError("argument string is required");var n="object"==typeof t?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(t):t;if("string"!=typeof n)throw new TypeError("argument string is required to be a string");var o=n.indexOf(";"),a=-1!==o?n.slice(0,o).trim():n.trim();if(!i.test(a))throw new TypeError("invalid media type");var l=new s(a.toLowerCase());if(-1!==o){var c,u,d;for(e.lastIndex=o;u=e.exec(n);){if(u.index!==o)throw new TypeError("invalid parameter format");o+=u[0].length,c=u[1].toLowerCase(),34===(d=u[2]).charCodeAt(0)&&-1!==(d=d.slice(1,-1)).indexOf("\\")&&(d=d.replace(r,"$1")),l.parameters[c]=d}if(o!==n.length)throw new TypeError("invalid parameter format")}return l},nj}(),oj=new Map,ij=function(e){return e.cloneNode(!0)},aj=function(){return"file:"===window.location.protocol},sj=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&2===r.readyState){var t=r.getResponseHeader("Content-Type");if(!t)throw new Error("Content type not found");var o=rj.parse(t).type;if("image/svg+xml"!==o&&"text/plain"!==o)throw new Error("Invalid content type: ".concat(o))}if(4===r.readyState){if(404===r.status||null===r.responseXML)throw new Error(aj()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(!(200===r.status||aj()&&0===r.status))throw new Error("There was a problem injecting the SVG: "+r.status+" "+r.statusText);n(null,r)}}catch(e){if(r.abort(),!(e instanceof Error))throw e;n(e,r)}},r.open("GET",e),r.withCredentials=t,r.overrideMimeType&&r.overrideMimeType("text/xml"),r.send()},lj={},cj=function(e,t){lj[e]=lj[e]||[],lj[e].push(t)},uj=function(e,t,n){if(oj.has(e)){var r=oj.get(e);if(void 0===r)return void cj(e,n);if(r instanceof SVGSVGElement)return void n(null,ij(r))}oj.set(e,void 0),cj(e,n),sj(e,t,(function(t,n){var r;t?oj.set(e,t):(null===(r=n.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&oj.set(e,n.responseXML.documentElement),function(e){for(var t=function(t,n){setTimeout((function(){if(Array.isArray(lj[e])){var n=oj.get(e),r=lj[e][t];n instanceof SVGSVGElement&&r(null,ij(n)),n instanceof Error&&r(n),t===lj[e].length-1&&delete lj[e]}}),0)},n=0,r=lj[e].length;n<r;n++)t(n)}(e)}))},dj=function(e,t,n){sj(e,t,(function(e,t){var r;e?n(e):(null===(r=t.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&n(null,t.responseXML.documentElement)}))},pj=0,fj=[],hj={},mj="http://www.w3.org/1999/xlink",gj=function(e,t,n,r,o,i,a){var s=e.getAttribute("data-src")||e.getAttribute("src");if(s){if(-1!==fj.indexOf(e))return fj.splice(fj.indexOf(e),1),void(e=null);fj.push(e),e.setAttribute("src",""),(r?uj:dj)(s,o,(function(r,o){if(!o)return fj.splice(fj.indexOf(e),1),e=null,void a(r);var l=e.getAttribute("id");l&&o.setAttribute("id",l);var c=e.getAttribute("title");c&&o.setAttribute("title",c);var u=e.getAttribute("width");u&&o.setAttribute("width",u);var d=e.getAttribute("height");d&&o.setAttribute("height",d);var p=Array.from(new Set(_d(_d(_d([],(o.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();o.setAttribute("class",p);var f=e.getAttribute("style");f&&o.setAttribute("style",f),o.setAttribute("data-src",s);var h=[].filter.call(e.attributes,(function(e){return/^data-\w[\w-]*$/.test(e.name)}));if(Array.prototype.forEach.call(h,(function(e){e.name&&e.value&&o.setAttribute(e.name,e.value)})),n){var m,g,y,b,v,w={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]};Object.keys(w).forEach((function(e){m=e,y=w[e];for(var t=function(e,t){var n;b=g[e].id,v=b+"-"+ ++pj,Array.prototype.forEach.call(y,(function(e){for(var t=0,r=(n=o.querySelectorAll("["+e+'*="'+b+'"]')).length;t<r;t++){var i=n[t].getAttribute(e);i&&!i.match(new RegExp('url\\("?#'+b+'"?\\)'))||n[t].setAttribute(e,"url(#"+v+")")}}));for(var r=o.querySelectorAll("[*|href]"),i=[],a=0,s=r.length;a<s;a++){var l=r[a].getAttributeNS(mj,"href");l&&l.toString()==="#"+g[e].id&&i.push(r[a])}for(var c=0,u=i.length;c<u;c++)i[c].setAttributeNS(mj,"href","#"+v);g[e].id=v},n=0,r=(g=o.querySelectorAll(m+"[id]")).length;n<r;n++)t(n)}))}o.removeAttribute("xmlns:a");for(var x,C,E=o.querySelectorAll("script"),k=[],S=0,I=E.length;S<I;S++)(C=E[S].getAttribute("type"))&&"application/ecmascript"!==C&&"application/javascript"!==C&&"text/javascript"!==C||((x=E[S].innerText||E[S].textContent)&&k.push(x),o.removeChild(E[S]));if(k.length>0&&("always"===t||"once"===t&&!hj[s])){for(var _=0,A=k.length;_<A;_++)new Function(k[_])(window);hj[s]=!0}var N=o.querySelectorAll("style");if(Array.prototype.forEach.call(N,(function(e){e.textContent+=""})),o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("xmlns:xlink",mj),i(o),!e.parentNode)return fj.splice(fj.indexOf(e),1),e=null,void a(new Error("Parent node is null"));e.parentNode.replaceChild(o,e),fj.splice(fj.indexOf(e),1),e=null,a(null,o)}))}else a(new Error("Invalid data-src or src attribute"))},yj=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],bj="http://www.w3.org/2000/svg",vj="http://www.w3.org/1999/xlink",wj=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).initialState={hasError:!1,isLoading:!0},t.state=t.initialState,t._isMounted=!1,t.reactWrapper=void 0,t.nonReactWrapper=void 0,t.refCallback=function(e){t.reactWrapper=e},t}bw(t,e);var n=t.prototype;return n.renderSVG=function(){var e=this;if(this.reactWrapper instanceof function(e){return((null==e?void 0:e.ownerDocument)||document).defaultView||window}(this.reactWrapper).Node){var t,n,r=this.props,o=r.desc,i=r.evalScripts,a=r.httpRequestWithCredentials,s=r.renumerateIRIElements,l=r.src,c=r.title,u=r.useRequestCache,d=this.props.onError,p=this.props.beforeInjection,f=this.props.afterInjection,h=this.props.wrapper;"svg"===h?((t=document.createElementNS(bj,h)).setAttribute("xmlns",bj),t.setAttribute("xmlns:xlink",vj),n=document.createElementNS(bj,h)):(t=document.createElement(h),n=document.createElement(h)),t.appendChild(n),n.dataset.src=l,this.nonReactWrapper=this.reactWrapper.appendChild(t);var m=function(t){e.removeSVG(),e._isMounted?e.setState((function(){return{hasError:!0,isLoading:!1}}),(function(){d(t)})):d(t)};!function(e,t){var n=void 0===t?{}:t,r=n.afterAll,o=void 0===r?function(){}:r,i=n.afterEach,a=void 0===i?function(){}:i,s=n.beforeEach,l=void 0===s?function(){}:s,c=n.cacheRequests,u=void 0===c||c,d=n.evalScripts,p=void 0===d?"never":d,f=n.httpRequestWithCredentials,h=void 0!==f&&f,m=n.renumerateIRIElements,g=void 0===m||m;if(e&&"length"in e)for(var y=0,b=0,v=e.length;b<v;b++)gj(e[b],p,g,u,h,l,(function(t,n){a(t,n),e&&"length"in e&&e.length===++y&&o(y)}));else e?gj(e,p,g,u,h,l,(function(t,n){a(t,n),o(1),e=null})):o(0)}(n,{afterEach:function(t,n){t?m(t):e._isMounted&&e.setState((function(){return{isLoading:!1}}),(function(){try{f(n)}catch(e){m(e)}}))},beforeEach:function(e){if(e.setAttribute("role","img"),o){var t=e.querySelector(":scope > desc");t&&e.removeChild(t);var n=document.createElement("desc");n.innerHTML=o,e.prepend(n)}if(c){var r=e.querySelector(":scope > title");r&&e.removeChild(r);var i=document.createElement("title");i.innerHTML=c,e.prepend(i)}try{p(e)}catch(e){m(e)}},cacheRequests:u,evalScripts:i,httpRequestWithCredentials:a,renumerateIRIElements:s})}},n.removeSVG=function(){var e;null!=(e=this.nonReactWrapper)&&e.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(e){var t=this;(function(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1})(Im({},e),this.props)&&this.setState((function(){return t.initialState}),(function(){t.removeSVG(),t.renderSVG()}))},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var e=this.props;e.afterInjection,e.beforeInjection,e.desc,e.evalScripts;var t=e.fallback;e.httpRequestWithCredentials;var n=e.loading;e.renumerateIRIElements,e.src,e.title,e.useRequestCache;var r=e.wrapper,i=gw(e,yj),a=r;return o.createElement(a,Im({},i,{ref:this.refCallback},"svg"===r?{xmlns:bj,xmlnsXlink:vj}:{}),this.state.isLoading&&n&&o.createElement(n,null),this.state.hasError&&t&&o.createElement(t,null))},t}(o.Component);wj.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"},wj.propTypes={afterInjection:Yf.func,beforeInjection:Yf.func,desc:Yf.string,evalScripts:Yf.oneOf(["always","once","never"]),fallback:Yf.oneOfType([Yf.func,Yf.object,Yf.string]),httpRequestWithCredentials:Yf.bool,loading:Yf.oneOfType([Yf.func,Yf.object,Yf.string]),onError:Yf.func,renumerateIRIElements:Yf.bool,src:Yf.string.isRequired,title:Yf.string,useRequestCache:Yf.bool,wrapper:Yf.oneOf(["div","span","svg"])};const xj=({value:e,renderoptions:t})=>(void 0===t&&(t={}),void 0===t.format&&(t.format="jpeg"),o.createElement("img",{src:"data:image/"+t.format+";base64, "+e,style:{maxWidth:"100%",maxHeight:"100%"}})),Cj=({value:e})=>o.createElement(wj,{src:`data:image/svg+xml;base64,${btoa(e)}`,style:{maxWidth:"100%",maxHeight:"100%"},beforeInjection:e=>{e.classList.add("svg-class-name"),e.setAttribute("style","max-width: 100%; max-height: 100%;"),e.setAttribute("width","100%"),e.setAttribute("height","100%")}}),Ej=({io:e})=>{let t=e.fullvalue;if(null==t&&(t=e.value),void 0===t&&(t=""),"string"!=typeof t||t.length%4!=0)return o.createElement("div",null,t);const n=Math.round(3*t.length/4);return o.createElement("div",null,o.createElement("pre",null,"Bytes(",n,")"))},kj=({io:e})=>{let t=e.fullvalue;return void 0===t&&(t=e.value),void 0===t&&(t={}),o.createElement(qB,{data:t})},Sj={float:({io:e,inputconverter:t})=>RB({io:e,inputconverter:t,parser:parseFloat}),int:({io:e,inputconverter:t})=>RB({io:e,inputconverter:t,parser:parseInt}),bool:({io:t,inputconverter:n})=>{const r=e.useContext(pF),i=void 0===t.value,a=e.useRef(null);e.useEffect((()=>{a.current&&(a.current.indeterminate=i)}),[a,i]);return o.createElement("input",{ref:a,type:"checkbox",className:"styledcheckbox booleaninput",checked:!!n[1](t.value),onChange:e=>{let o=e.target.checked;try{o=n[0](e.target.checked)}catch(e){}r.worker?.set_io_value({nid:t.node,ioid:t.id,value:o,set_default:t.render_options.set_default})},disabled:t.connected})},string:OB,str:OB,color:({io:t})=>{const n=e.useContext(pF),r=t.value_options?.colorspace||"hex";let i=!1;return"string"!=typeof t.type&&"anyOf"in t.type&&void 0!==t.type.anyOf&&(i=t.type.anyOf.some((e=>"None"===e))),o.createElement(RM,{onChange:e=>{let o="<NoValue>";e&&(o=e[r]?e[r]():e.hex()),null===e&&(o=null),n.worker?.set_io_value({nid:t.node,ioid:t.id,value:o,set_default:t.render_options.set_default})},inicolordata:t.value,allow_null:i,inicolorspace:r})},select:BB,enum:BB,bytes:Ej},Ij={Inputrenderer:Sj,Outputrenderer:{},HandlePreviewRenderer:{bytes:Ej},DataOverlayRenderer:{},DataPreviewViewRenderer:{string:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),t=void 0===t?"":JSON.stringify(e.value).replace(/\\n/g,"\n"),o.createElement("div",null,o.createElement("pre",null,t))},table:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=[]),o.createElement(ej,{tabledata:t})},image:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=""),o.createElement(xj,{value:t})},svg:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=""),o.createElement(Cj,{value:t})},dict:kj,bytes:Ej},DataViewRenderer:{},InLineRenderer:{bytes:({io:e})=>{let t=e.fullvalue;null==t&&(t=e.value),t=void 0===t?"":JSON.stringify(e.value).replace(/\\n/g,"\n");return`Bytes(${Math.round(3*t.length/4)})`}}},_j=(e,t)=>{const n=t.options||{},r=void 0===n.overwrite||n.overwrite;switch(t.type){case"EXTEND_INPUT_RENDER":return!r&&e.Inputrenderer[t.payload.type]?e:{...e,Inputrenderer:{...e.Inputrenderer,[t.payload.type]:t.payload.component}};case"EXTEND_OUTPUT_RENDER":return!r&&e.Outputrenderer[t.payload.type]?e:{...e,Outputrenderer:{...e.Outputrenderer,[t.payload.type]:t.payload.component}};case"EXTEND_HANDLE_PREVIEW_RENDER":return!r&&e.HandlePreviewRenderer[t.payload.type]?e:{...e,HandlePreviewRenderer:{...e.HandlePreviewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_OVERLAY_RENDER":return!r&&e.DataOverlayRenderer[t.payload.type]?e:{...e,DataOverlayRenderer:{...e.DataOverlayRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_PREVIEW_RENDER":return!r&&e.DataPreviewViewRenderer[t.payload.type]?e:{...e,DataPreviewViewRenderer:{...e.DataPreviewViewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_VIEW_RENDER":return!r&&e.DataViewRenderer[t.payload.type]?e:{...e,DataViewRenderer:{...e.DataViewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_FROM_PLUGIN":let n=!1;const o=[[t.payload.plugin.input_renderers||{},e.Inputrenderer],[t.payload.plugin.output_renderers||{},e.Outputrenderer],[t.payload.plugin.handle_preview_renderers||{},e.HandlePreviewRenderer],[t.payload.plugin.data_overlay_renderers||{},e.DataOverlayRenderer],[t.payload.plugin.data_preview_renderers||{},e.DataPreviewViewRenderer],[t.payload.plugin.data_view_renderers||{},e.DataViewRenderer]];for(const[e,t]of o){if(Object.keys(e).length>0)if(r)n=!0;else for(const r in e)if(!t[r]){n=!0;break}if(n)break}if(!n)return e;for(const[e,t]of o)for(const n in e)!r&&t[n]||(t[n]=e[n]);return{...e};default:return e}},Aj=({children:t,plugins:n,fnrf_zst:r})=>{const[i,a]=e.useReducer(_j,Ij),s=(e,t)=>{a({type:"EXTEND_FROM_PLUGIN",payload:{plugin:e},options:t})};return e.useEffect((()=>{for(const e in n){const t=n[e].RendererPlugin;t&&s(t);const i=n[e].renderpluginfactory;i&&s(i({React:o,fnrf_zst:r}))}}),[n]),o.createElement(Nj.Provider,{value:{Inputrenderer:i.Inputrenderer,Outputrenderer:i.Outputrenderer,HandlePreviewRenderer:i.HandlePreviewRenderer,DataOverlayRenderer:i.DataOverlayRenderer,DataPreviewViewRenderer:i.DataPreviewViewRenderer,DataViewRenderer:i.DataViewRenderer,InLineRenderer:i.InLineRenderer,extendInputRenderMapping:(e,t,n)=>{a({type:"EXTEND_INPUT_RENDER",payload:{type:e,component:t},options:n})},extendOutputRenderMapping:(e,t,n)=>{a({type:"EXTEND_OUTPUT_RENDER",payload:{type:e,component:t},options:n})},extendHandlePreviewRenderMapping:(e,t,n)=>{a({type:"EXTEND_HANDLE_PREVIEW_RENDER",payload:{type:e,component:t},options:n})},extendDataOverlayRenderMapping:(e,t,n)=>{a({type:"EXTEND_DATA_OVERLAY_RENDER",payload:{type:e,component:t},options:n})},extendDataPreviewRenderMapping:(e,t,n)=>{a({type:"EXTEND_DATA_PREVIEW_RENDER",payload:{type:e,component:t},options:n})},extendDataViewRenderMapping:(e,t,n)=>{a({type:"EXTEND_DATA_VIEW_RENDER",payload:{type:e,component:t},options:n})},extendFromPlugin:s}},t)},Nj=e.createContext({Inputrenderer:Ij.Inputrenderer,Outputrenderer:Ij.Outputrenderer,HandlePreviewRenderer:Ij.HandlePreviewRenderer,DataOverlayRenderer:Ij.DataOverlayRenderer,DataPreviewViewRenderer:Ij.DataPreviewViewRenderer,DataViewRenderer:Ij.DataViewRenderer,InLineRenderer:Ij.InLineRenderer,extendInputRenderMapping:(e,t,n)=>{},extendOutputRenderMapping:(e,t,n)=>{},extendHandlePreviewRenderMapping:(e,t,n)=>{},extendDataOverlayRenderMapping:(e,t,n)=>{},extendDataPreviewRenderMapping:(e,t,n)=>{},extendDataViewRenderMapping:(e,t,n)=>{},extendFromPlugin:(e,t)=>{}}),Rj=({component:e,...t})=>o.createElement(e,{...t}),Oj=t=>{const n=e.useContext(pF).render_options(),[r]=Tj(t.type,n.typemap||{});if(!r)return kj;const{DataOverlayRenderer:o,DataPreviewViewRenderer:i}=e.useContext(Nj);return o[r]?o[r]:i[r]?i[r]:kj},Tj=(e,t)=>{if("string"==typeof e)return e in t?[t[e],e]:[e,e];if("allOf"in e&&void 0!==e.allOf)return[void 0,void 0];if("anyOf"in e&&void 0!==e.anyOf){const n=e.anyOf.map((e=>Tj(e,t)));for(const e of n)switch(e[0]){case"bool":return["bool",e[1]];case"enum":return["enum",e[1]];case"float":return["float",e[1]];case"int":return["int",e[1]];case"string":case"str":return["string",e[1]]}return[void 0,void 0]}return"type"in e&&void 0!==e.type&&"enum"===e.type?["enum","enum"]:[void 0,void 0]},Mj=({io:t,typestring:n,preview:r,...i})=>{const[a,s]=e.useState(!1),[l,c]=e.useState(!1),[u,d]=t?(t=>{const n=e.useContext(pF).render_options(),[r]=Tj(t.type,n.typemap||{}),{HandlePreviewRenderer:o,DataPreviewViewRenderer:i}=e.useContext(Nj),a=Oj(t);return r?o[r]?[o[r],a]:i[r]?[i[r],a]:[kj,a]:[kj,a]})(t):[void 0,void 0];return o.createElement(LT,null,o.createElement(VT,{open:a||l,onOpenChange:c},o.createElement(zT,{asChild:!0},o.createElement(li,{id:t.id,"data-type":n,...i})),o.createElement(GT,null,o.createElement(HT,{className:"iotooltipcontent",sideOffset:5},o.createElement("div",{className:"iotooltip_container"},o.createElement("div",{className:"iotooltip_header"},a?o.createElement(Dv,{onClick:()=>s(!1)}):o.createElement(Pv,{onClick:()=>s(!0)}),d&&o.createElement(Kw,{title:t.full_id,trigger:o.createElement(Bv,null),onOpenChange:e=>{e&&t.try_get_full_value&&t.try_get_full_value(),s(e)}},o.createElement(Rj,{component:d,io:t}))),u?o.createElement(Rj,{component:u,io:t}):`no preview available for "${n}"`),o.createElement(WT,{className:"iotooltipcontentarrow"})))))},Pj={"":[e=>e,e=>e],str_to_json:[e=>JSON.parse(e),e=>"string"==typeof e?e:JSON.stringify(e)],str_to_list:[e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t:[t]}catch(t){try{return JSON.parse("["+e+"]")}catch(e){}}throw new Error("Invalid list")},e=>JSON.stringify(e)]},Dj=({io:t})=>{const n=e.useContext(pF).render_options(),[r,i]=Tj(t.render_options.type,n.typemap||{}),{Inputrenderer:a}=e.useContext(Nj),s=r?t.value_options?.options?BB:a[r]:void 0,l=Pj[(i&&n.inputconverter?.[i])??""];return o.createElement("div",{className:"nodeinput","data-type":r},o.createElement(Mj,{io:t,typestring:r,position:ko.Left,type:"target"}),s&&o.createElement("div",{className:"iovaluefield nodrag","data-type":r},o.createElement(s,{io:t,inputconverter:l})),o.createElement("div",{className:"ioname"},t.name),o.createElement(Mj,{io:t,typestring:r,position:ko.Right,type:"source"}))},Bj=({io:t,typestring:n})=>{const{InLineRenderer:r}=e.useContext(Nj);if(n&&r[n])return o.createElement("div",null,r[n]({io:t}));let i=t.fullvalue;return null==i&&(i=t.value),i=void 0===i?"":JSON.stringify(i).replace(/\\n/g,"\n"),i.length>63&&(i=i.slice(0,60)+"..."),o.createElement("div",null,i)},jj=({io:t})=>{const n=e.useContext(pF).render_options(),[r]=Tj(t.type,n.typemap||{}),{Outputrenderer:i}=e.useContext(Nj),a=r?i[r]:void 0;return o.createElement("div",{className:"nodeoutput","data-type":r},o.createElement(Mj,{io:t,typestring:r,position:ko.Right,type:"source"}),o.createElement("div",{className:"ioname"},t.name),a?o.createElement("div",{className:"iovaluefield nodrag"},o.createElement(a,{io:t})):o.createElement("div",{className:"iovaluefield"},o.createElement(Bj,{io:t,typestring:r})))};function Fj(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function Lj(e,t){const n=["","K","M","G","T"];let r=0;for(;e>=t&&r<n.length-1;)e/=t,r++;return[e.toFixed(2),n[r]]}const Vj=({state:t,className:n="reacttqdm",...r})=>{const i=e.useRef(null),a=e.useRef(null);e.useEffect((()=>{const e=()=>{i.current&&a.current&&function(e,t,n={}){const{maxFontSize:r=100,minFontSize:o=6,decrementFactor:i=.9}=n;if(!e||!t)return;if(i>=1||i<=0)throw new Error("decrementFactor must be between 0 and 1");const a=e.getBoundingClientRect(),s=a.width,l=a.height;let c=r;t.style.whiteSpace="nowrap",t.style.display="inline-block",t.style.fontSize=c+"px";let u=t.getBoundingClientRect();for(;(u.width>s||u.height>l)&&c>o;)c*=i,t.style.fontSize=c+"px",u=t.getBoundingClientRect()}(i.current,a.current,{maxFontSize:12,decrementFactor:.9})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]);const s=t.total?t.n/t.total*100:0;return o.createElement("div",{ref:i,className:n,...r},o.createElement("div",{style:{position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},o.createElement("div",{className:n+"-bar",style:{position:"absolute",width:"100%",height:"100%",overflow:"hidden"}},o.createElement("div",{className:n+"-progress",style:{width:`${s}%`,height:"100%"}})),o.createElement("div",{className:n+"-text",ref:a},function(e={n:0,elapsed:0,ascii:!1,unit:"it",unit_scale:!1,unit_divisor:1e3}){let t=e.total??null;const{n:n,unit_scale:r,elapsed:o,unit:i,unit_divisor:a,prefix:s="",rate:l,postfix:c=null,initial:u=0}=e;null!==t&&n>=t+.5&&(t=null);let d=n,p=t,f=l;r&&!0!==r&&1!==r&&(null!==t&&(p=t*r),d=n*r,void 0!==l&&(f=l*r));const h=Fj(o);void 0===f&&o>0&&(f=(d-u)/o);const m=f?1/f:void 0,[g,y]=f?Lj(f,a):[void 0,""],[b,v]=m?Lj(m,1e3):[void 0,""],w=m&&m>1?b?`${b}${v}s/`+i:"?":(g||"?")+`${y}${i}/s`,x=r?Lj(d,a).join(""):d.toString(),C=r&&null!==p?Lj(p,a).join(""):p?.toString()??"?",E=f?Fj(f&&null!==p?(p-d)/f:0):"?",k=s?`${s}: `:"";if(null!==t){const e=` ${x}/${C} [${h} < ${E}, ${w}${c??""}]`;return`${k}${(d/t*100).toFixed(0)}%${e}`}return`${k}${x}${i} [${h}, ${w}${c??""}]`}(t))))},zj=({node_data:t})=>{const n=e.useContext(pF);return o.createElement("div",{className:"nodeheader",title:t.description||t.node_name},o.createElement("div",{className:"nodeheader_element"},o.createElement(Lv,{fontSize:"inherit",className:"triggerbutton",onClick:()=>{n.on_node_action({type:"trigger",from_remote:!1,id:t.id})}}),o.createElement(Fv,{fontSize:"inherit",onClick:async()=>{n.logger.info("nodestatus",await(n.worker?.get_node_status(t.id)))}})),o.createElement("div",{className:"nodeheader_element nodeheader_title"},o.createElement("div",{className:"nodeheader_title_text"},t.node_name)),o.createElement("div",{className:"nodeheader_element"},o.createElement(jv,{fontSize:"inherit"})))},Gj=({node_data:t})=>{const n=t.render_options?.data?.src?t.io[t.render_options?.data?.src]:void 0,[r,i]=n?(t=>{const n=e.useContext(pF).render_options(),[r]=Tj(t.type,n.typemap||{}),o=Oj(t),{DataPreviewViewRenderer:i,DataViewRenderer:a}=e.useContext(Nj);return r?a[r]?[a[r],o]:i[r]?[i[r],o]:[kj,o]:[kj,o]})(n):[void 0,void 0];return o.createElement("div",{className:"nodrag nodedatabody"},r&&n&&o.createElement(Kw,{title:n.full_id,trigger:o.createElement("div",null,o.createElement(Rj,{component:r,io:n})),onOpenChange:e=>{e&&n?.try_get_full_value&&n?.try_get_full_value()}},o.createElement(Rj,{component:i,io:n})))},Hj=({node_data:e})=>{const t=Object.values(e.io).filter((e=>e.is_input)),n=Object.values(e.io).filter((e=>!e.is_input));return e.render_options,o.createElement("div",{className:"nodebody"},n.map((e=>e.hidden?null:o.createElement(jj,{key:e.id,io:e}))),o.createElement(Gj,{node_data:e}),t.map((e=>e.hidden?null:o.createElement(Dj,{key:e.id,io:e}))))},Wj=({node_data:t})=>{const[n,r]=e.useState(t.name);e.useEffect((()=>{r(t.name)}),[t]);const i=e.useContext(pF);return o.createElement("input",{className:"nodename_input",value:n,onChange:e=>{r(e.target.value)},onBlur:e=>{const n=e.target.value;i.on_node_action({type:"update",from_remote:!1,id:t.id,node:{name:n}})}})},Xj=({node_data:e})=>e.progress?o.createElement(Vj,{style:{height:"idle"===e.progress.prefix?"0px":void 0},state:e.progress,className:"nodeprogress"}):null,Zj=({node_data:e})=>o.createElement("div",{className:"nodefooter"},e.error&&o.createElement("div",{className:"nodeerror"},e.error),o.createElement(Xj,{node_data:e})),$j=({io:e})=>{const t=o.useContext(pF).render_options(),[n,r]=Tj(e.render_options.type,t.typemap||{}),{Inputrenderer:i}=o.useContext(Nj),a=n?e.value_options?.options?BB:i[n]:void 0,s=Pj[(r&&t.inputconverter?.[r])??""];return o.createElement("div",{className:"nodesettings_component"},o.createElement("div",null,e.name),a&&o.createElement(a,{io:e,inputconverter:s}),o.createElement("div",null,o.createElement("label",null,"hidden:",o.createElement("input",{className:"styledcheckbox",type:"checkbox",disabled:e.connected,onChange:t=>{e.set_hidden?.(t.target.checked)},checked:e.hidden}))))},Yj=({io:e})=>o.createElement("div",{className:"nodesettings_component"},o.createElement("div",null,e.name),o.createElement("div",null,o.createElement("label",null,"hidden:",o.createElement("input",{className:"styledcheckbox",type:"checkbox",disabled:e.connected,onChange:t=>{e.set_hidden?.(t.target.checked)},checked:e.hidden})))),Uj=({nodestore:e})=>{const t=e(),n=Object.values(t.io).filter((e=>e.is_input)),r=Object.values(t.io).filter((e=>!e.is_input));return o.createElement("div",null,o.createElement("div",{className:"nodesettings_section"},o.createElement("div",{className:"nodesettings_component"},o.createElement("div",null,"Name"),o.createElement("div",null,o.createElement(Wj,{node_data:t})))),o.createElement("div",{className:"nodesettings_section"},o.createElement("div",null,"Inputs"),n.map((e=>o.createElement($j,{io:e,key:e.id})))),o.createElement("div",{className:"nodesettings_section"},o.createElement("div",null,"Outputs"),r.map((e=>o.createElement(Yj,{io:e,key:e.id})))))},Jj=()=>{const e=o.useContext(pF),t=e.local_state((e=>e.selected_nodes));if(0===t.length)return o.createElement("div",null,"Node Settings");if(t.length>1)return o.createElement("div",null,"Multiple Nodes Selected");const n=e.nodespace.get_node(t[0]);return n?o.createElement(Uj,{nodestore:n}):o.createElement("div",null,"Node not found")},Kj=()=>{const e=o.useContext(pF),t=e.local_settings((e=>e.view_settings.expand_node_props)),n=e.local_settings((e=>e.update_view_settings)),r=e=>{n({expand_node_props:e})};return o.createElement("div",{className:"nodesettings_container"},o.createElement("div",{className:"nodesettings_expander"},t?o.createElement(Mv,{onClick:()=>{r(!1)}}):o.createElement(Vv,{onClick:()=>{r(!0)}})),o.createElement("div",{className:"nodesettings_content "+(t?"expanded":"collapsed")},t&&o.createElement(Jj,null)))},Qj=e=>({nodes:e.nodes,edges:e.edges,onNodesChange:e.onNodesChange,onEdgesChange:e.onEdgesChange,onConnect:e.onConnect}),qj={default:({data:t})=>{const n=t.UseNodeStore(),r=n.frontend.collapsed||!1,[i,a]=e.useState(!1);return e.useEffect((()=>{let e;return n.in_trigger?a(!0):i&&(e=setTimeout((()=>a(!1)),200)),()=>clearTimeout(e)}),[n.in_trigger,i]),o.createElement(o.Fragment,null,o.createElement("div",{className:"innernode"+(i?" intrigger":"")+(n.error?" error":"")},o.createElement(zj,{node_data:n}),o.createElement(Wj,{node_data:n}),r?null:o.createElement(Hj,{node_data:n}),o.createElement(Zj,{node_data:n})))}},eF={default:({id:e,sourceX:t,sourceY:n,targetX:r,targetY:i,sourcePosition:a,targetPosition:s,data:l,...c})=>{const[u]=jo({sourceX:t,sourceY:n,sourcePosition:a,targetX:r,targetY:i,targetPosition:s});return o.createElement(o.Fragment,null,o.createElement(mo,{id:e,path:u,...c}))}},tF=()=>{const t=Zi();return e.useContext(pF).rf_instance=t,o.createElement(o.Fragment,null)},nF=()=>{const t=e.useContext(pF),n=Mi("Delete"),r=Hr(xs,Z),i=Hr(ws,Z);if(n){for(const e of r)if(e.selected){if(!t.worker)return o.createElement(o.Fragment,null);if(!e.source||!e.target)return o.createElement(o.Fragment,null);if(!e.sourceHandle||!e.targetHandle)return o.createElement(o.Fragment,null);t.worker.remove_edge({src_nid:e.source,src_ioid:e.sourceHandle,trg_nid:e.target,trg_ioid:e.targetHandle})}for(const e of i)if(e.selected){if(!t.worker)return o.createElement(o.Fragment,null);t.worker.remove_node(e.id)}}return o.createElement(o.Fragment,null)},rF=({id:t,top:n,left:r,right:i,bottom:a,...s})=>{const{getNode:l,setNodes:c,addNodes:u,setEdges:d}=Zi(),p=e.useContext(pF),f=e.useCallback((()=>{const e=l(t);if(!e)return;const n={x:e.position.x+50,y:e.position.y+50};u({...e,id:`${e.id}-copy`,position:n})}),[t,l,u]),h=e.useCallback((()=>{p.on_node_action({type:"delete",id:t,from_remote:!1})}),[t,c,d]),m=p.nodespace.get_node(t,!1);if(!m)return o.createElement(o.Fragment,null," ");const g=m();return o.createElement("div",{style:{top:n,left:r,right:i,bottom:a},className:"context-menu",...s},o.createElement("p",{style:{fontWeight:"bold"}},o.createElement("small",null,g.name)),o.createElement("button",{onClick:f},"duplicate"),o.createElement("button",{onClick:h},"delete"))},oF=t=>{const n=e.useContext(pF),r=e.useRef(null);e.useEffect((()=>{n.reactflowRef=r.current}),[r]);const[i,a]=e.useState(null),s=e.useCallback((()=>a(null)),[a]),{nodes:l,edges:c,onNodesChange:u,onEdgesChange:d,onConnect:p}=n.useReactFlowStore(cT(Qj));return o.createElement("div",{className:"reactflowlayer"},o.createElement(vs,{nodes:l,edges:c,onNodesChange:u,onEdgesChange:d,onConnect:p,nodeTypes:qj,edgeTypes:eF,minZoom:t.minZoom,maxZoom:t.maxZoom,fitView:!0,onSelectionChange:({nodes:e,edges:t})=>{const r=n.local_state.getState();n.local_state.setState({...r,selected_nodes:e.map((e=>e.id)),selected_edges:t.map((e=>e.id))})},ref:r,onPaneClick:s,panOnDrag:!t.static},o.createElement(tF,null),o.createElement(nF,null),o.createElement(Fs,{color:"#888",gap:16,size:1}),t.minimap&&o.createElement(Os,{nodeStrokeWidth:3,pannable:!t.static,zoomable:!t.static,zoomStep:3}),i&&o.createElement(rF,{onClick:s,...i})))},iF=e.createContext(void 0),aF=e.forwardRef(((t,n)=>{const{asChild:r,children:a,className:s,style:l,...c}=t,[u,d]=e.useState(!1),p=e.useRef(null),[f,h]=e.useState(null),[m,g]=e.useState({}),y=t.htime||300,b=t.vtime||300,v=t.hdelay||0,w=t.vdelay||200;e.useImperativeHandle(n,(()=>p.current),[]);let x;if(r&&o.isValidElement(a)){const e=a,t=[e.props.className,s,"smooth-expand",u?"smooth-expand-expanded":""].filter(Boolean).join(" "),n={...e.props.style,...l,...m};x=o.cloneElement(e,{ref:p,className:t,style:n,...c})}else x=o.createElement("div",{ref:p,...c,className:`smooth-expand ${u?"smooth-expand-expanded":""} ${s||""}`,style:{...l,...m}},a);const C=o.createElement(iF.Provider,{value:{isExpanded:u,toggleExpand:async()=>{p.current&&(u?await(async()=>{if(!p.current)return;if(!f)return;const e={transitionProperty:"width, left, height, top",transitionDuration:`${y}ms, ${y}ms, ${b}ms, ${b}ms`};g((t=>({...t,...e})));const[t,n,r,o]=f,i=new Promise((e=>{setTimeout((()=>{g((e=>({...e,left:`${t}px`,width:`${r}px`}))),e()}),w)})),a=new Promise((e=>{setTimeout((()=>{g((e=>({...e,top:`${n}px`,height:`${o}px`}))),e()}),v)})),s=Math.max(y+v,b+w),l=new Promise((e=>{setTimeout((()=>{e()}),s)}));await Promise.all([i,a,l]),p.current.style.transition="",g({}),d(!1)})():await(async()=>{if(!p.current)return;p.current.style.transition="none",p.current.style.position="",p.current.style.top="",p.current.style.left="",p.current.style.width="",p.current.style.height="";const e=p.current.getBoundingClientRect();h([e.left,e.top,e.width,e.height]),p.current.style.transition="none",g({position:"absolute",top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`}),g((e=>({...e,transitionProperty:"width, left, height, top",transitionDuration:`${y}ms, ${y}ms, ${b}ms, ${b}ms`}))),d(!0);const t=new Promise((e=>{setTimeout((()=>{g((e=>({...e,left:"0px",width:"100vw"}))),e()}),v)})),n=new Promise((e=>{setTimeout((()=>{g((e=>({...e,top:"0px",height:"100vh"}))),e()}),w)})),r=Math.max(y+v,b+w),o=new Promise((e=>{setTimeout((()=>{e()}),r)}));await Promise.all([t,n,o])})())}}},x);return u?i.createPortal(C,document.body):C}));aF.Trigger=function({children:t}){const n=e.useContext(iF);if(!n)throw new Error("SmoothExpandComponent.Trigger must be used within a SmoothExpandComponent");return o.createElement("div",{style:{cursor:"pointer"},onClick:n.toggleExpand},t)},aF.Expanded=function({children:t}){const n=e.useContext(iF);if(!n)throw new Error("SmoothExpandComponent.Expanded must be used within a SmoothExpandComponent");return n.isExpanded?o.createElement(o.Fragment,null,t):null},aF.Collapsed=function({children:t}){const n=e.useContext(iF);if(!n)throw new Error("SmoothExpandComponent.Collapsed must be used within a SmoothExpandComponent");return n.isExpanded?null:o.createElement(o.Fragment,null,t)};const sF=o.createContext(void 0),lF=e.forwardRef(((t,n)=>{const{asChild:r,children:i,className:a,style:s,...l}=t,c=e.useRef(null);e.useImperativeHandle(n,(()=>c.current),[]);const[u,d]=e.useState(!1),p=e.useCallback((async()=>{try{const e=c.current;if(!e)return;if(u){const e=document;e.exitFullscreen?await e.exitFullscreen():e.mozCancelFullScreen?await e.mozCancelFullScreen():e.webkitExitFullscreen?await e.webkitExitFullscreen():e.msExitFullscreen&&await e.msExitFullscreen(),d(!1)}else e.requestFullscreen?await e.requestFullscreen():e.mozRequestFullScreen?await e.mozRequestFullScreen():e.webkitRequestFullscreen?await e.webkitRequestFullscreen():e.msRequestFullscreen&&await e.msRequestFullscreen(),d(!0)}catch(e){console.error("Error toggling fullscreen",e)}}),[u]);let f;if(e.useEffect((()=>{const e=()=>{const e=document.fullscreenElement;d(!!e)};return document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("MSFullscreenChange",e),()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}}),[]),r&&o.isValidElement(i)){const e=i,t=[e.props.className,a].filter(Boolean).join(" "),n={...e.props.style,...s};f=o.cloneElement(e,{ref:c,className:t,style:n,...l})}else f=o.createElement("div",{ref:c,...l,className:a,style:s},i);return o.createElement(sF.Provider,{value:{isFullScreen:u,toggleFullscreen:p}},f)}));lF.Trigger=function({children:e}){const t=o.useContext(sF);if(!t)throw new Error("FullScreenComponent.Trigger must be used within a FullScreenComponent");return o.createElement("div",{style:{cursor:"pointer"},onClick:t.toggleFullscreen},e)},lF.InFullScreen=function({children:e}){const t=o.useContext(sF);if(!t)throw new Error("FullScreenComponent.Expanded must be used within a FullScreenComponent");return t.isFullScreen?o.createElement(o.Fragment,null,e):null},lF.OutFullScreen=function({children:e}){const t=o.useContext(sF);if(!t)throw new Error("FullScreenComponent.Collapsed must be used within a FullScreenComponent");return t.isFullScreen?null:o.createElement(o.Fragment,null,e)};const cF=({fnrf_zst:t,header:n,flow:r,library:i})=>{const[a,s]=e.useState(t.options.worker);t.workermanager&&(t.workermanager.on_setWorker=s),t.set_worker(a),t.auto_progress();const l=t.plugins();return o.createElement(Aj,{plugins:l,fnrf_zst:t},o.createElement(pF.Provider,{value:t},o.createElement(aF,{asChild:!0},o.createElement(lF,{asChild:!0},o.createElement("div",{className:"funcnodesreactflowcontainer funcnodescontainer"},n.show&&o.createElement(kS,{...n}),o.createElement("div",{className:"funcnodesreactflowbody"},a&&i.show&&o.createElement(sT,null),o.createElement(oF,{...r}),a&&r.showNodeSettings&&o.createElement(Kj,null)),o.createElement("div",{className:"funcnodesflaotingmenu"},o.createElement(lF.OutFullScreen,null,r.allowExpand&&o.createElement(aF.Trigger,null,o.createElement(aF.Expanded,null,o.createElement(Uw,null)),o.createElement(aF.Collapsed,null,o.createElement(Jw,null)))),r.allowFullScreen&&o.createElement(lF.Trigger,null,o.createElement(lF.OutFullScreen,null,o.createElement(Bv,null)),o.createElement(lF.InFullScreen,null,o.createElement(Yw,null)))))))))},uF={},dF={id:"",debug:!1,useWorkerManager:!0,show_library:!0,header:{show:!0,showmenu:!0},flow:{minimap:!0,static:!1,minZoom:.1,maxZoom:5,allowFullScreen:!0,allowExpand:!0,showNodeSettings:!0},library:{show:!0}},pF=e.createContext(Us(dF)),fF=e=>{let t=M(e,{...dF,id:ku()}).new_obj;if(!t.useWorkerManager&&void 0===t.worker)return o.createElement("div",null,"Error: If you don't use a worker manager, you must provide a default worker.");if(e.useWorkerManager&&void 0===e.workermanager_url)return o.createElement("div",null,"Error: If you use a worker manager, you must provide a worker manager url.");if(void 0===window.fnrf_zst&&(window.fnrf_zst=uF),void 0===uF[t.id]){const e=Us(t);uF[t.id]=e}if(t.worker&&t.worker.set_zustand(uF[t.id]),uF[t.id].options.debug=t.debug,t.useWorkerManager){const e=new _u(t.workermanager_url,uF[t.id]);uF[t.id].workermanager=e}return o.createElement(cF,{fnrf_zst:uF[t.id],header:t.header,library:t.library,flow:t.flow})},hF={set_io_value:({nid:t,ioid:n,value:r,set_default:o=!1})=>{const i=e.useContext(pF);i.worker?.set_io_value({nid:t,ioid:n,value:r,set_default:o})}};exports.FuncNodesContext=pF,exports.FuncNodesReactFlowZustand=Us,exports.FuncNodesWorker=Su,exports.FuncnodesReactFlow=fF,exports.ReactFlowLayer=oF,exports.RenderMappingProvider=Aj,exports.WebSocketWorker=Iu,exports.assert_full_node=F,exports.deep_update=M,exports.default=e=>{const t=new Zs("FuncNodes",e.debug?"debug":"info");t.debug("Initalizing FuncNodes with props:",e);let n=M(e,{...dF,id:ku()}).new_obj;if(void 0===e.worker&&void 0!==e.worker_url&&(n.useWorkerManager=!1,n.worker=new Iu({url:e.worker_url,uuid:n.id,on_sync_complete:n.on_sync_complete})),void 0!==n.worker){const e=Us(n);n.worker.set_zustand(e)}if(void 0!==e.fnw_url){if(void 0===n.worker)throw new Error("defining fnw_url requires a worker to be defined");const t=async function(e,t=!0){try{const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch from URL: ${n.status} ${n.statusText}`);const r=await n.blob();return await new Promise(((e,n)=>{const o=new FileReader;o.onload=()=>{const r=o.result;"string"!=typeof r&&(n("Failed to convert URL to Base64: No result from FileReader"),n(o.error)),e(t?r.split(",")[1]:r)},o.onerror=()=>n(o.error),o.readAsDataURL(r)}))}catch(e){throw console.error("Error converting URL to Base64:",e),e}}(e.fnw_url),r=n.worker.on_sync_complete,o=async e=>{const n=await t;e.on_sync_complete=r,await e.update_from_export(n)};n.worker.on_sync_complete=o}return t.debug("Initalizing FuncnodesReactFlow with props:",n),o.createElement("div",{className:"App",style:{height:"100%",width:"100%"}},o.createElement(fF,{...n}))},exports.helperfunctions=hF;
145
+ */var QB=function(){if(JB)return KB;JB=1;var e=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,t=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,n=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,r=/\\([\u000b\u0020-\u00ff])/g,o=/([\\"])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function a(e){var r=String(e);if(n.test(r))return r;if(r.length>0&&!t.test(r))throw new TypeError("invalid parameter value");return'"'+r.replace(o,"\\$1")+'"'}function s(e){this.parameters=Object.create(null),this.type=e}return KB.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,r=e.type;if(!r||!i.test(r))throw new TypeError("invalid type");var o=r;if(t&&"object"==typeof t)for(var s,l=Object.keys(t).sort(),c=0;c<l.length;c++){if(s=l[c],!n.test(s))throw new TypeError("invalid parameter name");o+="; "+s+"="+a(t[s])}return o},KB.parse=function(t){if(!t)throw new TypeError("argument string is required");var n="object"==typeof t?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(t):t;if("string"!=typeof n)throw new TypeError("argument string is required to be a string");var o=n.indexOf(";"),a=-1!==o?n.slice(0,o).trim():n.trim();if(!i.test(a))throw new TypeError("invalid media type");var l=new s(a.toLowerCase());if(-1!==o){var c,u,d;for(e.lastIndex=o;u=e.exec(n);){if(u.index!==o)throw new TypeError("invalid parameter format");o+=u[0].length,c=u[1].toLowerCase(),34===(d=u[2]).charCodeAt(0)&&-1!==(d=d.slice(1,-1)).indexOf("\\")&&(d=d.replace(r,"$1")),l.parameters[c]=d}if(o!==n.length)throw new TypeError("invalid parameter format")}return l},KB}(),qB=new Map,ej=function(e){return e.cloneNode(!0)},tj=function(){return"file:"===window.location.protocol},nj=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&2===r.readyState){var t=r.getResponseHeader("Content-Type");if(!t)throw new Error("Content type not found");var o=QB.parse(t).type;if("image/svg+xml"!==o&&"text/plain"!==o)throw new Error("Invalid content type: ".concat(o))}if(4===r.readyState){if(404===r.status||null===r.responseXML)throw new Error(tj()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(!(200===r.status||tj()&&0===r.status))throw new Error("There was a problem injecting the SVG: "+r.status+" "+r.statusText);n(null,r)}}catch(e){if(r.abort(),!(e instanceof Error))throw e;n(e,r)}},r.open("GET",e),r.withCredentials=t,r.overrideMimeType&&r.overrideMimeType("text/xml"),r.send()},rj={},oj=function(e,t){rj[e]=rj[e]||[],rj[e].push(t)},ij=function(e,t,n){if(qB.has(e)){var r=qB.get(e);if(void 0===r)return void oj(e,n);if(r instanceof SVGSVGElement)return void n(null,ej(r))}qB.set(e,void 0),oj(e,n),nj(e,t,(function(t,n){var r;t?qB.set(e,t):(null===(r=n.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&qB.set(e,n.responseXML.documentElement),function(e){for(var t=function(t,n){setTimeout((function(){if(Array.isArray(rj[e])){var n=qB.get(e),r=rj[e][t];n instanceof SVGSVGElement&&r(null,ej(n)),n instanceof Error&&r(n),t===rj[e].length-1&&delete rj[e]}}),0)},n=0,r=rj[e].length;n<r;n++)t(n)}(e)}))},aj=function(e,t,n){nj(e,t,(function(e,t){var r;e?n(e):(null===(r=t.responseXML)||void 0===r?void 0:r.documentElement)instanceof SVGSVGElement&&n(null,t.responseXML.documentElement)}))},sj=0,lj=[],cj={},uj="http://www.w3.org/1999/xlink",dj=function(e,t,n,r,o,i,a){var s=e.getAttribute("data-src")||e.getAttribute("src");if(s){if(-1!==lj.indexOf(e))return lj.splice(lj.indexOf(e),1),void(e=null);lj.push(e),e.setAttribute("src",""),(r?ij:aj)(s,o,(function(r,o){if(!o)return lj.splice(lj.indexOf(e),1),e=null,void a(r);var l=e.getAttribute("id");l&&o.setAttribute("id",l);var c=e.getAttribute("title");c&&o.setAttribute("title",c);var u=e.getAttribute("width");u&&o.setAttribute("width",u);var d=e.getAttribute("height");d&&o.setAttribute("height",d);var p=Array.from(new Set(_d(_d(_d([],(o.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();o.setAttribute("class",p);var f=e.getAttribute("style");f&&o.setAttribute("style",f),o.setAttribute("data-src",s);var h=[].filter.call(e.attributes,(function(e){return/^data-\w[\w-]*$/.test(e.name)}));if(Array.prototype.forEach.call(h,(function(e){e.name&&e.value&&o.setAttribute(e.name,e.value)})),n){var m,g,y,b,v,w={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]};Object.keys(w).forEach((function(e){m=e,y=w[e];for(var t=function(e,t){var n;b=g[e].id,v=b+"-"+ ++sj,Array.prototype.forEach.call(y,(function(e){for(var t=0,r=(n=o.querySelectorAll("["+e+'*="'+b+'"]')).length;t<r;t++){var i=n[t].getAttribute(e);i&&!i.match(new RegExp('url\\("?#'+b+'"?\\)'))||n[t].setAttribute(e,"url(#"+v+")")}}));for(var r=o.querySelectorAll("[*|href]"),i=[],a=0,s=r.length;a<s;a++){var l=r[a].getAttributeNS(uj,"href");l&&l.toString()==="#"+g[e].id&&i.push(r[a])}for(var c=0,u=i.length;c<u;c++)i[c].setAttributeNS(uj,"href","#"+v);g[e].id=v},n=0,r=(g=o.querySelectorAll(m+"[id]")).length;n<r;n++)t(n)}))}o.removeAttribute("xmlns:a");for(var x,C,E=o.querySelectorAll("script"),k=[],S=0,I=E.length;S<I;S++)(C=E[S].getAttribute("type"))&&"application/ecmascript"!==C&&"application/javascript"!==C&&"text/javascript"!==C||((x=E[S].innerText||E[S].textContent)&&k.push(x),o.removeChild(E[S]));if(k.length>0&&("always"===t||"once"===t&&!cj[s])){for(var _=0,A=k.length;_<A;_++)new Function(k[_])(window);cj[s]=!0}var N=o.querySelectorAll("style");if(Array.prototype.forEach.call(N,(function(e){e.textContent+=""})),o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("xmlns:xlink",uj),i(o),!e.parentNode)return lj.splice(lj.indexOf(e),1),e=null,void a(new Error("Parent node is null"));e.parentNode.replaceChild(o,e),lj.splice(lj.indexOf(e),1),e=null,a(null,o)}))}else a(new Error("Invalid data-src or src attribute"))},pj=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],fj="http://www.w3.org/2000/svg",hj="http://www.w3.org/1999/xlink",mj=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).initialState={hasError:!1,isLoading:!0},t.state=t.initialState,t._isMounted=!1,t.reactWrapper=void 0,t.nonReactWrapper=void 0,t.refCallback=function(e){t.reactWrapper=e},t}bw(t,e);var n=t.prototype;return n.renderSVG=function(){var e=this;if(this.reactWrapper instanceof function(e){return((null==e?void 0:e.ownerDocument)||document).defaultView||window}(this.reactWrapper).Node){var t,n,r=this.props,o=r.desc,i=r.evalScripts,a=r.httpRequestWithCredentials,s=r.renumerateIRIElements,l=r.src,c=r.title,u=r.useRequestCache,d=this.props.onError,p=this.props.beforeInjection,f=this.props.afterInjection,h=this.props.wrapper;"svg"===h?((t=document.createElementNS(fj,h)).setAttribute("xmlns",fj),t.setAttribute("xmlns:xlink",hj),n=document.createElementNS(fj,h)):(t=document.createElement(h),n=document.createElement(h)),t.appendChild(n),n.dataset.src=l,this.nonReactWrapper=this.reactWrapper.appendChild(t);var m=function(t){e.removeSVG(),e._isMounted?e.setState((function(){return{hasError:!0,isLoading:!1}}),(function(){d(t)})):d(t)};!function(e,t){var n=void 0===t?{}:t,r=n.afterAll,o=void 0===r?function(){}:r,i=n.afterEach,a=void 0===i?function(){}:i,s=n.beforeEach,l=void 0===s?function(){}:s,c=n.cacheRequests,u=void 0===c||c,d=n.evalScripts,p=void 0===d?"never":d,f=n.httpRequestWithCredentials,h=void 0!==f&&f,m=n.renumerateIRIElements,g=void 0===m||m;if(e&&"length"in e)for(var y=0,b=0,v=e.length;b<v;b++)dj(e[b],p,g,u,h,l,(function(t,n){a(t,n),e&&"length"in e&&e.length===++y&&o(y)}));else e?dj(e,p,g,u,h,l,(function(t,n){a(t,n),o(1),e=null})):o(0)}(n,{afterEach:function(t,n){t?m(t):e._isMounted&&e.setState((function(){return{isLoading:!1}}),(function(){try{f(n)}catch(e){m(e)}}))},beforeEach:function(e){if(e.setAttribute("role","img"),o){var t=e.querySelector(":scope > desc");t&&e.removeChild(t);var n=document.createElement("desc");n.innerHTML=o,e.prepend(n)}if(c){var r=e.querySelector(":scope > title");r&&e.removeChild(r);var i=document.createElement("title");i.innerHTML=c,e.prepend(i)}try{p(e)}catch(e){m(e)}},cacheRequests:u,evalScripts:i,httpRequestWithCredentials:a,renumerateIRIElements:s})}},n.removeSVG=function(){var e;null!=(e=this.nonReactWrapper)&&e.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(e){var t=this;(function(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1})(Im({},e),this.props)&&this.setState((function(){return t.initialState}),(function(){t.removeSVG(),t.renderSVG()}))},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var e=this.props;e.afterInjection,e.beforeInjection,e.desc,e.evalScripts;var t=e.fallback;e.httpRequestWithCredentials;var n=e.loading;e.renumerateIRIElements,e.src,e.title,e.useRequestCache;var r=e.wrapper,i=gw(e,pj),a=r;return o.createElement(a,Im({},i,{ref:this.refCallback},"svg"===r?{xmlns:fj,xmlnsXlink:hj}:{}),this.state.isLoading&&n&&o.createElement(n,null),this.state.hasError&&t&&o.createElement(t,null))},t}(o.Component);mj.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"},mj.propTypes={afterInjection:Yf.func,beforeInjection:Yf.func,desc:Yf.string,evalScripts:Yf.oneOf(["always","once","never"]),fallback:Yf.oneOfType([Yf.func,Yf.object,Yf.string]),httpRequestWithCredentials:Yf.bool,loading:Yf.oneOfType([Yf.func,Yf.object,Yf.string]),onError:Yf.func,renumerateIRIElements:Yf.bool,src:Yf.string.isRequired,title:Yf.string,useRequestCache:Yf.bool,wrapper:Yf.oneOf(["div","span","svg"])};const gj=({value:e,renderoptions:t})=>(void 0===t&&(t={}),void 0===t.format&&(t.format="jpeg"),o.createElement("img",{src:"data:image/"+t.format+";base64, "+e,style:{maxWidth:"100%",maxHeight:"100%"}})),yj=({value:e})=>o.createElement(mj,{src:`data:image/svg+xml;base64,${btoa(e)}`,style:{maxWidth:"100%",maxHeight:"100%"},beforeInjection:e=>{e.classList.add("svg-class-name"),e.setAttribute("style","max-width: 100%; max-height: 100%;"),e.setAttribute("width","100%"),e.setAttribute("height","100%")}}),bj=({io:e})=>{let t=e.fullvalue;if(null==t&&(t=e.value),void 0===t&&(t=""),"string"!=typeof t||t.length%4!=0)return o.createElement("div",null,t);const n=Math.round(3*t.length/4);return o.createElement("div",null,o.createElement("pre",null,"Bytes(",n,")"))},vj=({io:e})=>{let t=e.fullvalue;return void 0===t&&(t=e.value),void 0===t&&(t={}),o.createElement(YB,{data:t})},wj={float:({io:e,inputconverter:t})=>SB({io:e,inputconverter:t,parser:parseFloat}),int:({io:e,inputconverter:t})=>SB({io:e,inputconverter:t,parser:parseInt}),bool:({io:t,inputconverter:n})=>{const r=e.useContext(sF),i=void 0===t.value,a=e.useRef(null);e.useEffect((()=>{a.current&&(a.current.indeterminate=i)}),[a,i]);return o.createElement("input",{ref:a,type:"checkbox",className:"styledcheckbox booleaninput",checked:!!n[1](t.value),onChange:e=>{let o=e.target.checked;try{o=n[0](e.target.checked)}catch(e){}r.worker?.set_io_value({nid:t.node,ioid:t.id,value:o,set_default:t.render_options.set_default})},disabled:t.connected})},string:IB,str:IB,color:({io:t})=>{const n=e.useContext(sF),r=t.value_options?.colorspace||"hex";let i=!1;return"string"!=typeof t.type&&"anyOf"in t.type&&void 0!==t.type.anyOf&&(i=t.type.anyOf.some((e=>"None"===e))),o.createElement(SM,{onChange:e=>{let o="<NoValue>";e&&(o=e[r]?e[r]():e.hex()),null===e&&(o=null),n.worker?.set_io_value({nid:t.node,ioid:t.id,value:o,set_default:t.render_options.set_default})},inicolordata:t.value,allow_null:i,inicolorspace:r})},select:OB,enum:OB,bytes:bj},xj={Inputrenderer:wj,Outputrenderer:{},HandlePreviewRenderer:{bytes:bj},DataOverlayRenderer:{},DataPreviewViewRenderer:{string:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),t=void 0===t?"":JSON.stringify(e.value).replace(/\\n/g,"\n"),o.createElement("div",null,o.createElement("pre",null,t))},table:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=[]),o.createElement(UB,{tabledata:t})},image:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=""),o.createElement(gj,{value:t})},svg:({io:e})=>{let t=e.fullvalue;return null==t&&(t=e.value),void 0===t&&(t=""),o.createElement(yj,{value:t})},dict:vj,bytes:bj},DataViewRenderer:{},InLineRenderer:{bytes:({io:e})=>{let t=e.fullvalue;null==t&&(t=e.value),t=void 0===t?"":JSON.stringify(e.value).replace(/\\n/g,"\n");return`Bytes(${Math.round(3*t.length/4)})`}}},Cj=(e,t)=>{const n=t.options||{},r=void 0===n.overwrite||n.overwrite;switch(t.type){case"EXTEND_INPUT_RENDER":return!r&&e.Inputrenderer[t.payload.type]?e:{...e,Inputrenderer:{...e.Inputrenderer,[t.payload.type]:t.payload.component}};case"EXTEND_OUTPUT_RENDER":return!r&&e.Outputrenderer[t.payload.type]?e:{...e,Outputrenderer:{...e.Outputrenderer,[t.payload.type]:t.payload.component}};case"EXTEND_HANDLE_PREVIEW_RENDER":return!r&&e.HandlePreviewRenderer[t.payload.type]?e:{...e,HandlePreviewRenderer:{...e.HandlePreviewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_OVERLAY_RENDER":return!r&&e.DataOverlayRenderer[t.payload.type]?e:{...e,DataOverlayRenderer:{...e.DataOverlayRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_PREVIEW_RENDER":return!r&&e.DataPreviewViewRenderer[t.payload.type]?e:{...e,DataPreviewViewRenderer:{...e.DataPreviewViewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_DATA_VIEW_RENDER":return!r&&e.DataViewRenderer[t.payload.type]?e:{...e,DataViewRenderer:{...e.DataViewRenderer,[t.payload.type]:t.payload.component}};case"EXTEND_FROM_PLUGIN":let n=!1;const o=[[t.payload.plugin.input_renderers||{},e.Inputrenderer],[t.payload.plugin.output_renderers||{},e.Outputrenderer],[t.payload.plugin.handle_preview_renderers||{},e.HandlePreviewRenderer],[t.payload.plugin.data_overlay_renderers||{},e.DataOverlayRenderer],[t.payload.plugin.data_preview_renderers||{},e.DataPreviewViewRenderer],[t.payload.plugin.data_view_renderers||{},e.DataViewRenderer]];for(const[e,t]of o){if(Object.keys(e).length>0)if(r)n=!0;else for(const r in e)if(!t[r]){n=!0;break}if(n)break}if(!n)return e;for(const[e,t]of o)for(const n in e)!r&&t[n]||(t[n]=e[n]);return{...e};default:return e}},Ej=({children:t,plugins:n,fnrf_zst:r})=>{const[i,a]=e.useReducer(Cj,xj),s=(e,t)=>{a({type:"EXTEND_FROM_PLUGIN",payload:{plugin:e},options:t})};return e.useEffect((()=>{for(const e in n){const t=n[e].RendererPlugin;t&&s(t);const i=n[e].renderpluginfactory;i&&s(i({React:o,fnrf_zst:r}))}}),[n]),o.createElement(kj.Provider,{value:{Inputrenderer:i.Inputrenderer,Outputrenderer:i.Outputrenderer,HandlePreviewRenderer:i.HandlePreviewRenderer,DataOverlayRenderer:i.DataOverlayRenderer,DataPreviewViewRenderer:i.DataPreviewViewRenderer,DataViewRenderer:i.DataViewRenderer,InLineRenderer:i.InLineRenderer,extendInputRenderMapping:(e,t,n)=>{a({type:"EXTEND_INPUT_RENDER",payload:{type:e,component:t},options:n})},extendOutputRenderMapping:(e,t,n)=>{a({type:"EXTEND_OUTPUT_RENDER",payload:{type:e,component:t},options:n})},extendHandlePreviewRenderMapping:(e,t,n)=>{a({type:"EXTEND_HANDLE_PREVIEW_RENDER",payload:{type:e,component:t},options:n})},extendDataOverlayRenderMapping:(e,t,n)=>{a({type:"EXTEND_DATA_OVERLAY_RENDER",payload:{type:e,component:t},options:n})},extendDataPreviewRenderMapping:(e,t,n)=>{a({type:"EXTEND_DATA_PREVIEW_RENDER",payload:{type:e,component:t},options:n})},extendDataViewRenderMapping:(e,t,n)=>{a({type:"EXTEND_DATA_VIEW_RENDER",payload:{type:e,component:t},options:n})},extendFromPlugin:s}},t)},kj=e.createContext({Inputrenderer:xj.Inputrenderer,Outputrenderer:xj.Outputrenderer,HandlePreviewRenderer:xj.HandlePreviewRenderer,DataOverlayRenderer:xj.DataOverlayRenderer,DataPreviewViewRenderer:xj.DataPreviewViewRenderer,DataViewRenderer:xj.DataViewRenderer,InLineRenderer:xj.InLineRenderer,extendInputRenderMapping:(e,t,n)=>{},extendOutputRenderMapping:(e,t,n)=>{},extendHandlePreviewRenderMapping:(e,t,n)=>{},extendDataOverlayRenderMapping:(e,t,n)=>{},extendDataPreviewRenderMapping:(e,t,n)=>{},extendDataViewRenderMapping:(e,t,n)=>{},extendFromPlugin:(e,t)=>{}}),Sj=({component:e,...t})=>o.createElement(e,{...t}),Ij=t=>{const n=e.useContext(sF).render_options(),[r]=_j(t.type,n.typemap||{});if(!r)return vj;const{DataOverlayRenderer:o,DataPreviewViewRenderer:i}=e.useContext(kj);return o[r]?o[r]:i[r]?i[r]:vj},_j=(e,t)=>{if("string"==typeof e)return e in t?[t[e],e]:[e,e];if("allOf"in e&&void 0!==e.allOf)return[void 0,void 0];if("anyOf"in e&&void 0!==e.anyOf){const n=e.anyOf.map((e=>_j(e,t)));for(const e of n)switch(e[0]){case"bool":return["bool",e[1]];case"enum":return["enum",e[1]];case"float":return["float",e[1]];case"int":return["int",e[1]];case"string":case"str":return["string",e[1]]}return[void 0,void 0]}return"type"in e&&void 0!==e.type&&"enum"===e.type?["enum","enum"]:[void 0,void 0]},Aj=({io:t,typestring:n,preview:r,...i})=>{const[a,s]=e.useState(!1),[l,c]=e.useState(!1),[u,d]=t?(t=>{const n=e.useContext(sF).render_options(),[r]=_j(t.type,n.typemap||{}),{HandlePreviewRenderer:o,DataPreviewViewRenderer:i}=e.useContext(kj),a=Ij(t);return r?o[r]?[o[r],a]:i[r]?[i[r],a]:[vj,a]:[vj,a]})(t):[void 0,void 0];return o.createElement(PT,null,o.createElement(DT,{open:a||l,onOpenChange:c},o.createElement(BT,{asChild:!0},o.createElement(li,{id:t.id,"data-type":n,...i})),o.createElement(jT,null,o.createElement(FT,{className:"iotooltipcontent",sideOffset:5},o.createElement("div",{className:"iotooltip_container"},o.createElement("div",{className:"iotooltip_header"},a?o.createElement(Dv,{onClick:()=>s(!1)}):o.createElement(Pv,{onClick:()=>s(!0)}),d&&o.createElement(Kw,{title:t.full_id,trigger:o.createElement(Bv,null),onOpenChange:e=>{e&&t.try_get_full_value&&t.try_get_full_value(),s(e)}},o.createElement(Sj,{component:d,io:t}))),u?o.createElement(Sj,{component:u,io:t}):`no preview available for "${n}"`),o.createElement(LT,{className:"iotooltipcontentarrow"})))))},Nj={"":[e=>e,e=>e],str_to_json:[e=>JSON.parse(e),e=>"string"==typeof e?e:JSON.stringify(e)],str_to_list:[e=>{try{const t=JSON.parse(e);return Array.isArray(t)?t:[t]}catch(t){try{return JSON.parse("["+e+"]")}catch(e){}}throw new Error("Invalid list")},e=>JSON.stringify(e)]},Rj=({io:t})=>{const n=e.useContext(sF).render_options(),[r,i]=_j(t.render_options.type,n.typemap||{}),{Inputrenderer:a}=e.useContext(kj),s=r?t.value_options?.options?OB:a[r]:void 0,l=Nj[(i&&n.inputconverter?.[i])??""];return o.createElement("div",{className:"nodeinput","data-type":r},o.createElement(Aj,{io:t,typestring:r,position:ko.Left,type:"target"}),s&&o.createElement("div",{className:"iovaluefield nodrag","data-type":r},o.createElement(s,{io:t,inputconverter:l})),o.createElement("div",{className:"ioname"},t.name),o.createElement(Aj,{io:t,typestring:r,position:ko.Right,type:"source"}))},Oj=({io:t,typestring:n})=>{const{InLineRenderer:r}=e.useContext(kj);if(n&&r[n])return o.createElement("div",null,r[n]({io:t}));let i=t.fullvalue;return null==i&&(i=t.value),i=void 0===i?"":JSON.stringify(i).replace(/\\n/g,"\n"),i.length>63&&(i=i.slice(0,60)+"..."),o.createElement("div",null,i)},Tj=({io:t})=>{const n=e.useContext(sF).render_options(),[r]=_j(t.type,n.typemap||{}),{Outputrenderer:i}=e.useContext(kj),a=r?i[r]:void 0;return o.createElement("div",{className:"nodeoutput","data-type":r},o.createElement(Aj,{io:t,typestring:r,position:ko.Right,type:"source"}),o.createElement("div",{className:"ioname"},t.name),a?o.createElement("div",{className:"iovaluefield nodrag"},o.createElement(a,{io:t})):o.createElement("div",{className:"iovaluefield"},o.createElement(Oj,{io:t,typestring:r})))};function Mj(e){return`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function Pj(e,t){const n=["","K","M","G","T"];let r=0;for(;e>=t&&r<n.length-1;)e/=t,r++;return[e.toFixed(2),n[r]]}const Dj=({state:t,className:n="reacttqdm",...r})=>{const i=e.useRef(null),a=e.useRef(null);e.useEffect((()=>{const e=()=>{i.current&&a.current&&function(e,t,n={}){const{maxFontSize:r=100,minFontSize:o=6,decrementFactor:i=.9}=n;if(!e||!t)return;if(i>=1||i<=0)throw new Error("decrementFactor must be between 0 and 1");const a=e.getBoundingClientRect(),s=a.width,l=a.height;let c=r;t.style.whiteSpace="nowrap",t.style.display="inline-block",t.style.fontSize=c+"px";let u=t.getBoundingClientRect();for(;(u.width>s||u.height>l)&&c>o;)c*=i,t.style.fontSize=c+"px",u=t.getBoundingClientRect()}(i.current,a.current,{maxFontSize:12,decrementFactor:.9})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]);const s=t.total?t.n/t.total*100:0;return o.createElement("div",{ref:i,className:n,...r},o.createElement("div",{style:{position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},o.createElement("div",{className:n+"-bar",style:{position:"absolute",width:"100%",height:"100%",overflow:"hidden"}},o.createElement("div",{className:n+"-progress",style:{width:`${s}%`,height:"100%"}})),o.createElement("div",{className:n+"-text",ref:a},function(e={n:0,elapsed:0,ascii:!1,unit:"it",unit_scale:!1,unit_divisor:1e3}){let t=e.total??null;const{n:n,unit_scale:r,elapsed:o,unit:i,unit_divisor:a,prefix:s="",rate:l,postfix:c=null,initial:u=0}=e;null!==t&&n>=t+.5&&(t=null);let d=n,p=t,f=l;r&&!0!==r&&1!==r&&(null!==t&&(p=t*r),d=n*r,void 0!==l&&(f=l*r));const h=Mj(o);void 0===f&&o>0&&(f=(d-u)/o);const m=f?1/f:void 0,[g,y]=f?Pj(f,a):[void 0,""],[b,v]=m?Pj(m,1e3):[void 0,""],w=m&&m>1?b?`${b}${v}s/`+i:"?":(g||"?")+`${y}${i}/s`,x=r?Pj(d,a).join(""):d.toString(),C=r&&null!==p?Pj(p,a).join(""):p?.toString()??"?",E=f?Mj(f&&null!==p?(p-d)/f:0):"?",k=s?`${s}: `:"";if(null!==t){const e=` ${x}/${C} [${h} < ${E}, ${w}${c??""}]`;return`${k}${(d/t*100).toFixed(0)}%${e}`}return`${k}${x}${i} [${h}, ${w}${c??""}]`}(t))))},Bj=({node_data:t})=>{const n=e.useContext(sF);return o.createElement("div",{className:"nodeheader",title:t.description||t.node_name},o.createElement("div",{className:"nodeheader_element"},o.createElement(Lv,{fontSize:"inherit",className:"triggerbutton",onClick:()=>{n.on_node_action({type:"trigger",from_remote:!1,id:t.id})}}),o.createElement(Fv,{fontSize:"inherit",onClick:async()=>{n.logger.info("nodestatus",await(n.worker?.get_node_status(t.id)))}})),o.createElement("div",{className:"nodeheader_element nodeheader_title"},o.createElement("div",{className:"nodeheader_title_text"},t.node_name)),o.createElement("div",{className:"nodeheader_element"},o.createElement(jv,{fontSize:"inherit"})))},jj=({node_data:t})=>{const n=t.render_options?.data?.src?t.io[t.render_options?.data?.src]:void 0,[r,i]=n?(t=>{const n=e.useContext(sF).render_options(),[r]=_j(t.type,n.typemap||{}),o=Ij(t),{DataPreviewViewRenderer:i,DataViewRenderer:a}=e.useContext(kj);return r?a[r]?[a[r],o]:i[r]?[i[r],o]:[vj,o]:[vj,o]})(n):[void 0,void 0];return o.createElement("div",{className:"nodrag nodedatabody"},r&&n&&o.createElement(Kw,{title:n.full_id,trigger:o.createElement("div",null,o.createElement(Sj,{component:r,io:n})),onOpenChange:e=>{e&&n?.try_get_full_value&&n?.try_get_full_value()}},o.createElement(Sj,{component:i,io:n})))},Fj=({node_data:e})=>{const t=Object.values(e.io).filter((e=>e.is_input)),n=Object.values(e.io).filter((e=>!e.is_input));return e.render_options,o.createElement("div",{className:"nodebody"},n.map((e=>e.hidden?null:o.createElement(Tj,{key:e.id,io:e}))),o.createElement(jj,{node_data:e}),t.map((e=>e.hidden?null:o.createElement(Rj,{key:e.id,io:e}))))},Lj=({node_data:t})=>{const[n,r]=e.useState(t.name);e.useEffect((()=>{r(t.name)}),[t]);const i=e.useContext(sF);return o.createElement("input",{className:"nodename_input",value:n,onChange:e=>{r(e.target.value)},onBlur:e=>{const n=e.target.value;i.on_node_action({type:"update",from_remote:!1,id:t.id,node:{name:n}})}})},Vj=({node_data:e})=>e.progress?o.createElement(Dj,{style:{height:"idle"===e.progress.prefix?"0px":void 0},state:e.progress,className:"nodeprogress"}):null,zj=({node_data:e})=>o.createElement("div",{className:"nodefooter"},e.error&&o.createElement("div",{className:"nodeerror"},e.error),o.createElement(Vj,{node_data:e})),Gj=({io:e})=>{const t=o.useContext(sF).render_options(),[n,r]=_j(e.render_options.type,t.typemap||{}),{Inputrenderer:i}=o.useContext(kj),a=n?e.value_options?.options?OB:i[n]:void 0,s=Nj[(r&&t.inputconverter?.[r])??""];return o.createElement("div",{className:"nodesettings_component"},o.createElement("div",null,e.name),a&&o.createElement(a,{io:e,inputconverter:s}),o.createElement("div",null,o.createElement("label",null,"hidden:",o.createElement("input",{className:"styledcheckbox",type:"checkbox",disabled:e.connected,onChange:t=>{e.set_hidden?.(t.target.checked)},checked:e.hidden}))))},Hj=({io:e})=>o.createElement("div",{className:"nodesettings_component"},o.createElement("div",null,e.name),o.createElement("div",null,o.createElement("label",null,"hidden:",o.createElement("input",{className:"styledcheckbox",type:"checkbox",disabled:e.connected,onChange:t=>{e.set_hidden?.(t.target.checked)},checked:e.hidden})))),Wj=({nodestore:e})=>{const t=e(),n=Object.values(t.io).filter((e=>e.is_input)),r=Object.values(t.io).filter((e=>!e.is_input));return o.createElement("div",null,o.createElement("div",{className:"nodesettings_section"},o.createElement("div",{className:"nodesettings_component"},o.createElement("div",null,"Name"),o.createElement("div",null,o.createElement(Lj,{node_data:t})))),o.createElement("div",{className:"nodesettings_section"},o.createElement("div",null,"Inputs"),n.map((e=>o.createElement(Gj,{io:e,key:e.id})))),o.createElement("div",{className:"nodesettings_section"},o.createElement("div",null,"Outputs"),r.map((e=>o.createElement(Hj,{io:e,key:e.id})))))},Xj=()=>{const e=o.useContext(sF),t=e.local_state((e=>e.selected_nodes));if(0===t.length)return o.createElement("div",null,"Node Settings");if(t.length>1)return o.createElement("div",null,"Multiple Nodes Selected");const n=e.nodespace.get_node(t[0]);return n?o.createElement(Wj,{nodestore:n}):o.createElement("div",null,"Node not found")},Zj=()=>{const e=o.useContext(sF),t=e.local_settings((e=>e.view_settings.expand_node_props)),n=e.local_settings((e=>e.update_view_settings)),r=e=>{n({expand_node_props:e})};return o.createElement("div",{className:"nodesettings_container"},o.createElement("div",{className:"nodesettings_expander"},t?o.createElement(Mv,{onClick:()=>{r(!1)}}):o.createElement(Vv,{onClick:()=>{r(!0)}})),o.createElement("div",{className:"nodesettings_content "+(t?"expanded":"collapsed")},t&&o.createElement(Xj,null)))},$j=e=>({nodes:e.nodes,edges:e.edges,onNodesChange:e.onNodesChange,onEdgesChange:e.onEdgesChange,onConnect:e.onConnect}),Yj={default:({data:t})=>{const n=t.UseNodeStore(),r=n.frontend.collapsed||!1,{visualTrigger:i}=(t=>{const n=e.useContext(sF),[r,o]=e.useState(!1);return e.useEffect((()=>{n.worker?.call_hooks("node_mounted",t.id)}),[n.worker,t.id]),e.useEffect((()=>{let e;return t.in_trigger&&!r?o(!0):r&&(e=setTimeout((()=>o(!1)),200)),()=>clearTimeout(e)}),[t.in_trigger,r]),{visualTrigger:r}})(n);return o.createElement(o.Fragment,null,o.createElement("div",{className:"innernode"+(i?" intrigger":"")+(n.error?" error":"")},o.createElement(Bj,{node_data:n}),o.createElement(Lj,{node_data:n}),r?null:o.createElement(Fj,{node_data:n}),o.createElement(zj,{node_data:n})))}},Uj={default:({id:e,sourceX:t,sourceY:n,targetX:r,targetY:i,sourcePosition:a,targetPosition:s,data:l,...c})=>{const[u]=jo({sourceX:t,sourceY:n,sourcePosition:a,targetX:r,targetY:i,targetPosition:s});return o.createElement(o.Fragment,null,o.createElement(mo,{id:e,path:u,...c}))}},Jj=()=>{const t=Zi();return e.useContext(sF).rf_instance=t,o.createElement(o.Fragment,null)},Kj=()=>{const t=e.useContext(sF),n=Mi("Delete"),r=Hr(xs,Z),i=Hr(ws,Z);if(n){for(const e of r)if(e.selected){if(!t.worker)return o.createElement(o.Fragment,null);if(!e.source||!e.target)return o.createElement(o.Fragment,null);if(!e.sourceHandle||!e.targetHandle)return o.createElement(o.Fragment,null);t.worker.remove_edge({src_nid:e.source,src_ioid:e.sourceHandle,trg_nid:e.target,trg_ioid:e.targetHandle})}for(const e of i)if(e.selected){if(!t.worker)return o.createElement(o.Fragment,null);t.worker.remove_node(e.id)}}return o.createElement(o.Fragment,null)},Qj=({id:t,top:n,left:r,right:i,bottom:a,...s})=>{const{getNode:l,setNodes:c,addNodes:u,setEdges:d}=Zi(),p=e.useContext(sF),f=e.useCallback((()=>{const e=l(t);if(!e)return;const n={x:e.position.x+50,y:e.position.y+50};u({...e,id:`${e.id}-copy`,position:n})}),[t,l,u]),h=e.useCallback((()=>{p.on_node_action({type:"delete",id:t,from_remote:!1})}),[t,c,d]),m=p.nodespace.get_node(t,!1);if(!m)return o.createElement(o.Fragment,null," ");const g=m();return o.createElement("div",{style:{top:n,left:r,right:i,bottom:a},className:"context-menu",...s},o.createElement("p",{style:{fontWeight:"bold"}},o.createElement("small",null,g.name)),o.createElement("button",{onClick:f},"duplicate"),o.createElement("button",{onClick:h},"delete"))},qj=t=>{const n=e.useContext(sF),r=e.useRef(null);e.useEffect((()=>{n.reactflowRef=r.current}),[r]);const[i,a]=e.useState(null),s=e.useCallback((()=>a(null)),[a]),{nodes:l,edges:c,onNodesChange:u,onEdgesChange:d,onConnect:p}=n.useReactFlowStore(oT($j));return o.createElement("div",{className:"reactflowlayer"},o.createElement(vs,{nodes:l,edges:c,onNodesChange:u,onEdgesChange:d,onConnect:p,nodeTypes:Yj,edgeTypes:Uj,minZoom:t.minZoom,maxZoom:t.maxZoom,fitView:!0,onSelectionChange:({nodes:e,edges:t})=>{const r=n.local_state.getState();n.local_state.setState({...r,selected_nodes:e.map((e=>e.id)),selected_edges:t.map((e=>e.id))})},ref:r,onPaneClick:s,panOnDrag:!t.static},o.createElement(Jj,null),o.createElement(Kj,null),o.createElement(Fs,{color:"#888",gap:16,size:1}),t.minimap&&o.createElement(Os,{nodeStrokeWidth:3,pannable:!t.static,zoomable:!t.static,zoomStep:3}),i&&o.createElement(Qj,{onClick:s,...i})))},eF=e.createContext(void 0),tF=e.forwardRef(((t,n)=>{const{asChild:r,children:a,className:s,style:l,...c}=t,[u,d]=e.useState(!1),p=e.useRef(null),[f,h]=e.useState(null),[m,g]=e.useState({}),y=t.htime||300,b=t.vtime||300,v=t.hdelay||0,w=t.vdelay||200;e.useImperativeHandle(n,(()=>p.current),[]);let x;if(r&&o.isValidElement(a)){const e=a,t=[e.props.className,s,"smooth-expand",u?"smooth-expand-expanded":""].filter(Boolean).join(" "),n={...e.props.style,...l,...m};x=o.cloneElement(e,{ref:p,className:t,style:n,...c})}else x=o.createElement("div",{ref:p,...c,className:`smooth-expand ${u?"smooth-expand-expanded":""} ${s||""}`,style:{...l,...m}},a);const C=o.createElement(eF.Provider,{value:{isExpanded:u,toggleExpand:async()=>{p.current&&(u?await(async()=>{if(!p.current)return;if(!f)return;const e={transitionProperty:"width, left, height, top",transitionDuration:`${y}ms, ${y}ms, ${b}ms, ${b}ms`};g((t=>({...t,...e})));const[t,n,r,o]=f,i=new Promise((e=>{setTimeout((()=>{g((e=>({...e,left:`${t}px`,width:`${r}px`}))),e()}),w)})),a=new Promise((e=>{setTimeout((()=>{g((e=>({...e,top:`${n}px`,height:`${o}px`}))),e()}),v)})),s=Math.max(y+v,b+w),l=new Promise((e=>{setTimeout((()=>{e()}),s)}));await Promise.all([i,a,l]),p.current.style.transition="",g({}),d(!1)})():await(async()=>{if(!p.current)return;p.current.style.transition="none",p.current.style.position="",p.current.style.top="",p.current.style.left="",p.current.style.width="",p.current.style.height="";const e=p.current.getBoundingClientRect();h([e.left,e.top,e.width,e.height]),p.current.style.transition="none",g({position:"absolute",top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`}),g((e=>({...e,transitionProperty:"width, left, height, top",transitionDuration:`${y}ms, ${y}ms, ${b}ms, ${b}ms`}))),d(!0);const t=new Promise((e=>{setTimeout((()=>{g((e=>({...e,left:"0px",width:"100vw"}))),e()}),v)})),n=new Promise((e=>{setTimeout((()=>{g((e=>({...e,top:"0px",height:"100vh"}))),e()}),w)})),r=Math.max(y+v,b+w),o=new Promise((e=>{setTimeout((()=>{e()}),r)}));await Promise.all([t,n,o])})())}}},x);return u?i.createPortal(C,document.body):C}));tF.Trigger=function({children:t}){const n=e.useContext(eF);if(!n)throw new Error("SmoothExpandComponent.Trigger must be used within a SmoothExpandComponent");return o.createElement("div",{style:{cursor:"pointer"},onClick:n.toggleExpand},t)},tF.Expanded=function({children:t}){const n=e.useContext(eF);if(!n)throw new Error("SmoothExpandComponent.Expanded must be used within a SmoothExpandComponent");return n.isExpanded?o.createElement(o.Fragment,null,t):null},tF.Collapsed=function({children:t}){const n=e.useContext(eF);if(!n)throw new Error("SmoothExpandComponent.Collapsed must be used within a SmoothExpandComponent");return n.isExpanded?null:o.createElement(o.Fragment,null,t)};const nF=o.createContext(void 0),rF=e.forwardRef(((t,n)=>{const{asChild:r,children:i,className:a,style:s,...l}=t,c=e.useRef(null);e.useImperativeHandle(n,(()=>c.current),[]);const[u,d]=e.useState(!1),p=e.useCallback((async()=>{try{const e=c.current;if(!e)return;if(u){const e=document;e.exitFullscreen?await e.exitFullscreen():e.mozCancelFullScreen?await e.mozCancelFullScreen():e.webkitExitFullscreen?await e.webkitExitFullscreen():e.msExitFullscreen&&await e.msExitFullscreen(),d(!1)}else e.requestFullscreen?await e.requestFullscreen():e.mozRequestFullScreen?await e.mozRequestFullScreen():e.webkitRequestFullscreen?await e.webkitRequestFullscreen():e.msRequestFullscreen&&await e.msRequestFullscreen(),d(!0)}catch(e){console.error("Error toggling fullscreen",e)}}),[u]);let f;if(e.useEffect((()=>{const e=()=>{const e=document.fullscreenElement;d(!!e)};return document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("MSFullscreenChange",e),()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e),document.removeEventListener("mozfullscreenchange",e),document.removeEventListener("MSFullscreenChange",e)}}),[]),r&&o.isValidElement(i)){const e=i,t=[e.props.className,a].filter(Boolean).join(" "),n={...e.props.style,...s};f=o.cloneElement(e,{ref:c,className:t,style:n,...l})}else f=o.createElement("div",{ref:c,...l,className:a,style:s},i);return o.createElement(nF.Provider,{value:{isFullScreen:u,toggleFullscreen:p}},f)}));rF.Trigger=function({children:e}){const t=o.useContext(nF);if(!t)throw new Error("FullScreenComponent.Trigger must be used within a FullScreenComponent");return o.createElement("div",{style:{cursor:"pointer"},onClick:t.toggleFullscreen},e)},rF.InFullScreen=function({children:e}){const t=o.useContext(nF);if(!t)throw new Error("FullScreenComponent.Expanded must be used within a FullScreenComponent");return t.isFullScreen?o.createElement(o.Fragment,null,e):null},rF.OutFullScreen=function({children:e}){const t=o.useContext(nF);if(!t)throw new Error("FullScreenComponent.Collapsed must be used within a FullScreenComponent");return t.isFullScreen?null:o.createElement(o.Fragment,null,e)};const oF=({fnrf_zst:t,header:n,flow:r,library:i})=>{const[a,s]=e.useState(t.options.worker);t.workermanager&&(t.workermanager.on_setWorker=s),t.set_worker(a),t.auto_progress();const l=t.plugins();return o.createElement(Ej,{plugins:l,fnrf_zst:t},o.createElement(sF.Provider,{value:t},o.createElement(tF,{asChild:!0},o.createElement(rF,{asChild:!0},o.createElement("div",{className:"funcnodesreactflowcontainer funcnodescontainer"},n.show&&o.createElement(vS,{...n}),o.createElement("div",{className:"funcnodesreactflowbody"},a&&i.show&&o.createElement(nT,null),o.createElement(qj,{...r}),a&&r.showNodeSettings&&o.createElement(Zj,null)),o.createElement("div",{className:"funcnodesflaotingmenu"},o.createElement(rF.OutFullScreen,null,r.allowExpand&&o.createElement(tF.Trigger,null,o.createElement(tF.Expanded,null,o.createElement(Uw,null)),o.createElement(tF.Collapsed,null,o.createElement(Jw,null)))),r.allowFullScreen&&o.createElement(rF.Trigger,null,o.createElement(rF.OutFullScreen,null,o.createElement(Bv,null)),o.createElement(rF.InFullScreen,null,o.createElement(Yw,null)))))))))},iF={},aF={id:"",debug:!1,useWorkerManager:!0,show_library:!0,header:{show:!0,showmenu:!0},flow:{minimap:!0,static:!1,minZoom:.1,maxZoom:5,allowFullScreen:!0,allowExpand:!0,showNodeSettings:!0},library:{show:!0}},sF=e.createContext(Us(aF)),lF=e=>{let t=M(e,{...aF,id:ku()}).new_obj;if(!t.useWorkerManager&&void 0===t.worker)return o.createElement("div",null,"Error: If you don't use a worker manager, you must provide a default worker.");if(e.useWorkerManager&&void 0===e.workermanager_url)return o.createElement("div",null,"Error: If you use a worker manager, you must provide a worker manager url.");if(void 0===window.fnrf_zst&&(window.fnrf_zst=iF),void 0===iF[t.id]){const e=Us(t);iF[t.id]=e}if(t.worker&&t.worker.set_zustand(iF[t.id]),iF[t.id].options.debug=t.debug,t.useWorkerManager){const e=new _u(t.workermanager_url,iF[t.id]);iF[t.id].workermanager=e}return o.createElement(oF,{fnrf_zst:iF[t.id],header:t.header,library:t.library,flow:t.flow})},cF={set_io_value:({nid:t,ioid:n,value:r,set_default:o=!1})=>{const i=e.useContext(sF);i.worker?.set_io_value({nid:t,ioid:n,value:r,set_default:o})}};exports.FuncNodesContext=sF,exports.FuncNodesReactFlowZustand=Us,exports.FuncNodesWorker=Su,exports.FuncnodesReactFlow=lF,exports.ReactFlowLayer=qj,exports.RenderMappingProvider=Ej,exports.WebSocketWorker=Iu,exports.assert_full_node=F,exports.deep_update=M,exports.default=e=>{const t=new Zs("FuncNodes",e.debug?"debug":"info");t.debug("Initalizing FuncNodes with props:",e);let n=M(e,{...aF,id:ku()}).new_obj;if(void 0===e.worker&&void 0!==e.worker_url&&(n.useWorkerManager=!1,n.worker=new Iu({url:e.worker_url,uuid:n.id,on_sync_complete:n.on_sync_complete})),void 0!==n.worker){const e=Us(n);n.worker.set_zustand(e)}if(void 0!==e.fnw_url){if(void 0===n.worker)throw new Error("defining fnw_url requires a worker to be defined");const t=async function(e,t=!0){try{const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch from URL: ${n.status} ${n.statusText}`);const r=await n.blob();return await new Promise(((e,n)=>{const o=new FileReader;o.onload=()=>{const r=o.result;"string"!=typeof r&&(n("Failed to convert URL to Base64: No result from FileReader"),n(o.error)),e(t?r.split(",")[1]:r)},o.onerror=()=>n(o.error),o.readAsDataURL(r)}))}catch(e){throw console.error("Error converting URL to Base64:",e),e}}(e.fnw_url),r=n.worker.on_sync_complete,o=async e=>{const n=await t;e.on_sync_complete=r,await e.update_from_export(n)};n.worker.on_sync_complete=o}return t.debug("Initalizing FuncnodesReactFlow with props:",n),o.createElement("div",{className:"FuncnodesApp"},o.createElement(lF,{...n}))},exports.helperfunctions=cF;
146
146
  //# sourceMappingURL=index.umd.js.map