@ws-ui/roles-editor 1.13.0-dev.4 → 1.13.0-dev.6
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.
package/dist/index.cjs.js
CHANGED
|
@@ -54,7 +54,7 @@ Valid keys: `+JSON.stringify(Object.keys(P),null," "));var Z=ve(q,ne,D,$,H+"."+
|
|
|
54
54
|
*
|
|
55
55
|
* This source code is licensed under the MIT license found in the
|
|
56
56
|
* LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/var RC;function NK(){return RC||(RC=1,process.env.NODE_ENV!=="production"&&(function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),s=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),y=!1,m=!1,g=!1,w=!1,x=!1,_;_=Symbol.for("react.module.reference");function S(ae){return!!(typeof ae=="string"||typeof ae=="function"||ae===r||ae===i||x||ae===n||ae===d||ae===u||w||ae===v||y||m||g||typeof ae=="object"&&ae!==null&&(ae.$$typeof===p||ae.$$typeof===h||ae.$$typeof===o||ae.$$typeof===a||ae.$$typeof===c||ae.$$typeof===_||ae.getModuleId!==void 0))}function E(ae){if(typeof ae=="object"&&ae!==null){var he=ae.$$typeof;switch(he){case e:var ue=ae.type;switch(ue){case r:case i:case n:case d:case u:return ue;default:var de=ue&&ue.$$typeof;switch(de){case s:case a:case c:case p:case h:case o:return de;default:return he}}case t:return he}}}var I=a,N=o,T=e,M=c,z=r,j=p,W=h,U=t,A=i,K=n,V=d,te=u,G=!1,re=!1;function P(ae){return G||(G=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function B(ae){return re||(re=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function X(ae){return E(ae)===a}function Q(ae){return E(ae)===o}function D(ae){return typeof ae=="object"&&ae!==null&&ae.$$typeof===e}function $(ae){return E(ae)===c}function H(ae){return E(ae)===r}function q(ae){return E(ae)===p}function Y(ae){return E(ae)===h}function ie(ae){return E(ae)===t}function ne(ae){return E(ae)===i}function ve(ae){return E(ae)===n}function Z(ae){return E(ae)===d}function J(ae){return E(ae)===u}vt.ContextConsumer=I,vt.ContextProvider=N,vt.Element=T,vt.ForwardRef=M,vt.Fragment=z,vt.Lazy=j,vt.Memo=W,vt.Portal=U,vt.Profiler=A,vt.StrictMode=K,vt.Suspense=V,vt.SuspenseList=te,vt.isAsyncMode=P,vt.isConcurrentMode=B,vt.isContextConsumer=X,vt.isContextProvider=Q,vt.isElement=D,vt.isForwardRef=$,vt.isFragment=H,vt.isLazy=q,vt.isMemo=Y,vt.isPortal=ie,vt.isProfiler=ne,vt.isStrictMode=ve,vt.isSuspense=Z,vt.isSuspenseList=J,vt.isValidElementType=S,vt.typeOf=E})()),vt}var NC;function TK(){return NC||(NC=1,process.env.NODE_ENV==="production"?Uh.exports=RK():Uh.exports=NK()),Uh.exports}var TC=TK();const PC=e=>typeof e=="object"&&e!=null&&e.nodeType===1,MC=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Vc=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const r=getComputedStyle(e,null);return MC(r.overflowY,t)||MC(r.overflowX,t)||(n=>{const i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!i&&(i.clientHeight<n.scrollHeight||i.clientWidth<n.scrollWidth)})(e)}return!1},Hc=(e,t,r,n,i,o,a,s)=>o<e&&a>t||o>e&&a<t?0:o<=e&&s<=r||a>=t&&s>=r?o-e-n:a>t&&s<r||o<e&&s>r?a-t+i:0,PK=e=>e.parentElement??(e.getRootNode().host||null),MK=(e,t)=>{var r,n,i,o;if(typeof document>"u")return[];const{inline:a,boundary:s,skipOverflowHiddenElements:c}=t,d=typeof s=="function"?s:U=>U!==s;if(!PC(e))throw new TypeError("Invalid target");const u=document.scrollingElement||document.documentElement,h=[];let p=e;for(;PC(p)&&d(p);){if(p=PK(p),p===u){h.push(p);break}p!=null&&p===document.body&&Vc(p)&&!Vc(document.documentElement)||p!=null&&Vc(p,c)&&h.push(p)}const v=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,y=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,{scrollX:m,scrollY:g}=window,{height:w,width:x,top:_,right:S,bottom:E,left:I}=e.getBoundingClientRect(),{top:N,right:T,left:M}=(U=>{const A=window.getComputedStyle(U);return{top:parseFloat(A.scrollMarginTop)||0,right:parseFloat(A.scrollMarginRight)||0,bottom:parseFloat(A.scrollMarginBottom)||0,left:parseFloat(A.scrollMarginLeft)||0}})(e);let z=_-N,j=a==="center"?I+x/2-M+T:a==="end"?S+T:I-M;const W=[];for(let U=0;U<h.length;U++){const A=h[U],{height:K,width:V,top:te,right:G,bottom:re,left:P}=A.getBoundingClientRect();if(_>=0&&I>=0&&E<=y&&S<=v&&(A===u&&!Vc(A)||_>=te&&E<=re&&I>=P&&S<=G))return W;const B=getComputedStyle(A),X=parseInt(B.borderLeftWidth,10),Q=parseInt(B.borderTopWidth,10),D=parseInt(B.borderRightWidth,10),$=parseInt(B.borderBottomWidth,10);let H=0,q=0;const Y="offsetWidth"in A?A.offsetWidth-A.clientWidth-X-D:0,ie="offsetHeight"in A?A.offsetHeight-A.clientHeight-Q-$:0,ne="offsetWidth"in A?A.offsetWidth===0?0:V/A.offsetWidth:0,ve="offsetHeight"in A?A.offsetHeight===0?0:K/A.offsetHeight:0;if(u===A)H=Hc(g,g+y,y,Q,$,g+z,g+z+w,w),q=a==="start"?j:a==="center"?j-v/2:a==="end"?j-v:Hc(m,m+v,v,X,D,m+j,m+j+x,x),H=Math.max(0,H+g),q=Math.max(0,q+m);else{H=Hc(te,re,K,Q,$+ie,z,z+w,w),q=a==="start"?j-P-X:a==="center"?j-(P+V/2)+Y/2:a==="end"?j-G+D+Y:Hc(P,G,V,X,D+Y,j,j+x,x);const{scrollLeft:Z,scrollTop:J}=A;H=ve===0?0:Math.max(0,Math.min(J+H/ve,A.scrollHeight-K/ve+ie)),q=ne===0?0:Math.max(0,Math.min(Z+q/ne,A.scrollWidth-V/ne+Y)),z+=J-H,j+=Z-q}W.push({el:A,top:H,left:q})}return W};var Ia=function(){return Ia=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ia.apply(this,arguments)},kK=0;function kC(e){return typeof e=="function"?e:Cr}function Cr(){}function P3(e,t){if(e){var r=MK(e,{boundary:t});r.forEach(function(n){var i=n.el,o=n.top,a=n.left;i.scrollTop=o,i.scrollLeft=a})}}function AC(e,t,r){var n=e===t||t instanceof r.Node&&e.contains&&e.contains(t);return n}function wd(e,t){var r;function n(){r&&clearTimeout(r)}function i(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];n(),r=setTimeout(function(){r=null,e.apply(void 0,a)},t)}return i.cancel=n,i}function st(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return t.some(function(s){return s&&s.apply(void 0,[n].concat(o)),n.preventDownshiftDefault||n.hasOwnProperty("nativeEvent")&&n.nativeEvent.preventDownshiftDefault})}}function zn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){t.forEach(function(i){typeof i=="function"?i(n):i&&(i.current=n)})}}function M3(){return String(kK++)}function AK(e){var t=e.isOpen,r=e.resultCount,n=e.previousResultCount;return t?r?r!==n?r+" result"+(r===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function DC(e,t){return e=Array.isArray(e)?e[0]:e,!e&&t?t:e}function k3(e){return typeof e.type=="string"}function A3(e){return e.props}function DK(e,t){console.error('The property "'+t+'" is required in "'+e+'"')}var jK=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Wc(e){e===void 0&&(e={});var t={};return jK.forEach(function(r){e.hasOwnProperty(r)&&(t[r]=e[r])}),t}function ul(e,t){return!e||!t?e:Object.keys(e).reduce(function(r,n){return r[n]=$u(t,n)?t[n]:e[n],r},{})}function $u(e,t){return e[t]!==void 0}function Ra(e){var t=e.key,r=e.keyCode;return r>=37&&r<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function qK(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ln(e,t,r,n,i){i===void 0&&(i=!1);var o=r.length;if(o===0)return-1;var a=o-1;(typeof e!="number"||e<0||e>a)&&(e=t>0?-1:a+1);var s=e+t;s<0?s=i?a:0:s>a&&(s=i?0:a);var c=Ji(s,t<0,r,n,i);return c===-1?e>=o?-1:e:c}function Ji(e,t,r,n,i){i===void 0&&(i=!1);var o=r.length;if(t){for(var a=e;a>=0;a--)if(!n(r[a],a))return a}else for(var s=e;s<o;s++)if(!n(r[s],s))return s;return i?Ji(t?o-1:0,t,r,n):-1}function Vu(e,t,r,n){return n===void 0&&(n=!0),r&&t.some(function(i){return i&&(AC(i,e,r)||n&&AC(i,r.document.activeElement,r))})}var w1=Cr;process.env.NODE_ENV!=="production"&&(w1=function(e,t,r){var n="This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props";Object.keys(e).forEach(function(i){t[i]!==void 0&&r[i]===void 0?console.error('downshift: A component has changed the controlled prop "'+i+'" to be uncontrolled. '+n):t[i]===void 0&&r[i]!==void 0&&console.error('downshift: A component has changed the uncontrolled prop "'+i+'" to be controlled. '+n)})});var zK=wd(function(e){D3(e).textContent=""},500);function D3(e){var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function j3(e,t){if(!(!e||!t)){var r=D3(t);r.textContent=e,zK(t)}}function LK(e){var t=e==null?void 0:e.getElementById("a11y-status-message");t&&t.remove()}var q3=process.env.NODE_ENV!=="production"?"__autocomplete_unknown__":0,z3=process.env.NODE_ENV!=="production"?"__autocomplete_mouseup__":1,L3=process.env.NODE_ENV!=="production"?"__autocomplete_item_mouseenter__":2,gu=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_arrow_up__":3,mu=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_arrow_down__":4,B3=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_escape__":5,F3=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_enter__":6,$3=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_home__":7,V3=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_end__":8,H3=process.env.NODE_ENV!=="production"?"__autocomplete_click_item__":9,W3=process.env.NODE_ENV!=="production"?"__autocomplete_blur_input__":10,U3=process.env.NODE_ENV!=="production"?"__autocomplete_change_input__":11,G3=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_space_button__":12,Pw=process.env.NODE_ENV!=="production"?"__autocomplete_click_button__":13,K3=process.env.NODE_ENV!=="production"?"__autocomplete_blur_button__":14,Y3=process.env.NODE_ENV!=="production"?"__autocomplete_controlled_prop_updated_selected_item__":15,X3=process.env.NODE_ENV!=="production"?"__autocomplete_touchend__":16,BK=Object.freeze({__proto__:null,blurButton:K3,blurInput:W3,changeInput:U3,clickButton:Pw,clickItem:H3,controlledPropUpdatedSelectedItem:Y3,itemMouseEnter:L3,keyDownArrowDown:mu,keyDownArrowUp:gu,keyDownEnd:V3,keyDownEnter:F3,keyDownEscape:B3,keyDownHome:$3,keyDownSpaceButton:G3,mouseUp:z3,touchEnd:X3,unknown:q3}),FK=["refKey","ref"],$K=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],VK=["onKeyDown","onBlur","onChange","onInput","onChangeText"],HK=["refKey","ref"],WK=["onMouseMove","onMouseDown","onClick","onPress","index","item"],UK=(function(){var e=(function(t){function r(i){var o;o=t.call(this,i)||this,o.id=o.props.id||"downshift-"+M3(),o.menuId=o.props.menuId||o.id+"-menu",o.labelId=o.props.labelId||o.id+"-label",o.inputId=o.props.inputId||o.id+"-input",o.getItemId=o.props.getItemId||function(x){return o.id+"-item-"+x},o.items=[],o.itemCount=null,o.previousResultCount=0,o.timeoutIds=[],o.internalSetTimeout=function(x,_){var S=setTimeout(function(){o.timeoutIds=o.timeoutIds.filter(function(E){return E!==S}),x()},_);o.timeoutIds.push(S)},o.setItemCount=function(x){o.itemCount=x},o.unsetItemCount=function(){o.itemCount=null},o.isItemDisabled=function(x,_){var S=o.getItemNodeFromIndex(_);return S&&S.hasAttribute("disabled")},o.setHighlightedIndex=function(x,_){x===void 0&&(x=o.props.defaultHighlightedIndex),_===void 0&&(_={}),_=Wc(_),o.internalSetState(je({highlightedIndex:x},_))},o.clearSelection=function(x){o.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:o.props.defaultHighlightedIndex,isOpen:o.props.defaultIsOpen},x)},o.selectItem=function(x,_,S){_=Wc(_),o.internalSetState(je({isOpen:o.props.defaultIsOpen,highlightedIndex:o.props.defaultHighlightedIndex,selectedItem:x,inputValue:o.props.itemToString(x)},_),S)},o.selectItemAtIndex=function(x,_,S){var E=o.items[x];E!=null&&o.selectItem(E,_,S)},o.selectHighlightedItem=function(x,_){return o.selectItemAtIndex(o.getState().highlightedIndex,x,_)},o.internalSetState=function(x,_){var S,E,I={},N=typeof x=="function";return!N&&x.hasOwnProperty("inputValue")&&o.props.onInputValueChange(x.inputValue,je({},o.getStateAndHelpers(),x)),o.setState(function(T){var M;T=o.getState(T);var z=N?x(T):x;z=o.props.stateReducer(T,z),S=z.hasOwnProperty("selectedItem");var j={};return S&&z.selectedItem!==T.selectedItem&&(E=z.selectedItem),(M=z).type||(M.type=q3),Object.keys(z).forEach(function(W){T[W]!==z[W]&&(I[W]=z[W]),W!=="type"&&(z[W],$u(o.props,W)||(j[W]=z[W]))}),N&&z.hasOwnProperty("inputValue")&&o.props.onInputValueChange(z.inputValue,je({},o.getStateAndHelpers(),z)),j},function(){kC(_)();var T=Object.keys(I).length>1;T&&o.props.onStateChange(I,o.getStateAndHelpers()),S&&o.props.onSelect(x.selectedItem,o.getStateAndHelpers()),E!==void 0&&o.props.onChange(E,o.getStateAndHelpers()),o.props.onUserAction(I,o.getStateAndHelpers())})},o.rootRef=function(x){return o._rootNode=x},o.getRootProps=function(x,_){var S,E=x===void 0?{}:x,I=E.refKey,N=I===void 0?"ref":I,T=E.ref,M=Ir(E,FK),z=_===void 0?{}:_,j=z.suppressRefError,W=j===void 0?!1:j;o.getRootProps.called=!0,o.getRootProps.refKey=N,o.getRootProps.suppressRefError=W;var U=o.getState(),A=U.isOpen;return je((S={},S[N]=zn(T,o.rootRef),S.role="combobox",S["aria-expanded"]=A,S["aria-haspopup"]="listbox",S["aria-owns"]=A?o.menuId:void 0,S["aria-labelledby"]=o.labelId,S),M)},o.keyDownHandlers={ArrowDown:function(x){var _=this;if(x.preventDefault(),this.getState().isOpen){var S=x.shiftKey?5:1;this.moveHighlightedIndex(S,{type:mu})}else this.internalSetState({isOpen:!0,type:mu},function(){var E=_.getItemCount();if(E>0){var I=_.getState(),N=I.highlightedIndex,T=Ln(N,1,{length:E},_.isItemDisabled,!0);_.setHighlightedIndex(T,{type:mu})}})},ArrowUp:function(x){var _=this;if(x.preventDefault(),this.getState().isOpen){var S=x.shiftKey?-5:-1;this.moveHighlightedIndex(S,{type:gu})}else this.internalSetState({isOpen:!0,type:gu},function(){var E=_.getItemCount();if(E>0){var I=_.getState(),N=I.highlightedIndex,T=Ln(N,-1,{length:E},_.isItemDisabled,!0);_.setHighlightedIndex(T,{type:gu})}})},Enter:function(x){if(x.which!==229){var _=this.getState(),S=_.isOpen,E=_.highlightedIndex;if(S&&E!=null){x.preventDefault();var I=this.items[E],N=this.getItemNodeFromIndex(E);if(I==null||N&&N.hasAttribute("disabled"))return;this.selectHighlightedItem({type:F3})}}},Escape:function(x){x.preventDefault(),this.reset(je({type:B3},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},o.buttonKeyDownHandlers=je({},o.keyDownHandlers,{" ":function(x){x.preventDefault(),this.toggleMenu({type:G3})}}),o.inputKeyDownHandlers=je({},o.keyDownHandlers,{Home:function(x){var _=this.getState(),S=_.isOpen;if(S){x.preventDefault();var E=this.getItemCount();if(!(E<=0||!S)){var I=Ji(0,!1,{length:E},this.isItemDisabled);this.setHighlightedIndex(I,{type:$3})}}},End:function(x){var _=this.getState(),S=_.isOpen;if(S){x.preventDefault();var E=this.getItemCount();if(!(E<=0||!S)){var I=Ji(E-1,!0,{length:E},this.isItemDisabled);this.setHighlightedIndex(I,{type:V3})}}}}),o.getToggleButtonProps=function(x){var _=x===void 0?{}:x,S=_.onClick;_.onPress;var E=_.onKeyDown,I=_.onKeyUp,N=_.onBlur,T=Ir(_,$K),M=o.getState(),z=M.isOpen,j={onClick:st(S,o.buttonHandleClick),onKeyDown:st(E,o.buttonHandleKeyDown),onKeyUp:st(I,o.buttonHandleKeyUp),onBlur:st(N,o.buttonHandleBlur)},W=T.disabled?{}:j;return je({type:"button",role:"button","aria-label":z?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},W,T)},o.buttonHandleKeyUp=function(x){x.preventDefault()},o.buttonHandleKeyDown=function(x){var _=Ra(x);o.buttonKeyDownHandlers[_]&&o.buttonKeyDownHandlers[_].call(o,x)},o.buttonHandleClick=function(x){if(x.preventDefault(),o.props.environment){var _=o.props.environment.document,S=_.body,E=_.activeElement;S&&S===E&&x.target.focus()}process.env.NODE_ENV==="test"?o.toggleMenu({type:Pw}):o.internalSetTimeout(function(){return o.toggleMenu({type:Pw})})},o.buttonHandleBlur=function(x){var _=x.target;o.internalSetTimeout(function(){if(!(o.isMouseDown||!o.props.environment)){var S=o.props.environment.document.activeElement;(S==null||S.id!==o.inputId)&&S!==_&&o.reset({type:K3})}})},o.getLabelProps=function(x){return je({htmlFor:o.inputId,id:o.labelId},x)},o.getInputProps=function(x){var _=x===void 0?{}:x,S=_.onKeyDown,E=_.onBlur,I=_.onChange,N=_.onInput;_.onChangeText;var T=Ir(_,VK),M,z={};M="onChange";var j=o.getState(),W=j.inputValue,U=j.isOpen,A=j.highlightedIndex;if(!T.disabled){var K;z=(K={},K[M]=st(I,N,o.inputHandleChange),K.onKeyDown=st(S,o.inputHandleKeyDown),K.onBlur=st(E,o.inputHandleBlur),K)}return je({"aria-autocomplete":"list","aria-activedescendant":U&&typeof A=="number"&&A>=0?o.getItemId(A):void 0,"aria-controls":U?o.menuId:void 0,"aria-labelledby":T&&T["aria-label"]?void 0:o.labelId,autoComplete:"off",value:W,id:o.inputId},z,T)},o.inputHandleKeyDown=function(x){var _=Ra(x);_&&o.inputKeyDownHandlers[_]&&o.inputKeyDownHandlers[_].call(o,x)},o.inputHandleChange=function(x){o.internalSetState({type:U3,isOpen:!0,inputValue:x.target.value,highlightedIndex:o.props.defaultHighlightedIndex})},o.inputHandleBlur=function(){o.internalSetTimeout(function(){var x;if(!(o.isMouseDown||!o.props.environment)){var _=o.props.environment.document.activeElement,S=(_==null||(x=_.dataset)==null?void 0:x.toggle)&&o._rootNode&&o._rootNode.contains(_);S||o.reset({type:W3})}})},o.menuRef=function(x){o._menuNode=x},o.getMenuProps=function(x,_){var S,E=x===void 0?{}:x,I=E.refKey,N=I===void 0?"ref":I,T=E.ref,M=Ir(E,HK),z=_===void 0?{}:_,j=z.suppressRefError,W=j===void 0?!1:j;return o.getMenuProps.called=!0,o.getMenuProps.refKey=N,o.getMenuProps.suppressRefError=W,je((S={},S[N]=zn(T,o.menuRef),S.role="listbox",S["aria-labelledby"]=M&&M["aria-label"]?void 0:o.labelId,S.id=o.menuId,S),M)},o.getItemProps=function(x){var _,S=x===void 0?{}:x,E=S.onMouseMove,I=S.onMouseDown,N=S.onClick;S.onPress;var T=S.index,M=S.item,z=M===void 0?process.env.NODE_ENV==="production"?void 0:DK("getItemProps","item"):M,j=Ir(S,WK);T===void 0?(o.items.push(z),T=o.items.indexOf(z)):o.items[T]=z;var W="onClick",U=N,A=(_={onMouseMove:st(E,function(){T!==o.getState().highlightedIndex&&(o.setHighlightedIndex(T,{type:L3}),o.avoidScrolling=!0,o.internalSetTimeout(function(){return o.avoidScrolling=!1},250))}),onMouseDown:st(I,function(V){V.preventDefault()})},_[W]=st(U,function(){o.selectItemAtIndex(T,{type:H3})}),_),K=j.disabled?{onMouseDown:A.onMouseDown}:A;return je({id:o.getItemId(T),role:"option","aria-selected":o.getState().highlightedIndex===T},K,j)},o.clearItems=function(){o.items=[]},o.reset=function(x,_){x===void 0&&(x={}),x=Wc(x),o.internalSetState(function(S){var E=S.selectedItem;return je({isOpen:o.props.defaultIsOpen,highlightedIndex:o.props.defaultHighlightedIndex,inputValue:o.props.itemToString(E)},x)},_)},o.toggleMenu=function(x,_){x===void 0&&(x={}),x=Wc(x),o.internalSetState(function(S){var E=S.isOpen;return je({isOpen:!E},E&&{highlightedIndex:o.props.defaultHighlightedIndex},x)},function(){var S=o.getState(),E=S.isOpen,I=S.highlightedIndex;E&&o.getItemCount()>0&&typeof I=="number"&&o.setHighlightedIndex(I,x),kC(_)()})},o.openMenu=function(x){o.internalSetState({isOpen:!0},x)},o.closeMenu=function(x){o.internalSetState({isOpen:!1},x)},o.updateStatus=wd(function(){var x;if((x=o.props)!=null&&(x=x.environment)!=null&&x.document){var _=o.getState(),S=o.items[_.highlightedIndex],E=o.getItemCount(),I=o.props.getA11yStatusMessage(je({itemToString:o.props.itemToString,previousResultCount:o.previousResultCount,resultCount:E,highlightedItem:S},_));o.previousResultCount=E,j3(I,o.props.environment.document)}},200);var a=o.props,s=a.defaultHighlightedIndex,c=a.initialHighlightedIndex,d=c===void 0?s:c,u=a.defaultIsOpen,h=a.initialIsOpen,p=h===void 0?u:h,v=a.initialInputValue,y=v===void 0?"":v,m=a.initialSelectedItem,g=m===void 0?null:m,w=o.getState({highlightedIndex:d,isOpen:p,inputValue:y,selectedItem:g});return w.selectedItem!=null&&o.props.initialInputValue===void 0&&(w.inputValue=o.props.itemToString(w.selectedItem)),o.state=w,o}yK(r,t);var n=r.prototype;return n.internalClearTimeouts=function(){this.timeoutIds.forEach(function(i){clearTimeout(i)}),this.timeoutIds=[]},n.getState=function(i){return i===void 0&&(i=this.state),ul(i,this.props)},n.getItemCount=function(){var i=this.items.length;return this.itemCount!=null?i=this.itemCount:this.props.itemCount!==void 0&&(i=this.props.itemCount),i},n.getItemNodeFromIndex=function(i){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(i)):null},n.scrollHighlightedItemIntoView=function(){{var i=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(i,this._menuNode)}},n.moveHighlightedIndex=function(i,o){var a=this.getItemCount(),s=this.getState(),c=s.highlightedIndex;if(a>0){var d=Ln(c,i,{length:a},this.isItemDisabled,!0);this.setHighlightedIndex(d,o)}},n.getStateAndHelpers=function(){var i=this.getState(),o=i.highlightedIndex,a=i.inputValue,s=i.selectedItem,c=i.isOpen,d=this.props.itemToString,u=this.id,h=this.getRootProps,p=this.getToggleButtonProps,v=this.getLabelProps,y=this.getMenuProps,m=this.getInputProps,g=this.getItemProps,w=this.openMenu,x=this.closeMenu,_=this.toggleMenu,S=this.selectItem,E=this.selectItemAtIndex,I=this.selectHighlightedItem,N=this.setHighlightedIndex,T=this.clearSelection,M=this.clearItems,z=this.reset,j=this.setItemCount,W=this.unsetItemCount,U=this.internalSetState;return{getRootProps:h,getToggleButtonProps:p,getLabelProps:v,getMenuProps:y,getInputProps:m,getItemProps:g,reset:z,openMenu:w,closeMenu:x,toggleMenu:_,selectItem:S,selectItemAtIndex:E,selectHighlightedItem:I,setHighlightedIndex:N,clearSelection:T,clearItems:M,setItemCount:j,unsetItemCount:W,setState:U,itemToString:d,id:u,highlightedIndex:o,inputValue:a,isOpen:c,selectedItem:s}},n.componentDidMount=function(){var i=this;if(process.env.NODE_ENV!=="production"&&this.getMenuProps.called&&!this.getMenuProps.suppressRefError&&jC(this._menuNode,this.getMenuProps),!this.props.environment)this.cleanup=function(){i.internalClearTimeouts()};else{var o=function(){i.isMouseDown=!0},a=function(h){i.isMouseDown=!1;var p=Vu(h.target,[i._rootNode,i._menuNode],i.props.environment);!p&&i.getState().isOpen&&i.reset({type:z3},function(){return i.props.onOuterClick(i.getStateAndHelpers())})},s=function(){i.isTouchMove=!1},c=function(){i.isTouchMove=!0},d=function(h){var p=Vu(h.target,[i._rootNode,i._menuNode],i.props.environment,!1);!i.isTouchMove&&!p&&i.getState().isOpen&&i.reset({type:X3},function(){return i.props.onOuterClick(i.getStateAndHelpers())})},u=this.props.environment;u.addEventListener("mousedown",o),u.addEventListener("mouseup",a),u.addEventListener("touchstart",s),u.addEventListener("touchmove",c),u.addEventListener("touchend",d),this.cleanup=function(){i.internalClearTimeouts(),i.updateStatus.cancel(),u.removeEventListener("mousedown",o),u.removeEventListener("mouseup",a),u.removeEventListener("touchstart",s),u.removeEventListener("touchmove",c),u.removeEventListener("touchend",d)}}},n.shouldScroll=function(i,o){var a=this.props.highlightedIndex===void 0?this.getState():this.props,s=a.highlightedIndex,c=o.highlightedIndex===void 0?i:o,d=c.highlightedIndex,u=s&&this.getState().isOpen&&!i.isOpen,h=s!==d;return u||h},n.componentDidUpdate=function(i,o){process.env.NODE_ENV!=="production"&&(w1(this.state,i,this.props),this.getMenuProps.called&&!this.getMenuProps.suppressRefError&&jC(this._menuNode,this.getMenuProps)),$u(this.props,"selectedItem")&&this.props.selectedItemChanged(i.selectedItem,this.props.selectedItem)&&this.internalSetState({type:Y3,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(o,i)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},n.componentWillUnmount=function(){this.cleanup()},n.render=function(){var i=DC(this.props.children,Cr);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var o=DC(i(this.getStateAndHelpers()));if(!o)return null;if(this.getRootProps.called||this.props.suppressRefError)return process.env.NODE_ENV!=="production"&&!this.getRootProps.suppressRefError&&!this.props.suppressRefError&&GK(o,this.getRootProps),o;if(k3(o))return C.cloneElement(o,this.getRootProps(A3(o)));if(process.env.NODE_ENV!=="production")throw new Error("downshift: If you return a non-DOM element, you must apply the getRootProps function")},r})(C.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:AK,itemToString:function(t){return t==null?"":(process.env.NODE_ENV!=="production"&&qK(t)&&!t.hasOwnProperty("toString")&&console.warn("downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.","The object that was passed:",t),String(t))},onStateChange:Cr,onInputValueChange:Cr,onUserAction:Cr,onChange:Cr,onSelect:Cr,onOuterClick:Cr,selectedItemChanged:function(t,r){return t!==r},environment:typeof window>"u"?void 0:window,stateReducer:function(t,r){return r},suppressRefError:!1,scrollIntoView:P3},e.stateChangeTypes=BK,e})();process.env.NODE_ENV!=="production"&&(UK.propTypes={children:Se.func,defaultHighlightedIndex:Se.number,defaultIsOpen:Se.bool,initialHighlightedIndex:Se.number,initialSelectedItem:Se.any,initialInputValue:Se.string,initialIsOpen:Se.bool,getA11yStatusMessage:Se.func,itemToString:Se.func,onChange:Se.func,onSelect:Se.func,onStateChange:Se.func,onInputValueChange:Se.func,onUserAction:Se.func,onOuterClick:Se.func,selectedItemChanged:Se.func,stateReducer:Se.func,itemCount:Se.number,id:Se.string,environment:Se.shape({addEventListener:Se.func.isRequired,removeEventListener:Se.func.isRequired,document:Se.shape({createElement:Se.func.isRequired,getElementById:Se.func.isRequired,activeElement:Se.any.isRequired,body:Se.any.isRequired}).isRequired,Node:Se.func.isRequired}),suppressRefError:Se.bool,scrollIntoView:Se.func,selectedItem:Se.any,isOpen:Se.bool,inputValue:Se.string,highlightedIndex:Se.number,labelId:Se.string,inputId:Se.string,menuId:Se.string,getItemId:Se.func});function jC(e,t){var r=t.refKey;e||console.error('downshift: The ref prop "'+r+'" from getMenuProps was not applied correctly on your menu element.')}function GK(e,t){var r=t.refKey,n=r!=="ref",i=!k3(e);i&&!n&&!TC.isForwardRef(e)?console.error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps"):!i&&n&&console.error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "'+r+'"'),!TC.isForwardRef(e)&&!A3(e)[r]&&console.error('downshift: You must apply the ref prop "'+r+'" from getRootProps onto your root element.')}var Z3={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function KK(e,t,r){var n=e.props,i=e.type,o={};Object.keys(t).forEach(function(a){YK(a,e,t,r),r[a]!==t[a]&&(o[a]=r[a])}),n.onStateChange&&Object.keys(o).length&&n.onStateChange(je({type:i},o))}function YK(e,t,r,n){var i=t.props,o=t.type,a="on"+E1(e)+"Change";i[a]&&n[e]!==void 0&&n[e]!==r[e]&&i[a](je({type:o},n))}function XK(e,t){return t.changes}var qC=wd(function(e,t){j3(e,t)},200),ZK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.useLayoutEffect:C.useEffect,J3="useId"in C?function(e){var t=e.id,r=e.labelId,n=e.menuId,i=e.getItemId,o=e.toggleButtonId,a=e.inputId,s="downshift-"+C.useId();t||(t=s);var c=C.useMemo(function(){return{labelId:r||t+"-label",menuId:n||t+"-menu",getItemId:i||function(d){return t+"-item-"+d},toggleButtonId:o||t+"-toggle-button",inputId:a||t+"-input"}},[i,t,a,r,n,o]);return c}:function(e){var t=e.id,r=t===void 0?"downshift-"+M3():t,n=e.labelId,i=e.menuId,o=e.getItemId,a=e.toggleButtonId,s=e.inputId,c=C.useMemo(function(){return{labelId:n||r+"-label",menuId:i||r+"-menu",getItemId:o||function(d){return r+"-item-"+d},toggleButtonId:a||r+"-toggle-button",inputId:s||r+"-input"}},[o,r,s,n,i,a]);return c};function S1(e,t,r,n){var i,o;if(e===void 0){if(t===void 0)throw new Error(n);i=r[t],o=t}else o=t===void 0?r.indexOf(e):t,i=e;return[i,o]}function JK(e){return/^\S{1}$/.test(e)}function E1(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Sd(e){var t=C.useRef(e);return t.current=e,t}function Q3(e,t,r,n){var i=C.useRef(),o=C.useRef(),a=C.useCallback(function(v,y){o.current=y,v=ul(v,y.props);var m=e(v,y),g=y.props.stateReducer(v,je({},y,{changes:m}));return g},[e]),s=C.useReducer(a,t,r),c=s[0],d=s[1],u=Sd(t),h=C.useCallback(function(v){return d(je({props:u.current},v))},[u]),p=o.current;return C.useEffect(function(){var v=ul(i.current,p==null?void 0:p.props),y=p&&i.current&&!n(v,c);y&&KK(p,v,c),i.current=c},[c,p,n]),[c,h]}function e4(e,t,r,n){var i=Q3(e,t,r,n),o=i[0],a=i[1];return[ul(o,t),a]}var el={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:XK,scrollIntoView:P3,environment:typeof window>"u"?void 0:window};function ri(e,t,r){r===void 0&&(r=Z3);var n=e["default"+E1(t)];return n!==void 0?n:r[t]}function So(e,t,r){r===void 0&&(r=Z3);var n=e[t];if(n!==void 0)return n;var i=e["initial"+E1(t)];return i!==void 0?i:ri(e,t,r)}function t4(e){var t=So(e,"selectedItem"),r=So(e,"isOpen"),n=QK(e),i=So(e,"inputValue");return{highlightedIndex:n<0&&t&&r?e.items.findIndex(function(o){return e.itemToKey(o)===e.itemToKey(t)}):n,isOpen:r,selectedItem:t,inputValue:i}}function Eo(e,t,r){var n=e.items,i=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,a=e.isItemDisabled,s=e.itemToKey,c=t.selectedItem,d=t.highlightedIndex;return n.length===0?-1:i!==void 0&&d===i&&!a(n[i],i)?i:o!==void 0&&!a(n[o],o)?o:c?n.findIndex(function(u){return s(c)===s(u)}):r<0&&!a(n[n.length-1],n.length-1)?n.length-1:r>0&&!a(n[0],0)?0:-1}function r4(e,t,r){var n=C.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),i=C.useCallback(function(){return r.map(function(o){return o.current})},[r]);return C.useEffect(function(){if(!e)return Cr;function o(){n.current.isTouchEnd=!1,n.current.isMouseDown=!0}function a(u){n.current.isMouseDown=!1,Vu(u.target,i(),e)||t()}function s(){n.current.isTouchEnd=!1,n.current.isTouchMove=!1}function c(){n.current.isTouchMove=!0}function d(u){n.current.isTouchEnd=!0,!n.current.isTouchMove&&!Vu(u.target,i(),e,!1)&&t()}return e.addEventListener("mousedown",o),e.addEventListener("mouseup",a),e.addEventListener("touchstart",s),e.addEventListener("touchmove",c),e.addEventListener("touchend",d),function(){e.removeEventListener("mousedown",o),e.removeEventListener("mouseup",a),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",c),e.removeEventListener("touchend",d)}},[e,i,t]),n.current}var Ed=function(){return Cr};process.env.NODE_ENV!=="production"&&(Ed=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=C.useRef(t.reduce(function(o,a){return o[a]={},o},{}));C.useEffect(function(){Object.keys(n.current).forEach(function(o){var a=n.current[o];if(!Object.keys(a).length){console.error("downshift: You forgot to call the "+o+" getter function on your component / element.");return}var s=a.suppressRefError,c=a.refKey,d=a.elementRef;s||d!=null&&d.current||console.error('downshift: The ref prop "'+c+'" from '+o+" was not applied correctly on your element.")})},[]);var i=C.useCallback(function(o,a,s,c){n.current[o]={suppressRefError:a,refKey:s,elementRef:c}},[]);return i});function _1(e,t,r,n){n===void 0&&(n={});var i=n.document,o=Cl();C.useEffect(function(){if(!(!e||o||!i)){var a=e(t);qC(a,i)}},r),C.useEffect(function(){return function(){qC.cancel(),LK(i)}},[i])}function n4(e){var t=e.highlightedIndex,r=e.isOpen,n=e.itemRefs,i=e.getItemNodeFromIndex,o=e.menuElement,a=e.scrollIntoView,s=C.useRef(!0);return ZK(function(){t<0||!r||!Object.keys(n.current).length||(s.current===!1?s.current=!0:a(i(t),o))},[t]),s}var _d=Cr;process.env.NODE_ENV!=="production"&&(_d=function(e){var t=e.props,r=e.state,n=C.useRef(t),i=Cl();C.useEffect(function(){i||(w1(r,n.current,t),n.current=t)},[r,t,i])});function Hu(e,t,r){var n;r===void 0&&(r=!0);var i=((n=e.items)==null?void 0:n.length)&&t>=0;return je({isOpen:!1,highlightedIndex:-1},i&&je({selectedItem:e.items[t],isOpen:ri(e,"isOpen"),highlightedIndex:ri(e,"highlightedIndex")},r&&{inputValue:e.itemToString(e.items[t])}))}function i4(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function Cl(){var e=C.useRef(!0);return C.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function Wu(e){var t=ri(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function QK(e){var t=So(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var bu={environment:Se.shape({addEventListener:Se.func.isRequired,removeEventListener:Se.func.isRequired,document:Se.shape({createElement:Se.func.isRequired,getElementById:Se.func.isRequired,activeElement:Se.any.isRequired,body:Se.any.isRequired}).isRequired,Node:Se.func.isRequired}),itemToString:Se.func,itemToKey:Se.func,stateReducer:Se.func},o4=je({},bu,{getA11yStatusMessage:Se.func,highlightedIndex:Se.number,defaultHighlightedIndex:Se.number,initialHighlightedIndex:Se.number,isOpen:Se.bool,defaultIsOpen:Se.bool,initialIsOpen:Se.bool,selectedItem:Se.any,initialSelectedItem:Se.any,defaultSelectedItem:Se.any,id:Se.string,labelId:Se.string,menuId:Se.string,getItemId:Se.func,toggleButtonId:Se.string,onSelectedItemChange:Se.func,onHighlightedIndexChange:Se.func,onStateChange:Se.func,onIsOpenChange:Se.func,scrollIntoView:Se.func});function a4(e,t,r){var n=t.type,i=t.props,o;switch(n){case r.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case r.MenuMouseLeave:o={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Eo(i,e,0)};break;case r.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:Eo(i,e,0)};break;case r.FunctionCloseMenu:o={isOpen:!1};break;case r.FunctionSetHighlightedIndex:o={highlightedIndex:i.isItemDisabled(i.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case r.FunctionSetInputValue:o={inputValue:t.inputValue};break;case r.FunctionReset:o={highlightedIndex:Wu(i),isOpen:ri(i,"isOpen"),selectedItem:ri(i,"selectedItem"),inputValue:ri(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return je({},e,o)}function eY(e){for(var t=e.keysSoFar,r=e.highlightedIndex,n=e.items,i=e.itemToString,o=e.isItemDisabled,a=t.toLowerCase(),s=0;s<n.length;s++){var c=(s+r+(t.length<2?1:0))%n.length,d=n[c];if(d!==void 0&&i(d).toLowerCase().startsWith(a)&&!o(d,c))return c}return r}var tY=Ia(Ia({},o4),{items:Se.array.isRequired,isItemDisabled:Se.func}),rY=Ia(Ia({},el),{isItemDisabled:function(){return!1}}),s4=Cr;process.env.NODE_ENV!=="production"&&(s4=function(e,t){Se.checkPropTypes(tY,e,"prop",t.name)});var yu=process.env.NODE_ENV!=="production"?"__togglebutton_click__":0,O1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_arrow_down__":1,C1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_arrow_up__":2,Uu=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_character__":3,I1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_escape__":4,R1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_home__":5,N1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_end__":6,T1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_enter__":7,P1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_space_button__":8,M1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_page_up__":9,k1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_page_down__":10,Gu=process.env.NODE_ENV!=="production"?"__togglebutton_blur__":11,l4=process.env.NODE_ENV!=="production"?"__menu_mouse_leave__":12,c4=process.env.NODE_ENV!=="production"?"__item_mouse_move__":13,A1=process.env.NODE_ENV!=="production"?"__item_click__":14,u4=process.env.NODE_ENV!=="production"?"__function_toggle_menu__":15,d4=process.env.NODE_ENV!=="production"?"__function_open_menu__":16,f4=process.env.NODE_ENV!=="production"?"__function_close_menu__":17,h4=process.env.NODE_ENV!=="production"?"__function_set_highlighted_index__":18,D1=process.env.NODE_ENV!=="production"?"__function_select_item__":19,Mw=process.env.NODE_ENV!=="production"?"__function_set_input_value__":20,p4=process.env.NODE_ENV!=="production"?"__function_reset__":21,v4=Object.freeze({__proto__:null,FunctionCloseMenu:f4,FunctionOpenMenu:d4,FunctionReset:p4,FunctionSelectItem:D1,FunctionSetHighlightedIndex:h4,FunctionSetInputValue:Mw,FunctionToggleMenu:u4,ItemClick:A1,ItemMouseMove:c4,MenuMouseLeave:l4,ToggleButtonBlur:Gu,ToggleButtonClick:yu,ToggleButtonKeyDownArrowDown:O1,ToggleButtonKeyDownArrowUp:C1,ToggleButtonKeyDownCharacter:Uu,ToggleButtonKeyDownEnd:N1,ToggleButtonKeyDownEnter:T1,ToggleButtonKeyDownEscape:I1,ToggleButtonKeyDownHome:R1,ToggleButtonKeyDownPageDown:k1,ToggleButtonKeyDownPageUp:M1,ToggleButtonKeyDownSpaceButton:P1});function nY(e,t){var r,n=t.type,i=t.props,o=t.altKey,a;switch(n){case A1:a={isOpen:ri(i,"isOpen"),highlightedIndex:Wu(i),selectedItem:i.items[t.index]};break;case Uu:{var s=t.key,c=""+e.inputValue+s,d=!e.isOpen&&e.selectedItem?i.items.findIndex(function(v){return i.itemToKey(v)===i.itemToKey(e.selectedItem)}):e.highlightedIndex,u=eY({keysSoFar:c,highlightedIndex:d,items:i.items,itemToString:i.itemToString,isItemDisabled:i.isItemDisabled});a={inputValue:c,highlightedIndex:u,isOpen:!0}}break;case O1:{var h=e.isOpen?Ln(e.highlightedIndex,1,i.items,i.isItemDisabled):o&&e.selectedItem==null?-1:Eo(i,e,1);a={highlightedIndex:h,isOpen:!0}}break;case C1:if(e.isOpen&&o)a=Hu(i,e.highlightedIndex,!1);else{var p=e.isOpen?Ln(e.highlightedIndex,-1,i.items,i.isItemDisabled):Eo(i,e,-1);a={highlightedIndex:p,isOpen:!0}}break;case T1:case P1:a=Hu(i,e.highlightedIndex,!1);break;case R1:a={highlightedIndex:Ji(0,!1,i.items,i.isItemDisabled),isOpen:!0};break;case N1:a={highlightedIndex:Ji(i.items.length-1,!0,i.items,i.isItemDisabled),isOpen:!0};break;case M1:a={highlightedIndex:Ln(e.highlightedIndex,-10,i.items,i.isItemDisabled)};break;case k1:a={highlightedIndex:Ln(e.highlightedIndex,10,i.items,i.isItemDisabled)};break;case I1:a={isOpen:!1,highlightedIndex:-1};break;case Gu:a=je({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=i.items)==null?void 0:r.length)&&{selectedItem:i.items[e.highlightedIndex]});break;case D1:a={selectedItem:t.selectedItem};break;default:return a4(e,t,v4)}return je({},e,a)}var iY=["onClick"],oY=["onMouseLeave","refKey","ref"],aY=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],sY=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];xi.stateChangeTypes=v4;function xi(e){e===void 0&&(e={}),s4(e,xi);var t=je({},rY,e),r=t.scrollIntoView,n=t.environment,i=t.getA11yStatusMessage,o=e4(nY,t,t4,i4),a=o[0],s=o[1],c=a.isOpen,d=a.highlightedIndex,u=a.selectedItem,h=a.inputValue,p=C.useRef(null),v=C.useRef(null),y=C.useRef({}),m=C.useRef(null),g=J3(t),w=Sd({state:a,props:t}),x=C.useCallback(function(P){return y.current[g.getItemId(P)]},[g]);_1(i,a,[c,d,u,h],n);var _=n4({menuElement:v.current,highlightedIndex:d,isOpen:c,itemRefs:y,scrollIntoView:r,getItemNodeFromIndex:x});C.useEffect(function(){return m.current=wd(function(P){P({type:Mw,inputValue:""})},500),function(){m.current.cancel()}},[]),C.useEffect(function(){h&&m.current(s)},[s,h]),_d({props:t,state:a}),C.useEffect(function(){var P=So(t,"isOpen");P&&p.current&&p.current.focus()},[]);var S=C.useCallback(function(){w.current.state.isOpen&&s({type:Gu})},[s,w]),E=C.useMemo(function(){return[v,p]},[]),I=r4(n,S,E),N=Ed("getMenuProps","getToggleButtonProps");C.useEffect(function(){c||(y.current={})},[c]);var T=C.useMemo(function(){return{ArrowDown:function(P){P.preventDefault(),s({type:O1,altKey:P.altKey})},ArrowUp:function(P){P.preventDefault(),s({type:C1,altKey:P.altKey})},Home:function(P){P.preventDefault(),s({type:R1})},End:function(P){P.preventDefault(),s({type:N1})},Escape:function(){w.current.state.isOpen&&s({type:I1})},Enter:function(P){P.preventDefault(),s({type:w.current.state.isOpen?T1:yu})},PageUp:function(P){w.current.state.isOpen&&(P.preventDefault(),s({type:M1}))},PageDown:function(P){w.current.state.isOpen&&(P.preventDefault(),s({type:k1}))}," ":function(P){P.preventDefault();var B=w.current.state;if(!B.isOpen){s({type:yu});return}B.inputValue?s({type:Uu,key:" "}):s({type:P1})}}},[s,w]),M=C.useCallback(function(){s({type:u4})},[s]),z=C.useCallback(function(){s({type:f4})},[s]),j=C.useCallback(function(){s({type:d4})},[s]),W=C.useCallback(function(P){s({type:h4,highlightedIndex:P})},[s]),U=C.useCallback(function(P){s({type:D1,selectedItem:P})},[s]),A=C.useCallback(function(){s({type:p4})},[s]),K=C.useCallback(function(P){s({type:Mw,inputValue:P})},[s]),V=C.useCallback(function(P){var B=P===void 0?{}:P,X=B.onClick,Q=Ir(B,iY),D=function(){var $;($=p.current)==null||$.focus()};return je({id:g.labelId,htmlFor:g.toggleButtonId,onClick:st(X,D)},Q)},[g]),te=C.useCallback(function(P,B){var X,Q=P===void 0?{}:P,D=Q.onMouseLeave,$=Q.refKey,H=$===void 0?"ref":$,q=Q.ref,Y=Ir(Q,oY),ie=B===void 0?{}:B,ne=ie.suppressRefError,ve=ne===void 0?!1:ne,Z=function(){s({type:l4})};return N("getMenuProps",ve,H,v),je((X={},X[H]=zn(q,function(J){v.current=J}),X.id=g.menuId,X.role="listbox",X["aria-labelledby"]=Y&&Y["aria-label"]?void 0:""+g.labelId,X.onMouseLeave=st(D,Z),X),Y)},[s,N,g]),G=C.useCallback(function(P,B){var X,Q=P===void 0?{}:P,D=Q.onBlur,$=Q.onClick;Q.onPress;var H=Q.onKeyDown,q=Q.refKey,Y=q===void 0?"ref":q,ie=Q.ref,ne=Ir(Q,aY),ve=B===void 0?{}:B,Z=ve.suppressRefError,J=Z===void 0?!1:Z,ae=w.current.state,he=function(){s({type:yu})},ue=function(){ae.isOpen&&!I.isMouseDown&&s({type:Gu})},de=function(xe){var Ee=Ra(xe);Ee&&T[Ee]?T[Ee](xe):JK(Ee)&&s({type:Uu,key:Ee})},le=je((X={},X[Y]=zn(ie,function(xe){p.current=xe}),X["aria-activedescendant"]=ae.isOpen&&ae.highlightedIndex>-1?g.getItemId(ae.highlightedIndex):"",X["aria-controls"]=g.menuId,X["aria-expanded"]=w.current.state.isOpen,X["aria-haspopup"]="listbox",X["aria-labelledby"]=ne&&ne["aria-label"]?void 0:""+g.labelId,X.id=g.toggleButtonId,X.role="combobox",X.tabIndex=0,X.onBlur=st(D,ue),X),ne);return ne.disabled||(le.onClick=st($,he),le.onKeyDown=st(H,de)),N("getToggleButtonProps",J,Y,p),le},[s,g,w,I,N,T]),re=C.useCallback(function(P){var B,X=P===void 0?{}:P,Q=X.item,D=X.index,$=X.onMouseMove,H=X.onClick,q=X.onMouseDown;X.onPress;var Y=X.refKey,ie=Y===void 0?"ref":Y,ne=X.disabled,ve=X.ref,Z=Ir(X,sY);ne!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var J=w.current,ae=J.state,he=J.props,ue=S1(Q,D,he.items,"Pass either item or index to getItemProps!"),de=ue[0],le=ue[1],xe=he.isItemDisabled(de,le),Ee=function(){I.isTouchEnd||le===ae.highlightedIndex||(_.current=!1,s({type:c4,index:le,disabled:xe}))},Ie=function(){s({type:A1,index:le})},Te=function(Ze){return Ze.preventDefault()},Me=je((B={},B[ie]=zn(ve,function(Ze){Ze&&(y.current[g.getItemId(le)]=Ze)}),B["aria-disabled"]=xe,B["aria-selected"]=de===ae.selectedItem,B.id=g.getItemId(le),B.role="option",B),Z);return xe||(Me.onClick=st(H,Ie)),Me.onMouseMove=st($,Ee),Me.onMouseDown=st(q,Te),Me},[w,g,I,_,s]);return{getToggleButtonProps:G,getLabelProps:V,getMenuProps:te,getItemProps:re,toggleMenu:M,openMenu:j,closeMenu:z,setHighlightedIndex:W,selectItem:U,reset:A,setInputValue:K,highlightedIndex:d,isOpen:c,selectedItem:u,inputValue:h}}var j1=process.env.NODE_ENV!=="production"?"__input_keydown_arrow_down__":0,q1=process.env.NODE_ENV!=="production"?"__input_keydown_arrow_up__":1,z1=process.env.NODE_ENV!=="production"?"__input_keydown_escape__":2,L1=process.env.NODE_ENV!=="production"?"__input_keydown_home__":3,B1=process.env.NODE_ENV!=="production"?"__input_keydown_end__":4,F1=process.env.NODE_ENV!=="production"?"__input_keydown_page_up__":5,$1=process.env.NODE_ENV!=="production"?"__input_keydown_page_down__":6,V1=process.env.NODE_ENV!=="production"?"__input_keydown_enter__":7,H1=process.env.NODE_ENV!=="production"?"__input_change__":8,Ku=process.env.NODE_ENV!=="production"?"__input_blur__":9,W1=process.env.NODE_ENV!=="production"?"__input_click__":10,g4=process.env.NODE_ENV!=="production"?"__menu_mouse_leave__":11,m4=process.env.NODE_ENV!=="production"?"__item_mouse_move__":12,U1=process.env.NODE_ENV!=="production"?"__item_click__":13,b4=process.env.NODE_ENV!=="production"?"__togglebutton_click__":14,y4=process.env.NODE_ENV!=="production"?"__function_toggle_menu__":15,x4=process.env.NODE_ENV!=="production"?"__function_open_menu__":16,w4=process.env.NODE_ENV!=="production"?"__function_close_menu__":17,S4=process.env.NODE_ENV!=="production"?"__function_set_highlighted_index__":18,G1=process.env.NODE_ENV!=="production"?"__function_select_item__":19,E4=process.env.NODE_ENV!=="production"?"__function_set_input_value__":20,_4=process.env.NODE_ENV!=="production"?"__function_reset__":21,K1=process.env.NODE_ENV!=="production"?"__controlled_prop_updated_selected_item__":22,O4=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:K1,FunctionCloseMenu:w4,FunctionOpenMenu:x4,FunctionReset:_4,FunctionSelectItem:G1,FunctionSetHighlightedIndex:S4,FunctionSetInputValue:E4,FunctionToggleMenu:y4,InputBlur:Ku,InputChange:H1,InputClick:W1,InputKeyDownArrowDown:j1,InputKeyDownArrowUp:q1,InputKeyDownEnd:B1,InputKeyDownEnter:V1,InputKeyDownEscape:z1,InputKeyDownHome:L1,InputKeyDownPageDown:$1,InputKeyDownPageUp:F1,ItemClick:U1,ItemMouseMove:m4,MenuMouseLeave:g4,ToggleButtonClick:b4});function lY(e){var t=t4(e),r=t.selectedItem,n=t.inputValue;return n===""&&r&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(n=e.itemToString(r)),je({},t,{inputValue:n})}var cY=je({},o4,{items:Se.array.isRequired,isItemDisabled:Se.func,inputValue:Se.string,defaultInputValue:Se.string,initialInputValue:Se.string,inputId:Se.string,onInputValueChange:Se.func});function uY(e,t,r,n){var i=C.useRef(),o=Q3(e,t,r,n),a=o[0],s=o[1],c=Cl();return C.useEffect(function(){if($u(t,"selectedItem")){if(!c){var d=t.itemToKey(t.selectedItem)!==t.itemToKey(i.current);d&&s({type:K1,inputValue:t.itemToString(t.selectedItem)})}i.current=a.selectedItem===i.current?t.selectedItem:a.selectedItem}},[a.selectedItem,t.selectedItem]),[ul(a,t),s]}var C4=Cr;process.env.NODE_ENV!=="production"&&(C4=function(e,t){Se.checkPropTypes(cY,e,"prop",t.name)});var dY=je({},el,{isItemDisabled:function(){return!1}});function fY(e,t){var r,n=t.type,i=t.props,o=t.altKey,a;switch(n){case U1:a={isOpen:ri(i,"isOpen"),highlightedIndex:Wu(i),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case j1:e.isOpen?a={highlightedIndex:Ln(e.highlightedIndex,1,i.items,i.isItemDisabled,!0)}:a={highlightedIndex:o&&e.selectedItem==null?-1:Eo(i,e,1),isOpen:i.items.length>=0};break;case q1:e.isOpen?o?a=Hu(i,e.highlightedIndex):a={highlightedIndex:Ln(e.highlightedIndex,-1,i.items,i.isItemDisabled,!0)}:a={highlightedIndex:Eo(i,e,-1),isOpen:i.items.length>=0};break;case V1:a=Hu(i,e.highlightedIndex);break;case z1:a=je({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case F1:a={highlightedIndex:Ln(e.highlightedIndex,-10,i.items,i.isItemDisabled,!0)};break;case $1:a={highlightedIndex:Ln(e.highlightedIndex,10,i.items,i.isItemDisabled,!0)};break;case L1:a={highlightedIndex:Ji(0,!1,i.items,i.isItemDisabled)};break;case B1:a={highlightedIndex:Ji(i.items.length-1,!0,i.items,i.isItemDisabled)};break;case Ku:a=je({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=i.items)==null?void 0:r.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case H1:a={isOpen:!0,highlightedIndex:Wu(i),inputValue:t.inputValue};break;case W1:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Eo(i,e,0)};break;case G1:a={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case K1:a={inputValue:t.inputValue};break;default:return a4(e,t,O4)}return je({},e,a)}var hY=["onMouseLeave","refKey","ref"],pY=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],vY=["onClick","onPress","refKey","ref"],gY=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];zr.stateChangeTypes=O4;function zr(e){e===void 0&&(e={}),C4(e,zr);var t=je({},dY,e),r=t.items,n=t.scrollIntoView,i=t.environment,o=t.getA11yStatusMessage,a=uY(fY,t,lY,i4),s=a[0],c=a[1],d=s.isOpen,u=s.highlightedIndex,h=s.selectedItem,p=s.inputValue,v=C.useRef(null),y=C.useRef({}),m=C.useRef(null),g=C.useRef(null),w=Cl(),x=J3(t),_=C.useRef(),S=Sd({state:s,props:t}),E=C.useCallback(function(D){return y.current[x.getItemId(D)]},[x]);_1(o,s,[d,u,h,p],i);var I=n4({menuElement:v.current,highlightedIndex:u,isOpen:d,itemRefs:y,scrollIntoView:n,getItemNodeFromIndex:E});_d({props:t,state:s}),C.useEffect(function(){var D=So(t,"isOpen");D&&m.current&&m.current.focus()},[]),C.useEffect(function(){w||(_.current=r.length)});var N=C.useCallback(function(){S.current.state.isOpen&&c({type:Ku})},[c,S]),T=C.useMemo(function(){return[v,g,m]},[]),M=r4(i,N,T),z=Ed("getInputProps","getMenuProps");C.useEffect(function(){d||(y.current={})},[d]),C.useEffect(function(){var D;!d||!(i!=null&&i.document)||!(m!=null&&(D=m.current)!=null&&D.focus)||i.document.activeElement!==m.current&&m.current.focus()},[d,i]);var j=C.useMemo(function(){return{ArrowDown:function(D){D.preventDefault(),c({type:j1,altKey:D.altKey})},ArrowUp:function(D){D.preventDefault(),c({type:q1,altKey:D.altKey})},Home:function(D){S.current.state.isOpen&&(D.preventDefault(),c({type:L1}))},End:function(D){S.current.state.isOpen&&(D.preventDefault(),c({type:B1}))},Escape:function(D){var $=S.current.state;($.isOpen||$.inputValue||$.selectedItem||$.highlightedIndex>-1)&&(D.preventDefault(),c({type:z1}))},Enter:function(D){var $=S.current.state;!$.isOpen||D.which===229||(D.preventDefault(),c({type:V1}))},PageUp:function(D){S.current.state.isOpen&&(D.preventDefault(),c({type:F1}))},PageDown:function(D){S.current.state.isOpen&&(D.preventDefault(),c({type:$1}))}}},[c,S]),W=C.useCallback(function(D){return je({id:x.labelId,htmlFor:x.inputId},D)},[x]),U=C.useCallback(function(D,$){var H,q=D===void 0?{}:D,Y=q.onMouseLeave,ie=q.refKey,ne=ie===void 0?"ref":ie,ve=q.ref,Z=Ir(q,hY),J=$===void 0?{}:$,ae=J.suppressRefError,he=ae===void 0?!1:ae;return z("getMenuProps",he,ne,v),je((H={},H[ne]=zn(ve,function(ue){v.current=ue}),H.id=x.menuId,H.role="listbox",H["aria-labelledby"]=Z&&Z["aria-label"]?void 0:""+x.labelId,H.onMouseLeave=st(Y,function(){c({type:g4})}),H),Z)},[c,z,x]),A=C.useCallback(function(D){var $,H,q=D===void 0?{}:D,Y=q.item,ie=q.index,ne=q.refKey,ve=ne===void 0?"ref":ne,Z=q.ref,J=q.onMouseMove,ae=q.onMouseDown,he=q.onClick;q.onPress;var ue=q.disabled,de=Ir(q,pY);ue!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var le=S.current,xe=le.props,Ee=le.state,Ie=S1(Y,ie,xe.items,"Pass either item or index to getItemProps!"),Te=Ie[0],Me=Ie[1],Ze=xe.isItemDisabled(Te,Me),tt="onClick",Fe=he,Le=function(){M.isTouchEnd||Me===Ee.highlightedIndex||(I.current=!1,c({type:m4,index:Me,disabled:Ze}))},ze=function(){c({type:U1,index:Me})},Je=function(rt){return rt.preventDefault()};return je(($={},$[ve]=zn(Z,function(rt){rt&&(y.current[x.getItemId(Me)]=rt)}),$["aria-disabled"]=Ze,$["aria-selected"]=Me===Ee.highlightedIndex,$.id=x.getItemId(Me),$.role="option",$),!Ze&&(H={},H[tt]=st(Fe,ze),H),{onMouseMove:st(J,Le),onMouseDown:st(ae,Je)},de)},[c,x,S,M,I]),K=C.useCallback(function(D){var $,H=D===void 0?{}:D,q=H.onClick;H.onPress;var Y=H.refKey,ie=Y===void 0?"ref":Y,ne=H.ref,ve=Ir(H,vY),Z=S.current.state,J=function(){c({type:b4})};return je(($={},$[ie]=zn(ne,function(ae){g.current=ae}),$["aria-controls"]=x.menuId,$["aria-expanded"]=Z.isOpen,$.id=x.toggleButtonId,$.tabIndex=-1,$),!ve.disabled&&je({},{onClick:st(q,J)}),ve)},[c,S,x]),V=C.useCallback(function(D,$){var H,q=D===void 0?{}:D,Y=q.onKeyDown,ie=q.onChange,ne=q.onInput,ve=q.onBlur;q.onChangeText;var Z=q.onClick,J=q.refKey,ae=J===void 0?"ref":J,he=q.ref,ue=Ir(q,gY),de=$===void 0?{}:$,le=de.suppressRefError,xe=le===void 0?!1:le;z("getInputProps",xe,ae,m);var Ee=S.current.state,Ie=function(ze){var Je=Ra(ze);Je&&j[Je]&&j[Je](ze)},Te=function(ze){c({type:H1,inputValue:ze.target.value})},Me=function(ze){if(i!=null&&i.document&&Ee.isOpen&&!M.isMouseDown){var Je=ze.relatedTarget===null&&i.document.activeElement!==i.document.body;c({type:Ku,selectItem:!Je})}},Ze=function(){c({type:W1})},tt="onChange",Fe={};if(!ue.disabled){var Le;Fe=(Le={},Le[tt]=st(ie,ne,Te),Le.onKeyDown=st(Y,Ie),Le.onBlur=st(ve,Me),Le.onClick=st(Z,Ze),Le)}return je((H={},H[ae]=zn(he,function(ze){m.current=ze}),H["aria-activedescendant"]=Ee.isOpen&&Ee.highlightedIndex>-1?x.getItemId(Ee.highlightedIndex):"",H["aria-autocomplete"]="list",H["aria-controls"]=x.menuId,H["aria-expanded"]=Ee.isOpen,H["aria-labelledby"]=ue&&ue["aria-label"]?void 0:x.labelId,H.autoComplete="off",H.id=x.inputId,H.role="combobox",H.value=Ee.inputValue,H),Fe,ue)},[c,x,i,j,S,M,z]),te=C.useCallback(function(){c({type:y4})},[c]),G=C.useCallback(function(){c({type:w4})},[c]),re=C.useCallback(function(){c({type:x4})},[c]),P=C.useCallback(function(D){c({type:S4,highlightedIndex:D})},[c]),B=C.useCallback(function(D){c({type:G1,selectedItem:D})},[c]),X=C.useCallback(function(D){c({type:E4,inputValue:D})},[c]),Q=C.useCallback(function(){c({type:_4})},[c]);return{getItemProps:A,getLabelProps:W,getMenuProps:U,getInputProps:V,getToggleButtonProps:K,toggleMenu:te,openMenu:re,closeMenu:G,setHighlightedIndex:P,setInputValue:X,selectItem:B,reset:Q,highlightedIndex:u,isOpen:d,selectedItem:h,inputValue:p}}var I4={activeIndex:-1,selectedItems:[]};function zC(e,t){return So(e,t,I4)}function LC(e,t){return ri(e,t,I4)}function mY(e){var t=zC(e,"activeIndex"),r=zC(e,"selectedItems");return{activeIndex:t,selectedItems:r}}function BC(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==""&&(t.selectionStart!==0||t.selectionEnd!==0))}function bY(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}var yY={stateReducer:bu.stateReducer,itemToKey:bu.itemToKey,environment:bu.environment,selectedItems:Se.array,initialSelectedItems:Se.array,defaultSelectedItems:Se.array,getA11yStatusMessage:Se.func,activeIndex:Se.number,initialActiveIndex:Se.number,defaultActiveIndex:Se.number,onActiveIndexChange:Se.func,onSelectedItemsChange:Se.func,keyNavigationNext:Se.string,keyNavigationPrevious:Se.string},xY={itemToKey:el.itemToKey,stateReducer:el.stateReducer,environment:el.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},R4=Cr;process.env.NODE_ENV!=="production"&&(R4=function(e,t){Se.checkPropTypes(yY,e,"prop",t.name)});var Y1=process.env.NODE_ENV!=="production"?"__selected_item_click__":0,X1=process.env.NODE_ENV!=="production"?"__selected_item_keydown_delete__":1,Z1=process.env.NODE_ENV!=="production"?"__selected_item_keydown_backspace__":2,J1=process.env.NODE_ENV!=="production"?"__selected_item_keydown_navigation_next__":3,Q1=process.env.NODE_ENV!=="production"?"__selected_item_keydown_navigation_previous__":4,eS=process.env.NODE_ENV!=="production"?"__dropdown_keydown_navigation_previous__":5,tS=process.env.NODE_ENV!=="production"?"__dropdown_keydown_backspace__":6,rS=process.env.NODE_ENV!=="production"?"__dropdown_click__":7,nS=process.env.NODE_ENV!=="production"?"__function_add_selected_item__":8,iS=process.env.NODE_ENV!=="production"?"__function_remove_selected_item__":9,oS=process.env.NODE_ENV!=="production"?"__function_set_selected_items__":10,aS=process.env.NODE_ENV!=="production"?"__function_set_active_index__":11,sS=process.env.NODE_ENV!=="production"?"__function_reset__":12,wY=Object.freeze({__proto__:null,DropdownClick:rS,DropdownKeyDownBackspace:tS,DropdownKeyDownNavigationPrevious:eS,FunctionAddSelectedItem:nS,FunctionRemoveSelectedItem:iS,FunctionReset:sS,FunctionSetActiveIndex:aS,FunctionSetSelectedItems:oS,SelectedItemClick:Y1,SelectedItemKeyDownBackspace:Z1,SelectedItemKeyDownDelete:X1,SelectedItemKeyDownNavigationNext:J1,SelectedItemKeyDownNavigationPrevious:Q1});function SY(e,t){var r=t.type,n=t.index,i=t.props,o=t.selectedItem,a=e.activeIndex,s=e.selectedItems,c;switch(r){case Y1:c={activeIndex:n};break;case Q1:c={activeIndex:a-1<0?0:a-1};break;case J1:c={activeIndex:a+1>=s.length?-1:a+1};break;case Z1:case X1:{if(a<0)break;var d=a;s.length===1?d=-1:a===s.length-1&&(d=s.length-2),c=je({selectedItems:[].concat(s.slice(0,a),s.slice(a+1))},{activeIndex:d});break}case eS:c={activeIndex:s.length-1};break;case tS:c={selectedItems:s.slice(0,s.length-1)};break;case nS:c={selectedItems:[].concat(s,[o])};break;case rS:c={activeIndex:-1};break;case iS:{var u=a,h=s.findIndex(function(y){return i.itemToKey(y)===i.itemToKey(o)});if(h<0)break;s.length===1?u=-1:h===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,h),s.slice(h+1)),activeIndex:u};break}case oS:{var p=t.selectedItems;c={selectedItems:p};break}case aS:{var v=t.activeIndex;c={activeIndex:v};break}case sS:c={activeIndex:LC(i,"activeIndex"),selectedItems:LC(i,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return je({},e,c)}var EY=["refKey","ref","onClick","onKeyDown","selectedItem","index"],_Y=["refKey","ref","onKeyDown","onClick","preventKeyAction"];lS.stateChangeTypes=wY;function lS(e){e===void 0&&(e={}),R4(e,lS);var t=je({},xY,e),r=t.getA11yStatusMessage,n=t.environment,i=t.keyNavigationNext,o=t.keyNavigationPrevious,a=e4(SY,t,mY,bY),s=a[0],c=a[1],d=s.activeIndex,u=s.selectedItems,h=Cl(),p=C.useRef(null),v=C.useRef();v.current=[];var y=Sd({state:s,props:t});_1(r,s,[d,u],n),C.useEffect(function(){h||(d===-1&&p.current?p.current.focus():v.current[d]&&v.current[d].focus())},[d]),_d({props:t,state:s});var m=Ed("getDropdownProps"),g=C.useMemo(function(){var M;return M={},M[o]=function(){c({type:Q1})},M[i]=function(){c({type:J1})},M.Delete=function(){c({type:X1})},M.Backspace=function(){c({type:Z1})},M},[c,i,o]),w=C.useMemo(function(){var M;return M={},M[o]=function(z){BC(z)&&c({type:eS})},M.Backspace=function(z){BC(z)&&c({type:tS})},M},[c,o]),x=C.useCallback(function(M){var z,j=M===void 0?{}:M,W=j.refKey,U=W===void 0?"ref":W,A=j.ref,K=j.onClick,V=j.onKeyDown,te=j.selectedItem,G=j.index,re=Ir(j,EY),P=y.current.state,B=S1(te,G,P.selectedItems,"Pass either item or index to getSelectedItemProps!"),X=B[1],Q=X>-1&&X===P.activeIndex,D=function(){c({type:Y1,index:X})},$=function(H){var q=Ra(H);q&&g[q]&&g[q](H)};return je((z={},z[U]=zn(A,function(H){H&&v.current.push(H)}),z.tabIndex=Q?0:-1,z.onClick=st(K,D),z.onKeyDown=st(V,$),z),re)},[c,y,g]),_=C.useCallback(function(M,z){var j,W=M===void 0?{}:M,U=W.refKey,A=U===void 0?"ref":U,K=W.ref,V=W.onKeyDown,te=W.onClick,G=W.preventKeyAction,re=G===void 0?!1:G,P=Ir(W,_Y),B=z===void 0?{}:z,X=B.suppressRefError,Q=X===void 0?!1:X;m("getDropdownProps",Q,A,p);var D=function(H){var q=Ra(H);q&&w[q]&&w[q](H)},$=function(){c({type:rS})};return je((j={},j[A]=zn(K,function(H){H&&(p.current=H)}),j),!re&&{onKeyDown:st(V,D),onClick:st(te,$)},P)},[c,w,m]),S=C.useCallback(function(M){c({type:nS,selectedItem:M})},[c]),E=C.useCallback(function(M){c({type:iS,selectedItem:M})},[c]),I=C.useCallback(function(M){c({type:oS,selectedItems:M})},[c]),N=C.useCallback(function(M){c({type:aS,activeIndex:M})},[c]),T=C.useCallback(function(){c({type:sS})},[c]);return{getSelectedItemProps:x,getDropdownProps:_,addSelectedItem:S,removeSelectedItem:E,setSelectedItems:I,setActiveIndex:N,reset:T,selectedItems:u,activeIndex:d}}let OY=0;const CY=()=>{const e=C.useRef(null);return e.current===null&&(e.current=`select-${++OY}`),e.current},IY=e=>{const{items:t=[],isMulti:r=!1,isSearchable:n=!1,value:i,defaultValue:o,inputValue:a,onChange:s,onInputChange:c,getOptionLabel:d=le=>(le==null?void 0:le.label)||"",getOptionValue:u=le=>(le==null?void 0:le.value)||"",isOpen:h,onOpenChange:p,customOptionGenerator:v,disableInternalFiltering:y=!1,stateReducer:m,isDisabled:g=!1,clearSearchOnSelect:w=!1,closeMenuOnSelect:x,onSelectionComplete:_,id:S}=e,E=CY(),I=S||E,N=C.useCallback(le=>{const xe=d(le);if(typeof xe=="string")return xe;if(typeof xe=="number")return String(xe);const Ee=le;if(typeof Ee=="object"&&Ee!==null){if(typeof Ee.label=="string")return Ee.label;if(typeof Ee.name=="string")return Ee.name}return String(u(le))},[d,u]),T=le=>le?Array.isArray(le)?le:[le]:[],M=o!==void 0?o:i!==void 0?i:null,[z,j]=C.useState(()=>T(M)),[W,U]=C.useState(()=>{if(a!==void 0)return a;if(n&&!r){const le=T(M)[0];if(le!==void 0)return N(le)}return""}),[A,K]=C.useState(()=>h!==void 0?h:!1),V=i!==void 0?T(i):z,te=a!==void 0?a:W,G=h!==void 0?h:A,re=C.useRef(null),P=C.useRef(null),B=C.useRef(!1);C.useEffect(()=>{const le=xe=>{const Ee=xe.target,Ie=document.querySelectorAll(`[data-select-id="${I}"]`);B.current=Array.from(Ie).some(Te=>Te.contains(Ee))};return document.addEventListener("mousedown",le,!0),()=>document.removeEventListener("mousedown",le,!0)},[I]);const X=C.useCallback(le=>{h===void 0&&K(le),p==null||p(le)},[h,p]),Q=C.useCallback(le=>{i===void 0&&j(le);const xe=r?le:le[0]||null;s==null||s(xe)},[i,r,s]),D=C.useCallback(le=>{a===void 0&&U(le),c==null||c(le)},[a,c]),$=lS({selectedItems:V,onSelectedItemsChange:le=>{const xe=le.selectedItems||[];Q(xe)}}),H=C.useCallback(le=>{r&&$.removeSelectedItem(le)},[r,$]),q=C.useCallback(le=>{if(le){if(r)V.some(xe=>u(xe)===u(le))?H(le):$.addSelectedItem(le);else{const xe=V[0];(!xe||u(xe)!==u(le))&&Q([le])}_==null||_(u(le),le)}},[r,V,u,H,$,Q,_]);C.useEffect(()=>{if(P.current){const le=P.current;P.current=null,q(le)}}),C.useLayoutEffect(()=>{if(n&&G){const le=requestAnimationFrame(()=>{var xe;(xe=re.current)==null||xe.focus()});return()=>cancelAnimationFrame(le)}},[n,G]),C.useEffect(()=>{if(n&&!r&&a===void 0&&!G){const le=V[0],xe=le!==void 0?N(le):"";xe!==W&&U(xe)}},[V,G,n,r]);const[Y,ie]=C.useState(te);C.useEffect(()=>{const le=setTimeout(()=>ie(te),120);return()=>clearTimeout(le)},[te]);const ne=C.useMemo(()=>v?v(te,t):y||!n||!Y?t:t.filter(le=>N(le).toLowerCase().includes(Y.toLowerCase())),[t,te,Y,v,y,n,N]),ve={items:ne,itemToString:le=>le?N(le):"",isOpen:G,onIsOpenChange:({isOpen:le})=>{le!==void 0&&X(le)},selectedItem:r?null:V[0]||null},Z=le=>{const xe=new Map;for(const[Ee,Ie]of Object.entries(le.stateChangeTypes))xe.set(Ie,Ee);return(Ee,Ie)=>{const{changes:Te,type:Me}=Ie,Ze=x??!r,tt=[zr.stateChangeTypes.ItemClick,zr.stateChangeTypes.InputKeyDownEnter,zr.stateChangeTypes.FunctionSelectItem,xi.stateChangeTypes.ItemClick,xi.stateChangeTypes.ToggleButtonKeyDownEnter,xi.stateChangeTypes.ToggleButtonKeyDownSpaceButton,xi.stateChangeTypes.FunctionSelectItem].includes(Me);if((Me===zr.stateChangeTypes.InputBlur||Me===xi.stateChangeTypes.ToggleButtonBlur)&&typeof document<"u"){const Fe=document.activeElement,Le=document.querySelectorAll(`[data-select-id="${I}"]`),ze=!!Fe&&Array.from(Le).some(Pt=>Pt.contains(Fe)),Je=Fe===document.body,rt=r&&Je&&B.current;if(ze||rt)return{...Te,isOpen:!0}}if(tt){const Fe=Te.selectedItem||null;Fe&&(P.current=Fe);const Le={...Te};return r?(Le.selectedItem=null,Le.isOpen=!Ze,Le.highlightedIndex=Ee.highlightedIndex,Le.inputValue=""):Fe&&(w?Le.inputValue="":n&&(Le.inputValue=N(Fe)),x===!1&&(Le.isOpen=!0,Le.highlightedIndex=Ee.highlightedIndex)),Le}return n&&!tt&&Me!==zr.stateChangeTypes.InputChange&&(Me===zr.stateChangeTypes.ControlledPropUpdatedSelectedItem||Me===zr.stateChangeTypes.FunctionSetInputValue||Me===zr.stateChangeTypes.InputBlur||Me===zr.stateChangeTypes.FunctionReset)?{...Te,inputValue:Ee.inputValue}:m?m(Ee,{...Ie,type:xe.get(Ie.type)||Ie.type,changes:Te}):Te}},J=n?zr({...ve,inputValue:te,onInputValueChange:({inputValue:le,type:xe})=>{!r&&!le&&xe===zr.stateChangeTypes.InputChange&&Q([]),D(le||"")},stateReducer:Z(zr),id:I}):xi({...ve,stateReducer:Z(xi),id:I}),ae=C.useCallback(()=>{g||("toggleMenu"in J&&typeof J.toggleMenu=="function"?J.toggleMenu():X(!G))},[J,g,X,G]),he=C.useCallback(()=>{g||("openMenu"in J&&typeof J.openMenu=="function"?J.openMenu():X(!0))},[J,g,X]),ue=C.useCallback(()=>{"closeMenu"in J&&typeof J.closeMenu=="function"?J.closeMenu():X(!1)},[J,X]),de=C.useCallback(()=>{Q([]),D(""),r&&$.reset()},[Q,D,r,$]);return{isOpen:J.isOpen,selectedItem:J.selectedItem,highlightedIndex:J.highlightedIndex,inputValue:te,getToggleButtonProps:J.getToggleButtonProps,getMenuProps:J.getMenuProps,getItemProps:J.getItemProps,getInputProps:n?(le,xe)=>({..."getInputProps"in J?J.getInputProps(le,xe):{},ref:re,value:te}):void 0,selectedItems:V,filteredItems:ne,setInputValue:D,setIsOpen:X,toggleMenu:ae,openMenu:he,closeMenu:ue,clearSelection:de,selectItem:"selectItem"in J?J.selectItem:void 0,removeItem:H,multipleSelection:$,isMulti:r,isSearchable:n,inputRef:re,selectId:I}},N4=({size:e="md",color:t="primary",isInvalid:r=!1,isDisabled:n=!1,className:i,children:o,options:a=[],value:s,defaultValue:c,onChange:d,isMulti:u,inputValue:h,onInputChange:p,isSearchable:v,isOpen:y,onOpenChange:m,customOptionGenerator:g,disableInternalFiltering:w,getOptionLabel:x=j=>typeof j=="string"||typeof j=="number"?String(j):(j==null?void 0:j.label)||(j==null?void 0:j.name)||String(j),getOptionValue:_=j=>typeof j=="string"||typeof j=="number"?String(j):(j==null?void 0:j.value)||(j==null?void 0:j.id)||(j==null?void 0:j.name)||String(j),isOptionDisabled:S=j=>(j==null?void 0:j.isDisabled)||!1,stateReducer:E,clearSearchOnSelect:I,closeMenuOnSelect:N,inputClassName:T,onSelectionComplete:M,...z})=>{const[j,W]=C.useState(!1),[U,A]=C.useState(!1),K=C.useRef(null),[V,te]=C.useState(!1),[G,re]=C.useState("bottom"),P=C.useRef(new Set),B=C.useCallback(H=>(P.current.add(H),()=>P.current.delete(H)),[]),X=C.useCallback((H,q)=>{M==null||M(H,q),P.current.forEach(Y=>Y(H,q))},[M]),Q=C.useMemo(()=>bK(a),[a]),D=IY({items:Q,value:s,defaultValue:c,onChange:d,isMulti:u,inputValue:h,onInputChange:p,isSearchable:v,isOpen:y,onOpenChange:m,getOptionLabel:x,getOptionValue:_,customOptionGenerator:g,disableInternalFiltering:w,stateReducer:E,isDisabled:n,clearSearchOnSelect:I,closeMenuOnSelect:N,onSelectionComplete:X}),$={size:e,color:r?"negative":t,isInvalid:r,isDisabled:n,hasMessage:j,setHasMessage:W,hasGroup:U,setHasGroup:A,groupRef:K,menuVisible:V,setMenuVisible:te,menuPlacement:G,setMenuPlacement:re,downshift:D,options:a,getOptionLabel:x,getOptionValue:_,isOptionDisabled:S,inputClassName:T,registerOnSelectionComplete:B};return O.jsx(C3.Provider,{value:$,children:O.jsx("div",{"data-qui":"Select","data-select-id":D.selectId,className:ye(QG(),i),...z,children:o})})},RY=C.forwardRef(({className:e,children:t,isFocused:r,isDisabled:n,...i},o)=>{const{size:a,color:s,isDisabled:c,hasMessage:d,hasGroup:u,downshift:h,isInvalid:p,menuPlacement:v}=or(),y=n??c,m=r??h.isOpen;return O.jsx("div",{ref:o,className:ye(rK({size:a,color:s,isDisabled:y,isFocused:!!m,isInvalid:p&&!h.isOpen,hasMessage:d,hasGroup:u,menuPlacement:h.isOpen?v:void 0}),e),"aria-disabled":y,"aria-invalid":p,role:"combobox",tabIndex:y?-1:0,...i,children:t})}),NY=({className:e,children:t,isMulti:r})=>O.jsx("div",{className:ye(nK({isMulti:r}),e),children:t}),xu=C.forwardRef(({isHidden:e,inputClassName:t,className:r,...n},i)=>{const{size:o,color:a}=or();return e?O.jsx("input",{ref:i,type:"text",className:r,style:{position:"absolute",top:0,left:0,opacity:0,width:"100%",height:"100%",pointerEvents:"none"},tabIndex:-1,...n}):O.jsx("input",{ref:i,type:"text","data-qui":"SelectSearchInput",className:ye(iK({size:o,color:a}),t,e?"":r),...n})}),TY=({className:e,children:t})=>{const{size:r,color:n}=or();return O.jsx("div",{className:ye(oK({size:r,color:n}),e),children:t})},PY=({className:e,children:t,data:r,isDisabled:n})=>{const{size:i,color:o,getOptionLabel:a}=or();return O.jsx("div",{className:ye(aK({size:i,color:o,isDisabled:n}),e),children:t||a(r)})},T4=({className:e,children:t,data:r,isDisabled:n,isFocused:i,onRemove:o})=>{const{size:a,color:s,downshift:c,getOptionLabel:d}=or(),u=()=>{o?o(r):c.removeItem(r)};return O.jsxs("div",{className:ye(sK({size:a,color:s,isDisabled:n,isFocused:i}),e),children:[O.jsx("div",{className:lK({size:a}),children:t||d(r)}),!n&&O.jsx("div",{className:cK({size:a,color:s,isDisabled:!1}),onClick:u,children:O.jsx(hd,{className:"w-3 h-3"})})]})},P4=({color:e,className:t,children:r,onClick:n,isDisabled:i,...o})=>{const{size:a,color:s,isDisabled:c,downshift:d}=or(),u=i??c,h=d.selectedItems.length>0;if(u||!h)return null;const p=v=>{v.stopPropagation(),n?n(v):d.clearSelection()};return O.jsx("div",{className:ye(R3({size:a,color:e||s,isDisabled:u}),t),onClick:p,role:"button",tabIndex:0,"aria-label":"Clear selection",...o,children:r||O.jsx(QD,{})})},MY=({className:e,children:t,onClick:r,isDisabled:n,...i})=>{const{size:o,color:a,isDisabled:s,downshift:c}=or(),d=n??s,u=c.inputValue.length>0&&c.isSearchable;if(d||!u)return null;const h=p=>{d||(p.preventDefault(),p.stopPropagation(),r?r(p):(c.setInputValue(""),c.clearSelection()))};return O.jsx("div",{"data-qui":"SelectIndicator",className:ye(R3({size:o,color:a,isDisabled:d}),"cursor-pointer",e),onClick:h,onMouseDown:p=>{p.preventDefault(),p.stopPropagation()},role:"button",tabIndex:-1,"aria-label":"Clear selection",...i,children:t||O.jsx(hd,{})})},M4=C.forwardRef(({color:e,className:t,children:r,onClick:n,isDisabled:i,...o},a)=>{const{size:s,color:c,isDisabled:d,downshift:u}=or(),h=i??d,p=u.isOpen,v=m=>{h||(m.preventDefault(),m.stopPropagation(),n?n(m):u.toggleMenu())},y=m=>{m.preventDefault(),m.stopPropagation()};return O.jsx("div",{ref:a,"data-qui":"SelectIndicator",className:ye(uK({size:s,color:e||c,isDisabled:h}),"cursor-pointer",t),onClick:y,onMouseDown:v,role:"button",tabIndex:-1,"aria-label":p?"Close menu":"Open menu","aria-expanded":p,"aria-disabled":h,...o,children:r||O.jsx(rj,{className:ye("transition-transform duration-200",{"rotate-180":p})})})}),kY=C.forwardRef(({className:e,children:t,placement:r,...n},i)=>{const{size:o,hasMessage:a,color:s,hasGroup:c}=or();return O.jsx("div",{"data-qui":"SelectMenu",ref:i,className:ye(dK({size:o,placement:r,hasMessage:a,color:s,hasGroup:c}),e),...n,children:t})}),AY=C.forwardRef(({className:e,children:t,maxHeight:r=300,totalHeight:n,...i},o)=>{const{size:a}=or();return O.jsx(a1,{scrollableNodeProps:{ref:o},className:ye(fK({size:a}),e),style:{maxHeight:r},...i,children:n!==void 0?O.jsx("div",{style:{height:n,position:"relative",width:"100%"},children:t}):t})}),wu=({className:e,children:t,data:r,isDisabled:n,isFocused:i,isSelected:o,innerProps:a,optionClassName:s,...c})=>{const{size:d,color:u,getOptionLabel:h}=or();return O.jsx("div",{"data-qui":"SelectOption",className:ye(hK({size:d,color:u,isDisabled:n,isFocused:i,isSelected:o}),s,e),...a,...c,children:t??h(r)})},k4=({className:e,children:t,data:r,label:n,renderGroupHeading:i})=>{const{size:o}=or();return O.jsxs("div",{"data-qui":"SelectOptionGroup",className:ye(pK({size:o}),e),children:[O.jsx(DY,{children:i?i(r):n||r.label}),t]})},DY=({className:e,children:t})=>{const{size:r,color:n}=or();return O.jsx("div",{className:ye(vK({size:r,color:n}),e),children:t})},Gh=({className:e,children:t,inputValue:r})=>{const{size:n}=or();return O.jsx("div",{className:ye(mK({size:n}),e),children:t||`No options found${r?` for "${r}"`:""}`})},A4=C.forwardRef(({className:e,children:t,...r},n)=>{const{size:i,color:o,isDisabled:a,hasMessage:s,isInvalid:c,setHasGroup:d,groupRef:u,menuVisible:h,menuPlacement:p}=or();return C.useEffect(()=>(d(!0),()=>{d(!1)}),[d]),O.jsx("div",{ref:ga([n,u]),"data-qui":"SelectGroup",className:ye(eK({size:i,color:o,isDisabled:a,hasMessage:s,isInvalid:c,isFocused:h,menuPlacement:h?p:void 0}),e),...r,children:t})}),jY=C.forwardRef(({isAction:e=!1,className:t,isDisabled:r=!1,style:n,children:i,...o},a)=>{const{size:s,color:c,isDisabled:d}=or(),u=r||d,h=tK({size:s,color:c,isDisabled:u,isAction:e});return O.jsx("div",{ref:a,"data-qui":"SelectIcon",className:ye(h,t),style:n,role:e||o.onClick?"button":void 0,tabIndex:(e||o.onClick)&&!u?0:void 0,"aria-disabled":u,...o,children:i})}),qY=({isOpen:e,usePortal:t,controlRef:r,selectId:n,children:i})=>{const[o,a]=C.useState(null);return C.useLayoutEffect(()=>{if(t&&e&&r.current){const s=()=>{var c;const d=(c=r.current)==null?void 0:c.closest('[data-qui="SelectGroup"]'),u=d||r.current;if(!u)return;const h=u.getBoundingClientRect();a(d?{top:h.top+window.scrollY+d.clientTop,left:h.left+window.scrollX+d.clientLeft,width:d.clientWidth,height:d.clientHeight}:{top:h.top+window.scrollY,left:h.left+window.scrollX,width:h.width,height:h.height})};return s(),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}}},[e,t,r]),e?t&&o?xn.createPortal(O.jsx("div",{"data-qui":"SelectPortal","data-select-id":n,style:{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,zIndex:50,pointerEvents:"none"},children:O.jsx("div",{style:{pointerEvents:"auto"},children:i})}),document.body):O.jsx(O.Fragment,{children:i}):null},ga=e=>t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&"current"in r&&(r.current=t)})},zY=e=>{let t=0,r=window.innerHeight,n=e.parentElement;for(;n&&n!==document.body&&n!==document.documentElement;){const{overflowY:i}=window.getComputedStyle(n);if(i!=="visible"){const o=n.getBoundingClientRect();t=Math.max(t,o.top),r=Math.min(r,o.bottom)}n=n.parentElement}return{top:t,bottom:r}},D4=C.forwardRef(({placeholder:e,noOptionsMessage:t,hideNoOptions:r=!1,loadingMessage:n="Loading...",isClearable:i=!1,isSearchClearable:o=!1,isLoading:a=!1,isRequired:s=!1,hideIndicators:c=!1,hideDropdownIndicator:d=!1,searchPlacement:u="trigger",menuPlacement:h="bottom",hideSelectedOptions:p=!1,onFocus:v,onBlur:y,renderMenuHeader:m,formatOptionLabel:g,renderOption:w,optionClassName:x,renderValue:_,renderGroupHeading:S,inputRef:E,controlShouldRenderValue:I=!0,name:N,id:T,onSelectionComplete:M,"aria-label":z,"aria-labelledby":j,"aria-describedby":W,children:U,usePortal:A=!1,virtualizeThreshold:K=100,className:V,inputClassName:te,...G},re)=>{const{size:P,isInvalid:B,isDisabled:X,hasGroup:Q,downshift:D,options:$=[],getOptionLabel:H,getOptionValue:q,isOptionDisabled:Y,menuPlacement:ie,setMenuPlacement:ne,menuVisible:ve,setMenuVisible:Z,inputClassName:J}=or(),ae=te||J,he=C.useMemo(()=>{if(w)return w;if(g)return({data:ke})=>g(ke)},[w,g]),ue=C.useRef(null),de=E||ue,le=C.useRef(null),[xe,Ee]=C.useState(null),Ie=C.useRef(null),{isOpen:Te,openMenu:Me,selectedItem:Ze,inputValue:tt,highlightedIndex:Fe,getToggleButtonProps:Le,getMenuProps:ze,getInputProps:Je,getItemProps:rt,isMulti:Pt,isSearchable:gt,multipleSelection:Rt}=D,{getDropdownProps:qt}=Rt;C.useLayoutEffect(()=>{if(!Te)return;if(h==="top"||h==="bottom"){ne(h);return}const ke=le.current;if(!ke)return;const $e=()=>{const Ht=ke.getBoundingClientRect(),wr=A?{top:0,bottom:window.innerHeight}:zY(ke),Sr=wr.bottom-Ht.bottom,tr=Ht.top-wr.top,un=P==="sm"?22:P==="lg"?36:28,Yr=Math.min((D.filteredItems.length||1)*un+16,300),ci=xe==null?void 0:xe.getBoundingClientRect().height,Ni=ci&&ci>0?ci:Yr,Qa=Sr>=Ni;ne(!Qa&&tr>Sr?"top":"bottom")};$e(),window.addEventListener("resize",$e),window.addEventListener("scroll",$e,!0);const xr=xe&&typeof ResizeObserver<"u"?new ResizeObserver(()=>$e()):void 0;return xe&&(xr==null||xr.observe(xe)),()=>{window.removeEventListener("resize",$e),window.removeEventListener("scroll",$e,!0),xr==null||xr.disconnect()}},[Te,ne,P,D.filteredItems.length,h,A,xe]),C.useLayoutEffect(()=>{const ke=Te&&!(r&&D.filteredItems.length===0);return Z(ke),()=>Z(!1)},[Te,r,D.filteredItems.length,Z]);const Ot=Pt?D.selectedItems??[]:Ze?[Ze]:[],Gr=Ot.length>0,Kr=o&&!!tt&&!X&&!c,ar=i&&(Gr||!!tt)&&!X&&!c,Nn=!d&&!c,io=!Gr&&(!gt||!tt)||!I,zt={},Mt={};Object.entries(G).forEach(([ke,$e])=>{ke.startsWith("data-")||ke.startsWith("aria-")||ke==="role"?zt[ke]=$e:Mt[ke]=$e});const Lt=C.useMemo(()=>ga([le,re]),[re]),fr=ze({},{suppressRefError:!0}),kt=qt({preventKeyAction:Te}),At={ref:de,disabled:X,required:s,name:N,id:T,"aria-label":z,"aria-labelledby":j,"aria-describedby":W,"aria-invalid":B,onFocus:v,onBlur:y,...Mt},hr=gt?(Je==null?void 0:Je({...At,...kt}))??At:{...At,...kt},{ref:Mr,...Et}=hr,Bt=C.useMemo(()=>ga([Mr]),[Mr]),{ref:pr,...vr}=fr,yr=C.useRef(pr);yr.current=pr;const sr=C.useCallback(ke=>{Ee($e=>$e===ke?$e:ke),ga([yr.current])(ke)},[]),Tn=ke=>Ot.some($e=>q($e)===q(ke)),Un=ke=>p?ke.filter($e=>!Tn($e)):ke,Za=ke=>p?ke.map($e=>({...$e,options:Un($e.options)})).filter($e=>$e.options.length>0):ke,Gn=Nw($)?[]:Un(D.filteredItems),Ja={sm:22,md:28,lg:36}[P]??28,Kn=Gn.length>=K,Ri=JG({count:Kn?Gn.length:0,getScrollElement:()=>Ie.current,estimateSize:()=>Ja,overscan:5});C.useEffect(()=>{Kn&&Te&&Fe>=0&&Fe<Gn.length&&Ri.scrollToIndex(Fe,{align:"auto"})},[Fe,Kn,Te]);const{registerOnSelectionComplete:Bo}=or();C.useEffect(()=>{if(M)return Bo(M)},[M,Bo]);const Fo=gt?{}:Le({disabled:X,...kt,ref:ga([Lt,kt.ref])});return O.jsxs("div",{className:ye({relative:!Q,"flex-1 min-w-0":Q}),children:[O.jsxs(RY,{"data-qui":"SelectControl",className:V,...gt?{ref:ga([Lt,kt.ref])}:Fo,...zt,isFocused:ve,isDisabled:X,onClick:ke=>{ke.defaultPrevented||(gt?Me():D.toggleMenu())},children:[U||O.jsxs(NY,{isMulti:Pt,children:[Pt&&I&&Ot.map((ke,$e)=>O.jsx(T4,{data:ke,index:$e,isDisabled:X,children:_?_(ke):void 0},q(ke))),!Pt&&Gr&&I&&!gt&&O.jsx("div",{className:"flex items-center gap-2",children:O.jsx(PY,{data:Ot[0],isDisabled:X,children:_?_(Ot[0]):H(Ot[0])})}),gt&&u==="trigger"?O.jsx(xu,{ref:Bt,...Et,className:V,inputClassName:ae,placeholder:e}):O.jsxs(O.Fragment,{children:[O.jsx(xu,{ref:Bt,...Et,className:V,inputClassName:ae,isHidden:!0,readOnly:!0,value:Ot.map(ke=>q(ke)).join(",")}),io&&O.jsx(TY,{children:e})]})]}),O.jsxs("div",{className:ye("flex items-center size-fit gap-1",{hidden:!ar&&!Nn}),children:[Kr&&O.jsx(MY,{}),ar&&O.jsx(P4,{}),Nn&&O.jsx(M4,{...gt?Le({disabled:X,"aria-label":Te?"Close menu":"Open menu"}):{}})]})]}),!Te&&O.jsx("div",{ref:fr.ref,style:{display:"none"},"aria-hidden":"true"}),O.jsx(qY,{isOpen:Te,usePortal:A,controlRef:le,selectId:D.selectId,children:r&&D.filteredItems.length===0?O.jsx("div",{...vr,style:{display:"none"},"aria-hidden":"true"}):O.jsxs(kY,{ref:sr,...vr,placement:ie,children:[m&&m(D),gt&&u==="menu"&&O.jsx("div",{className:"p-2",children:O.jsx(xu,{ref:Bt,...Et,className:V,inputClassName:ae,autoFocus:!0,placeholder:e,onClick:ke=>ke.stopPropagation()})}),O.jsx(AY,{ref:Ie,totalHeight:Kn?Ri.getTotalSize():void 0,children:a?O.jsx("div",{className:gK({size:P}),children:n}):D.filteredItems.length===0?O.jsx(Gh,{inputValue:tt,children:typeof t=="function"?t(tt):t}):Nw($)?(()=>{const ke=Za($);return ke.length===0?O.jsx(Gh,{inputValue:tt,children:typeof t=="function"?t(tt):t}):ke.map(($e,xr)=>O.jsx(k4,{data:$e,label:$e.label,options:$e.options,renderGroupHeading:S,children:$e.options.map(Ht=>{const wr=q(Ht),Sr=Ot.some(Ni=>q(Ni)===wr),tr=D.filteredItems.indexOf(Ht),un=Fe===tr,Yr=Y(Ht),ci=rt({item:Ht,index:tr});return O.jsx(wu,{...ci,data:Ht,isDisabled:Yr,isFocused:un,isSelected:Sr,optionClassName:x,children:he?he({data:Ht,isFocused:un,isSelected:Sr,isDisabled:Yr}):void 0},`${wr}-${tr}`)})},`${$e.label}-${xr}`))})():Gn.length===0?O.jsx(Gh,{inputValue:tt,children:typeof t=="function"?t(tt):t}):Kn?Ri.getVirtualItems().map(ke=>{const $e=Gn[ke.index],xr=q($e),Ht=Ot.some(Yr=>q(Yr)===xr),wr=D.filteredItems.indexOf($e),Sr=Fe===wr,tr=Y($e),un=rt({item:$e,index:wr});return O.jsx("div",{"data-index":ke.index,ref:Ri.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${ke.start}px)`},children:O.jsx(wu,{...un,data:$e,isDisabled:tr,isFocused:Sr,isSelected:Ht,optionClassName:x,children:he?he({data:$e,isFocused:Sr,isSelected:Ht,isDisabled:tr}):void 0})},ke.key)}):Gn.map(ke=>{const $e=q(ke),xr=Ot.some(un=>q(un)===$e),Ht=D.filteredItems.indexOf(ke),wr=Fe===Ht,Sr=Y(ke),tr=rt({item:ke,index:Ht});return O.jsx(wu,{...tr,data:ke,isDisabled:Sr,isFocused:wr,isSelected:xr,optionClassName:x,children:he?he({data:ke,isFocused:wr,isSelected:xr,isDisabled:Sr}):void 0},`${$e}-${Ht}`)})})]})})]})});N4.displayName="Select.Root";A4.displayName="Select.Group";jY.displayName="Select.Icon";xu.displayName="Select.Input";T4.displayName="Select.MultiValue";P4.displayName="Select.ClearIndicator";M4.displayName="Select.DropdownIndicator";wu.displayName="Select.Option";k4.displayName="Select.OptionGroup";const LY=D4;LY.displayName="Select.Field";const Kh={Root:N4,Group:A4,Field:D4};C.createContext(void 0);const BY=({active:e,disabled:t,error:r,isOpen:n,className:i})=>ye("flex w-full items-center justify-between text-left leading-5 transition-colors duration-200",{"cursor-pointer":!t,"text-inactive-text":t,"bg-primary hover:bg-primary-hover":e&&!t,"text-negative":r&&!e&&!t,"bg-primary-hover text-body":n&&!e&&!t,"text-body":!e&&!t&&!r,"hover:bg-primary-hover hover:text-tab-active-fg":!t&&!e},i),FY=C.forwardRef(({active:e,disabled:t,error:r,isOpen:n,className:i,children:o,as:a="div",...s},c)=>{const d=BY({active:e,disabled:t,error:r,isOpen:n,className:i});return O.jsx(a,{"data-qui":"ListItem",ref:c,className:d,"aria-disabled":t,"aria-selected":e,"aria-invalid":r,"aria-expanded":n,role:s.onClick?"button":"listitem",...s,children:o})});FY.displayName="ListItem";function $Y({qodly:e,activeTab:t,forceLogin:r,canUndo:n,canRedo:i,onUndo:o,onRedo:a,onTabChange:s,restrictedByDefault:c,onRestrictedByDefaultChange:d,onForceLoginChange:u}){return O.jsx(O.Fragment,{children:O.jsx(br,{depth:1,className:"relative mb-0 flex h-auto flex-wrap items-center justify-between border-b px-4 py-3",children:O.jsx("div",{className:"flex w-full flex-wrap items-center justify-between",children:O.jsxs("div",{className:"relative flex w-full justify-between",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsxs(zh,{defaultValue:t,onTabChange:h=>s(h),children:[O.jsx(zh.Item,{label:"Roles",value:"roles","data-cy":"roles_btn_navbar",className:"min-w-[110px] place-content-center"}),O.jsx(zh.Item,{label:"Privileges",value:"privileges","data-cy":"privileges_btn_navbar",className:"min-w-[110px] place-content-center"})]}),O.jsxs("div",{className:"flex items-center gap-1",children:[O.jsx(pe.ToolbarIcon,{"data-cy":"roles-toolbar-undo-button",label:"Undo",disabled:!n,Icon:Tu.FdUndo,as:"button",onClick:n?o:void 0}),O.jsx(pe.ToolbarIcon,{"data-cy":"roles-toolbar-redo-button",label:"Redo",disabled:!i,Icon:Tu.FdRedo,as:"button",onClick:i?a:void 0})]})]}),O.jsxs("div",{className:"flex gap-2 justify-between",children:[O.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap",children:[O.jsx(Fu,{checked:c||!1,onChange:h=>{d(h)}}),O.jsx("span",{className:"px-1 text-xs",children:"Restrict Access By Default"}),O.jsx(pe.Tip,{tipKey:"editors:roles:toolbar:restrictedByDefault",alwaysOn:!0,side:"left"})]}),e===!1&&O.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap",children:[O.jsx(Fu,{checked:r||!1,onChange:h=>{u(h)}}),O.jsx("span",{className:"px-1 text-xs",children:"Force login"}),O.jsx(pe.Tip,{tipKey:"editors:roles:toolbar:forceLogin",alwaysOn:!0,side:"left"})]})]})]})})})})}const j4=C.createContext(void 0),VY=({children:e})=>{const[t,r]=C.useState(null),[n,i]=C.useState(null);function o(s){r(s),setTimeout(()=>i(s),0)}const a={selectedRole:t,deferredSelectedRole:n,selectRole:o};return O.jsx(j4.Provider,{value:a,children:e})};function cS(){const e=C.useContext(j4);if(e===void 0)throw new Error("useSelectedRole must be used within a SelectedRoleProvider");return e}var FC=function(t){return t.reduce(function(r,n){var i=n[0],o=n[1];return r[i]=o,r},{})},$C=typeof window<"u"&&window.document&&window.document.createElement?nt.useLayoutEffect:nt.useEffect,$r="top",En="bottom",_n="right",Vr="left",uS="auto",Il=[$r,En,_n,Vr],Na="start",dl="end",HY="clippingParents",q4="viewport",Es="popper",WY="reference",VC=Il.reduce(function(e,t){return e.concat([t+"-"+Na,t+"-"+dl])},[]),z4=[].concat(Il,[uS]).reduce(function(e,t){return e.concat([t,t+"-"+Na,t+"-"+dl])},[]),UY="beforeRead",GY="read",KY="afterRead",YY="beforeMain",XY="main",ZY="afterMain",JY="beforeWrite",QY="write",eX="afterWrite",tX=[UY,GY,KY,YY,XY,ZY,JY,QY,eX];function ai(e){return e?(e.nodeName||"").toLowerCase():null}function sn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function To(e){var t=sn(e).Element;return e instanceof t||e instanceof Element}function Sn(e){var t=sn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function dS(e){if(typeof ShadowRoot>"u")return!1;var t=sn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function rX(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},i=t.attributes[r]||{},o=t.elements[r];!Sn(o)||!ai(o)||(Object.assign(o.style,n),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function nX(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var i=t.elements[n],o=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),s=a.reduce(function(c,d){return c[d]="",c},{});!Sn(i)||!ai(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const iX={name:"applyStyles",enabled:!0,phase:"write",fn:rX,effect:nX,requires:["computeStyles"]};function ni(e){return e.split("-")[0]}var _o=Math.max,Yu=Math.min,Ta=Math.round;function kw(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function L4(){return!/^((?!chrome|android).)*safari/i.test(kw())}function Pa(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),i=1,o=1;t&&Sn(e)&&(i=e.offsetWidth>0&&Ta(n.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Ta(n.height)/e.offsetHeight||1);var a=To(e)?sn(e):window,s=a.visualViewport,c=!L4()&&r,d=(n.left+(c&&s?s.offsetLeft:0))/i,u=(n.top+(c&&s?s.offsetTop:0))/o,h=n.width/i,p=n.height/o;return{width:h,height:p,top:u,right:d+h,bottom:u+p,left:d,x:d,y:u}}function fS(e){var t=Pa(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function B4(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&dS(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ei(e){return sn(e).getComputedStyle(e)}function oX(e){return["table","td","th"].indexOf(ai(e))>=0}function Qi(e){return((To(e)?e.ownerDocument:e.document)||window.document).documentElement}function Od(e){return ai(e)==="html"?e:e.assignedSlot||e.parentNode||(dS(e)?e.host:null)||Qi(e)}function HC(e){return!Sn(e)||Ei(e).position==="fixed"?null:e.offsetParent}function aX(e){var t=/firefox/i.test(kw()),r=/Trident/i.test(kw());if(r&&Sn(e)){var n=Ei(e);if(n.position==="fixed")return null}var i=Od(e);for(dS(i)&&(i=i.host);Sn(i)&&["html","body"].indexOf(ai(i))<0;){var o=Ei(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Rl(e){for(var t=sn(e),r=HC(e);r&&oX(r)&&Ei(r).position==="static";)r=HC(r);return r&&(ai(r)==="html"||ai(r)==="body"&&Ei(r).position==="static")?t:r||aX(e)||t}function hS(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function tl(e,t,r){return _o(e,Yu(t,r))}function sX(e,t,r){var n=tl(e,t,r);return n>r?r:n}function F4(){return{top:0,right:0,bottom:0,left:0}}function $4(e){return Object.assign({},F4(),e)}function V4(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var lX=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,$4(typeof t!="number"?t:V4(t,Il))};function cX(e){var t,r=e.state,n=e.name,i=e.options,o=r.elements.arrow,a=r.modifiersData.popperOffsets,s=ni(r.placement),c=hS(s),d=[Vr,_n].indexOf(s)>=0,u=d?"height":"width";if(!(!o||!a)){var h=lX(i.padding,r),p=fS(o),v=c==="y"?$r:Vr,y=c==="y"?En:_n,m=r.rects.reference[u]+r.rects.reference[c]-a[c]-r.rects.popper[u],g=a[c]-r.rects.reference[c],w=Rl(o),x=w?c==="y"?w.clientHeight||0:w.clientWidth||0:0,_=m/2-g/2,S=h[v],E=x-p[u]-h[y],I=x/2-p[u]/2+_,N=tl(S,I,E),T=c;r.modifiersData[n]=(t={},t[T]=N,t.centerOffset=N-I,t)}}function uX(e){var t=e.state,r=e.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||B4(t.elements.popper,i)&&(t.elements.arrow=i))}const dX={name:"arrow",enabled:!0,phase:"main",fn:cX,effect:uX,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ma(e){return e.split("-")[1]}var fX={top:"auto",right:"auto",bottom:"auto",left:"auto"};function hX(e,t){var r=e.x,n=e.y,i=t.devicePixelRatio||1;return{x:Ta(r*i)/i||0,y:Ta(n*i)/i||0}}function WC(e){var t,r=e.popper,n=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,d=e.adaptive,u=e.roundOffsets,h=e.isFixed,p=a.x,v=p===void 0?0:p,y=a.y,m=y===void 0?0:y,g=typeof u=="function"?u({x:v,y:m}):{x:v,y:m};v=g.x,m=g.y;var w=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),_=Vr,S=$r,E=window;if(d){var I=Rl(r),N="clientHeight",T="clientWidth";if(I===sn(r)&&(I=Qi(r),Ei(I).position!=="static"&&s==="absolute"&&(N="scrollHeight",T="scrollWidth")),I=I,i===$r||(i===Vr||i===_n)&&o===dl){S=En;var M=h&&I===E&&E.visualViewport?E.visualViewport.height:I[N];m-=M-n.height,m*=c?1:-1}if(i===Vr||(i===$r||i===En)&&o===dl){_=_n;var z=h&&I===E&&E.visualViewport?E.visualViewport.width:I[T];v-=z-n.width,v*=c?1:-1}}var j=Object.assign({position:s},d&&fX),W=u===!0?hX({x:v,y:m},sn(r)):{x:v,y:m};if(v=W.x,m=W.y,c){var U;return Object.assign({},j,(U={},U[S]=x?"0":"",U[_]=w?"0":"",U.transform=(E.devicePixelRatio||1)<=1?"translate("+v+"px, "+m+"px)":"translate3d("+v+"px, "+m+"px, 0)",U))}return Object.assign({},j,(t={},t[S]=x?m+"px":"",t[_]=w?v+"px":"",t.transform="",t))}function pX(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=n===void 0?!0:n,o=r.adaptive,a=o===void 0?!0:o,s=r.roundOffsets,c=s===void 0?!0:s,d={placement:ni(t.placement),variation:Ma(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,WC(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,WC(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const vX={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:pX,data:{}};var Uc={passive:!0};function gX(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,o=i===void 0?!0:i,a=n.resize,s=a===void 0?!0:a,c=sn(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",r.update,Uc)}),s&&c.addEventListener("resize",r.update,Uc),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",r.update,Uc)}),s&&c.removeEventListener("resize",r.update,Uc)}}const mX={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:gX,data:{}};var bX={left:"right",right:"left",bottom:"top",top:"bottom"};function Su(e){return e.replace(/left|right|bottom|top/g,function(t){return bX[t]})}var yX={start:"end",end:"start"};function UC(e){return e.replace(/start|end/g,function(t){return yX[t]})}function pS(e){var t=sn(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function vS(e){return Pa(Qi(e)).left+pS(e).scrollLeft}function xX(e,t){var r=sn(e),n=Qi(e),i=r.visualViewport,o=n.clientWidth,a=n.clientHeight,s=0,c=0;if(i){o=i.width,a=i.height;var d=L4();(d||!d&&t==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:s+vS(e),y:c}}function wX(e){var t,r=Qi(e),n=pS(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=_o(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=_o(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+vS(e),c=-n.scrollTop;return Ei(i||r).direction==="rtl"&&(s+=_o(r.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}function gS(e){var t=Ei(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function H4(e){return["html","body","#document"].indexOf(ai(e))>=0?e.ownerDocument.body:Sn(e)&&gS(e)?e:H4(Od(e))}function rl(e,t){var r;t===void 0&&(t=[]);var n=H4(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=sn(n),a=i?[o].concat(o.visualViewport||[],gS(n)?n:[]):n,s=t.concat(a);return i?s:s.concat(rl(Od(a)))}function Aw(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function SX(e,t){var r=Pa(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function GC(e,t,r){return t===q4?Aw(xX(e,r)):To(t)?SX(t,r):Aw(wX(Qi(e)))}function EX(e){var t=rl(Od(e)),r=["absolute","fixed"].indexOf(Ei(e).position)>=0,n=r&&Sn(e)?Rl(e):e;return To(n)?t.filter(function(i){return To(i)&&B4(i,n)&&ai(i)!=="body"}):[]}function _X(e,t,r,n){var i=t==="clippingParents"?EX(e):[].concat(t),o=[].concat(i,[r]),a=o[0],s=o.reduce(function(c,d){var u=GC(e,d,n);return c.top=_o(u.top,c.top),c.right=Yu(u.right,c.right),c.bottom=Yu(u.bottom,c.bottom),c.left=_o(u.left,c.left),c},GC(e,a,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function W4(e){var t=e.reference,r=e.element,n=e.placement,i=n?ni(n):null,o=n?Ma(n):null,a=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,c;switch(i){case $r:c={x:a,y:t.y-r.height};break;case En:c={x:a,y:t.y+t.height};break;case _n:c={x:t.x+t.width,y:s};break;case Vr:c={x:t.x-r.width,y:s};break;default:c={x:t.x,y:t.y}}var d=i?hS(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case Na:c[d]=c[d]-(t[u]/2-r[u]/2);break;case dl:c[d]=c[d]+(t[u]/2-r[u]/2);break}}return c}function fl(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=n===void 0?e.placement:n,o=r.strategy,a=o===void 0?e.strategy:o,s=r.boundary,c=s===void 0?HY:s,d=r.rootBoundary,u=d===void 0?q4:d,h=r.elementContext,p=h===void 0?Es:h,v=r.altBoundary,y=v===void 0?!1:v,m=r.padding,g=m===void 0?0:m,w=$4(typeof g!="number"?g:V4(g,Il)),x=p===Es?WY:Es,_=e.rects.popper,S=e.elements[y?x:p],E=_X(To(S)?S:S.contextElement||Qi(e.elements.popper),c,u,a),I=Pa(e.elements.reference),N=W4({reference:I,element:_,placement:i}),T=Aw(Object.assign({},_,N)),M=p===Es?T:I,z={top:E.top-M.top+w.top,bottom:M.bottom-E.bottom+w.bottom,left:E.left-M.left+w.left,right:M.right-E.right+w.right},j=e.modifiersData.offset;if(p===Es&&j){var W=j[i];Object.keys(z).forEach(function(U){var A=[_n,En].indexOf(U)>=0?1:-1,K=[$r,En].indexOf(U)>=0?"y":"x";z[U]+=W[K]*A})}return z}function OX(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=r.boundary,o=r.rootBoundary,a=r.padding,s=r.flipVariations,c=r.allowedAutoPlacements,d=c===void 0?z4:c,u=Ma(n),h=u?s?VC:VC.filter(function(y){return Ma(y)===u}):Il,p=h.filter(function(y){return d.indexOf(y)>=0});p.length===0&&(p=h);var v=p.reduce(function(y,m){return y[m]=fl(e,{placement:m,boundary:i,rootBoundary:o,padding:a})[ni(m)],y},{});return Object.keys(v).sort(function(y,m){return v[y]-v[m]})}function CX(e){if(ni(e)===uS)return[];var t=Su(e);return[UC(e),t,UC(t)]}function IX(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,o=i===void 0?!0:i,a=r.altAxis,s=a===void 0?!0:a,c=r.fallbackPlacements,d=r.padding,u=r.boundary,h=r.rootBoundary,p=r.altBoundary,v=r.flipVariations,y=v===void 0?!0:v,m=r.allowedAutoPlacements,g=t.options.placement,w=ni(g),x=w===g,_=c||(x||!y?[Su(g)]:CX(g)),S=[g].concat(_).reduce(function(D,$){return D.concat(ni($)===uS?OX(t,{placement:$,boundary:u,rootBoundary:h,padding:d,flipVariations:y,allowedAutoPlacements:m}):$)},[]),E=t.rects.reference,I=t.rects.popper,N=new Map,T=!0,M=S[0],z=0;z<S.length;z++){var j=S[z],W=ni(j),U=Ma(j)===Na,A=[$r,En].indexOf(W)>=0,K=A?"width":"height",V=fl(t,{placement:j,boundary:u,rootBoundary:h,altBoundary:p,padding:d}),te=A?U?_n:Vr:U?En:$r;E[K]>I[K]&&(te=Su(te));var G=Su(te),re=[];if(o&&re.push(V[W]<=0),s&&re.push(V[te]<=0,V[G]<=0),re.every(function(D){return D})){M=j,T=!1;break}N.set(j,re)}if(T)for(var P=y?3:1,B=function($){var H=S.find(function(q){var Y=N.get(q);if(Y)return Y.slice(0,$).every(function(ie){return ie})});if(H)return M=H,"break"},X=P;X>0;X--){var Q=B(X);if(Q==="break")break}t.placement!==M&&(t.modifiersData[n]._skip=!0,t.placement=M,t.reset=!0)}}const RX={name:"flip",enabled:!0,phase:"main",fn:IX,requiresIfExists:["offset"],data:{_skip:!1}};function KC(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function YC(e){return[$r,_n,En,Vr].some(function(t){return e[t]>=0})}function NX(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=fl(t,{elementContext:"reference"}),s=fl(t,{altBoundary:!0}),c=KC(a,n),d=KC(s,i,o),u=YC(c),h=YC(d);t.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}const TX={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:NX};function PX(e,t,r){var n=ni(e),i=[Vr,$r].indexOf(n)>=0?-1:1,o=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Vr,_n].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}function MX(e){var t=e.state,r=e.options,n=e.name,i=r.offset,o=i===void 0?[0,0]:i,a=z4.reduce(function(u,h){return u[h]=PX(h,t.rects,o),u},{}),s=a[t.placement],c=s.x,d=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=d),t.modifiersData[n]=a}const kX={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:MX};function AX(e){var t=e.state,r=e.name;t.modifiersData[r]=W4({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const DX={name:"popperOffsets",enabled:!0,phase:"read",fn:AX,data:{}};function jX(e){return e==="x"?"y":"x"}function qX(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,o=i===void 0?!0:i,a=r.altAxis,s=a===void 0?!1:a,c=r.boundary,d=r.rootBoundary,u=r.altBoundary,h=r.padding,p=r.tether,v=p===void 0?!0:p,y=r.tetherOffset,m=y===void 0?0:y,g=fl(t,{boundary:c,rootBoundary:d,padding:h,altBoundary:u}),w=ni(t.placement),x=Ma(t.placement),_=!x,S=hS(w),E=jX(S),I=t.modifiersData.popperOffsets,N=t.rects.reference,T=t.rects.popper,M=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,z=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,W={x:0,y:0};if(I){if(o){var U,A=S==="y"?$r:Vr,K=S==="y"?En:_n,V=S==="y"?"height":"width",te=I[S],G=te+g[A],re=te-g[K],P=v?-T[V]/2:0,B=x===Na?N[V]:T[V],X=x===Na?-T[V]:-N[V],Q=t.elements.arrow,D=v&&Q?fS(Q):{width:0,height:0},$=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:F4(),H=$[A],q=$[K],Y=tl(0,N[V],D[V]),ie=_?N[V]/2-P-Y-H-z.mainAxis:B-Y-H-z.mainAxis,ne=_?-N[V]/2+P+Y+q+z.mainAxis:X+Y+q+z.mainAxis,ve=t.elements.arrow&&Rl(t.elements.arrow),Z=ve?S==="y"?ve.clientTop||0:ve.clientLeft||0:0,J=(U=j==null?void 0:j[S])!=null?U:0,ae=te+ie-J-Z,he=te+ne-J,ue=tl(v?Yu(G,ae):G,te,v?_o(re,he):re);I[S]=ue,W[S]=ue-te}if(s){var de,le=S==="x"?$r:Vr,xe=S==="x"?En:_n,Ee=I[E],Ie=E==="y"?"height":"width",Te=Ee+g[le],Me=Ee-g[xe],Ze=[$r,Vr].indexOf(w)!==-1,tt=(de=j==null?void 0:j[E])!=null?de:0,Fe=Ze?Te:Ee-N[Ie]-T[Ie]-tt+z.altAxis,Le=Ze?Ee+N[Ie]+T[Ie]-tt-z.altAxis:Me,ze=v&&Ze?sX(Fe,Ee,Le):tl(v?Fe:Te,Ee,v?Le:Me);I[E]=ze,W[E]=ze-Ee}t.modifiersData[n]=W}}const zX={name:"preventOverflow",enabled:!0,phase:"main",fn:qX,requiresIfExists:["offset"]};function LX(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function BX(e){return e===sn(e)||!Sn(e)?pS(e):LX(e)}function FX(e){var t=e.getBoundingClientRect(),r=Ta(t.width)/e.offsetWidth||1,n=Ta(t.height)/e.offsetHeight||1;return r!==1||n!==1}function $X(e,t,r){r===void 0&&(r=!1);var n=Sn(t),i=Sn(t)&&FX(t),o=Qi(t),a=Pa(e,i,r),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((ai(t)!=="body"||gS(o))&&(s=BX(t)),Sn(t)?(c=Pa(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=vS(o))),{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function VX(e){var t=new Map,r=new Set,n=[];e.forEach(function(o){t.set(o.name,o)});function i(o){r.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!r.has(s)){var c=t.get(s);c&&i(c)}}),n.push(o)}return e.forEach(function(o){r.has(o.name)||i(o)}),n}function HX(e){var t=VX(e);return tX.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function WX(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function UX(e){var t=e.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var XC={placement:"bottom",modifiers:[],strategy:"absolute"};function ZC(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function GX(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,o=i===void 0?XC:i;return function(s,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},XC,o),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},h=[],p=!1,v={state:u,setOptions:function(w){var x=typeof w=="function"?w(u.options):w;m(),u.options=Object.assign({},o,u.options,x),u.scrollParents={reference:To(s)?rl(s):s.contextElement?rl(s.contextElement):[],popper:rl(c)};var _=HX(UX([].concat(n,u.options.modifiers)));return u.orderedModifiers=_.filter(function(S){return S.enabled}),y(),v.update()},forceUpdate:function(){if(!p){var w=u.elements,x=w.reference,_=w.popper;if(ZC(x,_)){u.rects={reference:$X(x,Rl(_),u.options.strategy==="fixed"),popper:fS(_)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(z){return u.modifiersData[z.name]=Object.assign({},z.data)});for(var S=0;S<u.orderedModifiers.length;S++){if(u.reset===!0){u.reset=!1,S=-1;continue}var E=u.orderedModifiers[S],I=E.fn,N=E.options,T=N===void 0?{}:N,M=E.name;typeof I=="function"&&(u=I({state:u,options:T,name:M,instance:v})||u)}}}},update:WX(function(){return new Promise(function(g){v.forceUpdate(),g(u)})}),destroy:function(){m(),p=!0}};if(!ZC(s,c))return v;v.setOptions(d).then(function(g){!p&&d.onFirstUpdate&&d.onFirstUpdate(g)});function y(){u.orderedModifiers.forEach(function(g){var w=g.name,x=g.options,_=x===void 0?{}:x,S=g.effect;if(typeof S=="function"){var E=S({state:u,name:w,instance:v,options:_}),I=function(){};h.push(E||I)}})}function m(){h.forEach(function(g){return g()}),h=[]}return v}}var KX=[mX,DX,vX,iX,kX,RX,zX,dX,TX],YX=GX({defaultModifiers:KX}),jt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yh,JC;function XX(){if(JC)return Yh;JC=1;var e=typeof Element<"u",t=typeof Map=="function",r=typeof Set=="function",n=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function i(o,a){if(o===a)return!0;if(o&&a&&typeof o=="object"&&typeof a=="object"){if(o.constructor!==a.constructor)return!1;var s,c,d;if(Array.isArray(o)){if(s=o.length,s!=a.length)return!1;for(c=s;c--!==0;)if(!i(o[c],a[c]))return!1;return!0}var u;if(t&&o instanceof Map&&a instanceof Map){if(o.size!==a.size)return!1;for(u=o.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;for(u=o.entries();!(c=u.next()).done;)if(!i(c.value[1],a.get(c.value[0])))return!1;return!0}if(r&&o instanceof Set&&a instanceof Set){if(o.size!==a.size)return!1;for(u=o.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(n&&ArrayBuffer.isView(o)&&ArrayBuffer.isView(a)){if(s=o.length,s!=a.length)return!1;for(c=s;c--!==0;)if(o[c]!==a[c])return!1;return!0}if(o.constructor===RegExp)return o.source===a.source&&o.flags===a.flags;if(o.valueOf!==Object.prototype.valueOf&&typeof o.valueOf=="function"&&typeof a.valueOf=="function")return o.valueOf()===a.valueOf();if(o.toString!==Object.prototype.toString&&typeof o.toString=="function"&&typeof a.toString=="function")return o.toString()===a.toString();if(d=Object.keys(o),s=d.length,s!==Object.keys(a).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(a,d[c]))return!1;if(e&&o instanceof Element)return!1;for(c=s;c--!==0;)if(!((d[c]==="_owner"||d[c]==="__v"||d[c]==="__o")&&o.$$typeof)&&!i(o[d[c]],a[d[c]]))return!1;return!0}return o!==o&&a!==a}return Yh=function(a,s){try{return i(a,s)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},Yh}var ZX=XX();const JX=eo(ZX);var QX=[],Cd=function(t,r,n){n===void 0&&(n={});var i=nt.useRef(null),o={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||QX},a=nt.useState({styles:{popper:{position:o.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=a[0],c=a[1],d=nt.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(v){var y=v.state,m=Object.keys(y.elements);gV.flushSync(function(){c({styles:FC(m.map(function(g){return[g,y.styles[g]||{}]})),attributes:FC(m.map(function(g){return[g,y.attributes[g]]}))})})},requires:["computeStyles"]}},[]),u=nt.useMemo(function(){var p={onFirstUpdate:o.onFirstUpdate,placement:o.placement,strategy:o.strategy,modifiers:[].concat(o.modifiers,[d,{name:"applyStyles",enabled:!1}])};return JX(i.current,p)?i.current||p:(i.current=p,p)},[o.onFirstUpdate,o.placement,o.strategy,o.modifiers,d]),h=nt.useRef();return $C(function(){h.current&&h.current.setOptions(u)},[u]),$C(function(){if(!(t==null||r==null)){var p=n.createPopper||YX,v=p(t,r,u);return h.current=v,function(){v.destroy(),h.current=null}}},[t,r,n.createPopper]),{state:h.current?h.current.state:null,styles:s.styles,attributes:s.attributes,update:h.current?h.current.update:null,forceUpdate:h.current?h.current.forceUpdate:null}};const U4=({tab:e})=>O.jsx(br,{depth:1,className:"flex flex-1 items-center justify-center border-l-[0.5px]",children:O.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-4 text-inactive-text",children:[O.jsx(on,{className:"h-10 w-10"}),O.jsxs("div",{className:"font-semibold",children:["No ",e," Selected"]}),O.jsxs("div",{className:"text-sm",children:["Click on a ",e," in the Sidebar to select it."]})]})});function mS(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xh,QC;function eZ(){if(QC)return Xh;QC=1;function e(){this.__data__=[],this.size=0}return Xh=e,Xh}var Zh,e2;function Va(){if(e2)return Zh;e2=1;function e(t,r){return t===r||t!==t&&r!==r}return Zh=e,Zh}var Jh,t2;function Id(){if(t2)return Jh;t2=1;var e=Va();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return Jh=t,Jh}var Qh,r2;function tZ(){if(r2)return Qh;r2=1;var e=Id(),t=Array.prototype,r=t.splice;function n(i){var o=this.__data__,a=e(o,i);if(a<0)return!1;var s=o.length-1;return a==s?o.pop():r.call(o,a,1),--this.size,!0}return Qh=n,Qh}var ep,n2;function rZ(){if(n2)return ep;n2=1;var e=Id();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return ep=t,ep}var tp,i2;function nZ(){if(i2)return tp;i2=1;var e=Id();function t(r){return e(this.__data__,r)>-1}return tp=t,tp}var rp,o2;function iZ(){if(o2)return rp;o2=1;var e=Id();function t(r,n){var i=this.__data__,o=e(i,r);return o<0?(++this.size,i.push([r,n])):i[o][1]=n,this}return rp=t,rp}var np,a2;function Rd(){if(a2)return np;a2=1;var e=eZ(),t=tZ(),r=rZ(),n=nZ(),i=iZ();function o(a){var s=-1,c=a==null?0:a.length;for(this.clear();++s<c;){var d=a[s];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,np=o,np}var ip,s2;function oZ(){if(s2)return ip;s2=1;var e=Rd();function t(){this.__data__=new e,this.size=0}return ip=t,ip}var op,l2;function aZ(){if(l2)return op;l2=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return op=e,op}var ap,c2;function sZ(){if(c2)return ap;c2=1;function e(t){return this.__data__.get(t)}return ap=e,ap}var sp,u2;function lZ(){if(u2)return sp;u2=1;function e(t){return this.__data__.has(t)}return sp=e,sp}var lp,d2;function G4(){if(d2)return lp;d2=1;var e=typeof jt=="object"&&jt&&jt.Object===Object&&jt;return lp=e,lp}var cp,f2;function Vn(){if(f2)return cp;f2=1;var e=G4(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return cp=r,cp}var up,h2;function Ha(){if(h2)return up;h2=1;var e=Vn(),t=e.Symbol;return up=t,up}var dp,p2;function cZ(){if(p2)return dp;p2=1;var e=Ha(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function o(a){var s=r.call(a,i),c=a[i];try{a[i]=void 0;var d=!0}catch{}var u=n.call(a);return d&&(s?a[i]=c:delete a[i]),u}return dp=o,dp}var fp,v2;function uZ(){if(v2)return fp;v2=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return fp=r,fp}var hp,g2;function ko(){if(g2)return hp;g2=1;var e=Ha(),t=cZ(),r=uZ(),n="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function a(s){return s==null?s===void 0?i:n:o&&o in Object(s)?t(s):r(s)}return hp=a,hp}var pp,m2;function On(){if(m2)return pp;m2=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return pp=e,pp}var vp,b2;function Nl(){if(b2)return vp;b2=1;var e=ko(),t=On(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function a(s){if(!t(s))return!1;var c=e(s);return c==n||c==i||c==r||c==o}return vp=a,vp}var gp,y2;function dZ(){if(y2)return gp;y2=1;var e=Vn(),t=e["__core-js_shared__"];return gp=t,gp}var mp,x2;function fZ(){if(x2)return mp;x2=1;var e=dZ(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return mp=r,mp}var bp,w2;function K4(){if(w2)return bp;w2=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return bp=r,bp}var yp,S2;function hZ(){if(S2)return yp;S2=1;var e=Nl(),t=fZ(),r=On(),n=K4(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,c=a.toString,d=s.hasOwnProperty,u=RegExp("^"+c.call(d).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(p){if(!r(p)||t(p))return!1;var v=e(p)?u:o;return v.test(n(p))}return yp=h,yp}var xp,E2;function pZ(){if(E2)return xp;E2=1;function e(t,r){return t==null?void 0:t[r]}return xp=e,xp}var wp,_2;function Ao(){if(_2)return wp;_2=1;var e=hZ(),t=pZ();function r(n,i){var o=t(n,i);return e(o)?o:void 0}return wp=r,wp}var Sp,O2;function bS(){if(O2)return Sp;O2=1;var e=Ao(),t=Vn(),r=e(t,"Map");return Sp=r,Sp}var Ep,C2;function Nd(){if(C2)return Ep;C2=1;var e=Ao(),t=e(Object,"create");return Ep=t,Ep}var _p,I2;function vZ(){if(I2)return _p;I2=1;var e=Nd();function t(){this.__data__=e?e(null):{},this.size=0}return _p=t,_p}var Op,R2;function gZ(){if(R2)return Op;R2=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Op=e,Op}var Cp,N2;function mZ(){if(N2)return Cp;N2=1;var e=Nd(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(o){var a=this.__data__;if(e){var s=a[o];return s===t?void 0:s}return n.call(a,o)?a[o]:void 0}return Cp=i,Cp}var Ip,T2;function bZ(){if(T2)return Ip;T2=1;var e=Nd(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var o=this.__data__;return e?o[i]!==void 0:r.call(o,i)}return Ip=n,Ip}var Rp,P2;function yZ(){if(P2)return Rp;P2=1;var e=Nd(),t="__lodash_hash_undefined__";function r(n,i){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=e&&i===void 0?t:i,this}return Rp=r,Rp}var Np,M2;function xZ(){if(M2)return Np;M2=1;var e=vZ(),t=gZ(),r=mZ(),n=bZ(),i=yZ();function o(a){var s=-1,c=a==null?0:a.length;for(this.clear();++s<c;){var d=a[s];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,Np=o,Np}var Tp,k2;function wZ(){if(k2)return Tp;k2=1;var e=xZ(),t=Rd(),r=bS();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Tp=n,Tp}var Pp,A2;function SZ(){if(A2)return Pp;A2=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Pp=e,Pp}var Mp,D2;function Td(){if(D2)return Mp;D2=1;var e=SZ();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Mp=t,Mp}var kp,j2;function EZ(){if(j2)return kp;j2=1;var e=Td();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return kp=t,kp}var Ap,q2;function _Z(){if(q2)return Ap;q2=1;var e=Td();function t(r){return e(this,r).get(r)}return Ap=t,Ap}var Dp,z2;function OZ(){if(z2)return Dp;z2=1;var e=Td();function t(r){return e(this,r).has(r)}return Dp=t,Dp}var jp,L2;function CZ(){if(L2)return jp;L2=1;var e=Td();function t(r,n){var i=e(this,r),o=i.size;return i.set(r,n),this.size+=i.size==o?0:1,this}return jp=t,jp}var qp,B2;function yS(){if(B2)return qp;B2=1;var e=wZ(),t=EZ(),r=_Z(),n=OZ(),i=CZ();function o(a){var s=-1,c=a==null?0:a.length;for(this.clear();++s<c;){var d=a[s];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,qp=o,qp}var zp,F2;function IZ(){if(F2)return zp;F2=1;var e=Rd(),t=bS(),r=yS(),n=200;function i(o,a){var s=this.__data__;if(s instanceof e){var c=s.__data__;if(!t||c.length<n-1)return c.push([o,a]),this.size=++s.size,this;s=this.__data__=new r(c)}return s.set(o,a),this.size=s.size,this}return zp=i,zp}var Lp,$2;function Pd(){if($2)return Lp;$2=1;var e=Rd(),t=oZ(),r=aZ(),n=sZ(),i=lZ(),o=IZ();function a(s){var c=this.__data__=new e(s);this.size=c.size}return a.prototype.clear=t,a.prototype.delete=r,a.prototype.get=n,a.prototype.has=i,a.prototype.set=o,Lp=a,Lp}var Bp,V2;function xS(){if(V2)return Bp;V2=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n<i&&r(t[n],n,t)!==!1;);return t}return Bp=e,Bp}var Fp,H2;function Y4(){if(H2)return Fp;H2=1;var e=Ao(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Fp=t,Fp}var $p,W2;function Md(){if(W2)return $p;W2=1;var e=Y4();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return $p=t,$p}var Vp,U2;function kd(){if(U2)return Vp;U2=1;var e=Md(),t=Va(),r=Object.prototype,n=r.hasOwnProperty;function i(o,a,s){var c=o[a];(!(n.call(o,a)&&t(c,s))||s===void 0&&!(a in o))&&e(o,a,s)}return Vp=i,Vp}var Hp,G2;function Tl(){if(G2)return Hp;G2=1;var e=kd(),t=Md();function r(n,i,o,a){var s=!o;o||(o={});for(var c=-1,d=i.length;++c<d;){var u=i[c],h=a?a(o[u],n[u],u,o,n):void 0;h===void 0&&(h=n[u]),s?t(o,u,h):e(o,u,h)}return o}return Hp=r,Hp}var Wp,K2;function RZ(){if(K2)return Wp;K2=1;function e(t,r){for(var n=-1,i=Array(t);++n<t;)i[n]=r(n);return i}return Wp=e,Wp}var Up,Y2;function si(){if(Y2)return Up;Y2=1;function e(t){return t!=null&&typeof t=="object"}return Up=e,Up}var Gp,X2;function NZ(){if(X2)return Gp;X2=1;var e=ko(),t=si(),r="[object Arguments]";function n(i){return t(i)&&e(i)==r}return Gp=n,Gp}var Kp,Z2;function Pl(){if(Z2)return Kp;Z2=1;var e=NZ(),t=si(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(a){return t(a)&&n.call(a,"callee")&&!i.call(a,"callee")};return Kp=o,Kp}var Yp,J2;function Ut(){if(J2)return Yp;J2=1;var e=Array.isArray;return Yp=e,Yp}var Hs={exports:{}},Xp,Q2;function TZ(){if(Q2)return Xp;Q2=1;function e(){return!1}return Xp=e,Xp}Hs.exports;var eI;function Wa(){return eI||(eI=1,(function(e,t){var r=Vn(),n=TZ(),i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===i,s=a?r.Buffer:void 0,c=s?s.isBuffer:void 0,d=c||n;e.exports=d})(Hs,Hs.exports)),Hs.exports}var Zp,tI;function Ad(){if(tI)return Zp;tI=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,i){var o=typeof n;return i=i??e,!!i&&(o=="number"||o!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<i}return Zp=r,Zp}var Jp,rI;function wS(){if(rI)return Jp;rI=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Jp=t,Jp}var Qp,nI;function PZ(){if(nI)return Qp;nI=1;var e=ko(),t=wS(),r=si(),n="[object Arguments]",i="[object Array]",o="[object Boolean]",a="[object Date]",s="[object Error]",c="[object Function]",d="[object Map]",u="[object Number]",h="[object Object]",p="[object RegExp]",v="[object Set]",y="[object String]",m="[object WeakMap]",g="[object ArrayBuffer]",w="[object DataView]",x="[object Float32Array]",_="[object Float64Array]",S="[object Int8Array]",E="[object Int16Array]",I="[object Int32Array]",N="[object Uint8Array]",T="[object Uint8ClampedArray]",M="[object Uint16Array]",z="[object Uint32Array]",j={};j[x]=j[_]=j[S]=j[E]=j[I]=j[N]=j[T]=j[M]=j[z]=!0,j[n]=j[i]=j[g]=j[o]=j[w]=j[a]=j[s]=j[c]=j[d]=j[u]=j[h]=j[p]=j[v]=j[y]=j[m]=!1;function W(U){return r(U)&&t(U.length)&&!!j[e(U)]}return Qp=W,Qp}var ev,iI;function Dd(){if(iI)return ev;iI=1;function e(t){return function(r){return t(r)}}return ev=e,ev}var Ws={exports:{}};Ws.exports;var oI;function SS(){return oI||(oI=1,(function(e,t){var r=G4(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===n,a=o&&r.process,s=(function(){try{var c=i&&i.require&&i.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}})();e.exports=s})(Ws,Ws.exports)),Ws.exports}var tv,aI;function Ml(){if(aI)return tv;aI=1;var e=PZ(),t=Dd(),r=SS(),n=r&&r.isTypedArray,i=n?t(n):e;return tv=i,tv}var rv,sI;function X4(){if(sI)return rv;sI=1;var e=RZ(),t=Pl(),r=Ut(),n=Wa(),i=Ad(),o=Ml(),a=Object.prototype,s=a.hasOwnProperty;function c(d,u){var h=r(d),p=!h&&t(d),v=!h&&!p&&n(d),y=!h&&!p&&!v&&o(d),m=h||p||v||y,g=m?e(d.length,String):[],w=g.length;for(var x in d)(u||s.call(d,x))&&!(m&&(x=="length"||v&&(x=="offset"||x=="parent")||y&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||i(x,w)))&&g.push(x);return g}return rv=c,rv}var nv,lI;function jd(){if(lI)return nv;lI=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return nv=t,nv}var iv,cI;function Z4(){if(cI)return iv;cI=1;function e(t,r){return function(n){return t(r(n))}}return iv=e,iv}var ov,uI;function MZ(){if(uI)return ov;uI=1;var e=Z4(),t=e(Object.keys,Object);return ov=t,ov}var av,dI;function ES(){if(dI)return av;dI=1;var e=jd(),t=MZ(),r=Object.prototype,n=r.hasOwnProperty;function i(o){if(!e(o))return t(o);var a=[];for(var s in Object(o))n.call(o,s)&&s!="constructor"&&a.push(s);return a}return av=i,av}var sv,fI;function Oi(){if(fI)return sv;fI=1;var e=Nl(),t=wS();function r(n){return n!=null&&t(n.length)&&!e(n)}return sv=r,sv}var lv,hI;function to(){if(hI)return lv;hI=1;var e=X4(),t=ES(),r=Oi();function n(i){return r(i)?e(i):t(i)}return lv=n,lv}var cv,pI;function kZ(){if(pI)return cv;pI=1;var e=Tl(),t=to();function r(n,i){return n&&e(i,t(i),n)}return cv=r,cv}var uv,vI;function AZ(){if(vI)return uv;vI=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return uv=e,uv}var dv,gI;function DZ(){if(gI)return dv;gI=1;var e=On(),t=jd(),r=AZ(),n=Object.prototype,i=n.hasOwnProperty;function o(a){if(!e(a))return r(a);var s=t(a),c=[];for(var d in a)d=="constructor"&&(s||!i.call(a,d))||c.push(d);return c}return dv=o,dv}var fv,mI;function Do(){if(mI)return fv;mI=1;var e=X4(),t=DZ(),r=Oi();function n(i){return r(i)?e(i,!0):t(i)}return fv=n,fv}var hv,bI;function jZ(){if(bI)return hv;bI=1;var e=Tl(),t=Do();function r(n,i){return n&&e(i,t(i),n)}return hv=r,hv}var Us={exports:{}};Us.exports;var yI;function J4(){return yI||(yI=1,(function(e,t){var r=Vn(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===n,a=o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;function c(d,u){if(u)return d.slice();var h=d.length,p=s?s(h):new d.constructor(h);return d.copy(p),p}e.exports=c})(Us,Us.exports)),Us.exports}var pv,xI;function Q4(){if(xI)return pv;xI=1;function e(t,r){var n=-1,i=t.length;for(r||(r=Array(i));++n<i;)r[n]=t[n];return r}return pv=e,pv}var vv,wI;function e6(){if(wI)return vv;wI=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,o=0,a=[];++n<i;){var s=t[n];r(s,n,t)&&(a[o++]=s)}return a}return vv=e,vv}var gv,SI;function t6(){if(SI)return gv;SI=1;function e(){return[]}return gv=e,gv}var mv,EI;function _S(){if(EI)return mv;EI=1;var e=e6(),t=t6(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(a){return a==null?[]:(a=Object(a),e(i(a),function(s){return n.call(a,s)}))}:t;return mv=o,mv}var bv,_I;function qZ(){if(_I)return bv;_I=1;var e=Tl(),t=_S();function r(n,i){return e(n,t(n),i)}return bv=r,bv}var yv,OI;function OS(){if(OI)return yv;OI=1;function e(t,r){for(var n=-1,i=r.length,o=t.length;++n<i;)t[o+n]=r[n];return t}return yv=e,yv}var xv,CI;function qd(){if(CI)return xv;CI=1;var e=Z4(),t=e(Object.getPrototypeOf,Object);return xv=t,xv}var wv,II;function r6(){if(II)return wv;II=1;var e=OS(),t=qd(),r=_S(),n=t6(),i=Object.getOwnPropertySymbols,o=i?function(a){for(var s=[];a;)e(s,r(a)),a=t(a);return s}:n;return wv=o,wv}var Sv,RI;function zZ(){if(RI)return Sv;RI=1;var e=Tl(),t=r6();function r(n,i){return e(n,t(n),i)}return Sv=r,Sv}var Ev,NI;function n6(){if(NI)return Ev;NI=1;var e=OS(),t=Ut();function r(n,i,o){var a=i(n);return t(n)?a:e(a,o(n))}return Ev=r,Ev}var _v,TI;function i6(){if(TI)return _v;TI=1;var e=n6(),t=_S(),r=to();function n(i){return e(i,r,t)}return _v=n,_v}var Ov,PI;function LZ(){if(PI)return Ov;PI=1;var e=n6(),t=r6(),r=Do();function n(i){return e(i,r,t)}return Ov=n,Ov}var Cv,MI;function BZ(){if(MI)return Cv;MI=1;var e=Ao(),t=Vn(),r=e(t,"DataView");return Cv=r,Cv}var Iv,kI;function FZ(){if(kI)return Iv;kI=1;var e=Ao(),t=Vn(),r=e(t,"Promise");return Iv=r,Iv}var Rv,AI;function o6(){if(AI)return Rv;AI=1;var e=Ao(),t=Vn(),r=e(t,"Set");return Rv=r,Rv}var Nv,DI;function $Z(){if(DI)return Nv;DI=1;var e=Ao(),t=Vn(),r=e(t,"WeakMap");return Nv=r,Nv}var Tv,jI;function Ua(){if(jI)return Tv;jI=1;var e=BZ(),t=bS(),r=FZ(),n=o6(),i=$Z(),o=ko(),a=K4(),s="[object Map]",c="[object Object]",d="[object Promise]",u="[object Set]",h="[object WeakMap]",p="[object DataView]",v=a(e),y=a(t),m=a(r),g=a(n),w=a(i),x=o;return(e&&x(new e(new ArrayBuffer(1)))!=p||t&&x(new t)!=s||r&&x(r.resolve())!=d||n&&x(new n)!=u||i&&x(new i)!=h)&&(x=function(_){var S=o(_),E=S==c?_.constructor:void 0,I=E?a(E):"";if(I)switch(I){case v:return p;case y:return s;case m:return d;case g:return u;case w:return h}return S}),Tv=x,Tv}var Pv,qI;function VZ(){if(qI)return Pv;qI=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n){var i=n.length,o=new n.constructor(i);return i&&typeof n[0]=="string"&&t.call(n,"index")&&(o.index=n.index,o.input=n.input),o}return Pv=r,Pv}var Mv,zI;function a6(){if(zI)return Mv;zI=1;var e=Vn(),t=e.Uint8Array;return Mv=t,Mv}var kv,LI;function CS(){if(LI)return kv;LI=1;var e=a6();function t(r){var n=new r.constructor(r.byteLength);return new e(n).set(new e(r)),n}return kv=t,kv}var Av,BI;function HZ(){if(BI)return Av;BI=1;var e=CS();function t(r,n){var i=n?e(r.buffer):r.buffer;return new r.constructor(i,r.byteOffset,r.byteLength)}return Av=t,Av}var Dv,FI;function WZ(){if(FI)return Dv;FI=1;var e=/\w*$/;function t(r){var n=new r.constructor(r.source,e.exec(r));return n.lastIndex=r.lastIndex,n}return Dv=t,Dv}var jv,$I;function UZ(){if($I)return jv;$I=1;var e=Ha(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function n(i){return r?Object(r.call(i)):{}}return jv=n,jv}var qv,VI;function s6(){if(VI)return qv;VI=1;var e=CS();function t(r,n){var i=n?e(r.buffer):r.buffer;return new r.constructor(i,r.byteOffset,r.length)}return qv=t,qv}var zv,HI;function GZ(){if(HI)return zv;HI=1;var e=CS(),t=HZ(),r=WZ(),n=UZ(),i=s6(),o="[object Boolean]",a="[object Date]",s="[object Map]",c="[object Number]",d="[object RegExp]",u="[object Set]",h="[object String]",p="[object Symbol]",v="[object ArrayBuffer]",y="[object DataView]",m="[object Float32Array]",g="[object Float64Array]",w="[object Int8Array]",x="[object Int16Array]",_="[object Int32Array]",S="[object Uint8Array]",E="[object Uint8ClampedArray]",I="[object Uint16Array]",N="[object Uint32Array]";function T(M,z,j){var W=M.constructor;switch(z){case v:return e(M);case o:case a:return new W(+M);case y:return t(M,j);case m:case g:case w:case x:case _:case S:case E:case I:case N:return i(M,j);case s:return new W;case c:case h:return new W(M);case d:return r(M);case u:return new W;case p:return n(M)}}return zv=T,zv}var Lv,WI;function l6(){if(WI)return Lv;WI=1;var e=On(),t=Object.create,r=(function(){function n(){}return function(i){if(!e(i))return{};if(t)return t(i);n.prototype=i;var o=new n;return n.prototype=void 0,o}})();return Lv=r,Lv}var Bv,UI;function c6(){if(UI)return Bv;UI=1;var e=l6(),t=qd(),r=jd();function n(i){return typeof i.constructor=="function"&&!r(i)?e(t(i)):{}}return Bv=n,Bv}var Fv,GI;function KZ(){if(GI)return Fv;GI=1;var e=Ua(),t=si(),r="[object Map]";function n(i){return t(i)&&e(i)==r}return Fv=n,Fv}var $v,KI;function YZ(){if(KI)return $v;KI=1;var e=KZ(),t=Dd(),r=SS(),n=r&&r.isMap,i=n?t(n):e;return $v=i,$v}var Vv,YI;function XZ(){if(YI)return Vv;YI=1;var e=Ua(),t=si(),r="[object Set]";function n(i){return t(i)&&e(i)==r}return Vv=n,Vv}var Hv,XI;function ZZ(){if(XI)return Hv;XI=1;var e=XZ(),t=Dd(),r=SS(),n=r&&r.isSet,i=n?t(n):e;return Hv=i,Hv}var Wv,ZI;function u6(){if(ZI)return Wv;ZI=1;var e=Pd(),t=xS(),r=kd(),n=kZ(),i=jZ(),o=J4(),a=Q4(),s=qZ(),c=zZ(),d=i6(),u=LZ(),h=Ua(),p=VZ(),v=GZ(),y=c6(),m=Ut(),g=Wa(),w=YZ(),x=On(),_=ZZ(),S=to(),E=Do(),I=1,N=2,T=4,M="[object Arguments]",z="[object Array]",j="[object Boolean]",W="[object Date]",U="[object Error]",A="[object Function]",K="[object GeneratorFunction]",V="[object Map]",te="[object Number]",G="[object Object]",re="[object RegExp]",P="[object Set]",B="[object String]",X="[object Symbol]",Q="[object WeakMap]",D="[object ArrayBuffer]",$="[object DataView]",H="[object Float32Array]",q="[object Float64Array]",Y="[object Int8Array]",ie="[object Int16Array]",ne="[object Int32Array]",ve="[object Uint8Array]",Z="[object Uint8ClampedArray]",J="[object Uint16Array]",ae="[object Uint32Array]",he={};he[M]=he[z]=he[D]=he[$]=he[j]=he[W]=he[H]=he[q]=he[Y]=he[ie]=he[ne]=he[V]=he[te]=he[G]=he[re]=he[P]=he[B]=he[X]=he[ve]=he[Z]=he[J]=he[ae]=!0,he[U]=he[A]=he[Q]=!1;function ue(de,le,xe,Ee,Ie,Te){var Me,Ze=le&I,tt=le&N,Fe=le&T;if(xe&&(Me=Ie?xe(de,Ee,Ie,Te):xe(de)),Me!==void 0)return Me;if(!x(de))return de;var Le=m(de);if(Le){if(Me=p(de),!Ze)return a(de,Me)}else{var ze=h(de),Je=ze==A||ze==K;if(g(de))return o(de,Ze);if(ze==G||ze==M||Je&&!Ie){if(Me=tt||Je?{}:y(de),!Ze)return tt?c(de,i(Me,de)):s(de,n(Me,de))}else{if(!he[ze])return Ie?de:{};Me=v(de,ze,Ze)}}Te||(Te=new e);var rt=Te.get(de);if(rt)return rt;Te.set(de,Me),_(de)?de.forEach(function(Rt){Me.add(ue(Rt,le,xe,Rt,de,Te))}):w(de)&&de.forEach(function(Rt,qt){Me.set(qt,ue(Rt,le,xe,qt,de,Te))});var Pt=Fe?tt?u:d:tt?E:S,gt=Le?void 0:Pt(de);return t(gt||de,function(Rt,qt){gt&&(qt=Rt,Rt=de[qt]),r(Me,qt,ue(Rt,le,xe,qt,de,Te))}),Me}return Wv=ue,Wv}var Uv,JI;function JZ(){if(JI)return Uv;JI=1;var e=u6(),t=4;function r(n){return e(n,t)}return Uv=r,Uv}var Gv,QI;function IS(){if(QI)return Gv;QI=1;function e(t){return function(){return t}}return Gv=e,Gv}var Kv,eR;function QZ(){if(eR)return Kv;eR=1;function e(t){return function(r,n,i){for(var o=-1,a=Object(r),s=i(r),c=s.length;c--;){var d=s[t?c:++o];if(n(a[d],d,a)===!1)break}return r}}return Kv=e,Kv}var Yv,tR;function RS(){if(tR)return Yv;tR=1;var e=QZ(),t=e();return Yv=t,Yv}var Xv,rR;function NS(){if(rR)return Xv;rR=1;var e=RS(),t=to();function r(n,i){return n&&e(n,i,t)}return Xv=r,Xv}var Zv,nR;function eJ(){if(nR)return Zv;nR=1;var e=Oi();function t(r,n){return function(i,o){if(i==null)return i;if(!e(i))return r(i,o);for(var a=i.length,s=n?a:-1,c=Object(i);(n?s--:++s<a)&&o(c[s],s,c)!==!1;);return i}}return Zv=t,Zv}var Jv,iR;function zd(){if(iR)return Jv;iR=1;var e=NS(),t=eJ(),r=t(e);return Jv=r,Jv}var Qv,oR;function jo(){if(oR)return Qv;oR=1;function e(t){return t}return Qv=e,Qv}var eg,aR;function d6(){if(aR)return eg;aR=1;var e=jo();function t(r){return typeof r=="function"?r:e}return eg=t,eg}var tg,sR;function f6(){if(sR)return tg;sR=1;var e=xS(),t=zd(),r=d6(),n=Ut();function i(o,a){var s=n(o)?e:t;return s(o,r(a))}return tg=i,tg}var rg,lR;function h6(){return lR||(lR=1,rg=f6()),rg}var ng,cR;function tJ(){if(cR)return ng;cR=1;var e=zd();function t(r,n){var i=[];return e(r,function(o,a,s){n(o,a,s)&&i.push(o)}),i}return ng=t,ng}var ig,uR;function rJ(){if(uR)return ig;uR=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return ig=t,ig}var og,dR;function nJ(){if(dR)return og;dR=1;function e(t){return this.__data__.has(t)}return og=e,og}var ag,fR;function p6(){if(fR)return ag;fR=1;var e=yS(),t=rJ(),r=nJ();function n(i){var o=-1,a=i==null?0:i.length;for(this.__data__=new e;++o<a;)this.add(i[o])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,ag=n,ag}var sg,hR;function iJ(){if(hR)return sg;hR=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(t[n],n,t))return!0;return!1}return sg=e,sg}var lg,pR;function v6(){if(pR)return lg;pR=1;function e(t,r){return t.has(r)}return lg=e,lg}var cg,vR;function g6(){if(vR)return cg;vR=1;var e=p6(),t=iJ(),r=v6(),n=1,i=2;function o(a,s,c,d,u,h){var p=c&n,v=a.length,y=s.length;if(v!=y&&!(p&&y>v))return!1;var m=h.get(a),g=h.get(s);if(m&&g)return m==s&&g==a;var w=-1,x=!0,_=c&i?new e:void 0;for(h.set(a,s),h.set(s,a);++w<v;){var S=a[w],E=s[w];if(d)var I=p?d(E,S,w,s,a,h):d(S,E,w,a,s,h);if(I!==void 0){if(I)continue;x=!1;break}if(_){if(!t(s,function(N,T){if(!r(_,T)&&(S===N||u(S,N,c,d,h)))return _.push(T)})){x=!1;break}}else if(!(S===E||u(S,E,c,d,h))){x=!1;break}}return h.delete(a),h.delete(s),x}return cg=o,cg}var ug,gR;function oJ(){if(gR)return ug;gR=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(i,o){n[++r]=[o,i]}),n}return ug=e,ug}var dg,mR;function TS(){if(mR)return dg;mR=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(i){n[++r]=i}),n}return dg=e,dg}var fg,bR;function aJ(){if(bR)return fg;bR=1;var e=Ha(),t=a6(),r=Va(),n=g6(),i=oJ(),o=TS(),a=1,s=2,c="[object Boolean]",d="[object Date]",u="[object Error]",h="[object Map]",p="[object Number]",v="[object RegExp]",y="[object Set]",m="[object String]",g="[object Symbol]",w="[object ArrayBuffer]",x="[object DataView]",_=e?e.prototype:void 0,S=_?_.valueOf:void 0;function E(I,N,T,M,z,j,W){switch(T){case x:if(I.byteLength!=N.byteLength||I.byteOffset!=N.byteOffset)return!1;I=I.buffer,N=N.buffer;case w:return!(I.byteLength!=N.byteLength||!j(new t(I),new t(N)));case c:case d:case p:return r(+I,+N);case u:return I.name==N.name&&I.message==N.message;case v:case m:return I==N+"";case h:var U=i;case y:var A=M&a;if(U||(U=o),I.size!=N.size&&!A)return!1;var K=W.get(I);if(K)return K==N;M|=s,W.set(I,N);var V=n(U(I),U(N),M,z,j,W);return W.delete(I),V;case g:if(S)return S.call(I)==S.call(N)}return!1}return fg=E,fg}var hg,yR;function sJ(){if(yR)return hg;yR=1;var e=i6(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(o,a,s,c,d,u){var h=s&t,p=e(o),v=p.length,y=e(a),m=y.length;if(v!=m&&!h)return!1;for(var g=v;g--;){var w=p[g];if(!(h?w in a:n.call(a,w)))return!1}var x=u.get(o),_=u.get(a);if(x&&_)return x==a&&_==o;var S=!0;u.set(o,a),u.set(a,o);for(var E=h;++g<v;){w=p[g];var I=o[w],N=a[w];if(c)var T=h?c(N,I,w,a,o,u):c(I,N,w,o,a,u);if(!(T===void 0?I===N||d(I,N,s,c,u):T)){S=!1;break}E||(E=w=="constructor")}if(S&&!E){var M=o.constructor,z=a.constructor;M!=z&&"constructor"in o&&"constructor"in a&&!(typeof M=="function"&&M instanceof M&&typeof z=="function"&&z instanceof z)&&(S=!1)}return u.delete(o),u.delete(a),S}return hg=i,hg}var pg,xR;function lJ(){if(xR)return pg;xR=1;var e=Pd(),t=g6(),r=aJ(),n=sJ(),i=Ua(),o=Ut(),a=Wa(),s=Ml(),c=1,d="[object Arguments]",u="[object Array]",h="[object Object]",p=Object.prototype,v=p.hasOwnProperty;function y(m,g,w,x,_,S){var E=o(m),I=o(g),N=E?u:i(m),T=I?u:i(g);N=N==d?h:N,T=T==d?h:T;var M=N==h,z=T==h,j=N==T;if(j&&a(m)){if(!a(g))return!1;E=!0,M=!1}if(j&&!M)return S||(S=new e),E||s(m)?t(m,g,w,x,_,S):r(m,g,N,w,x,_,S);if(!(w&c)){var W=M&&v.call(m,"__wrapped__"),U=z&&v.call(g,"__wrapped__");if(W||U){var A=W?m.value():m,K=U?g.value():g;return S||(S=new e),_(A,K,w,x,S)}}return j?(S||(S=new e),n(m,g,w,x,_,S)):!1}return pg=y,pg}var vg,wR;function m6(){if(wR)return vg;wR=1;var e=lJ(),t=si();function r(n,i,o,a,s){return n===i?!0:n==null||i==null||!t(n)&&!t(i)?n!==n&&i!==i:e(n,i,o,a,r,s)}return vg=r,vg}var gg,SR;function cJ(){if(SR)return gg;SR=1;var e=Pd(),t=m6(),r=1,n=2;function i(o,a,s,c){var d=s.length,u=d,h=!c;if(o==null)return!u;for(o=Object(o);d--;){var p=s[d];if(h&&p[2]?p[1]!==o[p[0]]:!(p[0]in o))return!1}for(;++d<u;){p=s[d];var v=p[0],y=o[v],m=p[1];if(h&&p[2]){if(y===void 0&&!(v in o))return!1}else{var g=new e;if(c)var w=c(y,m,v,o,a,g);if(!(w===void 0?t(m,y,r|n,c,g):w))return!1}}return!0}return gg=i,gg}var mg,ER;function b6(){if(ER)return mg;ER=1;var e=On();function t(r){return r===r&&!e(r)}return mg=t,mg}var bg,_R;function uJ(){if(_R)return bg;_R=1;var e=b6(),t=to();function r(n){for(var i=t(n),o=i.length;o--;){var a=i[o],s=n[a];i[o]=[a,s,e(s)]}return i}return bg=r,bg}var yg,OR;function y6(){if(OR)return yg;OR=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return yg=e,yg}var xg,CR;function dJ(){if(CR)return xg;CR=1;var e=cJ(),t=uJ(),r=y6();function n(i){var o=t(i);return o.length==1&&o[0][2]?r(o[0][0],o[0][1]):function(a){return a===i||e(a,i,o)}}return xg=n,xg}var wg,IR;function Ga(){if(IR)return wg;IR=1;var e=ko(),t=si(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return wg=n,wg}var Sg,RR;function PS(){if(RR)return Sg;RR=1;var e=Ut(),t=Ga(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(o,a){if(e(o))return!1;var s=typeof o;return s=="number"||s=="symbol"||s=="boolean"||o==null||t(o)?!0:n.test(o)||!r.test(o)||a!=null&&o in Object(a)}return Sg=i,Sg}var Eg,NR;function fJ(){if(NR)return Eg;NR=1;var e=yS(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var o=function(){var a=arguments,s=i?i.apply(this,a):a[0],c=o.cache;if(c.has(s))return c.get(s);var d=n.apply(this,a);return o.cache=c.set(s,d)||c,d};return o.cache=new(r.Cache||e),o}return r.Cache=e,Eg=r,Eg}var _g,TR;function hJ(){if(TR)return _g;TR=1;var e=fJ(),t=500;function r(n){var i=e(n,function(a){return o.size===t&&o.clear(),a}),o=i.cache;return i}return _g=r,_g}var Og,PR;function pJ(){if(PR)return Og;PR=1;var e=hJ(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(t,function(a,s,c,d){o.push(c?d.replace(r,"$1"):s||a)}),o});return Og=n,Og}var Cg,MR;function Ld(){if(MR)return Cg;MR=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,o=Array(i);++n<i;)o[n]=r(t[n],n,t);return o}return Cg=e,Cg}var Ig,kR;function vJ(){if(kR)return Ig;kR=1;var e=Ha(),t=Ld(),r=Ut(),n=Ga(),i=e?e.prototype:void 0,o=i?i.toString:void 0;function a(s){if(typeof s=="string")return s;if(r(s))return t(s,a)+"";if(n(s))return o?o.call(s):"";var c=s+"";return c=="0"&&1/s==-1/0?"-0":c}return Ig=a,Ig}var Rg,AR;function x6(){if(AR)return Rg;AR=1;var e=vJ();function t(r){return r==null?"":e(r)}return Rg=t,Rg}var Ng,DR;function Bd(){if(DR)return Ng;DR=1;var e=Ut(),t=PS(),r=pJ(),n=x6();function i(o,a){return e(o)?o:t(o,a)?[o]:r(n(o))}return Ng=i,Ng}var Tg,jR;function kl(){if(jR)return Tg;jR=1;var e=Ga();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Tg=t,Tg}var Pg,qR;function Fd(){if(qR)return Pg;qR=1;var e=Bd(),t=kl();function r(n,i){i=e(i,n);for(var o=0,a=i.length;n!=null&&o<a;)n=n[t(i[o++])];return o&&o==a?n:void 0}return Pg=r,Pg}var Mg,zR;function gJ(){if(zR)return Mg;zR=1;var e=Fd();function t(r,n,i){var o=r==null?void 0:e(r,n);return o===void 0?i:o}return Mg=t,Mg}var kg,LR;function mJ(){if(LR)return kg;LR=1;function e(t,r){return t!=null&&r in Object(t)}return kg=e,kg}var Ag,BR;function w6(){if(BR)return Ag;BR=1;var e=Bd(),t=Pl(),r=Ut(),n=Ad(),i=wS(),o=kl();function a(s,c,d){c=e(c,s);for(var u=-1,h=c.length,p=!1;++u<h;){var v=o(c[u]);if(!(p=s!=null&&d(s,v)))break;s=s[v]}return p||++u!=h?p:(h=s==null?0:s.length,!!h&&i(h)&&n(v,h)&&(r(s)||t(s)))}return Ag=a,Ag}var Dg,FR;function S6(){if(FR)return Dg;FR=1;var e=mJ(),t=w6();function r(n,i){return n!=null&&t(n,i,e)}return Dg=r,Dg}var jg,$R;function bJ(){if($R)return jg;$R=1;var e=m6(),t=gJ(),r=S6(),n=PS(),i=b6(),o=y6(),a=kl(),s=1,c=2;function d(u,h){return n(u)&&i(h)?o(a(u),h):function(p){var v=t(p,u);return v===void 0&&v===h?r(p,u):e(h,v,s|c)}}return jg=d,jg}var qg,VR;function E6(){if(VR)return qg;VR=1;function e(t){return function(r){return r==null?void 0:r[t]}}return qg=e,qg}var zg,HR;function yJ(){if(HR)return zg;HR=1;var e=Fd();function t(r){return function(n){return e(n,r)}}return zg=t,zg}var Lg,WR;function xJ(){if(WR)return Lg;WR=1;var e=E6(),t=yJ(),r=PS(),n=kl();function i(o){return r(o)?e(n(o)):t(o)}return Lg=i,Lg}var Bg,UR;function Ci(){if(UR)return Bg;UR=1;var e=dJ(),t=bJ(),r=jo(),n=Ut(),i=xJ();function o(a){return typeof a=="function"?a:a==null?r:typeof a=="object"?n(a)?t(a[0],a[1]):e(a):i(a)}return Bg=o,Bg}var Fg,GR;function _6(){if(GR)return Fg;GR=1;var e=e6(),t=tJ(),r=Ci(),n=Ut();function i(o,a){var s=n(o)?e:t;return s(o,r(a,3))}return Fg=i,Fg}var $g,KR;function wJ(){if(KR)return $g;KR=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n,i){return n!=null&&t.call(n,i)}return $g=r,$g}var Vg,YR;function O6(){if(YR)return Vg;YR=1;var e=wJ(),t=w6();function r(n,i){return n!=null&&t(n,i,e)}return Vg=r,Vg}var Hg,XR;function SJ(){if(XR)return Hg;XR=1;var e=ES(),t=Ua(),r=Pl(),n=Ut(),i=Oi(),o=Wa(),a=jd(),s=Ml(),c="[object Map]",d="[object Set]",u=Object.prototype,h=u.hasOwnProperty;function p(v){if(v==null)return!0;if(i(v)&&(n(v)||typeof v=="string"||typeof v.splice=="function"||o(v)||s(v)||r(v)))return!v.length;var y=t(v);if(y==c||y==d)return!v.size;if(a(v))return!e(v).length;for(var m in v)if(h.call(v,m))return!1;return!0}return Hg=p,Hg}var Wg,ZR;function C6(){if(ZR)return Wg;ZR=1;function e(t){return t===void 0}return Wg=e,Wg}var Ug,JR;function I6(){if(JR)return Ug;JR=1;var e=zd(),t=Oi();function r(n,i){var o=-1,a=t(n)?Array(n.length):[];return e(n,function(s,c,d){a[++o]=i(s,c,d)}),a}return Ug=r,Ug}var Gg,QR;function R6(){if(QR)return Gg;QR=1;var e=Ld(),t=Ci(),r=I6(),n=Ut();function i(o,a){var s=n(o)?e:r;return s(o,t(a,3))}return Gg=i,Gg}var Kg,eN;function EJ(){if(eN)return Kg;eN=1;function e(t,r,n,i){var o=-1,a=t==null?0:t.length;for(i&&a&&(n=t[++o]);++o<a;)n=r(n,t[o],o,t);return n}return Kg=e,Kg}var Yg,tN;function _J(){if(tN)return Yg;tN=1;function e(t,r,n,i,o){return o(t,function(a,s,c){n=i?(i=!1,a):r(n,a,s,c)}),n}return Yg=e,Yg}var Xg,rN;function N6(){if(rN)return Xg;rN=1;var e=EJ(),t=zd(),r=Ci(),n=_J(),i=Ut();function o(a,s,c){var d=i(a)?e:n,u=arguments.length<3;return d(a,r(s,4),c,u,t)}return Xg=o,Xg}var Zg,nN;function OJ(){if(nN)return Zg;nN=1;var e=ko(),t=Ut(),r=si(),n="[object String]";function i(o){return typeof o=="string"||!t(o)&&r(o)&&e(o)==n}return Zg=i,Zg}var Jg,iN;function CJ(){if(iN)return Jg;iN=1;var e=E6(),t=e("length");return Jg=t,Jg}var Qg,oN;function IJ(){if(oN)return Qg;oN=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,o="\\ufe0e\\ufe0f",a="\\u200d",s=RegExp("["+a+e+i+o+"]");function c(d){return s.test(d)}return Qg=c,Qg}var em,aN;function RJ(){if(aN)return em;aN=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,o="\\ufe0e\\ufe0f",a="["+e+"]",s="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",d="(?:"+s+"|"+c+")",u="[^"+e+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",y=d+"?",m="["+o+"]?",g="(?:"+v+"(?:"+[u,h,p].join("|")+")"+m+y+")*",w=m+y+g,x="(?:"+[u+s+"?",s,h,p,a].join("|")+")",_=RegExp(c+"(?="+c+")|"+x+w,"g");function S(E){for(var I=_.lastIndex=0;_.test(E);)++I;return I}return em=S,em}var tm,sN;function NJ(){if(sN)return tm;sN=1;var e=CJ(),t=IJ(),r=RJ();function n(i){return t(i)?r(i):e(i)}return tm=n,tm}var rm,lN;function TJ(){if(lN)return rm;lN=1;var e=ES(),t=Ua(),r=Oi(),n=OJ(),i=NJ(),o="[object Map]",a="[object Set]";function s(c){if(c==null)return 0;if(r(c))return n(c)?i(c):c.length;var d=t(c);return d==o||d==a?c.size:e(c).length}return rm=s,rm}var nm,cN;function PJ(){if(cN)return nm;cN=1;var e=xS(),t=l6(),r=NS(),n=Ci(),i=qd(),o=Ut(),a=Wa(),s=Nl(),c=On(),d=Ml();function u(h,p,v){var y=o(h),m=y||a(h)||d(h);if(p=n(p,4),v==null){var g=h&&h.constructor;m?v=y?new g:[]:c(h)?v=s(g)?t(i(h)):{}:v={}}return(m?e:r)(h,function(w,x,_){return p(v,w,x,_)}),v}return nm=u,nm}var im,uN;function MJ(){if(uN)return im;uN=1;var e=Ha(),t=Pl(),r=Ut(),n=e?e.isConcatSpreadable:void 0;function i(o){return r(o)||t(o)||!!(n&&o&&o[n])}return im=i,im}var om,dN;function MS(){if(dN)return om;dN=1;var e=OS(),t=MJ();function r(n,i,o,a,s){var c=-1,d=n.length;for(o||(o=t),s||(s=[]);++c<d;){var u=n[c];i>0&&o(u)?i>1?r(u,i-1,o,a,s):e(s,u):a||(s[s.length]=u)}return s}return om=r,om}var am,fN;function kJ(){if(fN)return am;fN=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return am=e,am}var sm,hN;function T6(){if(hN)return sm;hN=1;var e=kJ(),t=Math.max;function r(n,i,o){return i=t(i===void 0?n.length-1:i,0),function(){for(var a=arguments,s=-1,c=t(a.length-i,0),d=Array(c);++s<c;)d[s]=a[i+s];s=-1;for(var u=Array(i+1);++s<i;)u[s]=a[s];return u[i]=o(d),e(n,this,u)}}return sm=r,sm}var lm,pN;function AJ(){if(pN)return lm;pN=1;var e=IS(),t=Y4(),r=jo(),n=t?function(i,o){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:r;return lm=n,lm}var cm,vN;function DJ(){if(vN)return cm;vN=1;var e=800,t=16,r=Date.now;function n(i){var o=0,a=0;return function(){var s=r(),c=t-(s-a);if(a=s,c>0){if(++o>=e)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return cm=n,cm}var um,gN;function P6(){if(gN)return um;gN=1;var e=AJ(),t=DJ(),r=t(e);return um=r,um}var dm,mN;function $d(){if(mN)return dm;mN=1;var e=jo(),t=T6(),r=P6();function n(i,o){return r(t(i,o,e),i+"")}return dm=n,dm}var fm,bN;function M6(){if(bN)return fm;bN=1;function e(t,r,n,i){for(var o=t.length,a=n+(i?1:-1);i?a--:++a<o;)if(r(t[a],a,t))return a;return-1}return fm=e,fm}var hm,yN;function jJ(){if(yN)return hm;yN=1;function e(t){return t!==t}return hm=e,hm}var pm,xN;function qJ(){if(xN)return pm;xN=1;function e(t,r,n){for(var i=n-1,o=t.length;++i<o;)if(t[i]===r)return i;return-1}return pm=e,pm}var vm,wN;function zJ(){if(wN)return vm;wN=1;var e=M6(),t=jJ(),r=qJ();function n(i,o,a){return o===o?r(i,o,a):e(i,t,a)}return vm=n,vm}var gm,SN;function LJ(){if(SN)return gm;SN=1;var e=zJ();function t(r,n){var i=r==null?0:r.length;return!!i&&e(r,n,0)>-1}return gm=t,gm}var mm,EN;function BJ(){if(EN)return mm;EN=1;function e(t,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;)if(n(r,t[i]))return!0;return!1}return mm=e,mm}var bm,_N;function FJ(){if(_N)return bm;_N=1;function e(){}return bm=e,bm}var ym,ON;function $J(){if(ON)return ym;ON=1;var e=o6(),t=FJ(),r=TS(),n=1/0,i=e&&1/r(new e([,-0]))[1]==n?function(o){return new e(o)}:t;return ym=i,ym}var xm,CN;function VJ(){if(CN)return xm;CN=1;var e=p6(),t=LJ(),r=BJ(),n=v6(),i=$J(),o=TS(),a=200;function s(c,d,u){var h=-1,p=t,v=c.length,y=!0,m=[],g=m;if(u)y=!1,p=r;else if(v>=a){var w=d?null:i(c);if(w)return o(w);y=!1,p=n,g=new e}else g=d?[]:m;e:for(;++h<v;){var x=c[h],_=d?d(x):x;if(x=u||x!==0?x:0,y&&_===_){for(var S=g.length;S--;)if(g[S]===_)continue e;d&&g.push(_),m.push(x)}else p(g,_,u)||(g!==m&&g.push(_),m.push(x))}return m}return xm=s,xm}var wm,IN;function k6(){if(IN)return wm;IN=1;var e=Oi(),t=si();function r(n){return t(n)&&e(n)}return wm=r,wm}var Sm,RN;function HJ(){if(RN)return Sm;RN=1;var e=MS(),t=$d(),r=VJ(),n=k6(),i=t(function(o){return r(e(o,1,n,!0))});return Sm=i,Sm}var Em,NN;function WJ(){if(NN)return Em;NN=1;var e=Ld();function t(r,n){return e(n,function(i){return r[i]})}return Em=t,Em}var _m,TN;function A6(){if(TN)return _m;TN=1;var e=WJ(),t=to();function r(n){return n==null?[]:e(n,t(n))}return _m=r,_m}var Om,PN;function Cn(){if(PN)return Om;PN=1;var e;if(typeof mS=="function")try{e={clone:JZ(),constant:IS(),each:h6(),filter:_6(),has:O6(),isArray:Ut(),isEmpty:SJ(),isFunction:Nl(),isUndefined:C6(),keys:to(),map:R6(),reduce:N6(),size:TJ(),transform:PJ(),union:HJ(),values:A6()}}catch{}return e||(e=window._),Om=e,Om}var Cm,MN;function kS(){if(MN)return Cm;MN=1;var e=Cn();Cm=i;var t="\0",r="\0",n="";function i(u){this._isDirected=e.has(u,"directed")?u.directed:!0,this._isMultigraph=e.has(u,"multigraph")?u.multigraph:!1,this._isCompound=e.has(u,"compound")?u.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(u){return this._label=u,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(u){return e.isFunction(u)||(u=e.constant(u)),this._defaultNodeLabelFn=u,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return e.keys(this._nodes)},i.prototype.sources=function(){var u=this;return e.filter(this.nodes(),function(h){return e.isEmpty(u._in[h])})},i.prototype.sinks=function(){var u=this;return e.filter(this.nodes(),function(h){return e.isEmpty(u._out[h])})},i.prototype.setNodes=function(u,h){var p=arguments,v=this;return e.each(u,function(y){p.length>1?v.setNode(y,h):v.setNode(y)}),this},i.prototype.setNode=function(u,h){return e.has(this._nodes,u)?(arguments.length>1&&(this._nodes[u]=h),this):(this._nodes[u]=arguments.length>1?h:this._defaultNodeLabelFn(u),this._isCompound&&(this._parent[u]=r,this._children[u]={},this._children[r][u]=!0),this._in[u]={},this._preds[u]={},this._out[u]={},this._sucs[u]={},++this._nodeCount,this)},i.prototype.node=function(u){return this._nodes[u]},i.prototype.hasNode=function(u){return e.has(this._nodes,u)},i.prototype.removeNode=function(u){var h=this;if(e.has(this._nodes,u)){var p=function(v){h.removeEdge(h._edgeObjs[v])};delete this._nodes[u],this._isCompound&&(this._removeFromParentsChildList(u),delete this._parent[u],e.each(this.children(u),function(v){h.setParent(v)}),delete this._children[u]),e.each(e.keys(this._in[u]),p),delete this._in[u],delete this._preds[u],e.each(e.keys(this._out[u]),p),delete this._out[u],delete this._sucs[u],--this._nodeCount}return this},i.prototype.setParent=function(u,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(h))h=r;else{h+="";for(var p=h;!e.isUndefined(p);p=this.parent(p))if(p===u)throw new Error("Setting "+h+" as parent of "+u+" would create a cycle");this.setNode(h)}return this.setNode(u),this._removeFromParentsChildList(u),this._parent[u]=h,this._children[h][u]=!0,this},i.prototype._removeFromParentsChildList=function(u){delete this._children[this._parent[u]][u]},i.prototype.parent=function(u){if(this._isCompound){var h=this._parent[u];if(h!==r)return h}},i.prototype.children=function(u){if(e.isUndefined(u)&&(u=r),this._isCompound){var h=this._children[u];if(h)return e.keys(h)}else{if(u===r)return this.nodes();if(this.hasNode(u))return[]}},i.prototype.predecessors=function(u){var h=this._preds[u];if(h)return e.keys(h)},i.prototype.successors=function(u){var h=this._sucs[u];if(h)return e.keys(h)},i.prototype.neighbors=function(u){var h=this.predecessors(u);if(h)return e.union(h,this.successors(u))},i.prototype.isLeaf=function(u){var h;return this.isDirected()?h=this.successors(u):h=this.neighbors(u),h.length===0},i.prototype.filterNodes=function(u){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var p=this;e.each(this._nodes,function(m,g){u(g)&&h.setNode(g,m)}),e.each(this._edgeObjs,function(m){h.hasNode(m.v)&&h.hasNode(m.w)&&h.setEdge(m,p.edge(m))});var v={};function y(m){var g=p.parent(m);return g===void 0||h.hasNode(g)?(v[m]=g,g):g in v?v[g]:y(g)}return this._isCompound&&e.each(h.nodes(),function(m){h.setParent(m,y(m))}),h},i.prototype.setDefaultEdgeLabel=function(u){return e.isFunction(u)||(u=e.constant(u)),this._defaultEdgeLabelFn=u,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return e.values(this._edgeObjs)},i.prototype.setPath=function(u,h){var p=this,v=arguments;return e.reduce(u,function(y,m){return v.length>1?p.setEdge(y,m,h):p.setEdge(y,m),m}),this},i.prototype.setEdge=function(){var u,h,p,v,y=!1,m=arguments[0];typeof m=="object"&&m!==null&&"v"in m?(u=m.v,h=m.w,p=m.name,arguments.length===2&&(v=arguments[1],y=!0)):(u=m,h=arguments[1],p=arguments[3],arguments.length>2&&(v=arguments[2],y=!0)),u=""+u,h=""+h,e.isUndefined(p)||(p=""+p);var g=s(this._isDirected,u,h,p);if(e.has(this._edgeLabels,g))return y&&(this._edgeLabels[g]=v),this;if(!e.isUndefined(p)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(u),this.setNode(h),this._edgeLabels[g]=y?v:this._defaultEdgeLabelFn(u,h,p);var w=c(this._isDirected,u,h,p);return u=w.v,h=w.w,Object.freeze(w),this._edgeObjs[g]=w,o(this._preds[h],u),o(this._sucs[u],h),this._in[h][g]=w,this._out[u][g]=w,this._edgeCount++,this},i.prototype.edge=function(u,h,p){var v=arguments.length===1?d(this._isDirected,arguments[0]):s(this._isDirected,u,h,p);return this._edgeLabels[v]},i.prototype.hasEdge=function(u,h,p){var v=arguments.length===1?d(this._isDirected,arguments[0]):s(this._isDirected,u,h,p);return e.has(this._edgeLabels,v)},i.prototype.removeEdge=function(u,h,p){var v=arguments.length===1?d(this._isDirected,arguments[0]):s(this._isDirected,u,h,p),y=this._edgeObjs[v];return y&&(u=y.v,h=y.w,delete this._edgeLabels[v],delete this._edgeObjs[v],a(this._preds[h],u),a(this._sucs[u],h),delete this._in[h][v],delete this._out[u][v],this._edgeCount--),this},i.prototype.inEdges=function(u,h){var p=this._in[u];if(p){var v=e.values(p);return h?e.filter(v,function(y){return y.v===h}):v}},i.prototype.outEdges=function(u,h){var p=this._out[u];if(p){var v=e.values(p);return h?e.filter(v,function(y){return y.w===h}):v}},i.prototype.nodeEdges=function(u,h){var p=this.inEdges(u,h);if(p)return p.concat(this.outEdges(u,h))};function o(u,h){u[h]?u[h]++:u[h]=1}function a(u,h){--u[h]||delete u[h]}function s(u,h,p,v){var y=""+h,m=""+p;if(!u&&y>m){var g=y;y=m,m=g}return y+n+m+n+(e.isUndefined(v)?t:v)}function c(u,h,p,v){var y=""+h,m=""+p;if(!u&&y>m){var g=y;y=m,m=g}var w={v:y,w:m};return v&&(w.name=v),w}function d(u,h){return s(u,h.v,h.w,h.name)}return Cm}var Im,kN;function UJ(){return kN||(kN=1,Im="2.1.8"),Im}var Rm,AN;function GJ(){return AN||(AN=1,Rm={Graph:kS(),version:UJ()}),Rm}var Nm,DN;function KJ(){if(DN)return Nm;DN=1;var e=Cn(),t=kS();Nm={write:r,read:o};function r(a){var s={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:n(a),edges:i(a)};return e.isUndefined(a.graph())||(s.value=e.clone(a.graph())),s}function n(a){return e.map(a.nodes(),function(s){var c=a.node(s),d=a.parent(s),u={v:s};return e.isUndefined(c)||(u.value=c),e.isUndefined(d)||(u.parent=d),u})}function i(a){return e.map(a.edges(),function(s){var c=a.edge(s),d={v:s.v,w:s.w};return e.isUndefined(s.name)||(d.name=s.name),e.isUndefined(c)||(d.value=c),d})}function o(a){var s=new t(a.options).setGraph(a.value);return e.each(a.nodes,function(c){s.setNode(c.v,c.value),c.parent&&s.setParent(c.v,c.parent)}),e.each(a.edges,function(c){s.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),s}return Nm}var Tm,jN;function YJ(){if(jN)return Tm;jN=1;var e=Cn();Tm=t;function t(r){var n={},i=[],o;function a(s){e.has(n,s)||(n[s]=!0,o.push(s),e.each(r.successors(s),a),e.each(r.predecessors(s),a))}return e.each(r.nodes(),function(s){o=[],a(s),o.length&&i.push(o)}),i}return Tm}var Pm,qN;function D6(){if(qN)return Pm;qN=1;var e=Cn();Pm=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(r){return r.key})},t.prototype.has=function(r){return e.has(this._keyIndices,r)},t.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(r,n){var i=this._keyIndices;if(r=String(r),!e.has(i,r)){var o=this._arr,a=o.length;return i[r]=a,o.push({key:r,priority:n}),this._decrease(a),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},t.prototype.decrease=function(r,n){var i=this._keyIndices[r];if(n>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[i].priority+" New: "+n);this._arr[i].priority=n,this._decrease(i)},t.prototype._heapify=function(r){var n=this._arr,i=2*r,o=i+1,a=r;i<n.length&&(a=n[i].priority<n[a].priority?i:a,o<n.length&&(a=n[o].priority<n[a].priority?o:a),a!==r&&(this._swap(r,a),this._heapify(a)))},t.prototype._decrease=function(r){for(var n=this._arr,i=n[r].priority,o;r!==0&&(o=r>>1,!(n[o].priority<i));)this._swap(r,o),r=o},t.prototype._swap=function(r,n){var i=this._arr,o=this._keyIndices,a=i[r],s=i[n];i[r]=s,i[n]=a,o[s.key]=r,o[a.key]=n},Pm}var Mm,zN;function j6(){if(zN)return Mm;zN=1;var e=Cn(),t=D6();Mm=n;var r=e.constant(1);function n(o,a,s,c){return i(o,String(a),s||r,c||function(d){return o.outEdges(d)})}function i(o,a,s,c){var d={},u=new t,h,p,v=function(y){var m=y.v!==h?y.v:y.w,g=d[m],w=s(y),x=p.distance+w;if(w<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+y+" Weight: "+w);x<g.distance&&(g.distance=x,g.predecessor=h,u.decrease(m,x))};for(o.nodes().forEach(function(y){var m=y===a?0:Number.POSITIVE_INFINITY;d[y]={distance:m},u.add(y,m)});u.size()>0&&(h=u.removeMin(),p=d[h],p.distance!==Number.POSITIVE_INFINITY);)c(h).forEach(v);return d}return Mm}var km,LN;function XJ(){if(LN)return km;LN=1;var e=j6(),t=Cn();km=r;function r(n,i,o){return t.transform(n.nodes(),function(a,s){a[s]=e(n,s,i,o)},{})}return km}var Am,BN;function q6(){if(BN)return Am;BN=1;var e=Cn();Am=t;function t(r){var n=0,i=[],o={},a=[];function s(c){var d=o[c]={onStack:!0,lowlink:n,index:n++};if(i.push(c),r.successors(c).forEach(function(p){e.has(o,p)?o[p].onStack&&(d.lowlink=Math.min(d.lowlink,o[p].index)):(s(p),d.lowlink=Math.min(d.lowlink,o[p].lowlink))}),d.lowlink===d.index){var u=[],h;do h=i.pop(),o[h].onStack=!1,u.push(h);while(c!==h);a.push(u)}}return r.nodes().forEach(function(c){e.has(o,c)||s(c)}),a}return Am}var Dm,FN;function ZJ(){if(FN)return Dm;FN=1;var e=Cn(),t=q6();Dm=r;function r(n){return e.filter(t(n),function(i){return i.length>1||i.length===1&&n.hasEdge(i[0],i[0])})}return Dm}var jm,$N;function JJ(){if($N)return jm;$N=1;var e=Cn();jm=r;var t=e.constant(1);function r(i,o,a){return n(i,o||t,a||function(s){return i.outEdges(s)})}function n(i,o,a){var s={},c=i.nodes();return c.forEach(function(d){s[d]={},s[d][d]={distance:0},c.forEach(function(u){d!==u&&(s[d][u]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(u){var h=u.v===d?u.w:u.v,p=o(u);s[d][h]={distance:p,predecessor:d}})}),c.forEach(function(d){var u=s[d];c.forEach(function(h){var p=s[h];c.forEach(function(v){var y=p[d],m=u[v],g=p[v],w=y.distance+m.distance;w<g.distance&&(g.distance=w,g.predecessor=m.predecessor)})})}),s}return jm}var qm,VN;function z6(){if(VN)return qm;VN=1;var e=Cn();qm=t,t.CycleException=r;function t(n){var i={},o={},a=[];function s(c){if(e.has(o,c))throw new r;e.has(i,c)||(o[c]=!0,i[c]=!0,e.each(n.predecessors(c),s),delete o[c],a.push(c))}if(e.each(n.sinks(),s),e.size(i)!==n.nodeCount())throw new r;return a}function r(){}return r.prototype=new Error,qm}var zm,HN;function QJ(){if(HN)return zm;HN=1;var e=z6();zm=t;function t(r){try{e(r)}catch(n){if(n instanceof e.CycleException)return!1;throw n}return!0}return zm}var Lm,WN;function L6(){if(WN)return Lm;WN=1;var e=Cn();Lm=t;function t(n,i,o){e.isArray(i)||(i=[i]);var a=(n.isDirected()?n.successors:n.neighbors).bind(n),s=[],c={};return e.each(i,function(d){if(!n.hasNode(d))throw new Error("Graph does not have node: "+d);r(n,d,o==="post",c,a,s)}),s}function r(n,i,o,a,s,c){e.has(a,i)||(a[i]=!0,o||c.push(i),e.each(s(i),function(d){r(n,d,o,a,s,c)}),o&&c.push(i))}return Lm}var Bm,UN;function eQ(){if(UN)return Bm;UN=1;var e=L6();Bm=t;function t(r,n){return e(r,n,"post")}return Bm}var Fm,GN;function tQ(){if(GN)return Fm;GN=1;var e=L6();Fm=t;function t(r,n){return e(r,n,"pre")}return Fm}var $m,KN;function rQ(){if(KN)return $m;KN=1;var e=Cn(),t=kS(),r=D6();$m=n;function n(i,o){var a=new t,s={},c=new r,d;function u(p){var v=p.v===d?p.w:p.v,y=c.priority(v);if(y!==void 0){var m=o(p);m<y&&(s[v]=d,c.decrease(v,m))}}if(i.nodeCount()===0)return a;e.each(i.nodes(),function(p){c.add(p,Number.POSITIVE_INFINITY),a.setNode(p)}),c.decrease(i.nodes()[0],0);for(var h=!1;c.size()>0;){if(d=c.removeMin(),e.has(s,d))a.setEdge(d,s[d]);else{if(h)throw new Error("Input graph is not connected: "+i);h=!0}i.nodeEdges(d).forEach(u)}return a}return $m}var Vm,YN;function nQ(){return YN||(YN=1,Vm={components:YJ(),dijkstra:j6(),dijkstraAll:XJ(),findCycles:ZJ(),floydWarshall:JJ(),isAcyclic:QJ(),postorder:eQ(),preorder:tQ(),prim:rQ(),tarjan:q6(),topsort:z6()}),Vm}var Hm,XN;function iQ(){if(XN)return Hm;XN=1;var e=GJ();return Hm={Graph:e.Graph,json:KJ(),alg:nQ(),version:e.version},Hm}var Wm,ZN;function $n(){if(ZN)return Wm;ZN=1;var e;if(typeof mS=="function")try{e=iQ()}catch{}return e||(e=window.graphlib),Wm=e,Wm}var Um,JN;function oQ(){if(JN)return Um;JN=1;var e=u6(),t=1,r=4;function n(i){return e(i,t|r)}return Um=n,Um}var Gm,QN;function Vd(){if(QN)return Gm;QN=1;var e=Va(),t=Oi(),r=Ad(),n=On();function i(o,a,s){if(!n(s))return!1;var c=typeof a;return(c=="number"?t(s)&&r(a,s.length):c=="string"&&a in s)?e(s[a],o):!1}return Gm=i,Gm}var Km,eT;function aQ(){if(eT)return Km;eT=1;var e=$d(),t=Va(),r=Vd(),n=Do(),i=Object.prototype,o=i.hasOwnProperty,a=e(function(s,c){s=Object(s);var d=-1,u=c.length,h=u>2?c[2]:void 0;for(h&&r(c[0],c[1],h)&&(u=1);++d<u;)for(var p=c[d],v=n(p),y=-1,m=v.length;++y<m;){var g=v[y],w=s[g];(w===void 0||t(w,i[g])&&!o.call(s,g))&&(s[g]=p[g])}return s});return Km=a,Km}var Ym,tT;function sQ(){if(tT)return Ym;tT=1;var e=Ci(),t=Oi(),r=to();function n(i){return function(o,a,s){var c=Object(o);if(!t(o)){var d=e(a,3);o=r(o),a=function(h){return d(c[h],h,c)}}var u=i(o,a,s);return u>-1?c[d?o[u]:u]:void 0}}return Ym=n,Ym}var Xm,rT;function lQ(){if(rT)return Xm;rT=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Xm=t,Xm}var Zm,nT;function cQ(){if(nT)return Zm;nT=1;var e=lQ(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Zm=r,Zm}var Jm,iT;function uQ(){if(iT)return Jm;iT=1;var e=cQ(),t=On(),r=Ga(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt;function c(d){if(typeof d=="number")return d;if(r(d))return n;if(t(d)){var u=typeof d.valueOf=="function"?d.valueOf():d;d=t(u)?u+"":u}if(typeof d!="string")return d===0?d:+d;d=e(d);var h=o.test(d);return h||a.test(d)?s(d.slice(2),h?2:8):i.test(d)?n:+d}return Jm=c,Jm}var Qm,oT;function B6(){if(oT)return Qm;oT=1;var e=uQ(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var o=i<0?-1:1;return o*r}return i===i?i:0}return Qm=n,Qm}var eb,aT;function dQ(){if(aT)return eb;aT=1;var e=B6();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return eb=t,eb}var tb,sT;function fQ(){if(sT)return tb;sT=1;var e=M6(),t=Ci(),r=dQ(),n=Math.max;function i(o,a,s){var c=o==null?0:o.length;if(!c)return-1;var d=s==null?0:r(s);return d<0&&(d=n(c+d,0)),e(o,t(a,3),d)}return tb=i,tb}var rb,lT;function hQ(){if(lT)return rb;lT=1;var e=sQ(),t=fQ(),r=e(t);return rb=r,rb}var nb,cT;function F6(){if(cT)return nb;cT=1;var e=MS();function t(r){var n=r==null?0:r.length;return n?e(r,1):[]}return nb=t,nb}var ib,uT;function pQ(){if(uT)return ib;uT=1;var e=RS(),t=d6(),r=Do();function n(i,o){return i==null?i:e(i,t(o),r)}return ib=n,ib}var ob,dT;function vQ(){if(dT)return ob;dT=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return ob=e,ob}var ab,fT;function gQ(){if(fT)return ab;fT=1;var e=Md(),t=NS(),r=Ci();function n(i,o){var a={};return o=r(o,3),t(i,function(s,c,d){e(a,c,o(s,c,d))}),a}return ab=n,ab}var sb,hT;function AS(){if(hT)return sb;hT=1;var e=Ga();function t(r,n,i){for(var o=-1,a=r.length;++o<a;){var s=r[o],c=n(s);if(c!=null&&(d===void 0?c===c&&!e(c):i(c,d)))var d=c,u=s}return u}return sb=t,sb}var lb,pT;function mQ(){if(pT)return lb;pT=1;function e(t,r){return t>r}return lb=e,lb}var cb,vT;function bQ(){if(vT)return cb;vT=1;var e=AS(),t=mQ(),r=jo();function n(i){return i&&i.length?e(i,r,t):void 0}return cb=n,cb}var ub,gT;function $6(){if(gT)return ub;gT=1;var e=Md(),t=Va();function r(n,i,o){(o!==void 0&&!t(n[i],o)||o===void 0&&!(i in n))&&e(n,i,o)}return ub=r,ub}var db,mT;function yQ(){if(mT)return db;mT=1;var e=ko(),t=qd(),r=si(),n="[object Object]",i=Function.prototype,o=Object.prototype,a=i.toString,s=o.hasOwnProperty,c=a.call(Object);function d(u){if(!r(u)||e(u)!=n)return!1;var h=t(u);if(h===null)return!0;var p=s.call(h,"constructor")&&h.constructor;return typeof p=="function"&&p instanceof p&&a.call(p)==c}return db=d,db}var fb,bT;function V6(){if(bT)return fb;bT=1;function e(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}return fb=e,fb}var hb,yT;function xQ(){if(yT)return hb;yT=1;var e=Tl(),t=Do();function r(n){return e(n,t(n))}return hb=r,hb}var pb,xT;function wQ(){if(xT)return pb;xT=1;var e=$6(),t=J4(),r=s6(),n=Q4(),i=c6(),o=Pl(),a=Ut(),s=k6(),c=Wa(),d=Nl(),u=On(),h=yQ(),p=Ml(),v=V6(),y=xQ();function m(g,w,x,_,S,E,I){var N=v(g,x),T=v(w,x),M=I.get(T);if(M){e(g,x,M);return}var z=E?E(N,T,x+"",g,w,I):void 0,j=z===void 0;if(j){var W=a(T),U=!W&&c(T),A=!W&&!U&&p(T);z=T,W||U||A?a(N)?z=N:s(N)?z=n(N):U?(j=!1,z=t(T,!0)):A?(j=!1,z=r(T,!0)):z=[]:h(T)||o(T)?(z=N,o(N)?z=y(N):(!u(N)||d(N))&&(z=i(T))):j=!1}j&&(I.set(T,z),S(z,T,_,E,I),I.delete(T)),e(g,x,z)}return pb=m,pb}var vb,wT;function SQ(){if(wT)return vb;wT=1;var e=Pd(),t=$6(),r=RS(),n=wQ(),i=On(),o=Do(),a=V6();function s(c,d,u,h,p){c!==d&&r(d,function(v,y){if(p||(p=new e),i(v))n(c,d,y,u,s,h,p);else{var m=h?h(a(c,y),v,y+"",c,d,p):void 0;m===void 0&&(m=v),t(c,y,m)}},o)}return vb=s,vb}var gb,ST;function EQ(){if(ST)return gb;ST=1;var e=$d(),t=Vd();function r(n){return e(function(i,o){var a=-1,s=o.length,c=s>1?o[s-1]:void 0,d=s>2?o[2]:void 0;for(c=n.length>3&&typeof c=="function"?(s--,c):void 0,d&&t(o[0],o[1],d)&&(c=s<3?void 0:c,s=1),i=Object(i);++a<s;){var u=o[a];u&&n(i,u,a,c)}return i})}return gb=r,gb}var mb,ET;function _Q(){if(ET)return mb;ET=1;var e=SQ(),t=EQ(),r=t(function(n,i,o){e(n,i,o)});return mb=r,mb}var bb,_T;function H6(){if(_T)return bb;_T=1;function e(t,r){return t<r}return bb=e,bb}var yb,OT;function OQ(){if(OT)return yb;OT=1;var e=AS(),t=H6(),r=jo();function n(i){return i&&i.length?e(i,r,t):void 0}return yb=n,yb}var xb,CT;function CQ(){if(CT)return xb;CT=1;var e=AS(),t=Ci(),r=H6();function n(i,o){return i&&i.length?e(i,t(o,2),r):void 0}return xb=n,xb}var wb,IT;function IQ(){if(IT)return wb;IT=1;var e=Vn(),t=function(){return e.Date.now()};return wb=t,wb}var Sb,RT;function RQ(){if(RT)return Sb;RT=1;var e=kd(),t=Bd(),r=Ad(),n=On(),i=kl();function o(a,s,c,d){if(!n(a))return a;s=t(s,a);for(var u=-1,h=s.length,p=h-1,v=a;v!=null&&++u<h;){var y=i(s[u]),m=c;if(y==="__proto__"||y==="constructor"||y==="prototype")return a;if(u!=p){var g=v[y];m=d?d(g,y,v):void 0,m===void 0&&(m=n(g)?g:r(s[u+1])?[]:{})}e(v,y,m),v=v[y]}return a}return Sb=o,Sb}var Eb,NT;function NQ(){if(NT)return Eb;NT=1;var e=Fd(),t=RQ(),r=Bd();function n(i,o,a){for(var s=-1,c=o.length,d={};++s<c;){var u=o[s],h=e(i,u);a(h,u)&&t(d,r(u,i),h)}return d}return Eb=n,Eb}var _b,TT;function TQ(){if(TT)return _b;TT=1;var e=NQ(),t=S6();function r(n,i){return e(n,i,function(o,a){return t(n,a)})}return _b=r,_b}var Ob,PT;function PQ(){if(PT)return Ob;PT=1;var e=F6(),t=T6(),r=P6();function n(i){return r(t(i,void 0,e),i+"")}return Ob=n,Ob}var Cb,MT;function MQ(){if(MT)return Cb;MT=1;var e=TQ(),t=PQ(),r=t(function(n,i){return n==null?{}:e(n,i)});return Cb=r,Cb}var Ib,kT;function kQ(){if(kT)return Ib;kT=1;var e=Math.ceil,t=Math.max;function r(n,i,o,a){for(var s=-1,c=t(e((i-n)/(o||1)),0),d=Array(c);c--;)d[a?c:++s]=n,n+=o;return d}return Ib=r,Ib}var Rb,AT;function AQ(){if(AT)return Rb;AT=1;var e=kQ(),t=Vd(),r=B6();function n(i){return function(o,a,s){return s&&typeof s!="number"&&t(o,a,s)&&(a=s=void 0),o=r(o),a===void 0?(a=o,o=0):a=r(a),s=s===void 0?o<a?1:-1:r(s),e(o,a,s,i)}}return Rb=n,Rb}var Nb,DT;function DQ(){if(DT)return Nb;DT=1;var e=AQ(),t=e();return Nb=t,Nb}var Tb,jT;function jQ(){if(jT)return Tb;jT=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return Tb=e,Tb}var Pb,qT;function qQ(){if(qT)return Pb;qT=1;var e=Ga();function t(r,n){if(r!==n){var i=r!==void 0,o=r===null,a=r===r,s=e(r),c=n!==void 0,d=n===null,u=n===n,h=e(n);if(!d&&!h&&!s&&r>n||s&&c&&u&&!d&&!h||o&&c&&u||!i&&u||!a)return 1;if(!o&&!s&&!h&&r<n||h&&i&&a&&!o&&!s||d&&i&&a||!c&&a||!u)return-1}return 0}return Pb=t,Pb}var Mb,zT;function zQ(){if(zT)return Mb;zT=1;var e=qQ();function t(r,n,i){for(var o=-1,a=r.criteria,s=n.criteria,c=a.length,d=i.length;++o<c;){var u=e(a[o],s[o]);if(u){if(o>=d)return u;var h=i[o];return u*(h=="desc"?-1:1)}}return r.index-n.index}return Mb=t,Mb}var kb,LT;function LQ(){if(LT)return kb;LT=1;var e=Ld(),t=Fd(),r=Ci(),n=I6(),i=jQ(),o=Dd(),a=zQ(),s=jo(),c=Ut();function d(u,h,p){h.length?h=e(h,function(m){return c(m)?function(g){return t(g,m.length===1?m[0]:m)}:m}):h=[s];var v=-1;h=e(h,o(r));var y=n(u,function(m,g,w){var x=e(h,function(_){return _(m)});return{criteria:x,index:++v,value:m}});return i(y,function(m,g){return a(m,g,p)})}return kb=d,kb}var Ab,BT;function BQ(){if(BT)return Ab;BT=1;var e=MS(),t=LQ(),r=$d(),n=Vd(),i=r(function(o,a){if(o==null)return[];var s=a.length;return s>1&&n(o,a[0],a[1])?a=[]:s>2&&n(a[0],a[1],a[2])&&(a=[a[0]]),t(o,e(a,1),[])});return Ab=i,Ab}var Db,FT;function FQ(){if(FT)return Db;FT=1;var e=x6(),t=0;function r(n){var i=++t;return e(n)+i}return Db=r,Db}var jb,$T;function $Q(){if($T)return jb;$T=1;function e(t,r,n){for(var i=-1,o=t.length,a=r.length,s={};++i<o;){var c=i<a?r[i]:void 0;n(s,t[i],c)}return s}return jb=e,jb}var qb,VT;function VQ(){if(VT)return qb;VT=1;var e=kd(),t=$Q();function r(n,i){return t(n||[],i||[],e)}return qb=r,qb}var zb,HT;function It(){if(HT)return zb;HT=1;var e;if(typeof mS=="function")try{e={cloneDeep:oQ(),constant:IS(),defaults:aQ(),each:h6(),filter:_6(),find:hQ(),flatten:F6(),forEach:f6(),forIn:pQ(),has:O6(),isUndefined:C6(),last:vQ(),map:R6(),mapValues:gQ(),max:bQ(),merge:_Q(),min:OQ(),minBy:CQ(),now:IQ(),pick:MQ(),range:DQ(),reduce:N6(),sortBy:BQ(),uniqueId:FQ(),values:A6(),zipObject:VQ()}}catch{}return e||(e=window._),zb=e,zb}var Lb,WT;function HQ(){if(WT)return Lb;WT=1,Lb=e;function e(){var n={};n._next=n._prev=n,this._sentinel=n}e.prototype.dequeue=function(){var n=this._sentinel,i=n._prev;if(i!==n)return t(i),i},e.prototype.enqueue=function(n){var i=this._sentinel;n._prev&&n._next&&t(n),n._next=i._next,i._next._prev=n,i._next=n,n._prev=i},e.prototype.toString=function(){for(var n=[],i=this._sentinel,o=i._prev;o!==i;)n.push(JSON.stringify(o,r)),o=o._prev;return"["+n.join(", ")+"]"};function t(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function r(n,i){if(n!=="_next"&&n!=="_prev")return i}return Lb}var Bb,UT;function WQ(){if(UT)return Bb;UT=1;var e=It(),t=$n().Graph,r=HQ();Bb=i;var n=e.constant(1);function i(d,u){if(d.nodeCount()<=1)return[];var h=s(d,u||n),p=o(h.graph,h.buckets,h.zeroIdx);return e.flatten(e.map(p,function(v){return d.outEdges(v.v,v.w)}),!0)}function o(d,u,h){for(var p=[],v=u[u.length-1],y=u[0],m;d.nodeCount();){for(;m=y.dequeue();)a(d,u,h,m);for(;m=v.dequeue();)a(d,u,h,m);if(d.nodeCount()){for(var g=u.length-2;g>0;--g)if(m=u[g].dequeue(),m){p=p.concat(a(d,u,h,m,!0));break}}}return p}function a(d,u,h,p,v){var y=v?[]:void 0;return e.forEach(d.inEdges(p.v),function(m){var g=d.edge(m),w=d.node(m.v);v&&y.push({v:m.v,w:m.w}),w.out-=g,c(u,h,w)}),e.forEach(d.outEdges(p.v),function(m){var g=d.edge(m),w=m.w,x=d.node(w);x.in-=g,c(u,h,x)}),d.removeNode(p.v),y}function s(d,u){var h=new t,p=0,v=0;e.forEach(d.nodes(),function(g){h.setNode(g,{v:g,in:0,out:0})}),e.forEach(d.edges(),function(g){var w=h.edge(g.v,g.w)||0,x=u(g),_=w+x;h.setEdge(g.v,g.w,_),v=Math.max(v,h.node(g.v).out+=x),p=Math.max(p,h.node(g.w).in+=x)});var y=e.range(v+p+3).map(function(){return new r}),m=p+1;return e.forEach(h.nodes(),function(g){c(y,m,h.node(g))}),{graph:h,buckets:y,zeroIdx:m}}function c(d,u,h){h.out?h.in?d[h.out-h.in+u].enqueue(h):d[d.length-1].enqueue(h):d[0].enqueue(h)}return Bb}var Fb,GT;function UQ(){if(GT)return Fb;GT=1;var e=It(),t=WQ();Fb={run:r,undo:i};function r(o){var a=o.graph().acyclicer==="greedy"?t(o,s(o)):n(o);e.forEach(a,function(c){var d=o.edge(c);o.removeEdge(c),d.forwardName=c.name,d.reversed=!0,o.setEdge(c.w,c.v,d,e.uniqueId("rev"))});function s(c){return function(d){return c.edge(d).weight}}}function n(o){var a=[],s={},c={};function d(u){e.has(c,u)||(c[u]=!0,s[u]=!0,e.forEach(o.outEdges(u),function(h){e.has(s,h.w)?a.push(h):d(h.w)}),delete s[u])}return e.forEach(o.nodes(),d),a}function i(o){e.forEach(o.edges(),function(a){var s=o.edge(a);if(s.reversed){o.removeEdge(a);var c=s.forwardName;delete s.reversed,delete s.forwardName,o.setEdge(a.w,a.v,s,c)}})}return Fb}var $b,KT;function Hr(){if(KT)return $b;KT=1;var e=It(),t=$n().Graph;$b={addDummyNode:r,simplify:n,asNonCompoundGraph:i,successorWeights:o,predecessorWeights:a,intersectRect:s,buildLayerMatrix:c,normalizeRanks:d,removeEmptyRanks:u,addBorderNode:h,maxRank:p,partition:v,time:y,notime:m};function r(g,w,x,_){var S;do S=e.uniqueId(_);while(g.hasNode(S));return x.dummy=w,g.setNode(S,x),S}function n(g){var w=new t().setGraph(g.graph());return e.forEach(g.nodes(),function(x){w.setNode(x,g.node(x))}),e.forEach(g.edges(),function(x){var _=w.edge(x.v,x.w)||{weight:0,minlen:1},S=g.edge(x);w.setEdge(x.v,x.w,{weight:_.weight+S.weight,minlen:Math.max(_.minlen,S.minlen)})}),w}function i(g){var w=new t({multigraph:g.isMultigraph()}).setGraph(g.graph());return e.forEach(g.nodes(),function(x){g.children(x).length||w.setNode(x,g.node(x))}),e.forEach(g.edges(),function(x){w.setEdge(x,g.edge(x))}),w}function o(g){var w=e.map(g.nodes(),function(x){var _={};return e.forEach(g.outEdges(x),function(S){_[S.w]=(_[S.w]||0)+g.edge(S).weight}),_});return e.zipObject(g.nodes(),w)}function a(g){var w=e.map(g.nodes(),function(x){var _={};return e.forEach(g.inEdges(x),function(S){_[S.v]=(_[S.v]||0)+g.edge(S).weight}),_});return e.zipObject(g.nodes(),w)}function s(g,w){var x=g.x,_=g.y,S=w.x-x,E=w.y-_,I=g.width/2,N=g.height/2;if(!S&&!E)throw new Error("Not possible to find intersection inside of the rectangle");var T,M;return Math.abs(E)*I>Math.abs(S)*N?(E<0&&(N=-N),T=N*S/E,M=N):(S<0&&(I=-I),T=I,M=I*E/S),{x:x+T,y:_+M}}function c(g){var w=e.map(e.range(p(g)+1),function(){return[]});return e.forEach(g.nodes(),function(x){var _=g.node(x),S=_.rank;e.isUndefined(S)||(w[S][_.order]=x)}),w}function d(g){var w=e.min(e.map(g.nodes(),function(x){return g.node(x).rank}));e.forEach(g.nodes(),function(x){var _=g.node(x);e.has(_,"rank")&&(_.rank-=w)})}function u(g){var w=e.min(e.map(g.nodes(),function(E){return g.node(E).rank})),x=[];e.forEach(g.nodes(),function(E){var I=g.node(E).rank-w;x[I]||(x[I]=[]),x[I].push(E)});var _=0,S=g.graph().nodeRankFactor;e.forEach(x,function(E,I){e.isUndefined(E)&&I%S!==0?--_:_&&e.forEach(E,function(N){g.node(N).rank+=_})})}function h(g,w,x,_){var S={width:0,height:0};return arguments.length>=4&&(S.rank=x,S.order=_),r(g,"border",S,w)}function p(g){return e.max(e.map(g.nodes(),function(w){var x=g.node(w).rank;if(!e.isUndefined(x))return x}))}function v(g,w){var x={lhs:[],rhs:[]};return e.forEach(g,function(_){w(_)?x.lhs.push(_):x.rhs.push(_)}),x}function y(g,w){var x=e.now();try{return w()}finally{console.log(g+" time: "+(e.now()-x)+"ms")}}function m(g,w){return w()}return $b}var Vb,YT;function GQ(){if(YT)return Vb;YT=1;var e=It(),t=Hr();Vb={run:r,undo:i};function r(o){o.graph().dummyChains=[],e.forEach(o.edges(),function(a){n(o,a)})}function n(o,a){var s=a.v,c=o.node(s).rank,d=a.w,u=o.node(d).rank,h=a.name,p=o.edge(a),v=p.labelRank;if(u!==c+1){o.removeEdge(a);var y,m,g;for(g=0,++c;c<u;++g,++c)p.points=[],m={width:0,height:0,edgeLabel:p,edgeObj:a,rank:c},y=t.addDummyNode(o,"edge",m,"_d"),c===v&&(m.width=p.width,m.height=p.height,m.dummy="edge-label",m.labelpos=p.labelpos),o.setEdge(s,y,{weight:p.weight},h),g===0&&o.graph().dummyChains.push(y),s=y;o.setEdge(s,d,{weight:p.weight},h)}}function i(o){e.forEach(o.graph().dummyChains,function(a){var s=o.node(a),c=s.edgeLabel,d;for(o.setEdge(s.edgeObj,c);s.dummy;)d=o.successors(a)[0],o.removeNode(a),c.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(c.x=s.x,c.y=s.y,c.width=s.width,c.height=s.height),a=d,s=o.node(a)})}return Vb}var Hb,XT;function Xu(){if(XT)return Hb;XT=1;var e=It();Hb={longestPath:t,slack:r};function t(n){var i={};function o(a){var s=n.node(a);if(e.has(i,a))return s.rank;i[a]=!0;var c=e.min(e.map(n.outEdges(a),function(d){return o(d.w)-n.edge(d).minlen}));return(c===Number.POSITIVE_INFINITY||c===void 0||c===null)&&(c=0),s.rank=c}e.forEach(n.sources(),o)}function r(n,i){return n.node(i.w).rank-n.node(i.v).rank-n.edge(i).minlen}return Hb}var Wb,ZT;function W6(){if(ZT)return Wb;ZT=1;var e=It(),t=$n().Graph,r=Xu().slack;Wb=n;function n(s){var c=new t({directed:!1}),d=s.nodes()[0],u=s.nodeCount();c.setNode(d,{});for(var h,p;i(c,s)<u;)h=o(c,s),p=c.hasNode(h.v)?r(s,h):-r(s,h),a(c,s,p);return c}function i(s,c){function d(u){e.forEach(c.nodeEdges(u),function(h){var p=h.v,v=u===p?h.w:p;!s.hasNode(v)&&!r(c,h)&&(s.setNode(v,{}),s.setEdge(u,v,{}),d(v))})}return e.forEach(s.nodes(),d),s.nodeCount()}function o(s,c){return e.minBy(c.edges(),function(d){if(s.hasNode(d.v)!==s.hasNode(d.w))return r(c,d)})}function a(s,c,d){e.forEach(s.nodes(),function(u){c.node(u).rank+=d})}return Wb}var Ub,JT;function KQ(){if(JT)return Ub;JT=1;var e=It(),t=W6(),r=Xu().slack,n=Xu().longestPath,i=$n().alg.preorder,o=$n().alg.postorder,a=Hr().simplify;Ub=s,s.initLowLimValues=h,s.initCutValues=c,s.calcCutValue=u,s.leaveEdge=v,s.enterEdge=y,s.exchangeEdges=m;function s(_){_=a(_),n(_);var S=t(_);h(S),c(S,_);for(var E,I;E=v(S);)I=y(S,_,E),m(S,_,E,I)}function c(_,S){var E=o(_,_.nodes());E=E.slice(0,E.length-1),e.forEach(E,function(I){d(_,S,I)})}function d(_,S,E){var I=_.node(E),N=I.parent;_.edge(E,N).cutvalue=u(_,S,E)}function u(_,S,E){var I=_.node(E),N=I.parent,T=!0,M=S.edge(E,N),z=0;return M||(T=!1,M=S.edge(N,E)),z=M.weight,e.forEach(S.nodeEdges(E),function(j){var W=j.v===E,U=W?j.w:j.v;if(U!==N){var A=W===T,K=S.edge(j).weight;if(z+=A?K:-K,w(_,E,U)){var V=_.edge(E,U).cutvalue;z+=A?-V:V}}}),z}function h(_,S){arguments.length<2&&(S=_.nodes()[0]),p(_,{},1,S)}function p(_,S,E,I,N){var T=E,M=_.node(I);return S[I]=!0,e.forEach(_.neighbors(I),function(z){e.has(S,z)||(E=p(_,S,E,z,I))}),M.low=T,M.lim=E++,N?M.parent=N:delete M.parent,E}function v(_){return e.find(_.edges(),function(S){return _.edge(S).cutvalue<0})}function y(_,S,E){var I=E.v,N=E.w;S.hasEdge(I,N)||(I=E.w,N=E.v);var T=_.node(I),M=_.node(N),z=T,j=!1;T.lim>M.lim&&(z=M,j=!0);var W=e.filter(S.edges(),function(U){return j===x(_,_.node(U.v),z)&&j!==x(_,_.node(U.w),z)});return e.minBy(W,function(U){return r(S,U)})}function m(_,S,E,I){var N=E.v,T=E.w;_.removeEdge(N,T),_.setEdge(I.v,I.w,{}),h(_),c(_,S),g(_,S)}function g(_,S){var E=e.find(_.nodes(),function(N){return!S.node(N).parent}),I=i(_,E);I=I.slice(1),e.forEach(I,function(N){var T=_.node(N).parent,M=S.edge(N,T),z=!1;M||(M=S.edge(T,N),z=!0),S.node(N).rank=S.node(T).rank+(z?M.minlen:-M.minlen)})}function w(_,S,E){return _.hasEdge(S,E)}function x(_,S,E){return E.low<=S.lim&&S.lim<=E.lim}return Ub}var Gb,QT;function YQ(){if(QT)return Gb;QT=1;var e=Xu(),t=e.longestPath,r=W6(),n=KQ();Gb=i;function i(c){switch(c.graph().ranker){case"network-simplex":s(c);break;case"tight-tree":a(c);break;case"longest-path":o(c);break;default:s(c)}}var o=t;function a(c){t(c),r(c)}function s(c){n(c)}return Gb}var Kb,eP;function XQ(){if(eP)return Kb;eP=1;var e=It();Kb=t;function t(i){var o=n(i);e.forEach(i.graph().dummyChains,function(a){for(var s=i.node(a),c=s.edgeObj,d=r(i,o,c.v,c.w),u=d.path,h=d.lca,p=0,v=u[p],y=!0;a!==c.w;){if(s=i.node(a),y){for(;(v=u[p])!==h&&i.node(v).maxRank<s.rank;)p++;v===h&&(y=!1)}if(!y){for(;p<u.length-1&&i.node(v=u[p+1]).minRank<=s.rank;)p++;v=u[p]}i.setParent(a,v),a=i.successors(a)[0]}})}function r(i,o,a,s){var c=[],d=[],u=Math.min(o[a].low,o[s].low),h=Math.max(o[a].lim,o[s].lim),p,v;p=a;do p=i.parent(p),c.push(p);while(p&&(o[p].low>u||h>o[p].lim));for(v=p,p=s;(p=i.parent(p))!==v;)d.push(p);return{path:c.concat(d.reverse()),lca:v}}function n(i){var o={},a=0;function s(c){var d=a;e.forEach(i.children(c),s),o[c]={low:d,lim:a++}}return e.forEach(i.children(),s),o}return Kb}var Yb,tP;function ZQ(){if(tP)return Yb;tP=1;var e=It(),t=Hr();Yb={run:r,cleanup:a};function r(s){var c=t.addDummyNode(s,"root",{},"_root"),d=i(s),u=e.max(e.values(d))-1,h=2*u+1;s.graph().nestingRoot=c,e.forEach(s.edges(),function(v){s.edge(v).minlen*=h});var p=o(s)+1;e.forEach(s.children(),function(v){n(s,c,h,p,u,d,v)}),s.graph().nodeRankFactor=h}function n(s,c,d,u,h,p,v){var y=s.children(v);if(!y.length){v!==c&&s.setEdge(c,v,{weight:0,minlen:d});return}var m=t.addBorderNode(s,"_bt"),g=t.addBorderNode(s,"_bb"),w=s.node(v);s.setParent(m,v),w.borderTop=m,s.setParent(g,v),w.borderBottom=g,e.forEach(y,function(x){n(s,c,d,u,h,p,x);var _=s.node(x),S=_.borderTop?_.borderTop:x,E=_.borderBottom?_.borderBottom:x,I=_.borderTop?u:2*u,N=S!==E?1:h-p[v]+1;s.setEdge(m,S,{weight:I,minlen:N,nestingEdge:!0}),s.setEdge(E,g,{weight:I,minlen:N,nestingEdge:!0})}),s.parent(v)||s.setEdge(c,m,{weight:0,minlen:h+p[v]})}function i(s){var c={};function d(u,h){var p=s.children(u);p&&p.length&&e.forEach(p,function(v){d(v,h+1)}),c[u]=h}return e.forEach(s.children(),function(u){d(u,1)}),c}function o(s){return e.reduce(s.edges(),function(c,d){return c+s.edge(d).weight},0)}function a(s){var c=s.graph();s.removeNode(c.nestingRoot),delete c.nestingRoot,e.forEach(s.edges(),function(d){var u=s.edge(d);u.nestingEdge&&s.removeEdge(d)})}return Yb}var Xb,rP;function JQ(){if(rP)return Xb;rP=1;var e=It(),t=Hr();Xb=r;function r(i){function o(a){var s=i.children(a),c=i.node(a);if(s.length&&e.forEach(s,o),e.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var d=c.minRank,u=c.maxRank+1;d<u;++d)n(i,"borderLeft","_bl",a,c,d),n(i,"borderRight","_br",a,c,d)}}e.forEach(i.children(),o)}function n(i,o,a,s,c,d){var u={width:0,height:0,rank:d,borderType:o},h=c[o][d-1],p=t.addDummyNode(i,"border",u,a);c[o][d]=p,i.setParent(p,s),h&&i.setEdge(h,p,{weight:1})}return Xb}var Zb,nP;function QQ(){if(nP)return Zb;nP=1;var e=It();Zb={adjust:t,undo:r};function t(d){var u=d.graph().rankdir.toLowerCase();(u==="lr"||u==="rl")&&n(d)}function r(d){var u=d.graph().rankdir.toLowerCase();(u==="bt"||u==="rl")&&o(d),(u==="lr"||u==="rl")&&(s(d),n(d))}function n(d){e.forEach(d.nodes(),function(u){i(d.node(u))}),e.forEach(d.edges(),function(u){i(d.edge(u))})}function i(d){var u=d.width;d.width=d.height,d.height=u}function o(d){e.forEach(d.nodes(),function(u){a(d.node(u))}),e.forEach(d.edges(),function(u){var h=d.edge(u);e.forEach(h.points,a),e.has(h,"y")&&a(h)})}function a(d){d.y=-d.y}function s(d){e.forEach(d.nodes(),function(u){c(d.node(u))}),e.forEach(d.edges(),function(u){var h=d.edge(u);e.forEach(h.points,c),e.has(h,"x")&&c(h)})}function c(d){var u=d.x;d.x=d.y,d.y=u}return Zb}var Jb,iP;function eee(){if(iP)return Jb;iP=1;var e=It();Jb=t;function t(r){var n={},i=e.filter(r.nodes(),function(d){return!r.children(d).length}),o=e.max(e.map(i,function(d){return r.node(d).rank})),a=e.map(e.range(o+1),function(){return[]});function s(d){if(!e.has(n,d)){n[d]=!0;var u=r.node(d);a[u.rank].push(d),e.forEach(r.successors(d),s)}}var c=e.sortBy(i,function(d){return r.node(d).rank});return e.forEach(c,s),a}return Jb}var Qb,oP;function tee(){if(oP)return Qb;oP=1;var e=It();Qb=t;function t(n,i){for(var o=0,a=1;a<i.length;++a)o+=r(n,i[a-1],i[a]);return o}function r(n,i,o){for(var a=e.zipObject(o,e.map(o,function(p,v){return v})),s=e.flatten(e.map(i,function(p){return e.sortBy(e.map(n.outEdges(p),function(v){return{pos:a[v.w],weight:n.edge(v).weight}}),"pos")}),!0),c=1;c<o.length;)c<<=1;var d=2*c-1;c-=1;var u=e.map(new Array(d),function(){return 0}),h=0;return e.forEach(s.forEach(function(p){var v=p.pos+c;u[v]+=p.weight;for(var y=0;v>0;)v%2&&(y+=u[v+1]),v=v-1>>1,u[v]+=p.weight;h+=p.weight*y})),h}return Qb}var e0,aP;function ree(){if(aP)return e0;aP=1;var e=It();e0=t;function t(r,n){return e.map(n,function(i){var o=r.inEdges(i);if(o.length){var a=e.reduce(o,function(s,c){var d=r.edge(c),u=r.node(c.v);return{sum:s.sum+d.weight*u.order,weight:s.weight+d.weight}},{sum:0,weight:0});return{v:i,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:i}})}return e0}var t0,sP;function nee(){if(sP)return t0;sP=1;var e=It();t0=t;function t(i,o){var a={};e.forEach(i,function(c,d){var u=a[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:d};e.isUndefined(c.barycenter)||(u.barycenter=c.barycenter,u.weight=c.weight)}),e.forEach(o.edges(),function(c){var d=a[c.v],u=a[c.w];!e.isUndefined(d)&&!e.isUndefined(u)&&(u.indegree++,d.out.push(a[c.w]))});var s=e.filter(a,function(c){return!c.indegree});return r(s)}function r(i){var o=[];function a(d){return function(u){u.merged||(e.isUndefined(u.barycenter)||e.isUndefined(d.barycenter)||u.barycenter>=d.barycenter)&&n(d,u)}}function s(d){return function(u){u.in.push(d),--u.indegree===0&&i.push(u)}}for(;i.length;){var c=i.pop();o.push(c),e.forEach(c.in.reverse(),a(c)),e.forEach(c.out,s(c))}return e.map(e.filter(o,function(d){return!d.merged}),function(d){return e.pick(d,["vs","i","barycenter","weight"])})}function n(i,o){var a=0,s=0;i.weight&&(a+=i.barycenter*i.weight,s+=i.weight),o.weight&&(a+=o.barycenter*o.weight,s+=o.weight),i.vs=o.vs.concat(i.vs),i.barycenter=a/s,i.weight=s,i.i=Math.min(o.i,i.i),o.merged=!0}return t0}var r0,lP;function iee(){if(lP)return r0;lP=1;var e=It(),t=Hr();r0=r;function r(o,a){var s=t.partition(o,function(m){return e.has(m,"barycenter")}),c=s.lhs,d=e.sortBy(s.rhs,function(m){return-m.i}),u=[],h=0,p=0,v=0;c.sort(i(!!a)),v=n(u,d,v),e.forEach(c,function(m){v+=m.vs.length,u.push(m.vs),h+=m.barycenter*m.weight,p+=m.weight,v=n(u,d,v)});var y={vs:e.flatten(u,!0)};return p&&(y.barycenter=h/p,y.weight=p),y}function n(o,a,s){for(var c;a.length&&(c=e.last(a)).i<=s;)a.pop(),o.push(c.vs),s++;return s}function i(o){return function(a,s){return a.barycenter<s.barycenter?-1:a.barycenter>s.barycenter?1:o?s.i-a.i:a.i-s.i}}return r0}var n0,cP;function oee(){if(cP)return n0;cP=1;var e=It(),t=ree(),r=nee(),n=iee();n0=i;function i(s,c,d,u){var h=s.children(c),p=s.node(c),v=p?p.borderLeft:void 0,y=p?p.borderRight:void 0,m={};v&&(h=e.filter(h,function(E){return E!==v&&E!==y}));var g=t(s,h);e.forEach(g,function(E){if(s.children(E.v).length){var I=i(s,E.v,d,u);m[E.v]=I,e.has(I,"barycenter")&&a(E,I)}});var w=r(g,d);o(w,m);var x=n(w,u);if(v&&(x.vs=e.flatten([v,x.vs,y],!0),s.predecessors(v).length)){var _=s.node(s.predecessors(v)[0]),S=s.node(s.predecessors(y)[0]);e.has(x,"barycenter")||(x.barycenter=0,x.weight=0),x.barycenter=(x.barycenter*x.weight+_.order+S.order)/(x.weight+2),x.weight+=2}return x}function o(s,c){e.forEach(s,function(d){d.vs=e.flatten(d.vs.map(function(u){return c[u]?c[u].vs:u}),!0)})}function a(s,c){e.isUndefined(s.barycenter)?(s.barycenter=c.barycenter,s.weight=c.weight):(s.barycenter=(s.barycenter*s.weight+c.barycenter*c.weight)/(s.weight+c.weight),s.weight+=c.weight)}return n0}var i0,uP;function aee(){if(uP)return i0;uP=1;var e=It(),t=$n().Graph;i0=r;function r(i,o,a){var s=n(i),c=new t({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(d){return i.node(d)});return e.forEach(i.nodes(),function(d){var u=i.node(d),h=i.parent(d);(u.rank===o||u.minRank<=o&&o<=u.maxRank)&&(c.setNode(d),c.setParent(d,h||s),e.forEach(i[a](d),function(p){var v=p.v===d?p.w:p.v,y=c.edge(v,d),m=e.isUndefined(y)?0:y.weight;c.setEdge(v,d,{weight:i.edge(p).weight+m})}),e.has(u,"minRank")&&c.setNode(d,{borderLeft:u.borderLeft[o],borderRight:u.borderRight[o]}))}),c}function n(i){for(var o;i.hasNode(o=e.uniqueId("_root")););return o}return i0}var o0,dP;function see(){if(dP)return o0;dP=1;var e=It();o0=t;function t(r,n,i){var o={},a;e.forEach(i,function(s){for(var c=r.parent(s),d,u;c;){if(d=r.parent(c),d?(u=o[d],o[d]=c):(u=a,a=c),u&&u!==c){n.setEdge(u,c);return}c=d}})}return o0}var a0,fP;function lee(){if(fP)return a0;fP=1;var e=It(),t=eee(),r=tee(),n=oee(),i=aee(),o=see(),a=$n().Graph,s=Hr();a0=c;function c(p){var v=s.maxRank(p),y=d(p,e.range(1,v+1),"inEdges"),m=d(p,e.range(v-1,-1,-1),"outEdges"),g=t(p);h(p,g);for(var w=Number.POSITIVE_INFINITY,x,_=0,S=0;S<4;++_,++S){u(_%2?y:m,_%4>=2),g=s.buildLayerMatrix(p);var E=r(p,g);E<w&&(S=0,x=e.cloneDeep(g),w=E)}h(p,x)}function d(p,v,y){return e.map(v,function(m){return i(p,m,y)})}function u(p,v){var y=new a;e.forEach(p,function(m){var g=m.graph().root,w=n(m,g,y,v);e.forEach(w.vs,function(x,_){m.node(x).order=_}),o(m,y,w.vs)})}function h(p,v){e.forEach(v,function(y){e.forEach(y,function(m,g){p.node(m).order=g})})}return a0}var s0,hP;function cee(){if(hP)return s0;hP=1;var e=It(),t=$n().Graph,r=Hr();s0={positionX:y,findType1Conflicts:n,findType2Conflicts:i,addConflict:a,hasConflict:s,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:p,findSmallestWidthAlignment:h,balance:v};function n(w,x){var _={};function S(E,I){var N=0,T=0,M=E.length,z=e.last(I);return e.forEach(I,function(j,W){var U=o(w,j),A=U?w.node(U).order:M;(U||j===z)&&(e.forEach(I.slice(T,W+1),function(K){e.forEach(w.predecessors(K),function(V){var te=w.node(V),G=te.order;(G<N||A<G)&&!(te.dummy&&w.node(K).dummy)&&a(_,V,K)})}),T=W+1,N=A)}),I}return e.reduce(x,S),_}function i(w,x){var _={};function S(I,N,T,M,z){var j;e.forEach(e.range(N,T),function(W){j=I[W],w.node(j).dummy&&e.forEach(w.predecessors(j),function(U){var A=w.node(U);A.dummy&&(A.order<M||A.order>z)&&a(_,U,j)})})}function E(I,N){var T=-1,M,z=0;return e.forEach(N,function(j,W){if(w.node(j).dummy==="border"){var U=w.predecessors(j);U.length&&(M=w.node(U[0]).order,S(N,z,W,T,M),z=W,T=M)}S(N,z,N.length,M,I.length)}),N}return e.reduce(x,E),_}function o(w,x){if(w.node(x).dummy)return e.find(w.predecessors(x),function(_){return w.node(_).dummy})}function a(w,x,_){if(x>_){var S=x;x=_,_=S}var E=w[x];E||(w[x]=E={}),E[_]=!0}function s(w,x,_){if(x>_){var S=x;x=_,_=S}return e.has(w[x],_)}function c(w,x,_,S){var E={},I={},N={};return e.forEach(x,function(T){e.forEach(T,function(M,z){E[M]=M,I[M]=M,N[M]=z})}),e.forEach(x,function(T){var M=-1;e.forEach(T,function(z){var j=S(z);if(j.length){j=e.sortBy(j,function(V){return N[V]});for(var W=(j.length-1)/2,U=Math.floor(W),A=Math.ceil(W);U<=A;++U){var K=j[U];I[z]===z&&M<N[K]&&!s(_,z,K)&&(I[K]=z,I[z]=E[z]=E[K],M=N[K])}}})}),{root:E,align:I}}function d(w,x,_,S,E){var I={},N=u(w,x,_,E),T=E?"borderLeft":"borderRight";function M(W,U){for(var A=N.nodes(),K=A.pop(),V={};K;)V[K]?W(K):(V[K]=!0,A.push(K),A=A.concat(U(K))),K=A.pop()}function z(W){I[W]=N.inEdges(W).reduce(function(U,A){return Math.max(U,I[A.v]+N.edge(A))},0)}function j(W){var U=N.outEdges(W).reduce(function(K,V){return Math.min(K,I[V.w]-N.edge(V))},Number.POSITIVE_INFINITY),A=w.node(W);U!==Number.POSITIVE_INFINITY&&A.borderType!==T&&(I[W]=Math.max(I[W],U))}return M(z,N.predecessors.bind(N)),M(j,N.successors.bind(N)),e.forEach(S,function(W){I[W]=I[_[W]]}),I}function u(w,x,_,S){var E=new t,I=w.graph(),N=m(I.nodesep,I.edgesep,S);return e.forEach(x,function(T){var M;e.forEach(T,function(z){var j=_[z];if(E.setNode(j),M){var W=_[M],U=E.edge(W,j);E.setEdge(W,j,Math.max(N(w,z,M),U||0))}M=z})}),E}function h(w,x){return e.minBy(e.values(x),function(_){var S=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY;return e.forIn(_,function(I,N){var T=g(w,N)/2;S=Math.max(I+T,S),E=Math.min(I-T,E)}),S-E})}function p(w,x){var _=e.values(x),S=e.min(_),E=e.max(_);e.forEach(["u","d"],function(I){e.forEach(["l","r"],function(N){var T=I+N,M=w[T],z;if(M!==x){var j=e.values(M);z=N==="l"?S-e.min(j):E-e.max(j),z&&(w[T]=e.mapValues(M,function(W){return W+z}))}})})}function v(w,x){return e.mapValues(w.ul,function(_,S){if(x)return w[x.toLowerCase()][S];var E=e.sortBy(e.map(w,S));return(E[1]+E[2])/2})}function y(w){var x=r.buildLayerMatrix(w),_=e.merge(n(w,x),i(w,x)),S={},E;e.forEach(["u","d"],function(N){E=N==="u"?x:e.values(x).reverse(),e.forEach(["l","r"],function(T){T==="r"&&(E=e.map(E,function(W){return e.values(W).reverse()}));var M=(N==="u"?w.predecessors:w.successors).bind(w),z=c(w,E,_,M),j=d(w,E,z.root,z.align,T==="r");T==="r"&&(j=e.mapValues(j,function(W){return-W})),S[N+T]=j})});var I=h(w,S);return p(S,I),v(S,w.graph().align)}function m(w,x,_){return function(S,E,I){var N=S.node(E),T=S.node(I),M=0,z;if(M+=N.width/2,e.has(N,"labelpos"))switch(N.labelpos.toLowerCase()){case"l":z=-N.width/2;break;case"r":z=N.width/2;break}if(z&&(M+=_?z:-z),z=0,M+=(N.dummy?x:w)/2,M+=(T.dummy?x:w)/2,M+=T.width/2,e.has(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":z=T.width/2;break;case"r":z=-T.width/2;break}return z&&(M+=_?z:-z),z=0,M}}function g(w,x){return w.node(x).width}return s0}var l0,pP;function uee(){if(pP)return l0;pP=1;var e=It(),t=Hr(),r=cee().positionX;l0=n;function n(o){o=t.asNonCompoundGraph(o),i(o),e.forEach(r(o),function(a,s){o.node(s).x=a})}function i(o){var a=t.buildLayerMatrix(o),s=o.graph().ranksep,c=0;e.forEach(a,function(d){var u=e.max(e.map(d,function(h){return o.node(h).height}));e.forEach(d,function(h){o.node(h).y=c+u/2}),c+=u+s})}return l0}var c0,vP;function dee(){if(vP)return c0;vP=1;var e=It(),t=UQ(),r=GQ(),n=YQ(),i=Hr().normalizeRanks,o=XQ(),a=Hr().removeEmptyRanks,s=ZQ(),c=JQ(),d=QQ(),u=lee(),h=uee(),p=Hr(),v=$n().Graph;c0=y;function y(D,$){var H=$&&$.debugTiming?p.time:p.notime;H("layout",function(){var q=H(" buildLayoutGraph",function(){return M(D)});H(" runLayout",function(){m(q,H)}),H(" updateInputGraph",function(){g(D,q)})})}function m(D,$){$(" makeSpaceForEdgeLabels",function(){z(D)}),$(" removeSelfEdges",function(){re(D)}),$(" acyclic",function(){t.run(D)}),$(" nestingGraph.run",function(){s.run(D)}),$(" rank",function(){n(p.asNonCompoundGraph(D))}),$(" injectEdgeLabelProxies",function(){j(D)}),$(" removeEmptyRanks",function(){a(D)}),$(" nestingGraph.cleanup",function(){s.cleanup(D)}),$(" normalizeRanks",function(){i(D)}),$(" assignRankMinMax",function(){W(D)}),$(" removeEdgeLabelProxies",function(){U(D)}),$(" normalize.run",function(){r.run(D)}),$(" parentDummyChains",function(){o(D)}),$(" addBorderSegments",function(){c(D)}),$(" order",function(){u(D)}),$(" insertSelfEdges",function(){P(D)}),$(" adjustCoordinateSystem",function(){d.adjust(D)}),$(" position",function(){h(D)}),$(" positionSelfEdges",function(){B(D)}),$(" removeBorderNodes",function(){G(D)}),$(" normalize.undo",function(){r.undo(D)}),$(" fixupEdgeLabelCoords",function(){V(D)}),$(" undoCoordinateSystem",function(){d.undo(D)}),$(" translateGraph",function(){A(D)}),$(" assignNodeIntersects",function(){K(D)}),$(" reversePoints",function(){te(D)}),$(" acyclic.undo",function(){t.undo(D)})}function g(D,$){e.forEach(D.nodes(),function(H){var q=D.node(H),Y=$.node(H);q&&(q.x=Y.x,q.y=Y.y,$.children(H).length&&(q.width=Y.width,q.height=Y.height))}),e.forEach(D.edges(),function(H){var q=D.edge(H),Y=$.edge(H);q.points=Y.points,e.has(Y,"x")&&(q.x=Y.x,q.y=Y.y)}),D.graph().width=$.graph().width,D.graph().height=$.graph().height}var w=["nodesep","edgesep","ranksep","marginx","marginy"],x={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],S=["width","height"],E={width:0,height:0},I=["minlen","weight","width","height","labeloffset"],N={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function M(D){var $=new v({multigraph:!0,compound:!0}),H=Q(D.graph());return $.setGraph(e.merge({},x,X(H,w),e.pick(H,_))),e.forEach(D.nodes(),function(q){var Y=Q(D.node(q));$.setNode(q,e.defaults(X(Y,S),E)),$.setParent(q,D.parent(q))}),e.forEach(D.edges(),function(q){var Y=Q(D.edge(q));$.setEdge(q,e.merge({},N,X(Y,I),e.pick(Y,T)))}),$}function z(D){var $=D.graph();$.ranksep/=2,e.forEach(D.edges(),function(H){var q=D.edge(H);q.minlen*=2,q.labelpos.toLowerCase()!=="c"&&($.rankdir==="TB"||$.rankdir==="BT"?q.width+=q.labeloffset:q.height+=q.labeloffset)})}function j(D){e.forEach(D.edges(),function($){var H=D.edge($);if(H.width&&H.height){var q=D.node($.v),Y=D.node($.w),ie={rank:(Y.rank-q.rank)/2+q.rank,e:$};p.addDummyNode(D,"edge-proxy",ie,"_ep")}})}function W(D){var $=0;e.forEach(D.nodes(),function(H){var q=D.node(H);q.borderTop&&(q.minRank=D.node(q.borderTop).rank,q.maxRank=D.node(q.borderBottom).rank,$=e.max($,q.maxRank))}),D.graph().maxRank=$}function U(D){e.forEach(D.nodes(),function($){var H=D.node($);H.dummy==="edge-proxy"&&(D.edge(H.e).labelRank=H.rank,D.removeNode($))})}function A(D){var $=Number.POSITIVE_INFINITY,H=0,q=Number.POSITIVE_INFINITY,Y=0,ie=D.graph(),ne=ie.marginx||0,ve=ie.marginy||0;function Z(J){var ae=J.x,he=J.y,ue=J.width,de=J.height;$=Math.min($,ae-ue/2),H=Math.max(H,ae+ue/2),q=Math.min(q,he-de/2),Y=Math.max(Y,he+de/2)}e.forEach(D.nodes(),function(J){Z(D.node(J))}),e.forEach(D.edges(),function(J){var ae=D.edge(J);e.has(ae,"x")&&Z(ae)}),$-=ne,q-=ve,e.forEach(D.nodes(),function(J){var ae=D.node(J);ae.x-=$,ae.y-=q}),e.forEach(D.edges(),function(J){var ae=D.edge(J);e.forEach(ae.points,function(he){he.x-=$,he.y-=q}),e.has(ae,"x")&&(ae.x-=$),e.has(ae,"y")&&(ae.y-=q)}),ie.width=H-$+ne,ie.height=Y-q+ve}function K(D){e.forEach(D.edges(),function($){var H=D.edge($),q=D.node($.v),Y=D.node($.w),ie,ne;H.points?(ie=H.points[0],ne=H.points[H.points.length-1]):(H.points=[],ie=Y,ne=q),H.points.unshift(p.intersectRect(q,ie)),H.points.push(p.intersectRect(Y,ne))})}function V(D){e.forEach(D.edges(),function($){var H=D.edge($);if(e.has(H,"x"))switch((H.labelpos==="l"||H.labelpos==="r")&&(H.width-=H.labeloffset),H.labelpos){case"l":H.x-=H.width/2+H.labeloffset;break;case"r":H.x+=H.width/2+H.labeloffset;break}})}function te(D){e.forEach(D.edges(),function($){var H=D.edge($);H.reversed&&H.points.reverse()})}function G(D){e.forEach(D.nodes(),function($){if(D.children($).length){var H=D.node($),q=D.node(H.borderTop),Y=D.node(H.borderBottom),ie=D.node(e.last(H.borderLeft)),ne=D.node(e.last(H.borderRight));H.width=Math.abs(ne.x-ie.x),H.height=Math.abs(Y.y-q.y),H.x=ie.x+H.width/2,H.y=q.y+H.height/2}}),e.forEach(D.nodes(),function($){D.node($).dummy==="border"&&D.removeNode($)})}function re(D){e.forEach(D.edges(),function($){if($.v===$.w){var H=D.node($.v);H.selfEdges||(H.selfEdges=[]),H.selfEdges.push({e:$,label:D.edge($)}),D.removeEdge($)}})}function P(D){var $=p.buildLayerMatrix(D);e.forEach($,function(H){var q=0;e.forEach(H,function(Y,ie){var ne=D.node(Y);ne.order=ie+q,e.forEach(ne.selfEdges,function(ve){p.addDummyNode(D,"selfedge",{width:ve.label.width,height:ve.label.height,rank:ne.rank,order:ie+ ++q,e:ve.e,label:ve.label},"_se")}),delete ne.selfEdges})})}function B(D){e.forEach(D.nodes(),function($){var H=D.node($);if(H.dummy==="selfedge"){var q=D.node(H.e.v),Y=q.x+q.width/2,ie=q.y,ne=H.x-Y,ve=q.height/2;D.setEdge(H.e,H.label),D.removeNode($),H.label.points=[{x:Y+2*ne/3,y:ie-ve},{x:Y+5*ne/6,y:ie-ve},{x:Y+ne,y:ie},{x:Y+5*ne/6,y:ie+ve},{x:Y+2*ne/3,y:ie+ve}],H.label.x=H.x,H.label.y=H.y}})}function X(D,$){return e.mapValues(e.pick(D,$),Number)}function Q(D){var $={};return e.forEach(D,function(H,q){$[q.toLowerCase()]=H}),$}return c0}var u0,gP;function fee(){if(gP)return u0;gP=1;var e=It(),t=Hr(),r=$n().Graph;u0={debugOrdering:n};function n(i){var o=t.buildLayerMatrix(i),a=new r({compound:!0,multigraph:!0}).setGraph({});return e.forEach(i.nodes(),function(s){a.setNode(s,{label:s}),a.setParent(s,"layer"+i.node(s).rank)}),e.forEach(i.edges(),function(s){a.setEdge(s.v,s.w,{},s.name)}),e.forEach(o,function(s,c){var d="layer"+c;a.setNode(d,{rank:"same"}),e.reduce(s,function(u,h){return a.setEdge(u,h,{style:"invis"}),h})}),a}return u0}var d0,mP;function hee(){return mP||(mP=1,d0="0.8.5"),d0}var f0,bP;function pee(){return bP||(bP=1,f0={graphlib:$n(),layout:dee(),debug:fee(),util:{time:Hr().time,notime:Hr().notime},version:hee()}),f0}var vee=pee();const yP=eo(vee);function gee(e){let t;const r=new Set,n=(d,u)=>{const h=typeof d=="function"?d(t):d;if(h!==t){const p=t;t=u?h:Object.assign({},t,h),r.forEach(v=>v(t,p))}},i=()=>t,o=(d,u=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=u(t);function v(){const y=u(t);if(!h(p,y)){const m=p;d(p=y,m)}}return r.add(v),()=>r.delete(v)},c={setState:n,getState:i,subscribe:(d,u,h)=>u||h?o(d,u,h):(r.add(d),()=>r.delete(d)),destroy:()=>r.clear()};return t=e(n,i,c),c}const mee=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),xP=mee?C.useEffect:C.useLayoutEffect;function bee(e){const t=typeof e=="function"?gee(e):e,r=(n=t.getState,i=Object.is)=>{const[,o]=C.useReducer(g=>g+1,0),a=t.getState(),s=C.useRef(a),c=C.useRef(n),d=C.useRef(i),u=C.useRef(!1),h=C.useRef();h.current===void 0&&(h.current=n(a));let p,v=!1;(s.current!==a||c.current!==n||d.current!==i||u.current)&&(p=n(a),v=!i(h.current,p)),xP(()=>{v&&(h.current=p),s.current=a,c.current=n,d.current=i,u.current=!1});const y=C.useRef(a);xP(()=>{const g=()=>{try{const x=t.getState(),_=c.current(x);d.current(h.current,_)||(s.current=x,h.current=_,o())}catch{u.current=!0,o()}},w=t.subscribe(g);return t.getState()!==y.current&&g(),w},[]);const m=v?p:h.current;return C.useDebugValue(m),m};return Object.assign(r,t),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[r,t];return{next(){const i=n.length<=0;return{value:n.shift(),done:i}}}},r}function yee(){const e=C.createContext(void 0);return{Provider:({initialStore:i,createStore:o,children:a})=>{const s=C.useRef();return s.current||(i&&(console.warn("Provider initialStore is deprecated and will be removed in the next version."),o||(o=()=>i)),s.current=o()),C.createElement(e.Provider,{value:s.current},a)},useStore:(i,o=Object.is)=>{const a=C.useContext(e);if(!a)throw new Error("Seems like you have not used zustand provider as an ancestor.");return a(i,o)},useStoreApi:()=>{const i=C.useContext(e);if(!i)throw new Error("Seems like you have not used zustand provider as an ancestor.");return C.useMemo(()=>({getState:i.getState,setState:i.setState,subscribe:i.subscribe,destroy:i.destroy}),[i])}}}var xee={value:()=>{}};function Hd(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Eu(r)}function Eu(e){this._=e}function wee(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Eu.prototype=Hd.prototype={constructor:Eu,on:function(e,t){var r=this._,n=wee(e+"",r),i,o=-1,a=n.length;if(arguments.length<2){for(;++o<a;)if((i=(e=n[o]).type)&&(i=See(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=n[o]).type)r[i]=wP(r[i],e.name,t);else if(t==null)for(i in r)r[i]=wP(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Eu(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,o;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],n=0,i=o.length;n<i;++n)o[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,o=n.length;i<o;++i)n[i].value.apply(t,r)}};function See(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function wP(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=xee,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var Dw="http://www.w3.org/1999/xhtml";const SP={svg:"http://www.w3.org/2000/svg",xhtml:Dw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wd(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),SP.hasOwnProperty(t)?{space:SP[t],local:e}:e}function Eee(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Dw&&t.documentElement.namespaceURI===Dw?t.createElement(e):t.createElementNS(r,e)}}function _ee(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function U6(e){var t=Wd(e);return(t.local?_ee:Eee)(t)}function Oee(){}function DS(e){return e==null?Oee:function(){return this.querySelector(e)}}function Cee(e){typeof e!="function"&&(e=DS(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var o=t[i],a=o.length,s=n[i]=new Array(a),c,d,u=0;u<a;++u)(c=o[u])&&(d=e.call(c,c.__data__,u,o))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new ln(n,this._parents)}function Iee(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ree(){return[]}function G6(e){return e==null?Ree:function(){return this.querySelectorAll(e)}}function Nee(e){return function(){return Iee(e.apply(this,arguments))}}function Tee(e){typeof e=="function"?e=Nee(e):e=G6(e);for(var t=this._groups,r=t.length,n=[],i=[],o=0;o<r;++o)for(var a=t[o],s=a.length,c,d=0;d<s;++d)(c=a[d])&&(n.push(e.call(c,c.__data__,d,a)),i.push(c));return new ln(n,i)}function K6(e){return function(){return this.matches(e)}}function Y6(e){return function(t){return t.matches(e)}}var Pee=Array.prototype.find;function Mee(e){return function(){return Pee.call(this.children,e)}}function kee(){return this.firstElementChild}function Aee(e){return this.select(e==null?kee:Mee(typeof e=="function"?e:Y6(e)))}var Dee=Array.prototype.filter;function jee(){return Array.from(this.children)}function qee(e){return function(){return Dee.call(this.children,e)}}function zee(e){return this.selectAll(e==null?jee:qee(typeof e=="function"?e:Y6(e)))}function Lee(e){typeof e!="function"&&(e=K6(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var o=t[i],a=o.length,s=n[i]=[],c,d=0;d<a;++d)(c=o[d])&&e.call(c,c.__data__,d,o)&&s.push(c);return new ln(n,this._parents)}function X6(e){return new Array(e.length)}function Bee(){return new ln(this._enter||this._groups.map(X6),this._parents)}function Zu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Zu.prototype={constructor:Zu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Fee(e){return function(){return e}}function $ee(e,t,r,n,i,o){for(var a=0,s,c=t.length,d=o.length;a<d;++a)(s=t[a])?(s.__data__=o[a],n[a]=s):r[a]=new Zu(e,o[a]);for(;a<c;++a)(s=t[a])&&(i[a]=s)}function Vee(e,t,r,n,i,o,a){var s,c,d=new Map,u=t.length,h=o.length,p=new Array(u),v;for(s=0;s<u;++s)(c=t[s])&&(p[s]=v=a.call(c,c.__data__,s,t)+"",d.has(v)?i[s]=c:d.set(v,c));for(s=0;s<h;++s)v=a.call(e,o[s],s,o)+"",(c=d.get(v))?(n[s]=c,c.__data__=o[s],d.delete(v)):r[s]=new Zu(e,o[s]);for(s=0;s<u;++s)(c=t[s])&&d.get(p[s])===c&&(i[s]=c)}function Hee(e){return e.__data__}function Wee(e,t){if(!arguments.length)return Array.from(this,Hee);var r=t?Vee:$ee,n=this._parents,i=this._groups;typeof e!="function"&&(e=Fee(e));for(var o=i.length,a=new Array(o),s=new Array(o),c=new Array(o),d=0;d<o;++d){var u=n[d],h=i[d],p=h.length,v=Uee(e.call(u,u&&u.__data__,d,n)),y=v.length,m=s[d]=new Array(y),g=a[d]=new Array(y),w=c[d]=new Array(p);r(u,h,m,g,w,v,t);for(var x=0,_=0,S,E;x<y;++x)if(S=m[x]){for(x>=_&&(_=x+1);!(E=g[_])&&++_<y;);S._next=E||null}}return a=new ln(a,n),a._enter=s,a._exit=c,a}function Uee(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Gee(){return new ln(this._exit||this._groups.map(X6),this._parents)}function Kee(e,t,r){var n=this.enter(),i=this,o=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?o.remove():r(o),n&&i?n.merge(i).order():i}function Yee(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,o=n.length,a=Math.min(i,o),s=new Array(i),c=0;c<a;++c)for(var d=r[c],u=n[c],h=d.length,p=s[c]=new Array(h),v,y=0;y<h;++y)(v=d[y]||u[y])&&(p[y]=v);for(;c<i;++c)s[c]=r[c];return new ln(s,this._parents)}function Xee(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,o=n[i],a;--i>=0;)(a=n[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function Zee(e){e||(e=Jee);function t(h,p){return h&&p?e(h.__data__,p.__data__):!h-!p}for(var r=this._groups,n=r.length,i=new Array(n),o=0;o<n;++o){for(var a=r[o],s=a.length,c=i[o]=new Array(s),d,u=0;u<s;++u)(d=a[u])&&(c[u]=d);c.sort(t)}return new ln(i,this._parents).order()}function Jee(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Qee(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ete(){return Array.from(this)}function tte(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,o=n.length;i<o;++i){var a=n[i];if(a)return a}return null}function rte(){let e=0;for(const t of this)++e;return e}function nte(){return!this.node()}function ite(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],o=0,a=i.length,s;o<a;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function ote(e){return function(){this.removeAttribute(e)}}function ate(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ste(e,t){return function(){this.setAttribute(e,t)}}function lte(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function cte(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function ute(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function dte(e,t){var r=Wd(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?ate:ote:typeof t=="function"?r.local?ute:cte:r.local?lte:ste)(r,t))}function Z6(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function fte(e){return function(){this.style.removeProperty(e)}}function hte(e,t,r){return function(){this.style.setProperty(e,t,r)}}function pte(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function vte(e,t,r){return arguments.length>1?this.each((t==null?fte:typeof t=="function"?pte:hte)(e,t,r??"")):ka(this.node(),e)}function ka(e,t){return e.style.getPropertyValue(t)||Z6(e).getComputedStyle(e,null).getPropertyValue(t)}function gte(e){return function(){delete this[e]}}function mte(e,t){return function(){this[e]=t}}function bte(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function yte(e,t){return arguments.length>1?this.each((t==null?gte:typeof t=="function"?bte:mte)(e,t)):this.node()[e]}function J6(e){return e.trim().split(/^|\s+/)}function jS(e){return e.classList||new Q6(e)}function Q6(e){this._node=e,this._names=J6(e.getAttribute("class")||"")}Q6.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function eq(e,t){for(var r=jS(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function tq(e,t){for(var r=jS(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function xte(e){return function(){eq(this,e)}}function wte(e){return function(){tq(this,e)}}function Ste(e,t){return function(){(t.apply(this,arguments)?eq:tq)(this,e)}}function Ete(e,t){var r=J6(e+"");if(arguments.length<2){for(var n=jS(this.node()),i=-1,o=r.length;++i<o;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?Ste:t?xte:wte)(r,t))}function _te(){this.textContent=""}function Ote(e){return function(){this.textContent=e}}function Cte(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ite(e){return arguments.length?this.each(e==null?_te:(typeof e=="function"?Cte:Ote)(e)):this.node().textContent}function Rte(){this.innerHTML=""}function Nte(e){return function(){this.innerHTML=e}}function Tte(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Pte(e){return arguments.length?this.each(e==null?Rte:(typeof e=="function"?Tte:Nte)(e)):this.node().innerHTML}function Mte(){this.nextSibling&&this.parentNode.appendChild(this)}function kte(){return this.each(Mte)}function Ate(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Dte(){return this.each(Ate)}function jte(e){var t=typeof e=="function"?e:U6(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qte(){return null}function zte(e,t){var r=typeof e=="function"?e:U6(e),n=t==null?qte:typeof t=="function"?t:DS(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function Lte(){var e=this.parentNode;e&&e.removeChild(this)}function Bte(){return this.each(Lte)}function Fte(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $te(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vte(e){return this.select(e?$te:Fte)}function Hte(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Wte(e){return function(t){e.call(this,t,this.__data__)}}function Ute(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function Gte(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,o;r<i;++r)o=t[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++n]=o;++n?t.length=n:delete this.__on}}}function Kte(e,t,r){return function(){var n=this.__on,i,o=Wte(t);if(n){for(var a=0,s=n.length;a<s;++a)if((i=n[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=r),i.value=t;return}}this.addEventListener(e.type,o,r),i={type:e.type,name:e.name,value:t,listener:o,options:r},n?n.push(i):this.__on=[i]}}function Yte(e,t,r){var n=Ute(e+""),i,o=n.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,d=s.length,u;c<d;++c)for(i=0,u=s[c];i<o;++i)if((a=n[i]).type===u.type&&a.name===u.name)return u.value}return}for(s=t?Kte:Gte,i=0;i<o;++i)this.each(s(n[i],t,r));return this}function rq(e,t,r){var n=Z6(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Xte(e,t){return function(){return rq(this,e,t)}}function Zte(e,t){return function(){return rq(this,e,t.apply(this,arguments))}}function Jte(e,t){return this.each((typeof t=="function"?Zte:Xte)(e,t))}function*Qte(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,o=n.length,a;i<o;++i)(a=n[i])&&(yield a)}var nq=[null];function ln(e,t){this._groups=e,this._parents=t}function Al(){return new ln([[document.documentElement]],nq)}function ere(){return this}ln.prototype=Al.prototype={constructor:ln,select:Cee,selectAll:Tee,selectChild:Aee,selectChildren:zee,filter:Lee,data:Wee,enter:Bee,exit:Gee,join:Kee,merge:Yee,selection:ere,order:Xee,sort:Zee,call:Qee,nodes:ete,node:tte,size:rte,empty:nte,each:ite,attr:dte,style:vte,property:yte,classed:Ete,text:Ite,html:Pte,raise:kte,lower:Dte,append:jte,insert:zte,remove:Bte,clone:Vte,datum:Hte,on:Yte,dispatch:Jte,[Symbol.iterator]:Qte};function jn(e){return typeof e=="string"?new ln([[document.querySelector(e)]],[document.documentElement]):new ln([[e]],nq)}function tre(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ti(e,t){if(e=tre(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const rre={passive:!1},hl={capture:!0,passive:!1};function h0(e){e.stopImmediatePropagation()}function Sa(e){e.preventDefault(),e.stopImmediatePropagation()}function iq(e){var t=e.document.documentElement,r=jn(e).on("dragstart.drag",Sa,hl);"onselectstart"in t?r.on("selectstart.drag",Sa,hl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function oq(e,t){var r=e.document.documentElement,n=jn(e).on("dragstart.drag",null);t&&(n.on("click.drag",Sa,hl),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Gc=e=>()=>e;function jw(e,{sourceEvent:t,subject:r,target:n,identifier:i,active:o,x:a,y:s,dx:c,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}jw.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nre(e){return!e.ctrlKey&&!e.button}function ire(){return this.parentNode}function ore(e,t){return t??{x:e.x,y:e.y}}function are(){return navigator.maxTouchPoints||"ontouchstart"in this}function sre(){var e=nre,t=ire,r=ore,n=are,i={},o=Hd("start","drag","end"),a=0,s,c,d,u,h=0;function p(S){S.on("mousedown.drag",v).filter(n).on("touchstart.drag",g).on("touchmove.drag",w,rre).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(S,E){if(!(u||!e.call(this,S,E))){var I=_(this,t.call(this,S,E),S,E,"mouse");I&&(jn(S.view).on("mousemove.drag",y,hl).on("mouseup.drag",m,hl),iq(S.view),h0(S),d=!1,s=S.clientX,c=S.clientY,I("start",S))}}function y(S){if(Sa(S),!d){var E=S.clientX-s,I=S.clientY-c;d=E*E+I*I>h}i.mouse("drag",S)}function m(S){jn(S.view).on("mousemove.drag mouseup.drag",null),oq(S.view,d),Sa(S),i.mouse("end",S)}function g(S,E){if(e.call(this,S,E)){var I=S.changedTouches,N=t.call(this,S,E),T=I.length,M,z;for(M=0;M<T;++M)(z=_(this,N,S,E,I[M].identifier,I[M]))&&(h0(S),z("start",S,I[M]))}}function w(S){var E=S.changedTouches,I=E.length,N,T;for(N=0;N<I;++N)(T=i[E[N].identifier])&&(Sa(S),T("drag",S,E[N]))}function x(S){var E=S.changedTouches,I=E.length,N,T;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),N=0;N<I;++N)(T=i[E[N].identifier])&&(h0(S),T("end",S,E[N]))}function _(S,E,I,N,T,M){var z=o.copy(),j=ti(M||I,E),W,U,A;if((A=r.call(S,new jw("beforestart",{sourceEvent:I,target:p,identifier:T,active:a,x:j[0],y:j[1],dx:0,dy:0,dispatch:z}),N))!=null)return W=A.x-j[0]||0,U=A.y-j[1]||0,function K(V,te,G){var re=j,P;switch(V){case"start":i[T]=K,P=a++;break;case"end":delete i[T],--a;case"drag":j=ti(G||te,E),P=a;break}z.call(V,S,new jw(V,{sourceEvent:te,subject:A,target:p,identifier:T,active:P,x:j[0]+W,y:j[1]+U,dx:j[0]-re[0],dy:j[1]-re[1],dispatch:z}),N)}}return p.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Gc(!!S),p):e},p.container=function(S){return arguments.length?(t=typeof S=="function"?S:Gc(S),p):t},p.subject=function(S){return arguments.length?(r=typeof S=="function"?S:Gc(S),p):r},p.touchable=function(S){return arguments.length?(n=typeof S=="function"?S:Gc(!!S),p):n},p.on=function(){var S=o.on.apply(o,arguments);return S===o?p:S},p.clickDistance=function(S){return arguments.length?(h=(S=+S)*S,p):Math.sqrt(h)},p}function qS(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function aq(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Dl(){}var pl=.7,Ju=1/pl,Ea="\\s*([+-]?\\d+)\\s*",vl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lre=/^#([0-9a-f]{3,8})$/,cre=new RegExp(`^rgb\\(${Ea},${Ea},${Ea}\\)$`),ure=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),dre=new RegExp(`^rgba\\(${Ea},${Ea},${Ea},${vl}\\)$`),fre=new RegExp(`^rgba\\(${ii},${ii},${ii},${vl}\\)$`),hre=new RegExp(`^hsl\\(${vl},${ii},${ii}\\)$`),pre=new RegExp(`^hsla\\(${vl},${ii},${ii},${vl}\\)$`),EP={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};qS(Dl,gl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_P,formatHex:_P,formatHex8:vre,formatHsl:gre,formatRgb:OP,toString:OP});function _P(){return this.rgb().formatHex()}function vre(){return this.rgb().formatHex8()}function gre(){return sq(this).formatHsl()}function OP(){return this.rgb().formatRgb()}function gl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=lre.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?CP(t):r===3?new Fr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Kc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Kc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=cre.exec(e))?new Fr(t[1],t[2],t[3],1):(t=ure.exec(e))?new Fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dre.exec(e))?Kc(t[1],t[2],t[3],t[4]):(t=fre.exec(e))?Kc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hre.exec(e))?NP(t[1],t[2]/100,t[3]/100,1):(t=pre.exec(e))?NP(t[1],t[2]/100,t[3]/100,t[4]):EP.hasOwnProperty(e)?CP(EP[e]):e==="transparent"?new Fr(NaN,NaN,NaN,0):null}function CP(e){return new Fr(e>>16&255,e>>8&255,e&255,1)}function Kc(e,t,r,n){return n<=0&&(e=t=r=NaN),new Fr(e,t,r,n)}function mre(e){return e instanceof Dl||(e=gl(e)),e?(e=e.rgb(),new Fr(e.r,e.g,e.b,e.opacity)):new Fr}function qw(e,t,r,n){return arguments.length===1?mre(e):new Fr(e,t,r,n??1)}function Fr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}qS(Fr,qw,aq(Dl,{brighter(e){return e=e==null?Ju:Math.pow(Ju,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pl:Math.pow(pl,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fr(Oo(this.r),Oo(this.g),Oo(this.b),Qu(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:IP,formatHex:IP,formatHex8:bre,formatRgb:RP,toString:RP}));function IP(){return`#${xo(this.r)}${xo(this.g)}${xo(this.b)}`}function bre(){return`#${xo(this.r)}${xo(this.g)}${xo(this.b)}${xo((isNaN(this.opacity)?1:this.opacity)*255)}`}function RP(){const e=Qu(this.opacity);return`${e===1?"rgb(":"rgba("}${Oo(this.r)}, ${Oo(this.g)}, ${Oo(this.b)}${e===1?")":`, ${e})`}`}function Qu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Oo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xo(e){return e=Oo(e),(e<16?"0":"")+e.toString(16)}function NP(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new qn(e,t,r,n)}function sq(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof Dl||(e=gl(e)),!e)return new qn;if(e instanceof qn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,c=(o+i)/2;return s?(t===o?a=(r-n)/s+(r<n)*6:r===o?a=(n-t)/s+2:a=(t-r)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new qn(a,s,c,e.opacity)}function yre(e,t,r,n){return arguments.length===1?sq(e):new qn(e,t,r,n??1)}function qn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}qS(qn,yre,aq(Dl,{brighter(e){return e=e==null?Ju:Math.pow(Ju,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pl:Math.pow(pl,e),new qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Fr(p0(e>=240?e-240:e+120,i,n),p0(e,i,n),p0(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new qn(TP(this.h),Yc(this.s),Yc(this.l),Qu(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=Qu(this.opacity);return`${e===1?"hsl(":"hsla("}${TP(this.h)}, ${Yc(this.s)*100}%, ${Yc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function TP(e){return e=(e||0)%360,e<0?e+360:e}function Yc(e){return Math.max(0,Math.min(1,e||0))}function p0(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const lq=e=>()=>e;function xre(e,t){return function(r){return e+r*t}}function wre(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Sre(e){return(e=+e)==1?cq:function(t,r){return r-t?wre(t,r,e):lq(isNaN(t)?r:t)}}function cq(e,t){var r=t-e;return r?xre(e,r):lq(isNaN(e)?t:e)}const PP=(function e(t){var r=Sre(t);function n(i,o){var a=r((i=qw(i)).r,(o=qw(o)).r),s=r(i.g,o.g),c=r(i.b,o.b),d=cq(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=c(u),i.opacity=d(u),i+""}}return n.gamma=e,n})(1);function Gi(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var zw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,v0=new RegExp(zw.source,"g");function Ere(e){return function(){return e}}function _re(e){return function(t){return e(t)+""}}function Ore(e,t){var r=zw.lastIndex=v0.lastIndex=0,n,i,o,a=-1,s=[],c=[];for(e=e+"",t=t+"";(n=zw.exec(e))&&(i=v0.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,c.push({i:a,x:Gi(n,i)})),r=v0.lastIndex;return r<t.length&&(o=t.slice(r),s[a]?s[a]+=o:s[++a]=o),s.length<2?c[0]?_re(c[0].x):Ere(t):(t=c.length,function(d){for(var u=0,h;u<t;++u)s[(h=c[u]).i]=h.x(d);return s.join("")})}var MP=180/Math.PI,Lw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function uq(e,t,r,n,i,o){var a,s,c;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(c=e*r+t*n)&&(r-=e*c,n-=t*c),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,c/=s),e*n<t*r&&(e=-e,t=-t,c=-c,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*MP,skewX:Math.atan(c)*MP,scaleX:a,scaleY:s}}var Xc;function Cre(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Lw:uq(t.a,t.b,t.c,t.d,t.e,t.f)}function Ire(e){return e==null||(Xc||(Xc=document.createElementNS("http://www.w3.org/2000/svg","g")),Xc.setAttribute("transform",e),!(e=Xc.transform.baseVal.consolidate()))?Lw:(e=e.matrix,uq(e.a,e.b,e.c,e.d,e.e,e.f))}function dq(e,t,r,n){function i(d){return d.length?d.pop()+" ":""}function o(d,u,h,p,v,y){if(d!==h||u!==p){var m=v.push("translate(",null,t,null,r);y.push({i:m-4,x:Gi(d,h)},{i:m-2,x:Gi(u,p)})}else(h||p)&&v.push("translate("+h+t+p+r)}function a(d,u,h,p){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),p.push({i:h.push(i(h)+"rotate(",null,n)-2,x:Gi(d,u)})):u&&h.push(i(h)+"rotate("+u+n)}function s(d,u,h,p){d!==u?p.push({i:h.push(i(h)+"skewX(",null,n)-2,x:Gi(d,u)}):u&&h.push(i(h)+"skewX("+u+n)}function c(d,u,h,p,v,y){if(d!==h||u!==p){var m=v.push(i(v)+"scale(",null,",",null,")");y.push({i:m-4,x:Gi(d,h)},{i:m-2,x:Gi(u,p)})}else(h!==1||p!==1)&&v.push(i(v)+"scale("+h+","+p+")")}return function(d,u){var h=[],p=[];return d=e(d),u=e(u),o(d.translateX,d.translateY,u.translateX,u.translateY,h,p),a(d.rotate,u.rotate,h,p),s(d.skewX,u.skewX,h,p),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,h,p),d=u=null,function(v){for(var y=-1,m=p.length,g;++y<m;)h[(g=p[y]).i]=g.x(v);return h.join("")}}}var Rre=dq(Cre,"px, ","px)","deg)"),Nre=dq(Ire,", ",")",")"),Tre=1e-12;function kP(e){return((e=Math.exp(e))+1/e)/2}function Pre(e){return((e=Math.exp(e))-1/e)/2}function Mre(e){return((e=Math.exp(2*e))-1)/(e+1)}const kre=(function e(t,r,n){function i(o,a){var s=o[0],c=o[1],d=o[2],u=a[0],h=a[1],p=a[2],v=u-s,y=h-c,m=v*v+y*y,g,w;if(m<Tre)w=Math.log(p/d)/t,g=function(N){return[s+N*v,c+N*y,d*Math.exp(t*N*w)]};else{var x=Math.sqrt(m),_=(p*p-d*d+n*m)/(2*d*r*x),S=(p*p-d*d-n*m)/(2*p*r*x),E=Math.log(Math.sqrt(_*_+1)-_),I=Math.log(Math.sqrt(S*S+1)-S);w=(I-E)/t,g=function(N){var T=N*w,M=kP(E),z=d/(r*x)*(M*Mre(t*T+E)-Pre(E));return[s+z*v,c+z*y,d*M/kP(t*T+E)]}}return g.duration=w*1e3*t/Math.SQRT2,g}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,c=s*s;return e(a,s,c)},i})(Math.SQRT2,2,4);var Aa=0,Gs=0,_s=0,fq=1e3,ed,Ks,td=0,Po=0,Ud=0,ml=typeof performance=="object"&&performance.now?performance:Date,hq=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zS(){return Po||(hq(Are),Po=ml.now()+Ud)}function Are(){Po=0}function rd(){this._call=this._time=this._next=null}rd.prototype=pq.prototype={constructor:rd,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?zS():+r)+(t==null?0:+t),!this._next&&Ks!==this&&(Ks?Ks._next=this:ed=this,Ks=this),this._call=e,this._time=r,Bw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bw())}};function pq(e,t,r){var n=new rd;return n.restart(e,t,r),n}function Dre(){zS(),++Aa;for(var e=ed,t;e;)(t=Po-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Aa}function AP(){Po=(td=ml.now())+Ud,Aa=Gs=0;try{Dre()}finally{Aa=0,qre(),Po=0}}function jre(){var e=ml.now(),t=e-td;t>fq&&(Ud-=t,td=e)}function qre(){for(var e,t=ed,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:ed=r);Ks=e,Bw(n)}function Bw(e){if(!Aa){Gs&&(Gs=clearTimeout(Gs));var t=e-Po;t>24?(e<1/0&&(Gs=setTimeout(AP,e-ml.now()-Ud)),_s&&(_s=clearInterval(_s))):(_s||(td=ml.now(),_s=setInterval(jre,fq)),Aa=1,hq(AP))}}function DP(e,t,r){var n=new rd;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var zre=Hd("start","end","cancel","interrupt"),Lre=[],vq=0,jP=1,Fw=2,_u=3,qP=4,$w=5,Ou=6;function Gd(e,t,r,n,i,o){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;Bre(e,r,{name:t,index:n,group:i,on:zre,tween:Lre,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:vq})}function LS(e,t){var r=Hn(e,t);if(r.state>vq)throw new Error("too late; already scheduled");return r}function li(e,t){var r=Hn(e,t);if(r.state>_u)throw new Error("too late; already running");return r}function Hn(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Bre(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=pq(o,0,r.time);function o(d){r.state=jP,r.timer.restart(a,r.delay,r.time),r.delay<=d&&a(d-r.delay)}function a(d){var u,h,p,v;if(r.state!==jP)return c();for(u in n)if(v=n[u],v.name===r.name){if(v.state===_u)return DP(a);v.state===qP?(v.state=Ou,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete n[u]):+u<t&&(v.state=Ou,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete n[u])}if(DP(function(){r.state===_u&&(r.state=qP,r.timer.restart(s,r.delay,r.time),s(d))}),r.state=Fw,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Fw){for(r.state=_u,i=new Array(p=r.tween.length),u=0,h=-1;u<p;++u)(v=r.tween[u].value.call(e,e.__data__,r.index,r.group))&&(i[++h]=v);i.length=h+1}}function s(d){for(var u=d<r.duration?r.ease.call(null,d/r.duration):(r.timer.restart(c),r.state=$w,1),h=-1,p=i.length;++h<p;)i[h].call(e,u);r.state===$w&&(r.on.call("end",e,e.__data__,r.index,r.group),c())}function c(){r.state=Ou,r.timer.stop(),delete n[t];for(var d in n)return;delete e.__transition}}function Cu(e,t){var r=e.__transition,n,i,o=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((n=r[a]).name!==t){o=!1;continue}i=n.state>Fw&&n.state<$w,n.state=Ou,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[a]}o&&delete e.__transition}}function Fre(e){return this.each(function(){Cu(this,e)})}function $re(e,t){var r,n;return function(){var i=li(this,e),o=i.tween;if(o!==r){n=r=o;for(var a=0,s=n.length;a<s;++a)if(n[a].name===t){n=n.slice(),n.splice(a,1);break}}i.tween=n}}function Vre(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var o=li(this,e),a=o.tween;if(a!==n){i=(n=a).slice();for(var s={name:t,value:r},c=0,d=i.length;c<d;++c)if(i[c].name===t){i[c]=s;break}c===d&&i.push(s)}o.tween=i}}function Hre(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=Hn(this.node(),r).tween,i=0,o=n.length,a;i<o;++i)if((a=n[i]).name===e)return a.value;return null}return this.each((t==null?$re:Vre)(r,e,t))}function BS(e,t,r){var n=e._id;return e.each(function(){var i=li(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return Hn(i,n).value[t]}}function gq(e,t){var r;return(typeof t=="number"?Gi:t instanceof gl?PP:(r=gl(t))?(t=r,PP):Ore)(e,t)}function Wre(e){return function(){this.removeAttribute(e)}}function Ure(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Gre(e,t,r){var n,i=r+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===n?o:o=t(n=a,r)}}function Kre(e,t,r){var n,i=r+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===n?o:o=t(n=a,r)}}function Yre(e,t,r){var n,i,o;return function(){var a,s=r(this),c;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=s+"",a===c?null:a===n&&c===i?o:(i=c,o=t(n=a,s)))}}function Xre(e,t,r){var n,i,o;return function(){var a,s=r(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=s+"",a===c?null:a===n&&c===i?o:(i=c,o=t(n=a,s)))}}function Zre(e,t){var r=Wd(e),n=r==="transform"?Nre:gq;return this.attrTween(e,typeof t=="function"?(r.local?Xre:Yre)(r,n,BS(this,"attr."+e,t)):t==null?(r.local?Ure:Wre)(r):(r.local?Kre:Gre)(r,n,t))}function Jre(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Qre(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function ene(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Qre(e,o)),r}return i._value=t,i}function tne(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Jre(e,o)),r}return i._value=t,i}function rne(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=Wd(e);return this.tween(r,(n.local?ene:tne)(n,t))}function nne(e,t){return function(){LS(this,e).delay=+t.apply(this,arguments)}}function ine(e,t){return t=+t,function(){LS(this,e).delay=t}}function one(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?nne:ine)(t,e)):Hn(this.node(),t).delay}function ane(e,t){return function(){li(this,e).duration=+t.apply(this,arguments)}}function sne(e,t){return t=+t,function(){li(this,e).duration=t}}function lne(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ane:sne)(t,e)):Hn(this.node(),t).duration}function cne(e,t){if(typeof t!="function")throw new Error;return function(){li(this,e).ease=t}}function une(e){var t=this._id;return arguments.length?this.each(cne(t,e)):Hn(this.node(),t).ease}function dne(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;li(this,e).ease=r}}function fne(e){if(typeof e!="function")throw new Error;return this.each(dne(this._id,e))}function hne(e){typeof e!="function"&&(e=K6(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var o=t[i],a=o.length,s=n[i]=[],c,d=0;d<a;++d)(c=o[d])&&e.call(c,c.__data__,d,o)&&s.push(c);return new _i(n,this._parents,this._name,this._id)}function pne(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,o=Math.min(n,i),a=new Array(n),s=0;s<o;++s)for(var c=t[s],d=r[s],u=c.length,h=a[s]=new Array(u),p,v=0;v<u;++v)(p=c[v]||d[v])&&(h[v]=p);for(;s<n;++s)a[s]=t[s];return new _i(a,this._parents,this._name,this._id)}function vne(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function gne(e,t,r){var n,i,o=vne(t)?LS:li;return function(){var a=o(this,e),s=a.on;s!==n&&(i=(n=s).copy()).on(t,r),a.on=i}}function mne(e,t){var r=this._id;return arguments.length<2?Hn(this.node(),r).on.on(e):this.each(gne(r,e,t))}function bne(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function yne(){return this.on("end.remove",bne(this._id))}function xne(e){var t=this._name,r=this._id;typeof e!="function"&&(e=DS(e));for(var n=this._groups,i=n.length,o=new Array(i),a=0;a<i;++a)for(var s=n[a],c=s.length,d=o[a]=new Array(c),u,h,p=0;p<c;++p)(u=s[p])&&(h=e.call(u,u.__data__,p,s))&&("__data__"in u&&(h.__data__=u.__data__),d[p]=h,Gd(d[p],t,r,p,d,Hn(u,r)));return new _i(o,this._parents,t,r)}function wne(e){var t=this._name,r=this._id;typeof e!="function"&&(e=G6(e));for(var n=this._groups,i=n.length,o=[],a=[],s=0;s<i;++s)for(var c=n[s],d=c.length,u,h=0;h<d;++h)if(u=c[h]){for(var p=e.call(u,u.__data__,h,c),v,y=Hn(u,r),m=0,g=p.length;m<g;++m)(v=p[m])&&Gd(v,t,r,m,p,y);o.push(p),a.push(u)}return new _i(o,a,t,r)}var Sne=Al.prototype.constructor;function Ene(){return new Sne(this._groups,this._parents)}function _ne(e,t){var r,n,i;return function(){var o=ka(this,e),a=(this.style.removeProperty(e),ka(this,e));return o===a?null:o===r&&a===n?i:i=t(r=o,n=a)}}function mq(e){return function(){this.style.removeProperty(e)}}function One(e,t,r){var n,i=r+"",o;return function(){var a=ka(this,e);return a===i?null:a===n?o:o=t(n=a,r)}}function Cne(e,t,r){var n,i,o;return function(){var a=ka(this,e),s=r(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),ka(this,e))),a===c?null:a===n&&c===i?o:(i=c,o=t(n=a,s))}}function Ine(e,t){var r,n,i,o="style."+t,a="end."+o,s;return function(){var c=li(this,e),d=c.on,u=c.value[o]==null?s||(s=mq(t)):void 0;(d!==r||i!==u)&&(n=(r=d).copy()).on(a,i=u),c.on=n}}function Rne(e,t,r){var n=(e+="")=="transform"?Rre:gq;return t==null?this.styleTween(e,_ne(e,n)).on("end.style."+e,mq(e)):typeof t=="function"?this.styleTween(e,Cne(e,n,BS(this,"style."+e,t))).each(Ine(this._id,e)):this.styleTween(e,One(e,n,t),r).on("end.style."+e,null)}function Nne(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function Tne(e,t,r){var n,i;function o(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&Nne(e,a,r)),n}return o._value=t,o}function Pne(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,Tne(e,t,r??""))}function Mne(e){return function(){this.textContent=e}}function kne(e){return function(){var t=e(this);this.textContent=t??""}}function Ane(e){return this.tween("text",typeof e=="function"?kne(BS(this,"text",e)):Mne(e==null?"":e+""))}function Dne(e){return function(t){this.textContent=e.call(this,t)}}function jne(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&Dne(i)),t}return n._value=e,n}function qne(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,jne(e))}function zne(){for(var e=this._name,t=this._id,r=bq(),n=this._groups,i=n.length,o=0;o<i;++o)for(var a=n[o],s=a.length,c,d=0;d<s;++d)if(c=a[d]){var u=Hn(c,t);Gd(c,e,r,d,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new _i(n,this._parents,e,r)}function Lne(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(o,a){var s={value:a},c={value:function(){--i===0&&o()}};r.each(function(){var d=li(this,n),u=d.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),d.on=t}),i===0&&o()})}var Bne=0;function _i(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function bq(){return++Bne}var yi=Al.prototype;_i.prototype={constructor:_i,select:xne,selectAll:wne,selectChild:yi.selectChild,selectChildren:yi.selectChildren,filter:hne,merge:pne,selection:Ene,transition:zne,call:yi.call,nodes:yi.nodes,node:yi.node,size:yi.size,empty:yi.empty,each:yi.each,on:mne,attr:Zre,attrTween:rne,style:Rne,styleTween:Pne,text:Ane,textTween:qne,remove:yne,tween:Hre,delay:one,duration:lne,ease:une,easeVarying:fne,end:Lne,[Symbol.iterator]:yi[Symbol.iterator]};function Fne(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $ne={time:null,delay:0,duration:250,ease:Fne};function Vne(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Hne(e){var t,r;e instanceof _i?(t=e._id,e=e._name):(t=bq(),(r=$ne).time=zS(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,o=0;o<i;++o)for(var a=n[o],s=a.length,c,d=0;d<s;++d)(c=a[d])&&Gd(c,e,t,d,a,r||Vne(c,t));return new _i(n,this._parents,e,t)}Al.prototype.interrupt=Fre;Al.prototype.transition=Hne;const Zc=e=>()=>e;function Wne(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}function Si(e,t,r){this.k=e,this.x=t,this.y=r}Si.prototype={constructor:Si,scale:function(e){return e===1?this:new Si(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Si(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 Co=new Si(1,0,0);Si.prototype;function g0(e){e.stopImmediatePropagation()}function Os(e){e.preventDefault(),e.stopImmediatePropagation()}function Une(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Gne(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function zP(){return this.__zoom||Co}function Kne(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Yne(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xne(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],o=e.invertY(t[0][1])-r[0][1],a=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function Zne(){var e=Une,t=Gne,r=Xne,n=Kne,i=Yne,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,c=kre,d=Hd("start","zoom","end"),u,h,p,v=500,y=150,m=0,g=10;function w(A){A.property("__zoom",zP).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",z).filter(i).on("touchstart.zoom",j).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(A,K,V,te){var G=A.selection?A.selection():A;G.property("__zoom",zP),A!==G?E(A,K,V,te):G.interrupt().each(function(){I(this,arguments).event(te).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},w.scaleBy=function(A,K,V,te){w.scaleTo(A,function(){var G=this.__zoom.k,re=typeof K=="function"?K.apply(this,arguments):K;return G*re},V,te)},w.scaleTo=function(A,K,V,te){w.transform(A,function(){var G=t.apply(this,arguments),re=this.__zoom,P=V==null?S(G):typeof V=="function"?V.apply(this,arguments):V,B=re.invert(P),X=typeof K=="function"?K.apply(this,arguments):K;return r(_(x(re,X),P,B),G,a)},V,te)},w.translateBy=function(A,K,V,te){w.transform(A,function(){return r(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof V=="function"?V.apply(this,arguments):V),t.apply(this,arguments),a)},null,te)},w.translateTo=function(A,K,V,te,G){w.transform(A,function(){var re=t.apply(this,arguments),P=this.__zoom,B=te==null?S(re):typeof te=="function"?te.apply(this,arguments):te;return r(Co.translate(B[0],B[1]).scale(P.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof V=="function"?-V.apply(this,arguments):-V),re,a)},te,G)};function x(A,K){return K=Math.max(o[0],Math.min(o[1],K)),K===A.k?A:new Si(K,A.x,A.y)}function _(A,K,V){var te=K[0]-V[0]*A.k,G=K[1]-V[1]*A.k;return te===A.x&&G===A.y?A:new Si(A.k,te,G)}function S(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function E(A,K,V,te){A.on("start.zoom",function(){I(this,arguments).event(te).start()}).on("interrupt.zoom end.zoom",function(){I(this,arguments).event(te).end()}).tween("zoom",function(){var G=this,re=arguments,P=I(G,re).event(te),B=t.apply(G,re),X=V==null?S(B):typeof V=="function"?V.apply(G,re):V,Q=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),D=G.__zoom,$=typeof K=="function"?K.apply(G,re):K,H=c(D.invert(X).concat(Q/D.k),$.invert(X).concat(Q/$.k));return function(q){if(q===1)q=$;else{var Y=H(q),ie=Q/Y[2];q=new Si(ie,X[0]-Y[0]*ie,X[1]-Y[1]*ie)}P.zoom(null,q)}})}function I(A,K,V){return!V&&A.__zooming||new N(A,K)}function N(A,K){this.that=A,this.args=K,this.active=0,this.sourceEvent=null,this.extent=t.apply(A,K),this.taps=0}N.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,K){return this.mouse&&A!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var K=jn(this.that).datum();d.call(A,this.that,new Wne(A,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:d}),K)}};function T(A,...K){if(!e.apply(this,arguments))return;var V=I(this,K).event(A),te=this.__zoom,G=Math.max(o[0],Math.min(o[1],te.k*Math.pow(2,n.apply(this,arguments)))),re=ti(A);if(V.wheel)(V.mouse[0][0]!==re[0]||V.mouse[0][1]!==re[1])&&(V.mouse[1]=te.invert(V.mouse[0]=re)),clearTimeout(V.wheel);else{if(te.k===G)return;V.mouse=[re,te.invert(re)],Cu(this),V.start()}Os(A),V.wheel=setTimeout(P,y),V.zoom("mouse",r(_(x(te,G),V.mouse[0],V.mouse[1]),V.extent,a));function P(){V.wheel=null,V.end()}}function M(A,...K){if(p||!e.apply(this,arguments))return;var V=A.currentTarget,te=I(this,K,!0).event(A),G=jn(A.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",Q,!0),re=ti(A,V),P=A.clientX,B=A.clientY;iq(A.view),g0(A),te.mouse=[re,this.__zoom.invert(re)],Cu(this),te.start();function X(D){if(Os(D),!te.moved){var $=D.clientX-P,H=D.clientY-B;te.moved=$*$+H*H>m}te.event(D).zoom("mouse",r(_(te.that.__zoom,te.mouse[0]=ti(D,V),te.mouse[1]),te.extent,a))}function Q(D){G.on("mousemove.zoom mouseup.zoom",null),oq(D.view,te.moved),Os(D),te.event(D).end()}}function z(A,...K){if(e.apply(this,arguments)){var V=this.__zoom,te=ti(A.changedTouches?A.changedTouches[0]:A,this),G=V.invert(te),re=V.k*(A.shiftKey?.5:2),P=r(_(x(V,re),te,G),t.apply(this,K),a);Os(A),s>0?jn(this).transition().duration(s).call(E,P,te,A):jn(this).call(w.transform,P,te,A)}}function j(A,...K){if(e.apply(this,arguments)){var V=A.touches,te=V.length,G=I(this,K,A.changedTouches.length===te).event(A),re,P,B,X;for(g0(A),P=0;P<te;++P)B=V[P],X=ti(B,this),X=[X,this.__zoom.invert(X),B.identifier],G.touch0?!G.touch1&&G.touch0[2]!==X[2]&&(G.touch1=X,G.taps=0):(G.touch0=X,re=!0,G.taps=1+!!u);u&&(u=clearTimeout(u)),re&&(G.taps<2&&(h=X[0],u=setTimeout(function(){u=null},v)),Cu(this),G.start())}}function W(A,...K){if(this.__zooming){var V=I(this,K).event(A),te=A.changedTouches,G=te.length,re,P,B,X;for(Os(A),re=0;re<G;++re)P=te[re],B=ti(P,this),V.touch0&&V.touch0[2]===P.identifier?V.touch0[0]=B:V.touch1&&V.touch1[2]===P.identifier&&(V.touch1[0]=B);if(P=V.that.__zoom,V.touch1){var Q=V.touch0[0],D=V.touch0[1],$=V.touch1[0],H=V.touch1[1],q=(q=$[0]-Q[0])*q+(q=$[1]-Q[1])*q,Y=(Y=H[0]-D[0])*Y+(Y=H[1]-D[1])*Y;P=x(P,Math.sqrt(q/Y)),B=[(Q[0]+$[0])/2,(Q[1]+$[1])/2],X=[(D[0]+H[0])/2,(D[1]+H[1])/2]}else if(V.touch0)B=V.touch0[0],X=V.touch0[1];else return;V.zoom("touch",r(_(P,B,X),V.extent,a))}}function U(A,...K){if(this.__zooming){var V=I(this,K).event(A),te=A.changedTouches,G=te.length,re,P;for(g0(A),p&&clearTimeout(p),p=setTimeout(function(){p=null},v),re=0;re<G;++re)P=te[re],V.touch0&&V.touch0[2]===P.identifier?delete V.touch0:V.touch1&&V.touch1[2]===P.identifier&&delete V.touch1;if(V.touch1&&!V.touch0&&(V.touch0=V.touch1,delete V.touch1),V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2&&(P=ti(P,this),Math.hypot(h[0]-P[0],h[1]-P[1])<g)){var B=jn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return w.wheelDelta=function(A){return arguments.length?(n=typeof A=="function"?A:Zc(+A),w):n},w.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Zc(!!A),w):e},w.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:Zc(!!A),w):i},w.extent=function(A){return arguments.length?(t=typeof A=="function"?A:Zc([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),w):t},w.scaleExtent=function(A){return arguments.length?(o[0]=+A[0],o[1]=+A[1],w):[o[0],o[1]]},w.translateExtent=function(A){return arguments.length?(a[0][0]=+A[0][0],a[1][0]=+A[1][0],a[0][1]=+A[0][1],a[1][1]=+A[1][1],w):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},w.constrain=function(A){return arguments.length?(r=A,w):r},w.duration=function(A){return arguments.length?(s=+A,w):s},w.interpolate=function(A){return arguments.length?(c=A,w):c},w.on=function(){var A=d.on.apply(d,arguments);return A===d?w:A},w.clickDistance=function(A){return arguments.length?(m=(A=+A)*A,w):Math.sqrt(m)},w.tapDistance=function(A){return arguments.length?(g=+A,w):g},w}function it(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yq(e,t){if(e){if(typeof e=="string")return Vw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vw(e,t)}}function Jne(e){if(Array.isArray(e))return e}function Qne(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(e);!(i=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));i=!0);}catch(c){o=!0,s=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function eie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
57
|
+
*/var RC;function NK(){return RC||(RC=1,process.env.NODE_ENV!=="production"&&(function(){var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),s=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),y=!1,m=!1,g=!1,w=!1,x=!1,_;_=Symbol.for("react.module.reference");function S(ae){return!!(typeof ae=="string"||typeof ae=="function"||ae===r||ae===i||x||ae===n||ae===d||ae===u||w||ae===v||y||m||g||typeof ae=="object"&&ae!==null&&(ae.$$typeof===p||ae.$$typeof===h||ae.$$typeof===o||ae.$$typeof===a||ae.$$typeof===c||ae.$$typeof===_||ae.getModuleId!==void 0))}function E(ae){if(typeof ae=="object"&&ae!==null){var he=ae.$$typeof;switch(he){case e:var ue=ae.type;switch(ue){case r:case i:case n:case d:case u:return ue;default:var de=ue&&ue.$$typeof;switch(de){case s:case a:case c:case p:case h:case o:return de;default:return he}}case t:return he}}}var I=a,N=o,T=e,M=c,z=r,j=p,W=h,U=t,A=i,K=n,V=d,te=u,G=!1,re=!1;function P(ae){return G||(G=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function B(ae){return re||(re=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function X(ae){return E(ae)===a}function Q(ae){return E(ae)===o}function D(ae){return typeof ae=="object"&&ae!==null&&ae.$$typeof===e}function $(ae){return E(ae)===c}function H(ae){return E(ae)===r}function q(ae){return E(ae)===p}function Y(ae){return E(ae)===h}function ie(ae){return E(ae)===t}function ne(ae){return E(ae)===i}function ve(ae){return E(ae)===n}function Z(ae){return E(ae)===d}function J(ae){return E(ae)===u}vt.ContextConsumer=I,vt.ContextProvider=N,vt.Element=T,vt.ForwardRef=M,vt.Fragment=z,vt.Lazy=j,vt.Memo=W,vt.Portal=U,vt.Profiler=A,vt.StrictMode=K,vt.Suspense=V,vt.SuspenseList=te,vt.isAsyncMode=P,vt.isConcurrentMode=B,vt.isContextConsumer=X,vt.isContextProvider=Q,vt.isElement=D,vt.isForwardRef=$,vt.isFragment=H,vt.isLazy=q,vt.isMemo=Y,vt.isPortal=ie,vt.isProfiler=ne,vt.isStrictMode=ve,vt.isSuspense=Z,vt.isSuspenseList=J,vt.isValidElementType=S,vt.typeOf=E})()),vt}var NC;function TK(){return NC||(NC=1,process.env.NODE_ENV==="production"?Uh.exports=RK():Uh.exports=NK()),Uh.exports}var TC=TK();const PC=e=>typeof e=="object"&&e!=null&&e.nodeType===1,MC=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Vc=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){const r=getComputedStyle(e,null);return MC(r.overflowY,t)||MC(r.overflowX,t)||(n=>{const i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(n);return!!i&&(i.clientHeight<n.scrollHeight||i.clientWidth<n.scrollWidth)})(e)}return!1},Hc=(e,t,r,n,i,o,a,s)=>o<e&&a>t||o>e&&a<t?0:o<=e&&s<=r||a>=t&&s>=r?o-e-n:a>t&&s<r||o<e&&s>r?a-t+i:0,PK=e=>e.parentElement??(e.getRootNode().host||null),MK=(e,t)=>{var r,n,i,o;if(typeof document>"u")return[];const{inline:a,boundary:s,skipOverflowHiddenElements:c}=t,d=typeof s=="function"?s:U=>U!==s;if(!PC(e))throw new TypeError("Invalid target");const u=document.scrollingElement||document.documentElement,h=[];let p=e;for(;PC(p)&&d(p);){if(p=PK(p),p===u){h.push(p);break}p!=null&&p===document.body&&Vc(p)&&!Vc(document.documentElement)||p!=null&&Vc(p,c)&&h.push(p)}const v=(n=(r=window.visualViewport)==null?void 0:r.width)!=null?n:innerWidth,y=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,{scrollX:m,scrollY:g}=window,{height:w,width:x,top:_,right:S,bottom:E,left:I}=e.getBoundingClientRect(),{top:N,right:T,left:M}=(U=>{const A=window.getComputedStyle(U);return{top:parseFloat(A.scrollMarginTop)||0,right:parseFloat(A.scrollMarginRight)||0,bottom:parseFloat(A.scrollMarginBottom)||0,left:parseFloat(A.scrollMarginLeft)||0}})(e);let z=_-N,j=a==="center"?I+x/2-M+T:a==="end"?S+T:I-M;const W=[];for(let U=0;U<h.length;U++){const A=h[U],{height:K,width:V,top:te,right:G,bottom:re,left:P}=A.getBoundingClientRect();if(_>=0&&I>=0&&E<=y&&S<=v&&(A===u&&!Vc(A)||_>=te&&E<=re&&I>=P&&S<=G))return W;const B=getComputedStyle(A),X=parseInt(B.borderLeftWidth,10),Q=parseInt(B.borderTopWidth,10),D=parseInt(B.borderRightWidth,10),$=parseInt(B.borderBottomWidth,10);let H=0,q=0;const Y="offsetWidth"in A?A.offsetWidth-A.clientWidth-X-D:0,ie="offsetHeight"in A?A.offsetHeight-A.clientHeight-Q-$:0,ne="offsetWidth"in A?A.offsetWidth===0?0:V/A.offsetWidth:0,ve="offsetHeight"in A?A.offsetHeight===0?0:K/A.offsetHeight:0;if(u===A)H=Hc(g,g+y,y,Q,$,g+z,g+z+w,w),q=a==="start"?j:a==="center"?j-v/2:a==="end"?j-v:Hc(m,m+v,v,X,D,m+j,m+j+x,x),H=Math.max(0,H+g),q=Math.max(0,q+m);else{H=Hc(te,re,K,Q,$+ie,z,z+w,w),q=a==="start"?j-P-X:a==="center"?j-(P+V/2)+Y/2:a==="end"?j-G+D+Y:Hc(P,G,V,X,D+Y,j,j+x,x);const{scrollLeft:Z,scrollTop:J}=A;H=ve===0?0:Math.max(0,Math.min(J+H/ve,A.scrollHeight-K/ve+ie)),q=ne===0?0:Math.max(0,Math.min(Z+q/ne,A.scrollWidth-V/ne+Y)),z+=J-H,j+=Z-q}W.push({el:A,top:H,left:q})}return W};var Ia=function(){return Ia=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ia.apply(this,arguments)},kK=0;function kC(e){return typeof e=="function"?e:Cr}function Cr(){}function P3(e,t){if(e){var r=MK(e,{boundary:t});r.forEach(function(n){var i=n.el,o=n.top,a=n.left;i.scrollTop=o,i.scrollLeft=a})}}function AC(e,t,r){var n=e===t||t instanceof r.Node&&e.contains&&e.contains(t);return n}function wd(e,t){var r;function n(){r&&clearTimeout(r)}function i(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];n(),r=setTimeout(function(){r=null,e.apply(void 0,a)},t)}return i.cancel=n,i}function st(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return t.some(function(s){return s&&s.apply(void 0,[n].concat(o)),n.preventDownshiftDefault||n.hasOwnProperty("nativeEvent")&&n.nativeEvent.preventDownshiftDefault})}}function zn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){t.forEach(function(i){typeof i=="function"?i(n):i&&(i.current=n)})}}function M3(){return String(kK++)}function AK(e){var t=e.isOpen,r=e.resultCount,n=e.previousResultCount;return t?r?r!==n?r+" result"+(r===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function DC(e,t){return e=Array.isArray(e)?e[0]:e,!e&&t?t:e}function k3(e){return typeof e.type=="string"}function A3(e){return e.props}function DK(e,t){console.error('The property "'+t+'" is required in "'+e+'"')}var jK=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Wc(e){e===void 0&&(e={});var t={};return jK.forEach(function(r){e.hasOwnProperty(r)&&(t[r]=e[r])}),t}function ul(e,t){return!e||!t?e:Object.keys(e).reduce(function(r,n){return r[n]=$u(t,n)?t[n]:e[n],r},{})}function $u(e,t){return e[t]!==void 0}function Ra(e){var t=e.key,r=e.keyCode;return r>=37&&r<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function qK(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ln(e,t,r,n,i){i===void 0&&(i=!1);var o=r.length;if(o===0)return-1;var a=o-1;(typeof e!="number"||e<0||e>a)&&(e=t>0?-1:a+1);var s=e+t;s<0?s=i?a:0:s>a&&(s=i?0:a);var c=Ji(s,t<0,r,n,i);return c===-1?e>=o?-1:e:c}function Ji(e,t,r,n,i){i===void 0&&(i=!1);var o=r.length;if(t){for(var a=e;a>=0;a--)if(!n(r[a],a))return a}else for(var s=e;s<o;s++)if(!n(r[s],s))return s;return i?Ji(t?o-1:0,t,r,n):-1}function Vu(e,t,r,n){return n===void 0&&(n=!0),r&&t.some(function(i){return i&&(AC(i,e,r)||n&&AC(i,r.document.activeElement,r))})}var w1=Cr;process.env.NODE_ENV!=="production"&&(w1=function(e,t,r){var n="This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props";Object.keys(e).forEach(function(i){t[i]!==void 0&&r[i]===void 0?console.error('downshift: A component has changed the controlled prop "'+i+'" to be uncontrolled. '+n):t[i]===void 0&&r[i]!==void 0&&console.error('downshift: A component has changed the uncontrolled prop "'+i+'" to be controlled. '+n)})});var zK=wd(function(e){D3(e).textContent=""},500);function D3(e){var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function j3(e,t){if(!(!e||!t)){var r=D3(t);r.textContent=e,zK(t)}}function LK(e){var t=e==null?void 0:e.getElementById("a11y-status-message");t&&t.remove()}var q3=process.env.NODE_ENV!=="production"?"__autocomplete_unknown__":0,z3=process.env.NODE_ENV!=="production"?"__autocomplete_mouseup__":1,L3=process.env.NODE_ENV!=="production"?"__autocomplete_item_mouseenter__":2,gu=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_arrow_up__":3,mu=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_arrow_down__":4,B3=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_escape__":5,F3=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_enter__":6,$3=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_home__":7,V3=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_end__":8,H3=process.env.NODE_ENV!=="production"?"__autocomplete_click_item__":9,W3=process.env.NODE_ENV!=="production"?"__autocomplete_blur_input__":10,U3=process.env.NODE_ENV!=="production"?"__autocomplete_change_input__":11,G3=process.env.NODE_ENV!=="production"?"__autocomplete_keydown_space_button__":12,Pw=process.env.NODE_ENV!=="production"?"__autocomplete_click_button__":13,K3=process.env.NODE_ENV!=="production"?"__autocomplete_blur_button__":14,Y3=process.env.NODE_ENV!=="production"?"__autocomplete_controlled_prop_updated_selected_item__":15,X3=process.env.NODE_ENV!=="production"?"__autocomplete_touchend__":16,BK=Object.freeze({__proto__:null,blurButton:K3,blurInput:W3,changeInput:U3,clickButton:Pw,clickItem:H3,controlledPropUpdatedSelectedItem:Y3,itemMouseEnter:L3,keyDownArrowDown:mu,keyDownArrowUp:gu,keyDownEnd:V3,keyDownEnter:F3,keyDownEscape:B3,keyDownHome:$3,keyDownSpaceButton:G3,mouseUp:z3,touchEnd:X3,unknown:q3}),FK=["refKey","ref"],$K=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],VK=["onKeyDown","onBlur","onChange","onInput","onChangeText"],HK=["refKey","ref"],WK=["onMouseMove","onMouseDown","onClick","onPress","index","item"],UK=(function(){var e=(function(t){function r(i){var o;o=t.call(this,i)||this,o.id=o.props.id||"downshift-"+M3(),o.menuId=o.props.menuId||o.id+"-menu",o.labelId=o.props.labelId||o.id+"-label",o.inputId=o.props.inputId||o.id+"-input",o.getItemId=o.props.getItemId||function(x){return o.id+"-item-"+x},o.items=[],o.itemCount=null,o.previousResultCount=0,o.timeoutIds=[],o.internalSetTimeout=function(x,_){var S=setTimeout(function(){o.timeoutIds=o.timeoutIds.filter(function(E){return E!==S}),x()},_);o.timeoutIds.push(S)},o.setItemCount=function(x){o.itemCount=x},o.unsetItemCount=function(){o.itemCount=null},o.isItemDisabled=function(x,_){var S=o.getItemNodeFromIndex(_);return S&&S.hasAttribute("disabled")},o.setHighlightedIndex=function(x,_){x===void 0&&(x=o.props.defaultHighlightedIndex),_===void 0&&(_={}),_=Wc(_),o.internalSetState(je({highlightedIndex:x},_))},o.clearSelection=function(x){o.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:o.props.defaultHighlightedIndex,isOpen:o.props.defaultIsOpen},x)},o.selectItem=function(x,_,S){_=Wc(_),o.internalSetState(je({isOpen:o.props.defaultIsOpen,highlightedIndex:o.props.defaultHighlightedIndex,selectedItem:x,inputValue:o.props.itemToString(x)},_),S)},o.selectItemAtIndex=function(x,_,S){var E=o.items[x];E!=null&&o.selectItem(E,_,S)},o.selectHighlightedItem=function(x,_){return o.selectItemAtIndex(o.getState().highlightedIndex,x,_)},o.internalSetState=function(x,_){var S,E,I={},N=typeof x=="function";return!N&&x.hasOwnProperty("inputValue")&&o.props.onInputValueChange(x.inputValue,je({},o.getStateAndHelpers(),x)),o.setState(function(T){var M;T=o.getState(T);var z=N?x(T):x;z=o.props.stateReducer(T,z),S=z.hasOwnProperty("selectedItem");var j={};return S&&z.selectedItem!==T.selectedItem&&(E=z.selectedItem),(M=z).type||(M.type=q3),Object.keys(z).forEach(function(W){T[W]!==z[W]&&(I[W]=z[W]),W!=="type"&&(z[W],$u(o.props,W)||(j[W]=z[W]))}),N&&z.hasOwnProperty("inputValue")&&o.props.onInputValueChange(z.inputValue,je({},o.getStateAndHelpers(),z)),j},function(){kC(_)();var T=Object.keys(I).length>1;T&&o.props.onStateChange(I,o.getStateAndHelpers()),S&&o.props.onSelect(x.selectedItem,o.getStateAndHelpers()),E!==void 0&&o.props.onChange(E,o.getStateAndHelpers()),o.props.onUserAction(I,o.getStateAndHelpers())})},o.rootRef=function(x){return o._rootNode=x},o.getRootProps=function(x,_){var S,E=x===void 0?{}:x,I=E.refKey,N=I===void 0?"ref":I,T=E.ref,M=Ir(E,FK),z=_===void 0?{}:_,j=z.suppressRefError,W=j===void 0?!1:j;o.getRootProps.called=!0,o.getRootProps.refKey=N,o.getRootProps.suppressRefError=W;var U=o.getState(),A=U.isOpen;return je((S={},S[N]=zn(T,o.rootRef),S.role="combobox",S["aria-expanded"]=A,S["aria-haspopup"]="listbox",S["aria-owns"]=A?o.menuId:void 0,S["aria-labelledby"]=o.labelId,S),M)},o.keyDownHandlers={ArrowDown:function(x){var _=this;if(x.preventDefault(),this.getState().isOpen){var S=x.shiftKey?5:1;this.moveHighlightedIndex(S,{type:mu})}else this.internalSetState({isOpen:!0,type:mu},function(){var E=_.getItemCount();if(E>0){var I=_.getState(),N=I.highlightedIndex,T=Ln(N,1,{length:E},_.isItemDisabled,!0);_.setHighlightedIndex(T,{type:mu})}})},ArrowUp:function(x){var _=this;if(x.preventDefault(),this.getState().isOpen){var S=x.shiftKey?-5:-1;this.moveHighlightedIndex(S,{type:gu})}else this.internalSetState({isOpen:!0,type:gu},function(){var E=_.getItemCount();if(E>0){var I=_.getState(),N=I.highlightedIndex,T=Ln(N,-1,{length:E},_.isItemDisabled,!0);_.setHighlightedIndex(T,{type:gu})}})},Enter:function(x){if(x.which!==229){var _=this.getState(),S=_.isOpen,E=_.highlightedIndex;if(S&&E!=null){x.preventDefault();var I=this.items[E],N=this.getItemNodeFromIndex(E);if(I==null||N&&N.hasAttribute("disabled"))return;this.selectHighlightedItem({type:F3})}}},Escape:function(x){x.preventDefault(),this.reset(je({type:B3},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},o.buttonKeyDownHandlers=je({},o.keyDownHandlers,{" ":function(x){x.preventDefault(),this.toggleMenu({type:G3})}}),o.inputKeyDownHandlers=je({},o.keyDownHandlers,{Home:function(x){var _=this.getState(),S=_.isOpen;if(S){x.preventDefault();var E=this.getItemCount();if(!(E<=0||!S)){var I=Ji(0,!1,{length:E},this.isItemDisabled);this.setHighlightedIndex(I,{type:$3})}}},End:function(x){var _=this.getState(),S=_.isOpen;if(S){x.preventDefault();var E=this.getItemCount();if(!(E<=0||!S)){var I=Ji(E-1,!0,{length:E},this.isItemDisabled);this.setHighlightedIndex(I,{type:V3})}}}}),o.getToggleButtonProps=function(x){var _=x===void 0?{}:x,S=_.onClick;_.onPress;var E=_.onKeyDown,I=_.onKeyUp,N=_.onBlur,T=Ir(_,$K),M=o.getState(),z=M.isOpen,j={onClick:st(S,o.buttonHandleClick),onKeyDown:st(E,o.buttonHandleKeyDown),onKeyUp:st(I,o.buttonHandleKeyUp),onBlur:st(N,o.buttonHandleBlur)},W=T.disabled?{}:j;return je({type:"button",role:"button","aria-label":z?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},W,T)},o.buttonHandleKeyUp=function(x){x.preventDefault()},o.buttonHandleKeyDown=function(x){var _=Ra(x);o.buttonKeyDownHandlers[_]&&o.buttonKeyDownHandlers[_].call(o,x)},o.buttonHandleClick=function(x){if(x.preventDefault(),o.props.environment){var _=o.props.environment.document,S=_.body,E=_.activeElement;S&&S===E&&x.target.focus()}process.env.NODE_ENV==="test"?o.toggleMenu({type:Pw}):o.internalSetTimeout(function(){return o.toggleMenu({type:Pw})})},o.buttonHandleBlur=function(x){var _=x.target;o.internalSetTimeout(function(){if(!(o.isMouseDown||!o.props.environment)){var S=o.props.environment.document.activeElement;(S==null||S.id!==o.inputId)&&S!==_&&o.reset({type:K3})}})},o.getLabelProps=function(x){return je({htmlFor:o.inputId,id:o.labelId},x)},o.getInputProps=function(x){var _=x===void 0?{}:x,S=_.onKeyDown,E=_.onBlur,I=_.onChange,N=_.onInput;_.onChangeText;var T=Ir(_,VK),M,z={};M="onChange";var j=o.getState(),W=j.inputValue,U=j.isOpen,A=j.highlightedIndex;if(!T.disabled){var K;z=(K={},K[M]=st(I,N,o.inputHandleChange),K.onKeyDown=st(S,o.inputHandleKeyDown),K.onBlur=st(E,o.inputHandleBlur),K)}return je({"aria-autocomplete":"list","aria-activedescendant":U&&typeof A=="number"&&A>=0?o.getItemId(A):void 0,"aria-controls":U?o.menuId:void 0,"aria-labelledby":T&&T["aria-label"]?void 0:o.labelId,autoComplete:"off",value:W,id:o.inputId},z,T)},o.inputHandleKeyDown=function(x){var _=Ra(x);_&&o.inputKeyDownHandlers[_]&&o.inputKeyDownHandlers[_].call(o,x)},o.inputHandleChange=function(x){o.internalSetState({type:U3,isOpen:!0,inputValue:x.target.value,highlightedIndex:o.props.defaultHighlightedIndex})},o.inputHandleBlur=function(){o.internalSetTimeout(function(){var x;if(!(o.isMouseDown||!o.props.environment)){var _=o.props.environment.document.activeElement,S=(_==null||(x=_.dataset)==null?void 0:x.toggle)&&o._rootNode&&o._rootNode.contains(_);S||o.reset({type:W3})}})},o.menuRef=function(x){o._menuNode=x},o.getMenuProps=function(x,_){var S,E=x===void 0?{}:x,I=E.refKey,N=I===void 0?"ref":I,T=E.ref,M=Ir(E,HK),z=_===void 0?{}:_,j=z.suppressRefError,W=j===void 0?!1:j;return o.getMenuProps.called=!0,o.getMenuProps.refKey=N,o.getMenuProps.suppressRefError=W,je((S={},S[N]=zn(T,o.menuRef),S.role="listbox",S["aria-labelledby"]=M&&M["aria-label"]?void 0:o.labelId,S.id=o.menuId,S),M)},o.getItemProps=function(x){var _,S=x===void 0?{}:x,E=S.onMouseMove,I=S.onMouseDown,N=S.onClick;S.onPress;var T=S.index,M=S.item,z=M===void 0?process.env.NODE_ENV==="production"?void 0:DK("getItemProps","item"):M,j=Ir(S,WK);T===void 0?(o.items.push(z),T=o.items.indexOf(z)):o.items[T]=z;var W="onClick",U=N,A=(_={onMouseMove:st(E,function(){T!==o.getState().highlightedIndex&&(o.setHighlightedIndex(T,{type:L3}),o.avoidScrolling=!0,o.internalSetTimeout(function(){return o.avoidScrolling=!1},250))}),onMouseDown:st(I,function(V){V.preventDefault()})},_[W]=st(U,function(){o.selectItemAtIndex(T,{type:H3})}),_),K=j.disabled?{onMouseDown:A.onMouseDown}:A;return je({id:o.getItemId(T),role:"option","aria-selected":o.getState().highlightedIndex===T},K,j)},o.clearItems=function(){o.items=[]},o.reset=function(x,_){x===void 0&&(x={}),x=Wc(x),o.internalSetState(function(S){var E=S.selectedItem;return je({isOpen:o.props.defaultIsOpen,highlightedIndex:o.props.defaultHighlightedIndex,inputValue:o.props.itemToString(E)},x)},_)},o.toggleMenu=function(x,_){x===void 0&&(x={}),x=Wc(x),o.internalSetState(function(S){var E=S.isOpen;return je({isOpen:!E},E&&{highlightedIndex:o.props.defaultHighlightedIndex},x)},function(){var S=o.getState(),E=S.isOpen,I=S.highlightedIndex;E&&o.getItemCount()>0&&typeof I=="number"&&o.setHighlightedIndex(I,x),kC(_)()})},o.openMenu=function(x){o.internalSetState({isOpen:!0},x)},o.closeMenu=function(x){o.internalSetState({isOpen:!1},x)},o.updateStatus=wd(function(){var x;if((x=o.props)!=null&&(x=x.environment)!=null&&x.document){var _=o.getState(),S=o.items[_.highlightedIndex],E=o.getItemCount(),I=o.props.getA11yStatusMessage(je({itemToString:o.props.itemToString,previousResultCount:o.previousResultCount,resultCount:E,highlightedItem:S},_));o.previousResultCount=E,j3(I,o.props.environment.document)}},200);var a=o.props,s=a.defaultHighlightedIndex,c=a.initialHighlightedIndex,d=c===void 0?s:c,u=a.defaultIsOpen,h=a.initialIsOpen,p=h===void 0?u:h,v=a.initialInputValue,y=v===void 0?"":v,m=a.initialSelectedItem,g=m===void 0?null:m,w=o.getState({highlightedIndex:d,isOpen:p,inputValue:y,selectedItem:g});return w.selectedItem!=null&&o.props.initialInputValue===void 0&&(w.inputValue=o.props.itemToString(w.selectedItem)),o.state=w,o}yK(r,t);var n=r.prototype;return n.internalClearTimeouts=function(){this.timeoutIds.forEach(function(i){clearTimeout(i)}),this.timeoutIds=[]},n.getState=function(i){return i===void 0&&(i=this.state),ul(i,this.props)},n.getItemCount=function(){var i=this.items.length;return this.itemCount!=null?i=this.itemCount:this.props.itemCount!==void 0&&(i=this.props.itemCount),i},n.getItemNodeFromIndex=function(i){return this.props.environment?this.props.environment.document.getElementById(this.getItemId(i)):null},n.scrollHighlightedItemIntoView=function(){{var i=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(i,this._menuNode)}},n.moveHighlightedIndex=function(i,o){var a=this.getItemCount(),s=this.getState(),c=s.highlightedIndex;if(a>0){var d=Ln(c,i,{length:a},this.isItemDisabled,!0);this.setHighlightedIndex(d,o)}},n.getStateAndHelpers=function(){var i=this.getState(),o=i.highlightedIndex,a=i.inputValue,s=i.selectedItem,c=i.isOpen,d=this.props.itemToString,u=this.id,h=this.getRootProps,p=this.getToggleButtonProps,v=this.getLabelProps,y=this.getMenuProps,m=this.getInputProps,g=this.getItemProps,w=this.openMenu,x=this.closeMenu,_=this.toggleMenu,S=this.selectItem,E=this.selectItemAtIndex,I=this.selectHighlightedItem,N=this.setHighlightedIndex,T=this.clearSelection,M=this.clearItems,z=this.reset,j=this.setItemCount,W=this.unsetItemCount,U=this.internalSetState;return{getRootProps:h,getToggleButtonProps:p,getLabelProps:v,getMenuProps:y,getInputProps:m,getItemProps:g,reset:z,openMenu:w,closeMenu:x,toggleMenu:_,selectItem:S,selectItemAtIndex:E,selectHighlightedItem:I,setHighlightedIndex:N,clearSelection:T,clearItems:M,setItemCount:j,unsetItemCount:W,setState:U,itemToString:d,id:u,highlightedIndex:o,inputValue:a,isOpen:c,selectedItem:s}},n.componentDidMount=function(){var i=this;if(process.env.NODE_ENV!=="production"&&this.getMenuProps.called&&!this.getMenuProps.suppressRefError&&jC(this._menuNode,this.getMenuProps),!this.props.environment)this.cleanup=function(){i.internalClearTimeouts()};else{var o=function(){i.isMouseDown=!0},a=function(h){i.isMouseDown=!1;var p=Vu(h.target,[i._rootNode,i._menuNode],i.props.environment);!p&&i.getState().isOpen&&i.reset({type:z3},function(){return i.props.onOuterClick(i.getStateAndHelpers())})},s=function(){i.isTouchMove=!1},c=function(){i.isTouchMove=!0},d=function(h){var p=Vu(h.target,[i._rootNode,i._menuNode],i.props.environment,!1);!i.isTouchMove&&!p&&i.getState().isOpen&&i.reset({type:X3},function(){return i.props.onOuterClick(i.getStateAndHelpers())})},u=this.props.environment;u.addEventListener("mousedown",o),u.addEventListener("mouseup",a),u.addEventListener("touchstart",s),u.addEventListener("touchmove",c),u.addEventListener("touchend",d),this.cleanup=function(){i.internalClearTimeouts(),i.updateStatus.cancel(),u.removeEventListener("mousedown",o),u.removeEventListener("mouseup",a),u.removeEventListener("touchstart",s),u.removeEventListener("touchmove",c),u.removeEventListener("touchend",d)}}},n.shouldScroll=function(i,o){var a=this.props.highlightedIndex===void 0?this.getState():this.props,s=a.highlightedIndex,c=o.highlightedIndex===void 0?i:o,d=c.highlightedIndex,u=s&&this.getState().isOpen&&!i.isOpen,h=s!==d;return u||h},n.componentDidUpdate=function(i,o){process.env.NODE_ENV!=="production"&&(w1(this.state,i,this.props),this.getMenuProps.called&&!this.getMenuProps.suppressRefError&&jC(this._menuNode,this.getMenuProps)),$u(this.props,"selectedItem")&&this.props.selectedItemChanged(i.selectedItem,this.props.selectedItem)&&this.internalSetState({type:Y3,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(o,i)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},n.componentWillUnmount=function(){this.cleanup()},n.render=function(){var i=DC(this.props.children,Cr);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var o=DC(i(this.getStateAndHelpers()));if(!o)return null;if(this.getRootProps.called||this.props.suppressRefError)return process.env.NODE_ENV!=="production"&&!this.getRootProps.suppressRefError&&!this.props.suppressRefError&&GK(o,this.getRootProps),o;if(k3(o))return C.cloneElement(o,this.getRootProps(A3(o)));if(process.env.NODE_ENV!=="production")throw new Error("downshift: If you return a non-DOM element, you must apply the getRootProps function")},r})(C.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:AK,itemToString:function(t){return t==null?"":(process.env.NODE_ENV!=="production"&&qK(t)&&!t.hasOwnProperty("toString")&&console.warn("downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.","The object that was passed:",t),String(t))},onStateChange:Cr,onInputValueChange:Cr,onUserAction:Cr,onChange:Cr,onSelect:Cr,onOuterClick:Cr,selectedItemChanged:function(t,r){return t!==r},environment:typeof window>"u"?void 0:window,stateReducer:function(t,r){return r},suppressRefError:!1,scrollIntoView:P3},e.stateChangeTypes=BK,e})();process.env.NODE_ENV!=="production"&&(UK.propTypes={children:Se.func,defaultHighlightedIndex:Se.number,defaultIsOpen:Se.bool,initialHighlightedIndex:Se.number,initialSelectedItem:Se.any,initialInputValue:Se.string,initialIsOpen:Se.bool,getA11yStatusMessage:Se.func,itemToString:Se.func,onChange:Se.func,onSelect:Se.func,onStateChange:Se.func,onInputValueChange:Se.func,onUserAction:Se.func,onOuterClick:Se.func,selectedItemChanged:Se.func,stateReducer:Se.func,itemCount:Se.number,id:Se.string,environment:Se.shape({addEventListener:Se.func.isRequired,removeEventListener:Se.func.isRequired,document:Se.shape({createElement:Se.func.isRequired,getElementById:Se.func.isRequired,activeElement:Se.any.isRequired,body:Se.any.isRequired}).isRequired,Node:Se.func.isRequired}),suppressRefError:Se.bool,scrollIntoView:Se.func,selectedItem:Se.any,isOpen:Se.bool,inputValue:Se.string,highlightedIndex:Se.number,labelId:Se.string,inputId:Se.string,menuId:Se.string,getItemId:Se.func});function jC(e,t){var r=t.refKey;e||console.error('downshift: The ref prop "'+r+'" from getMenuProps was not applied correctly on your menu element.')}function GK(e,t){var r=t.refKey,n=r!=="ref",i=!k3(e);i&&!n&&!TC.isForwardRef(e)?console.error("downshift: You returned a non-DOM element. You must specify a refKey in getRootProps"):!i&&n&&console.error('downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified "'+r+'"'),!TC.isForwardRef(e)&&!A3(e)[r]&&console.error('downshift: You must apply the ref prop "'+r+'" from getRootProps onto your root element.')}var Z3={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function KK(e,t,r){var n=e.props,i=e.type,o={};Object.keys(t).forEach(function(a){YK(a,e,t,r),r[a]!==t[a]&&(o[a]=r[a])}),n.onStateChange&&Object.keys(o).length&&n.onStateChange(je({type:i},o))}function YK(e,t,r,n){var i=t.props,o=t.type,a="on"+E1(e)+"Change";i[a]&&n[e]!==void 0&&n[e]!==r[e]&&i[a](je({type:o},n))}function XK(e,t){return t.changes}var qC=wd(function(e,t){j3(e,t)},200),ZK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.useLayoutEffect:C.useEffect,J3="useId"in C?function(e){var t=e.id,r=e.labelId,n=e.menuId,i=e.getItemId,o=e.toggleButtonId,a=e.inputId,s="downshift-"+C.useId();t||(t=s);var c=C.useMemo(function(){return{labelId:r||t+"-label",menuId:n||t+"-menu",getItemId:i||function(d){return t+"-item-"+d},toggleButtonId:o||t+"-toggle-button",inputId:a||t+"-input"}},[i,t,a,r,n,o]);return c}:function(e){var t=e.id,r=t===void 0?"downshift-"+M3():t,n=e.labelId,i=e.menuId,o=e.getItemId,a=e.toggleButtonId,s=e.inputId,c=C.useMemo(function(){return{labelId:n||r+"-label",menuId:i||r+"-menu",getItemId:o||function(d){return r+"-item-"+d},toggleButtonId:a||r+"-toggle-button",inputId:s||r+"-input"}},[o,r,s,n,i,a]);return c};function S1(e,t,r,n){var i,o;if(e===void 0){if(t===void 0)throw new Error(n);i=r[t],o=t}else o=t===void 0?r.indexOf(e):t,i=e;return[i,o]}function JK(e){return/^\S{1}$/.test(e)}function E1(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function Sd(e){var t=C.useRef(e);return t.current=e,t}function Q3(e,t,r,n){var i=C.useRef(),o=C.useRef(),a=C.useCallback(function(v,y){o.current=y,v=ul(v,y.props);var m=e(v,y),g=y.props.stateReducer(v,je({},y,{changes:m}));return g},[e]),s=C.useReducer(a,t,r),c=s[0],d=s[1],u=Sd(t),h=C.useCallback(function(v){return d(je({props:u.current},v))},[u]),p=o.current;return C.useEffect(function(){var v=ul(i.current,p==null?void 0:p.props),y=p&&i.current&&!n(v,c);y&&KK(p,v,c),i.current=c},[c,p,n]),[c,h]}function e4(e,t,r,n){var i=Q3(e,t,r,n),o=i[0],a=i[1];return[ul(o,t),a]}var el={itemToString:function(e){return e?String(e):""},itemToKey:function(e){return e},stateReducer:XK,scrollIntoView:P3,environment:typeof window>"u"?void 0:window};function ri(e,t,r){r===void 0&&(r=Z3);var n=e["default"+E1(t)];return n!==void 0?n:r[t]}function So(e,t,r){r===void 0&&(r=Z3);var n=e[t];if(n!==void 0)return n;var i=e["initial"+E1(t)];return i!==void 0?i:ri(e,t,r)}function t4(e){var t=So(e,"selectedItem"),r=So(e,"isOpen"),n=QK(e),i=So(e,"inputValue");return{highlightedIndex:n<0&&t&&r?e.items.findIndex(function(o){return e.itemToKey(o)===e.itemToKey(t)}):n,isOpen:r,selectedItem:t,inputValue:i}}function Eo(e,t,r){var n=e.items,i=e.initialHighlightedIndex,o=e.defaultHighlightedIndex,a=e.isItemDisabled,s=e.itemToKey,c=t.selectedItem,d=t.highlightedIndex;return n.length===0?-1:i!==void 0&&d===i&&!a(n[i],i)?i:o!==void 0&&!a(n[o],o)?o:c?n.findIndex(function(u){return s(c)===s(u)}):r<0&&!a(n[n.length-1],n.length-1)?n.length-1:r>0&&!a(n[0],0)?0:-1}function r4(e,t,r){var n=C.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),i=C.useCallback(function(){return r.map(function(o){return o.current})},[r]);return C.useEffect(function(){if(!e)return Cr;function o(){n.current.isTouchEnd=!1,n.current.isMouseDown=!0}function a(u){n.current.isMouseDown=!1,Vu(u.target,i(),e)||t()}function s(){n.current.isTouchEnd=!1,n.current.isTouchMove=!1}function c(){n.current.isTouchMove=!0}function d(u){n.current.isTouchEnd=!0,!n.current.isTouchMove&&!Vu(u.target,i(),e,!1)&&t()}return e.addEventListener("mousedown",o),e.addEventListener("mouseup",a),e.addEventListener("touchstart",s),e.addEventListener("touchmove",c),e.addEventListener("touchend",d),function(){e.removeEventListener("mousedown",o),e.removeEventListener("mouseup",a),e.removeEventListener("touchstart",s),e.removeEventListener("touchmove",c),e.removeEventListener("touchend",d)}},[e,i,t]),n.current}var Ed=function(){return Cr};process.env.NODE_ENV!=="production"&&(Ed=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=C.useRef(t.reduce(function(o,a){return o[a]={},o},{}));C.useEffect(function(){Object.keys(n.current).forEach(function(o){var a=n.current[o];if(!Object.keys(a).length){console.error("downshift: You forgot to call the "+o+" getter function on your component / element.");return}var s=a.suppressRefError,c=a.refKey,d=a.elementRef;s||d!=null&&d.current||console.error('downshift: The ref prop "'+c+'" from '+o+" was not applied correctly on your element.")})},[]);var i=C.useCallback(function(o,a,s,c){n.current[o]={suppressRefError:a,refKey:s,elementRef:c}},[]);return i});function _1(e,t,r,n){n===void 0&&(n={});var i=n.document,o=Cl();C.useEffect(function(){if(!(!e||o||!i)){var a=e(t);qC(a,i)}},r),C.useEffect(function(){return function(){qC.cancel(),LK(i)}},[i])}function n4(e){var t=e.highlightedIndex,r=e.isOpen,n=e.itemRefs,i=e.getItemNodeFromIndex,o=e.menuElement,a=e.scrollIntoView,s=C.useRef(!0);return ZK(function(){t<0||!r||!Object.keys(n.current).length||(s.current===!1?s.current=!0:a(i(t),o))},[t]),s}var _d=Cr;process.env.NODE_ENV!=="production"&&(_d=function(e){var t=e.props,r=e.state,n=C.useRef(t),i=Cl();C.useEffect(function(){i||(w1(r,n.current,t),n.current=t)},[r,t,i])});function Hu(e,t,r){var n;r===void 0&&(r=!0);var i=((n=e.items)==null?void 0:n.length)&&t>=0;return je({isOpen:!1,highlightedIndex:-1},i&&je({selectedItem:e.items[t],isOpen:ri(e,"isOpen"),highlightedIndex:ri(e,"highlightedIndex")},r&&{inputValue:e.itemToString(e.items[t])}))}function i4(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function Cl(){var e=C.useRef(!0);return C.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function Wu(e){var t=ri(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function QK(e){var t=So(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var bu={environment:Se.shape({addEventListener:Se.func.isRequired,removeEventListener:Se.func.isRequired,document:Se.shape({createElement:Se.func.isRequired,getElementById:Se.func.isRequired,activeElement:Se.any.isRequired,body:Se.any.isRequired}).isRequired,Node:Se.func.isRequired}),itemToString:Se.func,itemToKey:Se.func,stateReducer:Se.func},o4=je({},bu,{getA11yStatusMessage:Se.func,highlightedIndex:Se.number,defaultHighlightedIndex:Se.number,initialHighlightedIndex:Se.number,isOpen:Se.bool,defaultIsOpen:Se.bool,initialIsOpen:Se.bool,selectedItem:Se.any,initialSelectedItem:Se.any,defaultSelectedItem:Se.any,id:Se.string,labelId:Se.string,menuId:Se.string,getItemId:Se.func,toggleButtonId:Se.string,onSelectedItemChange:Se.func,onHighlightedIndexChange:Se.func,onStateChange:Se.func,onIsOpenChange:Se.func,scrollIntoView:Se.func});function a4(e,t,r){var n=t.type,i=t.props,o;switch(n){case r.ItemMouseMove:o={highlightedIndex:t.disabled?-1:t.index};break;case r.MenuMouseLeave:o={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:o={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Eo(i,e,0)};break;case r.FunctionOpenMenu:o={isOpen:!0,highlightedIndex:Eo(i,e,0)};break;case r.FunctionCloseMenu:o={isOpen:!1};break;case r.FunctionSetHighlightedIndex:o={highlightedIndex:i.isItemDisabled(i.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case r.FunctionSetInputValue:o={inputValue:t.inputValue};break;case r.FunctionReset:o={highlightedIndex:Wu(i),isOpen:ri(i,"isOpen"),selectedItem:ri(i,"selectedItem"),inputValue:ri(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return je({},e,o)}function eY(e){for(var t=e.keysSoFar,r=e.highlightedIndex,n=e.items,i=e.itemToString,o=e.isItemDisabled,a=t.toLowerCase(),s=0;s<n.length;s++){var c=(s+r+(t.length<2?1:0))%n.length,d=n[c];if(d!==void 0&&i(d).toLowerCase().startsWith(a)&&!o(d,c))return c}return r}var tY=Ia(Ia({},o4),{items:Se.array.isRequired,isItemDisabled:Se.func}),rY=Ia(Ia({},el),{isItemDisabled:function(){return!1}}),s4=Cr;process.env.NODE_ENV!=="production"&&(s4=function(e,t){Se.checkPropTypes(tY,e,"prop",t.name)});var yu=process.env.NODE_ENV!=="production"?"__togglebutton_click__":0,O1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_arrow_down__":1,C1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_arrow_up__":2,Uu=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_character__":3,I1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_escape__":4,R1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_home__":5,N1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_end__":6,T1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_enter__":7,P1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_space_button__":8,M1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_page_up__":9,k1=process.env.NODE_ENV!=="production"?"__togglebutton_keydown_page_down__":10,Gu=process.env.NODE_ENV!=="production"?"__togglebutton_blur__":11,l4=process.env.NODE_ENV!=="production"?"__menu_mouse_leave__":12,c4=process.env.NODE_ENV!=="production"?"__item_mouse_move__":13,A1=process.env.NODE_ENV!=="production"?"__item_click__":14,u4=process.env.NODE_ENV!=="production"?"__function_toggle_menu__":15,d4=process.env.NODE_ENV!=="production"?"__function_open_menu__":16,f4=process.env.NODE_ENV!=="production"?"__function_close_menu__":17,h4=process.env.NODE_ENV!=="production"?"__function_set_highlighted_index__":18,D1=process.env.NODE_ENV!=="production"?"__function_select_item__":19,Mw=process.env.NODE_ENV!=="production"?"__function_set_input_value__":20,p4=process.env.NODE_ENV!=="production"?"__function_reset__":21,v4=Object.freeze({__proto__:null,FunctionCloseMenu:f4,FunctionOpenMenu:d4,FunctionReset:p4,FunctionSelectItem:D1,FunctionSetHighlightedIndex:h4,FunctionSetInputValue:Mw,FunctionToggleMenu:u4,ItemClick:A1,ItemMouseMove:c4,MenuMouseLeave:l4,ToggleButtonBlur:Gu,ToggleButtonClick:yu,ToggleButtonKeyDownArrowDown:O1,ToggleButtonKeyDownArrowUp:C1,ToggleButtonKeyDownCharacter:Uu,ToggleButtonKeyDownEnd:N1,ToggleButtonKeyDownEnter:T1,ToggleButtonKeyDownEscape:I1,ToggleButtonKeyDownHome:R1,ToggleButtonKeyDownPageDown:k1,ToggleButtonKeyDownPageUp:M1,ToggleButtonKeyDownSpaceButton:P1});function nY(e,t){var r,n=t.type,i=t.props,o=t.altKey,a;switch(n){case A1:a={isOpen:ri(i,"isOpen"),highlightedIndex:Wu(i),selectedItem:i.items[t.index]};break;case Uu:{var s=t.key,c=""+e.inputValue+s,d=!e.isOpen&&e.selectedItem?i.items.findIndex(function(v){return i.itemToKey(v)===i.itemToKey(e.selectedItem)}):e.highlightedIndex,u=eY({keysSoFar:c,highlightedIndex:d,items:i.items,itemToString:i.itemToString,isItemDisabled:i.isItemDisabled});a={inputValue:c,highlightedIndex:u,isOpen:!0}}break;case O1:{var h=e.isOpen?Ln(e.highlightedIndex,1,i.items,i.isItemDisabled):o&&e.selectedItem==null?-1:Eo(i,e,1);a={highlightedIndex:h,isOpen:!0}}break;case C1:if(e.isOpen&&o)a=Hu(i,e.highlightedIndex,!1);else{var p=e.isOpen?Ln(e.highlightedIndex,-1,i.items,i.isItemDisabled):Eo(i,e,-1);a={highlightedIndex:p,isOpen:!0}}break;case T1:case P1:a=Hu(i,e.highlightedIndex,!1);break;case R1:a={highlightedIndex:Ji(0,!1,i.items,i.isItemDisabled),isOpen:!0};break;case N1:a={highlightedIndex:Ji(i.items.length-1,!0,i.items,i.isItemDisabled),isOpen:!0};break;case M1:a={highlightedIndex:Ln(e.highlightedIndex,-10,i.items,i.isItemDisabled)};break;case k1:a={highlightedIndex:Ln(e.highlightedIndex,10,i.items,i.isItemDisabled)};break;case I1:a={isOpen:!1,highlightedIndex:-1};break;case Gu:a=je({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=i.items)==null?void 0:r.length)&&{selectedItem:i.items[e.highlightedIndex]});break;case D1:a={selectedItem:t.selectedItem};break;default:return a4(e,t,v4)}return je({},e,a)}var iY=["onClick"],oY=["onMouseLeave","refKey","ref"],aY=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],sY=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];xi.stateChangeTypes=v4;function xi(e){e===void 0&&(e={}),s4(e,xi);var t=je({},rY,e),r=t.scrollIntoView,n=t.environment,i=t.getA11yStatusMessage,o=e4(nY,t,t4,i4),a=o[0],s=o[1],c=a.isOpen,d=a.highlightedIndex,u=a.selectedItem,h=a.inputValue,p=C.useRef(null),v=C.useRef(null),y=C.useRef({}),m=C.useRef(null),g=J3(t),w=Sd({state:a,props:t}),x=C.useCallback(function(P){return y.current[g.getItemId(P)]},[g]);_1(i,a,[c,d,u,h],n);var _=n4({menuElement:v.current,highlightedIndex:d,isOpen:c,itemRefs:y,scrollIntoView:r,getItemNodeFromIndex:x});C.useEffect(function(){return m.current=wd(function(P){P({type:Mw,inputValue:""})},500),function(){m.current.cancel()}},[]),C.useEffect(function(){h&&m.current(s)},[s,h]),_d({props:t,state:a}),C.useEffect(function(){var P=So(t,"isOpen");P&&p.current&&p.current.focus()},[]);var S=C.useCallback(function(){w.current.state.isOpen&&s({type:Gu})},[s,w]),E=C.useMemo(function(){return[v,p]},[]),I=r4(n,S,E),N=Ed("getMenuProps","getToggleButtonProps");C.useEffect(function(){c||(y.current={})},[c]);var T=C.useMemo(function(){return{ArrowDown:function(P){P.preventDefault(),s({type:O1,altKey:P.altKey})},ArrowUp:function(P){P.preventDefault(),s({type:C1,altKey:P.altKey})},Home:function(P){P.preventDefault(),s({type:R1})},End:function(P){P.preventDefault(),s({type:N1})},Escape:function(){w.current.state.isOpen&&s({type:I1})},Enter:function(P){P.preventDefault(),s({type:w.current.state.isOpen?T1:yu})},PageUp:function(P){w.current.state.isOpen&&(P.preventDefault(),s({type:M1}))},PageDown:function(P){w.current.state.isOpen&&(P.preventDefault(),s({type:k1}))}," ":function(P){P.preventDefault();var B=w.current.state;if(!B.isOpen){s({type:yu});return}B.inputValue?s({type:Uu,key:" "}):s({type:P1})}}},[s,w]),M=C.useCallback(function(){s({type:u4})},[s]),z=C.useCallback(function(){s({type:f4})},[s]),j=C.useCallback(function(){s({type:d4})},[s]),W=C.useCallback(function(P){s({type:h4,highlightedIndex:P})},[s]),U=C.useCallback(function(P){s({type:D1,selectedItem:P})},[s]),A=C.useCallback(function(){s({type:p4})},[s]),K=C.useCallback(function(P){s({type:Mw,inputValue:P})},[s]),V=C.useCallback(function(P){var B=P===void 0?{}:P,X=B.onClick,Q=Ir(B,iY),D=function(){var $;($=p.current)==null||$.focus()};return je({id:g.labelId,htmlFor:g.toggleButtonId,onClick:st(X,D)},Q)},[g]),te=C.useCallback(function(P,B){var X,Q=P===void 0?{}:P,D=Q.onMouseLeave,$=Q.refKey,H=$===void 0?"ref":$,q=Q.ref,Y=Ir(Q,oY),ie=B===void 0?{}:B,ne=ie.suppressRefError,ve=ne===void 0?!1:ne,Z=function(){s({type:l4})};return N("getMenuProps",ve,H,v),je((X={},X[H]=zn(q,function(J){v.current=J}),X.id=g.menuId,X.role="listbox",X["aria-labelledby"]=Y&&Y["aria-label"]?void 0:""+g.labelId,X.onMouseLeave=st(D,Z),X),Y)},[s,N,g]),G=C.useCallback(function(P,B){var X,Q=P===void 0?{}:P,D=Q.onBlur,$=Q.onClick;Q.onPress;var H=Q.onKeyDown,q=Q.refKey,Y=q===void 0?"ref":q,ie=Q.ref,ne=Ir(Q,aY),ve=B===void 0?{}:B,Z=ve.suppressRefError,J=Z===void 0?!1:Z,ae=w.current.state,he=function(){s({type:yu})},ue=function(){ae.isOpen&&!I.isMouseDown&&s({type:Gu})},de=function(xe){var Ee=Ra(xe);Ee&&T[Ee]?T[Ee](xe):JK(Ee)&&s({type:Uu,key:Ee})},le=je((X={},X[Y]=zn(ie,function(xe){p.current=xe}),X["aria-activedescendant"]=ae.isOpen&&ae.highlightedIndex>-1?g.getItemId(ae.highlightedIndex):"",X["aria-controls"]=g.menuId,X["aria-expanded"]=w.current.state.isOpen,X["aria-haspopup"]="listbox",X["aria-labelledby"]=ne&&ne["aria-label"]?void 0:""+g.labelId,X.id=g.toggleButtonId,X.role="combobox",X.tabIndex=0,X.onBlur=st(D,ue),X),ne);return ne.disabled||(le.onClick=st($,he),le.onKeyDown=st(H,de)),N("getToggleButtonProps",J,Y,p),le},[s,g,w,I,N,T]),re=C.useCallback(function(P){var B,X=P===void 0?{}:P,Q=X.item,D=X.index,$=X.onMouseMove,H=X.onClick,q=X.onMouseDown;X.onPress;var Y=X.refKey,ie=Y===void 0?"ref":Y,ne=X.disabled,ve=X.ref,Z=Ir(X,sY);ne!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var J=w.current,ae=J.state,he=J.props,ue=S1(Q,D,he.items,"Pass either item or index to getItemProps!"),de=ue[0],le=ue[1],xe=he.isItemDisabled(de,le),Ee=function(){I.isTouchEnd||le===ae.highlightedIndex||(_.current=!1,s({type:c4,index:le,disabled:xe}))},Ie=function(){s({type:A1,index:le})},Te=function(Ze){return Ze.preventDefault()},Me=je((B={},B[ie]=zn(ve,function(Ze){Ze&&(y.current[g.getItemId(le)]=Ze)}),B["aria-disabled"]=xe,B["aria-selected"]=de===ae.selectedItem,B.id=g.getItemId(le),B.role="option",B),Z);return xe||(Me.onClick=st(H,Ie)),Me.onMouseMove=st($,Ee),Me.onMouseDown=st(q,Te),Me},[w,g,I,_,s]);return{getToggleButtonProps:G,getLabelProps:V,getMenuProps:te,getItemProps:re,toggleMenu:M,openMenu:j,closeMenu:z,setHighlightedIndex:W,selectItem:U,reset:A,setInputValue:K,highlightedIndex:d,isOpen:c,selectedItem:u,inputValue:h}}var j1=process.env.NODE_ENV!=="production"?"__input_keydown_arrow_down__":0,q1=process.env.NODE_ENV!=="production"?"__input_keydown_arrow_up__":1,z1=process.env.NODE_ENV!=="production"?"__input_keydown_escape__":2,L1=process.env.NODE_ENV!=="production"?"__input_keydown_home__":3,B1=process.env.NODE_ENV!=="production"?"__input_keydown_end__":4,F1=process.env.NODE_ENV!=="production"?"__input_keydown_page_up__":5,$1=process.env.NODE_ENV!=="production"?"__input_keydown_page_down__":6,V1=process.env.NODE_ENV!=="production"?"__input_keydown_enter__":7,H1=process.env.NODE_ENV!=="production"?"__input_change__":8,Ku=process.env.NODE_ENV!=="production"?"__input_blur__":9,W1=process.env.NODE_ENV!=="production"?"__input_click__":10,g4=process.env.NODE_ENV!=="production"?"__menu_mouse_leave__":11,m4=process.env.NODE_ENV!=="production"?"__item_mouse_move__":12,U1=process.env.NODE_ENV!=="production"?"__item_click__":13,b4=process.env.NODE_ENV!=="production"?"__togglebutton_click__":14,y4=process.env.NODE_ENV!=="production"?"__function_toggle_menu__":15,x4=process.env.NODE_ENV!=="production"?"__function_open_menu__":16,w4=process.env.NODE_ENV!=="production"?"__function_close_menu__":17,S4=process.env.NODE_ENV!=="production"?"__function_set_highlighted_index__":18,G1=process.env.NODE_ENV!=="production"?"__function_select_item__":19,E4=process.env.NODE_ENV!=="production"?"__function_set_input_value__":20,_4=process.env.NODE_ENV!=="production"?"__function_reset__":21,K1=process.env.NODE_ENV!=="production"?"__controlled_prop_updated_selected_item__":22,O4=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:K1,FunctionCloseMenu:w4,FunctionOpenMenu:x4,FunctionReset:_4,FunctionSelectItem:G1,FunctionSetHighlightedIndex:S4,FunctionSetInputValue:E4,FunctionToggleMenu:y4,InputBlur:Ku,InputChange:H1,InputClick:W1,InputKeyDownArrowDown:j1,InputKeyDownArrowUp:q1,InputKeyDownEnd:B1,InputKeyDownEnter:V1,InputKeyDownEscape:z1,InputKeyDownHome:L1,InputKeyDownPageDown:$1,InputKeyDownPageUp:F1,ItemClick:U1,ItemMouseMove:m4,MenuMouseLeave:g4,ToggleButtonClick:b4});function lY(e){var t=t4(e),r=t.selectedItem,n=t.inputValue;return n===""&&r&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(n=e.itemToString(r)),je({},t,{inputValue:n})}var cY=je({},o4,{items:Se.array.isRequired,isItemDisabled:Se.func,inputValue:Se.string,defaultInputValue:Se.string,initialInputValue:Se.string,inputId:Se.string,onInputValueChange:Se.func});function uY(e,t,r,n){var i=C.useRef(),o=Q3(e,t,r,n),a=o[0],s=o[1],c=Cl();return C.useEffect(function(){if($u(t,"selectedItem")){if(!c){var d=t.itemToKey(t.selectedItem)!==t.itemToKey(i.current);d&&s({type:K1,inputValue:t.itemToString(t.selectedItem)})}i.current=a.selectedItem===i.current?t.selectedItem:a.selectedItem}},[a.selectedItem,t.selectedItem]),[ul(a,t),s]}var C4=Cr;process.env.NODE_ENV!=="production"&&(C4=function(e,t){Se.checkPropTypes(cY,e,"prop",t.name)});var dY=je({},el,{isItemDisabled:function(){return!1}});function fY(e,t){var r,n=t.type,i=t.props,o=t.altKey,a;switch(n){case U1:a={isOpen:ri(i,"isOpen"),highlightedIndex:Wu(i),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case j1:e.isOpen?a={highlightedIndex:Ln(e.highlightedIndex,1,i.items,i.isItemDisabled,!0)}:a={highlightedIndex:o&&e.selectedItem==null?-1:Eo(i,e,1),isOpen:i.items.length>=0};break;case q1:e.isOpen?o?a=Hu(i,e.highlightedIndex):a={highlightedIndex:Ln(e.highlightedIndex,-1,i.items,i.isItemDisabled,!0)}:a={highlightedIndex:Eo(i,e,-1),isOpen:i.items.length>=0};break;case V1:a=Hu(i,e.highlightedIndex);break;case z1:a=je({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case F1:a={highlightedIndex:Ln(e.highlightedIndex,-10,i.items,i.isItemDisabled,!0)};break;case $1:a={highlightedIndex:Ln(e.highlightedIndex,10,i.items,i.isItemDisabled,!0)};break;case L1:a={highlightedIndex:Ji(0,!1,i.items,i.isItemDisabled)};break;case B1:a={highlightedIndex:Ji(i.items.length-1,!0,i.items,i.isItemDisabled)};break;case Ku:a=je({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=i.items)==null?void 0:r.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case H1:a={isOpen:!0,highlightedIndex:Wu(i),inputValue:t.inputValue};break;case W1:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Eo(i,e,0)};break;case G1:a={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case K1:a={inputValue:t.inputValue};break;default:return a4(e,t,O4)}return je({},e,a)}var hY=["onMouseLeave","refKey","ref"],pY=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],vY=["onClick","onPress","refKey","ref"],gY=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];zr.stateChangeTypes=O4;function zr(e){e===void 0&&(e={}),C4(e,zr);var t=je({},dY,e),r=t.items,n=t.scrollIntoView,i=t.environment,o=t.getA11yStatusMessage,a=uY(fY,t,lY,i4),s=a[0],c=a[1],d=s.isOpen,u=s.highlightedIndex,h=s.selectedItem,p=s.inputValue,v=C.useRef(null),y=C.useRef({}),m=C.useRef(null),g=C.useRef(null),w=Cl(),x=J3(t),_=C.useRef(),S=Sd({state:s,props:t}),E=C.useCallback(function(D){return y.current[x.getItemId(D)]},[x]);_1(o,s,[d,u,h,p],i);var I=n4({menuElement:v.current,highlightedIndex:u,isOpen:d,itemRefs:y,scrollIntoView:n,getItemNodeFromIndex:E});_d({props:t,state:s}),C.useEffect(function(){var D=So(t,"isOpen");D&&m.current&&m.current.focus()},[]),C.useEffect(function(){w||(_.current=r.length)});var N=C.useCallback(function(){S.current.state.isOpen&&c({type:Ku})},[c,S]),T=C.useMemo(function(){return[v,g,m]},[]),M=r4(i,N,T),z=Ed("getInputProps","getMenuProps");C.useEffect(function(){d||(y.current={})},[d]),C.useEffect(function(){var D;!d||!(i!=null&&i.document)||!(m!=null&&(D=m.current)!=null&&D.focus)||i.document.activeElement!==m.current&&m.current.focus()},[d,i]);var j=C.useMemo(function(){return{ArrowDown:function(D){D.preventDefault(),c({type:j1,altKey:D.altKey})},ArrowUp:function(D){D.preventDefault(),c({type:q1,altKey:D.altKey})},Home:function(D){S.current.state.isOpen&&(D.preventDefault(),c({type:L1}))},End:function(D){S.current.state.isOpen&&(D.preventDefault(),c({type:B1}))},Escape:function(D){var $=S.current.state;($.isOpen||$.inputValue||$.selectedItem||$.highlightedIndex>-1)&&(D.preventDefault(),c({type:z1}))},Enter:function(D){var $=S.current.state;!$.isOpen||D.which===229||(D.preventDefault(),c({type:V1}))},PageUp:function(D){S.current.state.isOpen&&(D.preventDefault(),c({type:F1}))},PageDown:function(D){S.current.state.isOpen&&(D.preventDefault(),c({type:$1}))}}},[c,S]),W=C.useCallback(function(D){return je({id:x.labelId,htmlFor:x.inputId},D)},[x]),U=C.useCallback(function(D,$){var H,q=D===void 0?{}:D,Y=q.onMouseLeave,ie=q.refKey,ne=ie===void 0?"ref":ie,ve=q.ref,Z=Ir(q,hY),J=$===void 0?{}:$,ae=J.suppressRefError,he=ae===void 0?!1:ae;return z("getMenuProps",he,ne,v),je((H={},H[ne]=zn(ve,function(ue){v.current=ue}),H.id=x.menuId,H.role="listbox",H["aria-labelledby"]=Z&&Z["aria-label"]?void 0:""+x.labelId,H.onMouseLeave=st(Y,function(){c({type:g4})}),H),Z)},[c,z,x]),A=C.useCallback(function(D){var $,H,q=D===void 0?{}:D,Y=q.item,ie=q.index,ne=q.refKey,ve=ne===void 0?"ref":ne,Z=q.ref,J=q.onMouseMove,ae=q.onMouseDown,he=q.onClick;q.onPress;var ue=q.disabled,de=Ir(q,pY);ue!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var le=S.current,xe=le.props,Ee=le.state,Ie=S1(Y,ie,xe.items,"Pass either item or index to getItemProps!"),Te=Ie[0],Me=Ie[1],Ze=xe.isItemDisabled(Te,Me),tt="onClick",Fe=he,Le=function(){M.isTouchEnd||Me===Ee.highlightedIndex||(I.current=!1,c({type:m4,index:Me,disabled:Ze}))},ze=function(){c({type:U1,index:Me})},Je=function(rt){return rt.preventDefault()};return je(($={},$[ve]=zn(Z,function(rt){rt&&(y.current[x.getItemId(Me)]=rt)}),$["aria-disabled"]=Ze,$["aria-selected"]=Me===Ee.highlightedIndex,$.id=x.getItemId(Me),$.role="option",$),!Ze&&(H={},H[tt]=st(Fe,ze),H),{onMouseMove:st(J,Le),onMouseDown:st(ae,Je)},de)},[c,x,S,M,I]),K=C.useCallback(function(D){var $,H=D===void 0?{}:D,q=H.onClick;H.onPress;var Y=H.refKey,ie=Y===void 0?"ref":Y,ne=H.ref,ve=Ir(H,vY),Z=S.current.state,J=function(){c({type:b4})};return je(($={},$[ie]=zn(ne,function(ae){g.current=ae}),$["aria-controls"]=x.menuId,$["aria-expanded"]=Z.isOpen,$.id=x.toggleButtonId,$.tabIndex=-1,$),!ve.disabled&&je({},{onClick:st(q,J)}),ve)},[c,S,x]),V=C.useCallback(function(D,$){var H,q=D===void 0?{}:D,Y=q.onKeyDown,ie=q.onChange,ne=q.onInput,ve=q.onBlur;q.onChangeText;var Z=q.onClick,J=q.refKey,ae=J===void 0?"ref":J,he=q.ref,ue=Ir(q,gY),de=$===void 0?{}:$,le=de.suppressRefError,xe=le===void 0?!1:le;z("getInputProps",xe,ae,m);var Ee=S.current.state,Ie=function(ze){var Je=Ra(ze);Je&&j[Je]&&j[Je](ze)},Te=function(ze){c({type:H1,inputValue:ze.target.value})},Me=function(ze){if(i!=null&&i.document&&Ee.isOpen&&!M.isMouseDown){var Je=ze.relatedTarget===null&&i.document.activeElement!==i.document.body;c({type:Ku,selectItem:!Je})}},Ze=function(){c({type:W1})},tt="onChange",Fe={};if(!ue.disabled){var Le;Fe=(Le={},Le[tt]=st(ie,ne,Te),Le.onKeyDown=st(Y,Ie),Le.onBlur=st(ve,Me),Le.onClick=st(Z,Ze),Le)}return je((H={},H[ae]=zn(he,function(ze){m.current=ze}),H["aria-activedescendant"]=Ee.isOpen&&Ee.highlightedIndex>-1?x.getItemId(Ee.highlightedIndex):"",H["aria-autocomplete"]="list",H["aria-controls"]=x.menuId,H["aria-expanded"]=Ee.isOpen,H["aria-labelledby"]=ue&&ue["aria-label"]?void 0:x.labelId,H.autoComplete="off",H.id=x.inputId,H.role="combobox",H.value=Ee.inputValue,H),Fe,ue)},[c,x,i,j,S,M,z]),te=C.useCallback(function(){c({type:y4})},[c]),G=C.useCallback(function(){c({type:w4})},[c]),re=C.useCallback(function(){c({type:x4})},[c]),P=C.useCallback(function(D){c({type:S4,highlightedIndex:D})},[c]),B=C.useCallback(function(D){c({type:G1,selectedItem:D})},[c]),X=C.useCallback(function(D){c({type:E4,inputValue:D})},[c]),Q=C.useCallback(function(){c({type:_4})},[c]);return{getItemProps:A,getLabelProps:W,getMenuProps:U,getInputProps:V,getToggleButtonProps:K,toggleMenu:te,openMenu:re,closeMenu:G,setHighlightedIndex:P,setInputValue:X,selectItem:B,reset:Q,highlightedIndex:u,isOpen:d,selectedItem:h,inputValue:p}}var I4={activeIndex:-1,selectedItems:[]};function zC(e,t){return So(e,t,I4)}function LC(e,t){return ri(e,t,I4)}function mY(e){var t=zC(e,"activeIndex"),r=zC(e,"selectedItems");return{activeIndex:t,selectedItems:r}}function BC(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==""&&(t.selectionStart!==0||t.selectionEnd!==0))}function bY(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}var yY={stateReducer:bu.stateReducer,itemToKey:bu.itemToKey,environment:bu.environment,selectedItems:Se.array,initialSelectedItems:Se.array,defaultSelectedItems:Se.array,getA11yStatusMessage:Se.func,activeIndex:Se.number,initialActiveIndex:Se.number,defaultActiveIndex:Se.number,onActiveIndexChange:Se.func,onSelectedItemsChange:Se.func,keyNavigationNext:Se.string,keyNavigationPrevious:Se.string},xY={itemToKey:el.itemToKey,stateReducer:el.stateReducer,environment:el.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},R4=Cr;process.env.NODE_ENV!=="production"&&(R4=function(e,t){Se.checkPropTypes(yY,e,"prop",t.name)});var Y1=process.env.NODE_ENV!=="production"?"__selected_item_click__":0,X1=process.env.NODE_ENV!=="production"?"__selected_item_keydown_delete__":1,Z1=process.env.NODE_ENV!=="production"?"__selected_item_keydown_backspace__":2,J1=process.env.NODE_ENV!=="production"?"__selected_item_keydown_navigation_next__":3,Q1=process.env.NODE_ENV!=="production"?"__selected_item_keydown_navigation_previous__":4,eS=process.env.NODE_ENV!=="production"?"__dropdown_keydown_navigation_previous__":5,tS=process.env.NODE_ENV!=="production"?"__dropdown_keydown_backspace__":6,rS=process.env.NODE_ENV!=="production"?"__dropdown_click__":7,nS=process.env.NODE_ENV!=="production"?"__function_add_selected_item__":8,iS=process.env.NODE_ENV!=="production"?"__function_remove_selected_item__":9,oS=process.env.NODE_ENV!=="production"?"__function_set_selected_items__":10,aS=process.env.NODE_ENV!=="production"?"__function_set_active_index__":11,sS=process.env.NODE_ENV!=="production"?"__function_reset__":12,wY=Object.freeze({__proto__:null,DropdownClick:rS,DropdownKeyDownBackspace:tS,DropdownKeyDownNavigationPrevious:eS,FunctionAddSelectedItem:nS,FunctionRemoveSelectedItem:iS,FunctionReset:sS,FunctionSetActiveIndex:aS,FunctionSetSelectedItems:oS,SelectedItemClick:Y1,SelectedItemKeyDownBackspace:Z1,SelectedItemKeyDownDelete:X1,SelectedItemKeyDownNavigationNext:J1,SelectedItemKeyDownNavigationPrevious:Q1});function SY(e,t){var r=t.type,n=t.index,i=t.props,o=t.selectedItem,a=e.activeIndex,s=e.selectedItems,c;switch(r){case Y1:c={activeIndex:n};break;case Q1:c={activeIndex:a-1<0?0:a-1};break;case J1:c={activeIndex:a+1>=s.length?-1:a+1};break;case Z1:case X1:{if(a<0)break;var d=a;s.length===1?d=-1:a===s.length-1&&(d=s.length-2),c=je({selectedItems:[].concat(s.slice(0,a),s.slice(a+1))},{activeIndex:d});break}case eS:c={activeIndex:s.length-1};break;case tS:c={selectedItems:s.slice(0,s.length-1)};break;case nS:c={selectedItems:[].concat(s,[o])};break;case rS:c={activeIndex:-1};break;case iS:{var u=a,h=s.findIndex(function(y){return i.itemToKey(y)===i.itemToKey(o)});if(h<0)break;s.length===1?u=-1:h===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,h),s.slice(h+1)),activeIndex:u};break}case oS:{var p=t.selectedItems;c={selectedItems:p};break}case aS:{var v=t.activeIndex;c={activeIndex:v};break}case sS:c={activeIndex:LC(i,"activeIndex"),selectedItems:LC(i,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return je({},e,c)}var EY=["refKey","ref","onClick","onKeyDown","selectedItem","index"],_Y=["refKey","ref","onKeyDown","onClick","preventKeyAction"];lS.stateChangeTypes=wY;function lS(e){e===void 0&&(e={}),R4(e,lS);var t=je({},xY,e),r=t.getA11yStatusMessage,n=t.environment,i=t.keyNavigationNext,o=t.keyNavigationPrevious,a=e4(SY,t,mY,bY),s=a[0],c=a[1],d=s.activeIndex,u=s.selectedItems,h=Cl(),p=C.useRef(null),v=C.useRef();v.current=[];var y=Sd({state:s,props:t});_1(r,s,[d,u],n),C.useEffect(function(){h||(d===-1&&p.current?p.current.focus():v.current[d]&&v.current[d].focus())},[d]),_d({props:t,state:s});var m=Ed("getDropdownProps"),g=C.useMemo(function(){var M;return M={},M[o]=function(){c({type:Q1})},M[i]=function(){c({type:J1})},M.Delete=function(){c({type:X1})},M.Backspace=function(){c({type:Z1})},M},[c,i,o]),w=C.useMemo(function(){var M;return M={},M[o]=function(z){BC(z)&&c({type:eS})},M.Backspace=function(z){BC(z)&&c({type:tS})},M},[c,o]),x=C.useCallback(function(M){var z,j=M===void 0?{}:M,W=j.refKey,U=W===void 0?"ref":W,A=j.ref,K=j.onClick,V=j.onKeyDown,te=j.selectedItem,G=j.index,re=Ir(j,EY),P=y.current.state,B=S1(te,G,P.selectedItems,"Pass either item or index to getSelectedItemProps!"),X=B[1],Q=X>-1&&X===P.activeIndex,D=function(){c({type:Y1,index:X})},$=function(H){var q=Ra(H);q&&g[q]&&g[q](H)};return je((z={},z[U]=zn(A,function(H){H&&v.current.push(H)}),z.tabIndex=Q?0:-1,z.onClick=st(K,D),z.onKeyDown=st(V,$),z),re)},[c,y,g]),_=C.useCallback(function(M,z){var j,W=M===void 0?{}:M,U=W.refKey,A=U===void 0?"ref":U,K=W.ref,V=W.onKeyDown,te=W.onClick,G=W.preventKeyAction,re=G===void 0?!1:G,P=Ir(W,_Y),B=z===void 0?{}:z,X=B.suppressRefError,Q=X===void 0?!1:X;m("getDropdownProps",Q,A,p);var D=function(H){var q=Ra(H);q&&w[q]&&w[q](H)},$=function(){c({type:rS})};return je((j={},j[A]=zn(K,function(H){H&&(p.current=H)}),j),!re&&{onKeyDown:st(V,D),onClick:st(te,$)},P)},[c,w,m]),S=C.useCallback(function(M){c({type:nS,selectedItem:M})},[c]),E=C.useCallback(function(M){c({type:iS,selectedItem:M})},[c]),I=C.useCallback(function(M){c({type:oS,selectedItems:M})},[c]),N=C.useCallback(function(M){c({type:aS,activeIndex:M})},[c]),T=C.useCallback(function(){c({type:sS})},[c]);return{getSelectedItemProps:x,getDropdownProps:_,addSelectedItem:S,removeSelectedItem:E,setSelectedItems:I,setActiveIndex:N,reset:T,selectedItems:u,activeIndex:d}}let OY=0;const CY=()=>{const e=C.useRef(null);return e.current===null&&(e.current=`select-${++OY}`),e.current},IY=e=>{const{items:t=[],isMulti:r=!1,isSearchable:n=!1,value:i,defaultValue:o,inputValue:a,onChange:s,onInputChange:c,getOptionLabel:d=le=>(le==null?void 0:le.label)||"",getOptionValue:u=le=>(le==null?void 0:le.value)||"",isOpen:h,onOpenChange:p,customOptionGenerator:v,disableInternalFiltering:y=!1,stateReducer:m,isDisabled:g=!1,clearSearchOnSelect:w=!1,closeMenuOnSelect:x,onSelectionComplete:_,id:S}=e,E=CY(),I=S||E,N=C.useCallback(le=>{const xe=d(le);if(typeof xe=="string")return xe;if(typeof xe=="number")return String(xe);const Ee=le;if(typeof Ee=="object"&&Ee!==null){if(typeof Ee.label=="string")return Ee.label;if(typeof Ee.name=="string")return Ee.name}return String(u(le))},[d,u]),T=le=>le?Array.isArray(le)?le:[le]:[],M=o!==void 0?o:i!==void 0?i:null,[z,j]=C.useState(()=>T(M)),[W,U]=C.useState(()=>{if(a!==void 0)return a;if(n&&!r){const le=T(M)[0];if(le!==void 0)return N(le)}return""}),[A,K]=C.useState(()=>h!==void 0?h:!1),V=i!==void 0?T(i):z,te=a!==void 0?a:W,G=h!==void 0?h:A,re=C.useRef(null),P=C.useRef(null),B=C.useRef(!1);C.useEffect(()=>{const le=xe=>{const Ee=xe.target,Ie=document.querySelectorAll(`[data-select-id="${I}"]`);B.current=Array.from(Ie).some(Te=>Te.contains(Ee))};return document.addEventListener("mousedown",le,!0),()=>document.removeEventListener("mousedown",le,!0)},[I]);const X=C.useCallback(le=>{h===void 0&&K(le),p==null||p(le)},[h,p]),Q=C.useCallback(le=>{i===void 0&&j(le);const xe=r?le:le[0]||null;s==null||s(xe)},[i,r,s]),D=C.useCallback(le=>{a===void 0&&U(le),c==null||c(le)},[a,c]),$=lS({selectedItems:V,onSelectedItemsChange:le=>{const xe=le.selectedItems||[];Q(xe)}}),H=C.useCallback(le=>{r&&$.removeSelectedItem(le)},[r,$]),q=C.useCallback(le=>{if(le){if(r)V.some(xe=>u(xe)===u(le))?H(le):$.addSelectedItem(le);else{const xe=V[0];(!xe||u(xe)!==u(le))&&Q([le])}_==null||_(u(le),le)}},[r,V,u,H,$,Q,_]);C.useEffect(()=>{if(P.current){const le=P.current;P.current=null,q(le)}}),C.useLayoutEffect(()=>{if(n&&G){const le=requestAnimationFrame(()=>{var xe;(xe=re.current)==null||xe.focus()});return()=>cancelAnimationFrame(le)}},[n,G]),C.useEffect(()=>{if(n&&!r&&a===void 0&&!G){const le=V[0],xe=le!==void 0?N(le):"";xe!==W&&U(xe)}},[V,G,n,r]);const[Y,ie]=C.useState(te);C.useEffect(()=>{const le=setTimeout(()=>ie(te),120);return()=>clearTimeout(le)},[te]);const ne=C.useMemo(()=>v?v(te,t):y||!n||!Y?t:t.filter(le=>N(le).toLowerCase().includes(Y.toLowerCase())),[t,te,Y,v,y,n,N]),ve={items:ne,itemToString:le=>le?N(le):"",isOpen:G,onIsOpenChange:({isOpen:le})=>{le!==void 0&&X(le)},selectedItem:r?null:V[0]||null},Z=le=>{const xe=new Map;for(const[Ee,Ie]of Object.entries(le.stateChangeTypes))xe.set(Ie,Ee);return(Ee,Ie)=>{const{changes:Te,type:Me}=Ie,Ze=x??!r,tt=[zr.stateChangeTypes.ItemClick,zr.stateChangeTypes.InputKeyDownEnter,zr.stateChangeTypes.FunctionSelectItem,xi.stateChangeTypes.ItemClick,xi.stateChangeTypes.ToggleButtonKeyDownEnter,xi.stateChangeTypes.ToggleButtonKeyDownSpaceButton,xi.stateChangeTypes.FunctionSelectItem].includes(Me);if((Me===zr.stateChangeTypes.InputBlur||Me===xi.stateChangeTypes.ToggleButtonBlur)&&typeof document<"u"){const Fe=document.activeElement,Le=document.querySelectorAll(`[data-select-id="${I}"]`),ze=!!Fe&&Array.from(Le).some(Pt=>Pt.contains(Fe)),Je=Fe===document.body,rt=r&&Je&&B.current;if(ze||rt)return{...Te,isOpen:!0}}if(tt){const Fe=Te.selectedItem||null;Fe&&(P.current=Fe);const Le={...Te};return r?(Le.selectedItem=null,Le.isOpen=!Ze,Le.highlightedIndex=Ee.highlightedIndex,Le.inputValue=""):Fe&&(w?Le.inputValue="":n&&(Le.inputValue=N(Fe)),x===!1&&(Le.isOpen=!0,Le.highlightedIndex=Ee.highlightedIndex)),Le}return n&&!tt&&Me!==zr.stateChangeTypes.InputChange&&(Me===zr.stateChangeTypes.ControlledPropUpdatedSelectedItem||Me===zr.stateChangeTypes.FunctionSetInputValue||Me===zr.stateChangeTypes.InputBlur||Me===zr.stateChangeTypes.FunctionReset)?{...Te,inputValue:Ee.inputValue}:m?m(Ee,{...Ie,type:xe.get(Ie.type)||Ie.type,changes:Te}):Te}},J=n?zr({...ve,inputValue:te,onInputValueChange:({inputValue:le,type:xe})=>{!r&&!le&&xe===zr.stateChangeTypes.InputChange&&Q([]),D(le||"")},stateReducer:Z(zr),id:I}):xi({...ve,stateReducer:Z(xi),id:I}),ae=C.useCallback(()=>{g||("toggleMenu"in J&&typeof J.toggleMenu=="function"?J.toggleMenu():X(!G))},[J,g,X,G]),he=C.useCallback(()=>{g||("openMenu"in J&&typeof J.openMenu=="function"?J.openMenu():X(!0))},[J,g,X]),ue=C.useCallback(()=>{"closeMenu"in J&&typeof J.closeMenu=="function"?J.closeMenu():X(!1)},[J,X]),de=C.useCallback(()=>{Q([]),D(""),r&&$.reset()},[Q,D,r,$]);return{isOpen:J.isOpen,selectedItem:J.selectedItem,highlightedIndex:J.highlightedIndex,inputValue:te,getToggleButtonProps:J.getToggleButtonProps,getMenuProps:J.getMenuProps,getItemProps:J.getItemProps,getInputProps:n?(le,xe)=>({..."getInputProps"in J?J.getInputProps(le,xe):{},ref:re,value:te}):void 0,selectedItems:V,filteredItems:ne,setInputValue:D,setIsOpen:X,toggleMenu:ae,openMenu:he,closeMenu:ue,clearSelection:de,selectItem:"selectItem"in J?J.selectItem:void 0,removeItem:H,multipleSelection:$,isMulti:r,isSearchable:n,inputRef:re,selectId:I}},N4=({size:e="md",color:t="primary",isInvalid:r=!1,isDisabled:n=!1,className:i,children:o,options:a=[],value:s,defaultValue:c,onChange:d,isMulti:u,inputValue:h,onInputChange:p,isSearchable:v,isOpen:y,onOpenChange:m,customOptionGenerator:g,disableInternalFiltering:w,getOptionLabel:x=j=>typeof j=="string"||typeof j=="number"?String(j):(j==null?void 0:j.label)||(j==null?void 0:j.name)||String(j),getOptionValue:_=j=>typeof j=="string"||typeof j=="number"?String(j):(j==null?void 0:j.value)||(j==null?void 0:j.id)||(j==null?void 0:j.name)||String(j),isOptionDisabled:S=j=>(j==null?void 0:j.isDisabled)||!1,stateReducer:E,clearSearchOnSelect:I,closeMenuOnSelect:N,inputClassName:T,onSelectionComplete:M,...z})=>{const[j,W]=C.useState(!1),[U,A]=C.useState(!1),K=C.useRef(null),[V,te]=C.useState(!1),[G,re]=C.useState("bottom"),P=C.useRef(new Set),B=C.useCallback(H=>(P.current.add(H),()=>P.current.delete(H)),[]),X=C.useCallback((H,q)=>{M==null||M(H,q),P.current.forEach(Y=>Y(H,q))},[M]),Q=C.useMemo(()=>bK(a),[a]),D=IY({items:Q,value:s,defaultValue:c,onChange:d,isMulti:u,inputValue:h,onInputChange:p,isSearchable:v,isOpen:y,onOpenChange:m,getOptionLabel:x,getOptionValue:_,customOptionGenerator:g,disableInternalFiltering:w,stateReducer:E,isDisabled:n,clearSearchOnSelect:I,closeMenuOnSelect:N,onSelectionComplete:X}),$={size:e,color:r?"negative":t,isInvalid:r,isDisabled:n,hasMessage:j,setHasMessage:W,hasGroup:U,setHasGroup:A,groupRef:K,menuVisible:V,setMenuVisible:te,menuPlacement:G,setMenuPlacement:re,downshift:D,options:a,getOptionLabel:x,getOptionValue:_,isOptionDisabled:S,inputClassName:T,registerOnSelectionComplete:B};return O.jsx(C3.Provider,{value:$,children:O.jsx("div",{"data-qui":"Select","data-select-id":D.selectId,className:ye(QG(),i),...z,children:o})})},RY=C.forwardRef(({className:e,children:t,isFocused:r,isDisabled:n,...i},o)=>{const{size:a,color:s,isDisabled:c,hasMessage:d,hasGroup:u,downshift:h,isInvalid:p,menuPlacement:v}=or(),y=n??c,m=r??h.isOpen;return O.jsx("div",{ref:o,className:ye(rK({size:a,color:s,isDisabled:y,isFocused:!!m,isInvalid:p&&!h.isOpen,hasMessage:d,hasGroup:u,menuPlacement:h.isOpen?v:void 0}),e),"aria-disabled":y,"aria-invalid":p,role:"combobox",tabIndex:y?-1:0,...i,children:t})}),NY=({className:e,children:t,isMulti:r})=>O.jsx("div",{className:ye(nK({isMulti:r}),e),children:t}),xu=C.forwardRef(({isHidden:e,inputClassName:t,className:r,...n},i)=>{const{size:o,color:a}=or();return e?O.jsx("input",{ref:i,type:"text",className:r,style:{position:"absolute",top:0,left:0,opacity:0,width:"100%",height:"100%",pointerEvents:"none"},tabIndex:-1,...n}):O.jsx("input",{ref:i,type:"text","data-qui":"SelectSearchInput",className:ye(iK({size:o,color:a}),t,e?"":r),...n})}),TY=({className:e,children:t})=>{const{size:r,color:n}=or();return O.jsx("div",{className:ye(oK({size:r,color:n}),e),children:t})},PY=({className:e,children:t,data:r,isDisabled:n})=>{const{size:i,color:o,getOptionLabel:a}=or();return O.jsx("div",{className:ye(aK({size:i,color:o,isDisabled:n}),e),children:t||a(r)})},T4=({className:e,children:t,data:r,isDisabled:n,isFocused:i,onRemove:o})=>{const{size:a,color:s,downshift:c,getOptionLabel:d}=or(),u=()=>{o?o(r):c.removeItem(r)};return O.jsxs("div",{className:ye(sK({size:a,color:s,isDisabled:n,isFocused:i}),e),children:[O.jsx("div",{className:lK({size:a}),children:t||d(r)}),!n&&O.jsx("div",{className:cK({size:a,color:s,isDisabled:!1}),onClick:u,children:O.jsx(hd,{className:"w-3 h-3"})})]})},P4=({color:e,className:t,children:r,onClick:n,isDisabled:i,...o})=>{const{size:a,color:s,isDisabled:c,downshift:d}=or(),u=i??c,h=d.selectedItems.length>0;if(u||!h)return null;const p=v=>{v.stopPropagation(),n?n(v):d.clearSelection()};return O.jsx("div",{className:ye(R3({size:a,color:e||s,isDisabled:u}),t),onClick:p,role:"button",tabIndex:0,"aria-label":"Clear selection",...o,children:r||O.jsx(QD,{})})},MY=({className:e,children:t,onClick:r,isDisabled:n,...i})=>{const{size:o,color:a,isDisabled:s,downshift:c}=or(),d=n??s,u=c.inputValue.length>0&&c.isSearchable;if(d||!u)return null;const h=p=>{d||(p.preventDefault(),p.stopPropagation(),r?r(p):(c.setInputValue(""),c.clearSelection()))};return O.jsx("div",{"data-qui":"SelectIndicator",className:ye(R3({size:o,color:a,isDisabled:d}),"cursor-pointer",e),onClick:h,onMouseDown:p=>{p.preventDefault(),p.stopPropagation()},role:"button",tabIndex:-1,"aria-label":"Clear selection",...i,children:t||O.jsx(hd,{})})},M4=C.forwardRef(({color:e,className:t,children:r,onClick:n,isDisabled:i,...o},a)=>{const{size:s,color:c,isDisabled:d,downshift:u}=or(),h=i??d,p=u.isOpen,v=m=>{h||(m.preventDefault(),m.stopPropagation(),n?n(m):u.toggleMenu())},y=m=>{m.preventDefault(),m.stopPropagation()};return O.jsx("div",{ref:a,"data-qui":"SelectIndicator",className:ye(uK({size:s,color:e||c,isDisabled:h}),"cursor-pointer",t),onClick:y,onMouseDown:v,role:"button",tabIndex:-1,"aria-label":p?"Close menu":"Open menu","aria-expanded":p,"aria-disabled":h,...o,children:r||O.jsx(rj,{className:ye("transition-transform duration-200",{"rotate-180":p})})})}),kY=C.forwardRef(({className:e,children:t,placement:r,...n},i)=>{const{size:o,hasMessage:a,color:s,hasGroup:c}=or();return O.jsx("div",{"data-qui":"SelectMenu",ref:i,className:ye(dK({size:o,placement:r,hasMessage:a,color:s,hasGroup:c}),e),...n,children:t})}),AY=C.forwardRef(({className:e,children:t,maxHeight:r=300,totalHeight:n,...i},o)=>{const{size:a}=or();return O.jsx(a1,{scrollableNodeProps:{ref:o},className:ye(fK({size:a}),e),style:{maxHeight:r},...i,children:n!==void 0?O.jsx("div",{style:{height:n,position:"relative",width:"100%"},children:t}):t})}),wu=({className:e,children:t,data:r,isDisabled:n,isFocused:i,isSelected:o,innerProps:a,optionClassName:s,...c})=>{const{size:d,color:u,getOptionLabel:h}=or();return O.jsx("div",{"data-qui":"SelectOption",className:ye(hK({size:d,color:u,isDisabled:n,isFocused:i,isSelected:o}),s,e),...a,...c,children:t??h(r)})},k4=({className:e,children:t,data:r,label:n,renderGroupHeading:i})=>{const{size:o}=or();return O.jsxs("div",{"data-qui":"SelectOptionGroup",className:ye(pK({size:o}),e),children:[O.jsx(DY,{children:i?i(r):n||r.label}),t]})},DY=({className:e,children:t})=>{const{size:r,color:n}=or();return O.jsx("div",{className:ye(vK({size:r,color:n}),e),children:t})},Gh=({className:e,children:t,inputValue:r})=>{const{size:n}=or();return O.jsx("div",{className:ye(mK({size:n}),e),children:t||`No options found${r?` for "${r}"`:""}`})},A4=C.forwardRef(({className:e,children:t,...r},n)=>{const{size:i,color:o,isDisabled:a,hasMessage:s,isInvalid:c,setHasGroup:d,groupRef:u,menuVisible:h,menuPlacement:p}=or();return C.useEffect(()=>(d(!0),()=>{d(!1)}),[d]),O.jsx("div",{ref:ga([n,u]),"data-qui":"SelectGroup",className:ye(eK({size:i,color:o,isDisabled:a,hasMessage:s,isInvalid:c,isFocused:h,menuPlacement:h?p:void 0}),e),...r,children:t})}),jY=C.forwardRef(({isAction:e=!1,className:t,isDisabled:r=!1,style:n,children:i,...o},a)=>{const{size:s,color:c,isDisabled:d}=or(),u=r||d,h=tK({size:s,color:c,isDisabled:u,isAction:e});return O.jsx("div",{ref:a,"data-qui":"SelectIcon",className:ye(h,t),style:n,role:e||o.onClick?"button":void 0,tabIndex:(e||o.onClick)&&!u?0:void 0,"aria-disabled":u,...o,children:i})}),qY=({isOpen:e,usePortal:t,controlRef:r,selectId:n,children:i})=>{const[o,a]=C.useState(null);return C.useLayoutEffect(()=>{if(t&&e&&r.current){const s=()=>{var c;const d=(c=r.current)==null?void 0:c.closest('[data-qui="SelectGroup"]'),u=d||r.current;if(!u)return;const h=u.getBoundingClientRect();a(d?{top:h.top+window.scrollY+d.clientTop,left:h.left+window.scrollX+d.clientLeft,width:d.clientWidth,height:d.clientHeight}:{top:h.top+window.scrollY,left:h.left+window.scrollX,width:h.width,height:h.height})};return s(),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}}},[e,t,r]),e?t&&o?xn.createPortal(O.jsx("div",{"data-qui":"SelectPortal","data-select-id":n,style:{position:"absolute",top:o.top,left:o.left,width:o.width,height:o.height,zIndex:50,pointerEvents:"none"},children:O.jsx("div",{style:{pointerEvents:"auto"},children:i})}),document.body):O.jsx(O.Fragment,{children:i}):null},ga=e=>t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&"current"in r&&(r.current=t)})},zY=e=>{let t=0,r=window.innerHeight,n=e.parentElement;for(;n&&n!==document.body&&n!==document.documentElement;){const{overflowY:i}=window.getComputedStyle(n);if(i!=="visible"){const o=n.getBoundingClientRect();t=Math.max(t,o.top),r=Math.min(r,o.bottom)}n=n.parentElement}return{top:t,bottom:r}},D4=C.forwardRef(({placeholder:e,noOptionsMessage:t,hideNoOptions:r=!1,loadingMessage:n="Loading...",isClearable:i=!1,isSearchClearable:o=!1,isLoading:a=!1,isRequired:s=!1,hideIndicators:c=!1,hideDropdownIndicator:d=!1,searchPlacement:u="trigger",menuPlacement:h="bottom",hideSelectedOptions:p=!1,onFocus:v,onBlur:y,renderMenuHeader:m,formatOptionLabel:g,renderOption:w,optionClassName:x,renderValue:_,renderGroupHeading:S,inputRef:E,controlShouldRenderValue:I=!0,name:N,id:T,onSelectionComplete:M,"aria-label":z,"aria-labelledby":j,"aria-describedby":W,children:U,usePortal:A=!1,virtualizeThreshold:K=100,className:V,inputClassName:te,...G},re)=>{const{size:P,isInvalid:B,isDisabled:X,hasGroup:Q,downshift:D,options:$=[],getOptionLabel:H,getOptionValue:q,isOptionDisabled:Y,menuPlacement:ie,setMenuPlacement:ne,menuVisible:ve,setMenuVisible:Z,inputClassName:J}=or(),ae=te||J,he=C.useMemo(()=>{if(w)return w;if(g)return({data:ke})=>g(ke)},[w,g]),ue=C.useRef(null),de=E||ue,le=C.useRef(null),[xe,Ee]=C.useState(null),Ie=C.useRef(null),{isOpen:Te,openMenu:Me,selectedItem:Ze,inputValue:tt,highlightedIndex:Fe,getToggleButtonProps:Le,getMenuProps:ze,getInputProps:Je,getItemProps:rt,isMulti:Pt,isSearchable:gt,multipleSelection:Rt}=D,{getDropdownProps:qt}=Rt;C.useLayoutEffect(()=>{if(!Te)return;if(h==="top"||h==="bottom"){ne(h);return}const ke=le.current;if(!ke)return;const $e=()=>{const Ht=ke.getBoundingClientRect(),wr=A?{top:0,bottom:window.innerHeight}:zY(ke),Sr=wr.bottom-Ht.bottom,tr=Ht.top-wr.top,un=P==="sm"?22:P==="lg"?36:28,Yr=Math.min((D.filteredItems.length||1)*un+16,300),ci=xe==null?void 0:xe.getBoundingClientRect().height,Ni=ci&&ci>0?ci:Yr,Qa=Sr>=Ni;ne(!Qa&&tr>Sr?"top":"bottom")};$e(),window.addEventListener("resize",$e),window.addEventListener("scroll",$e,!0);const xr=xe&&typeof ResizeObserver<"u"?new ResizeObserver(()=>$e()):void 0;return xe&&(xr==null||xr.observe(xe)),()=>{window.removeEventListener("resize",$e),window.removeEventListener("scroll",$e,!0),xr==null||xr.disconnect()}},[Te,ne,P,D.filteredItems.length,h,A,xe]),C.useLayoutEffect(()=>{const ke=Te&&!(r&&D.filteredItems.length===0);return Z(ke),()=>Z(!1)},[Te,r,D.filteredItems.length,Z]);const Ot=Pt?D.selectedItems??[]:Ze?[Ze]:[],Gr=Ot.length>0,Kr=o&&!!tt&&!X&&!c,ar=i&&(Gr||!!tt)&&!X&&!c,Nn=!d&&!c,io=!Gr&&(!gt||!tt)||!I,zt={},Mt={};Object.entries(G).forEach(([ke,$e])=>{ke.startsWith("data-")||ke.startsWith("aria-")||ke==="role"?zt[ke]=$e:Mt[ke]=$e});const Lt=C.useMemo(()=>ga([le,re]),[re]),fr=ze({},{suppressRefError:!0}),kt=qt({preventKeyAction:Te}),At={ref:de,disabled:X,required:s,name:N,id:T,"aria-label":z,"aria-labelledby":j,"aria-describedby":W,"aria-invalid":B,onFocus:v,onBlur:y,...Mt},hr=gt?(Je==null?void 0:Je({...At,...kt}))??At:{...At,...kt},{ref:Mr,...Et}=hr,Bt=C.useMemo(()=>ga([Mr]),[Mr]),{ref:pr,...vr}=fr,yr=C.useRef(pr);yr.current=pr;const sr=C.useCallback(ke=>{Ee($e=>$e===ke?$e:ke),ga([yr.current])(ke)},[]),Tn=ke=>Ot.some($e=>q($e)===q(ke)),Un=ke=>p?ke.filter($e=>!Tn($e)):ke,Za=ke=>p?ke.map($e=>({...$e,options:Un($e.options)})).filter($e=>$e.options.length>0):ke,Gn=Nw($)?[]:Un(D.filteredItems),Ja={sm:22,md:28,lg:36}[P]??28,Kn=Gn.length>=K,Ri=JG({count:Kn?Gn.length:0,getScrollElement:()=>Ie.current,estimateSize:()=>Ja,overscan:5});C.useEffect(()=>{Kn&&Te&&Fe>=0&&Fe<Gn.length&&Ri.scrollToIndex(Fe,{align:"auto"})},[Fe,Kn,Te]);const{registerOnSelectionComplete:Bo}=or();C.useEffect(()=>{if(M)return Bo(M)},[M,Bo]);const Fo=gt?{}:Le({disabled:X,...kt,ref:ga([Lt,kt.ref])});return O.jsxs("div",{className:ye({relative:!Q,"flex-1 min-w-0":Q}),children:[O.jsxs(RY,{"data-qui":"SelectControl",className:V,...gt?{ref:ga([Lt,kt.ref])}:Fo,...zt,isFocused:ve,isDisabled:X,onClick:ke=>{ke.defaultPrevented||(gt?Me():D.toggleMenu())},children:[U||O.jsxs(NY,{isMulti:Pt,children:[Pt&&I&&Ot.map((ke,$e)=>O.jsx(T4,{data:ke,index:$e,isDisabled:X,children:_?_(ke):void 0},q(ke))),!Pt&&Gr&&I&&!gt&&O.jsx("div",{className:"flex items-center gap-2",children:O.jsx(PY,{data:Ot[0],isDisabled:X,children:_?_(Ot[0]):H(Ot[0])})}),gt&&u==="trigger"?O.jsx(xu,{ref:Bt,...Et,className:V,inputClassName:ae,placeholder:e}):O.jsxs(O.Fragment,{children:[O.jsx(xu,{ref:Bt,...Et,className:V,inputClassName:ae,isHidden:!0,readOnly:!0,value:Ot.map(ke=>q(ke)).join(",")}),io&&O.jsx(TY,{children:e})]})]}),O.jsxs("div",{className:ye("flex items-center size-fit gap-1",{hidden:!ar&&!Nn}),children:[Kr&&O.jsx(MY,{}),ar&&O.jsx(P4,{}),Nn&&O.jsx(M4,{...gt?Le({disabled:X,"aria-label":Te?"Close menu":"Open menu"}):{}})]})]}),!Te&&O.jsx("div",{ref:fr.ref,style:{display:"none"},"aria-hidden":"true"}),O.jsx(qY,{isOpen:Te,usePortal:A,controlRef:le,selectId:D.selectId,children:r&&D.filteredItems.length===0?O.jsx("div",{...vr,style:{display:"none"},"aria-hidden":"true"}):O.jsxs(kY,{ref:sr,...vr,placement:ie,children:[m&&m(D),gt&&u==="menu"&&O.jsx("div",{className:"p-2",children:O.jsx(xu,{ref:Bt,...Et,className:V,inputClassName:ae,autoFocus:!0,placeholder:e,onClick:ke=>ke.stopPropagation()})}),O.jsx(AY,{ref:Ie,totalHeight:Kn?Ri.getTotalSize():void 0,children:a?O.jsx("div",{className:gK({size:P}),children:n}):D.filteredItems.length===0?O.jsx(Gh,{inputValue:tt,children:typeof t=="function"?t(tt):t}):Nw($)?(()=>{const ke=Za($);return ke.length===0?O.jsx(Gh,{inputValue:tt,children:typeof t=="function"?t(tt):t}):ke.map(($e,xr)=>O.jsx(k4,{data:$e,label:$e.label,options:$e.options,renderGroupHeading:S,children:$e.options.map(Ht=>{const wr=q(Ht),Sr=Ot.some(Ni=>q(Ni)===wr),tr=D.filteredItems.indexOf(Ht),un=Fe===tr,Yr=Y(Ht),ci=rt({item:Ht,index:tr});return O.jsx(wu,{...ci,data:Ht,isDisabled:Yr,isFocused:un,isSelected:Sr,optionClassName:x,children:he?he({data:Ht,isFocused:un,isSelected:Sr,isDisabled:Yr}):void 0},`${wr}-${tr}`)})},`${$e.label}-${xr}`))})():Gn.length===0?O.jsx(Gh,{inputValue:tt,children:typeof t=="function"?t(tt):t}):Kn?Ri.getVirtualItems().map(ke=>{const $e=Gn[ke.index],xr=q($e),Ht=Ot.some(Yr=>q(Yr)===xr),wr=D.filteredItems.indexOf($e),Sr=Fe===wr,tr=Y($e),un=rt({item:$e,index:wr});return O.jsx("div",{"data-index":ke.index,ref:Ri.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${ke.start}px)`},children:O.jsx(wu,{...un,data:$e,isDisabled:tr,isFocused:Sr,isSelected:Ht,optionClassName:x,children:he?he({data:$e,isFocused:Sr,isSelected:Ht,isDisabled:tr}):void 0})},ke.key)}):Gn.map(ke=>{const $e=q(ke),xr=Ot.some(un=>q(un)===$e),Ht=D.filteredItems.indexOf(ke),wr=Fe===Ht,Sr=Y(ke),tr=rt({item:ke,index:Ht});return O.jsx(wu,{...tr,data:ke,isDisabled:Sr,isFocused:wr,isSelected:xr,optionClassName:x,children:he?he({data:ke,isFocused:wr,isSelected:xr,isDisabled:Sr}):void 0},`${$e}-${Ht}`)})})]})})]})});N4.displayName="Select.Root";A4.displayName="Select.Group";jY.displayName="Select.Icon";xu.displayName="Select.Input";T4.displayName="Select.MultiValue";P4.displayName="Select.ClearIndicator";M4.displayName="Select.DropdownIndicator";wu.displayName="Select.Option";k4.displayName="Select.OptionGroup";const LY=D4;LY.displayName="Select.Field";const Kh={Root:N4,Group:A4,Field:D4};C.createContext(void 0);const BY=({active:e,disabled:t,error:r,isOpen:n,className:i})=>ye("flex w-full items-center justify-between text-left leading-5 transition-colors duration-200",{"cursor-pointer":!t,"text-inactive-text":t,"bg-primary hover:bg-primary-hover":e&&!t,"text-negative":r&&!e&&!t,"bg-primary-hover text-body":n&&!e&&!t,"text-body":!e&&!t&&!r,"hover:bg-primary-hover hover:text-tab-active-fg":!t&&!e},i),FY=C.forwardRef(({active:e,disabled:t,error:r,isOpen:n,className:i,children:o,as:a="div",...s},c)=>{const d=BY({active:e,disabled:t,error:r,isOpen:n,className:i});return O.jsx(a,{"data-qui":"ListItem",ref:c,className:d,"aria-disabled":t,"aria-selected":e,"aria-invalid":r,"aria-expanded":n,role:s.onClick?"button":"listitem",...s,children:o})});FY.displayName="ListItem";function $Y({qodly:e,activeTab:t,forceLogin:r,canUndo:n,canRedo:i,onUndo:o,onRedo:a,onTabChange:s,restrictedByDefault:c,onRestrictedByDefaultChange:d,onForceLoginChange:u}){return O.jsx(O.Fragment,{children:O.jsx(br,{depth:1,className:"relative mb-0 flex h-auto flex-wrap items-center justify-between border-b px-4 py-3",children:O.jsx("div",{className:"flex w-full flex-wrap items-center justify-between",children:O.jsxs("div",{className:"relative flex w-full justify-between",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsxs(zh,{activeTab:t,onTabChange:h=>s(h),children:[O.jsx(zh.Item,{label:"Roles",value:"roles","data-cy":"roles_btn_navbar",className:"min-w-[110px] place-content-center"}),O.jsx(zh.Item,{label:"Privileges",value:"privileges","data-cy":"privileges_btn_navbar",className:"min-w-[110px] place-content-center"})]}),O.jsxs("div",{className:"flex items-center gap-1",children:[O.jsx(pe.ToolbarIcon,{"data-cy":"roles-toolbar-undo-button",label:"Undo",disabled:!n,Icon:Tu.FdUndo,as:"button",onClick:n?o:void 0}),O.jsx(pe.ToolbarIcon,{"data-cy":"roles-toolbar-redo-button",label:"Redo",disabled:!i,Icon:Tu.FdRedo,as:"button",onClick:i?a:void 0})]})]}),O.jsxs("div",{className:"flex gap-2 justify-between",children:[O.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap",children:[O.jsx(Fu,{checked:c||!1,onChange:h=>{d(h)}}),O.jsx("span",{className:"px-1 text-xs",children:"Restrict Access By Default"}),O.jsx(pe.Tip,{tipKey:"editors:roles:toolbar:restrictedByDefault",alwaysOn:!0,side:"left"})]}),e===!1&&O.jsxs("span",{className:"flex items-center gap-1 whitespace-nowrap",children:[O.jsx(Fu,{checked:r||!1,onChange:h=>{u(h)}}),O.jsx("span",{className:"px-1 text-xs",children:"Force login"}),O.jsx(pe.Tip,{tipKey:"editors:roles:toolbar:forceLogin",alwaysOn:!0,side:"left"})]})]})]})})})})}const j4=C.createContext(void 0),VY=({children:e})=>{const[t,r]=C.useState(null),[n,i]=C.useState(null);function o(s){r(s),setTimeout(()=>i(s),0)}const a={selectedRole:t,deferredSelectedRole:n,selectRole:o};return O.jsx(j4.Provider,{value:a,children:e})};function cS(){const e=C.useContext(j4);if(e===void 0)throw new Error("useSelectedRole must be used within a SelectedRoleProvider");return e}var FC=function(t){return t.reduce(function(r,n){var i=n[0],o=n[1];return r[i]=o,r},{})},$C=typeof window<"u"&&window.document&&window.document.createElement?nt.useLayoutEffect:nt.useEffect,$r="top",En="bottom",_n="right",Vr="left",uS="auto",Il=[$r,En,_n,Vr],Na="start",dl="end",HY="clippingParents",q4="viewport",Es="popper",WY="reference",VC=Il.reduce(function(e,t){return e.concat([t+"-"+Na,t+"-"+dl])},[]),z4=[].concat(Il,[uS]).reduce(function(e,t){return e.concat([t,t+"-"+Na,t+"-"+dl])},[]),UY="beforeRead",GY="read",KY="afterRead",YY="beforeMain",XY="main",ZY="afterMain",JY="beforeWrite",QY="write",eX="afterWrite",tX=[UY,GY,KY,YY,XY,ZY,JY,QY,eX];function ai(e){return e?(e.nodeName||"").toLowerCase():null}function sn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function To(e){var t=sn(e).Element;return e instanceof t||e instanceof Element}function Sn(e){var t=sn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function dS(e){if(typeof ShadowRoot>"u")return!1;var t=sn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function rX(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},i=t.attributes[r]||{},o=t.elements[r];!Sn(o)||!ai(o)||(Object.assign(o.style,n),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function nX(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var i=t.elements[n],o=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),s=a.reduce(function(c,d){return c[d]="",c},{});!Sn(i)||!ai(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const iX={name:"applyStyles",enabled:!0,phase:"write",fn:rX,effect:nX,requires:["computeStyles"]};function ni(e){return e.split("-")[0]}var _o=Math.max,Yu=Math.min,Ta=Math.round;function kw(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function L4(){return!/^((?!chrome|android).)*safari/i.test(kw())}function Pa(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),i=1,o=1;t&&Sn(e)&&(i=e.offsetWidth>0&&Ta(n.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Ta(n.height)/e.offsetHeight||1);var a=To(e)?sn(e):window,s=a.visualViewport,c=!L4()&&r,d=(n.left+(c&&s?s.offsetLeft:0))/i,u=(n.top+(c&&s?s.offsetTop:0))/o,h=n.width/i,p=n.height/o;return{width:h,height:p,top:u,right:d+h,bottom:u+p,left:d,x:d,y:u}}function fS(e){var t=Pa(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function B4(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&dS(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ei(e){return sn(e).getComputedStyle(e)}function oX(e){return["table","td","th"].indexOf(ai(e))>=0}function Qi(e){return((To(e)?e.ownerDocument:e.document)||window.document).documentElement}function Od(e){return ai(e)==="html"?e:e.assignedSlot||e.parentNode||(dS(e)?e.host:null)||Qi(e)}function HC(e){return!Sn(e)||Ei(e).position==="fixed"?null:e.offsetParent}function aX(e){var t=/firefox/i.test(kw()),r=/Trident/i.test(kw());if(r&&Sn(e)){var n=Ei(e);if(n.position==="fixed")return null}var i=Od(e);for(dS(i)&&(i=i.host);Sn(i)&&["html","body"].indexOf(ai(i))<0;){var o=Ei(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Rl(e){for(var t=sn(e),r=HC(e);r&&oX(r)&&Ei(r).position==="static";)r=HC(r);return r&&(ai(r)==="html"||ai(r)==="body"&&Ei(r).position==="static")?t:r||aX(e)||t}function hS(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function tl(e,t,r){return _o(e,Yu(t,r))}function sX(e,t,r){var n=tl(e,t,r);return n>r?r:n}function F4(){return{top:0,right:0,bottom:0,left:0}}function $4(e){return Object.assign({},F4(),e)}function V4(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var lX=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,$4(typeof t!="number"?t:V4(t,Il))};function cX(e){var t,r=e.state,n=e.name,i=e.options,o=r.elements.arrow,a=r.modifiersData.popperOffsets,s=ni(r.placement),c=hS(s),d=[Vr,_n].indexOf(s)>=0,u=d?"height":"width";if(!(!o||!a)){var h=lX(i.padding,r),p=fS(o),v=c==="y"?$r:Vr,y=c==="y"?En:_n,m=r.rects.reference[u]+r.rects.reference[c]-a[c]-r.rects.popper[u],g=a[c]-r.rects.reference[c],w=Rl(o),x=w?c==="y"?w.clientHeight||0:w.clientWidth||0:0,_=m/2-g/2,S=h[v],E=x-p[u]-h[y],I=x/2-p[u]/2+_,N=tl(S,I,E),T=c;r.modifiersData[n]=(t={},t[T]=N,t.centerOffset=N-I,t)}}function uX(e){var t=e.state,r=e.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||B4(t.elements.popper,i)&&(t.elements.arrow=i))}const dX={name:"arrow",enabled:!0,phase:"main",fn:cX,effect:uX,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ma(e){return e.split("-")[1]}var fX={top:"auto",right:"auto",bottom:"auto",left:"auto"};function hX(e,t){var r=e.x,n=e.y,i=t.devicePixelRatio||1;return{x:Ta(r*i)/i||0,y:Ta(n*i)/i||0}}function WC(e){var t,r=e.popper,n=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,d=e.adaptive,u=e.roundOffsets,h=e.isFixed,p=a.x,v=p===void 0?0:p,y=a.y,m=y===void 0?0:y,g=typeof u=="function"?u({x:v,y:m}):{x:v,y:m};v=g.x,m=g.y;var w=a.hasOwnProperty("x"),x=a.hasOwnProperty("y"),_=Vr,S=$r,E=window;if(d){var I=Rl(r),N="clientHeight",T="clientWidth";if(I===sn(r)&&(I=Qi(r),Ei(I).position!=="static"&&s==="absolute"&&(N="scrollHeight",T="scrollWidth")),I=I,i===$r||(i===Vr||i===_n)&&o===dl){S=En;var M=h&&I===E&&E.visualViewport?E.visualViewport.height:I[N];m-=M-n.height,m*=c?1:-1}if(i===Vr||(i===$r||i===En)&&o===dl){_=_n;var z=h&&I===E&&E.visualViewport?E.visualViewport.width:I[T];v-=z-n.width,v*=c?1:-1}}var j=Object.assign({position:s},d&&fX),W=u===!0?hX({x:v,y:m},sn(r)):{x:v,y:m};if(v=W.x,m=W.y,c){var U;return Object.assign({},j,(U={},U[S]=x?"0":"",U[_]=w?"0":"",U.transform=(E.devicePixelRatio||1)<=1?"translate("+v+"px, "+m+"px)":"translate3d("+v+"px, "+m+"px, 0)",U))}return Object.assign({},j,(t={},t[S]=x?m+"px":"",t[_]=w?v+"px":"",t.transform="",t))}function pX(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=n===void 0?!0:n,o=r.adaptive,a=o===void 0?!0:o,s=r.roundOffsets,c=s===void 0?!0:s,d={placement:ni(t.placement),variation:Ma(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,WC(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,WC(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const vX={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:pX,data:{}};var Uc={passive:!0};function gX(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,o=i===void 0?!0:i,a=n.resize,s=a===void 0?!0:a,c=sn(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",r.update,Uc)}),s&&c.addEventListener("resize",r.update,Uc),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",r.update,Uc)}),s&&c.removeEventListener("resize",r.update,Uc)}}const mX={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:gX,data:{}};var bX={left:"right",right:"left",bottom:"top",top:"bottom"};function Su(e){return e.replace(/left|right|bottom|top/g,function(t){return bX[t]})}var yX={start:"end",end:"start"};function UC(e){return e.replace(/start|end/g,function(t){return yX[t]})}function pS(e){var t=sn(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function vS(e){return Pa(Qi(e)).left+pS(e).scrollLeft}function xX(e,t){var r=sn(e),n=Qi(e),i=r.visualViewport,o=n.clientWidth,a=n.clientHeight,s=0,c=0;if(i){o=i.width,a=i.height;var d=L4();(d||!d&&t==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:s+vS(e),y:c}}function wX(e){var t,r=Qi(e),n=pS(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=_o(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=_o(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+vS(e),c=-n.scrollTop;return Ei(i||r).direction==="rtl"&&(s+=_o(r.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}function gS(e){var t=Ei(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function H4(e){return["html","body","#document"].indexOf(ai(e))>=0?e.ownerDocument.body:Sn(e)&&gS(e)?e:H4(Od(e))}function rl(e,t){var r;t===void 0&&(t=[]);var n=H4(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=sn(n),a=i?[o].concat(o.visualViewport||[],gS(n)?n:[]):n,s=t.concat(a);return i?s:s.concat(rl(Od(a)))}function Aw(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function SX(e,t){var r=Pa(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function GC(e,t,r){return t===q4?Aw(xX(e,r)):To(t)?SX(t,r):Aw(wX(Qi(e)))}function EX(e){var t=rl(Od(e)),r=["absolute","fixed"].indexOf(Ei(e).position)>=0,n=r&&Sn(e)?Rl(e):e;return To(n)?t.filter(function(i){return To(i)&&B4(i,n)&&ai(i)!=="body"}):[]}function _X(e,t,r,n){var i=t==="clippingParents"?EX(e):[].concat(t),o=[].concat(i,[r]),a=o[0],s=o.reduce(function(c,d){var u=GC(e,d,n);return c.top=_o(u.top,c.top),c.right=Yu(u.right,c.right),c.bottom=Yu(u.bottom,c.bottom),c.left=_o(u.left,c.left),c},GC(e,a,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function W4(e){var t=e.reference,r=e.element,n=e.placement,i=n?ni(n):null,o=n?Ma(n):null,a=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,c;switch(i){case $r:c={x:a,y:t.y-r.height};break;case En:c={x:a,y:t.y+t.height};break;case _n:c={x:t.x+t.width,y:s};break;case Vr:c={x:t.x-r.width,y:s};break;default:c={x:t.x,y:t.y}}var d=i?hS(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case Na:c[d]=c[d]-(t[u]/2-r[u]/2);break;case dl:c[d]=c[d]+(t[u]/2-r[u]/2);break}}return c}function fl(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=n===void 0?e.placement:n,o=r.strategy,a=o===void 0?e.strategy:o,s=r.boundary,c=s===void 0?HY:s,d=r.rootBoundary,u=d===void 0?q4:d,h=r.elementContext,p=h===void 0?Es:h,v=r.altBoundary,y=v===void 0?!1:v,m=r.padding,g=m===void 0?0:m,w=$4(typeof g!="number"?g:V4(g,Il)),x=p===Es?WY:Es,_=e.rects.popper,S=e.elements[y?x:p],E=_X(To(S)?S:S.contextElement||Qi(e.elements.popper),c,u,a),I=Pa(e.elements.reference),N=W4({reference:I,element:_,placement:i}),T=Aw(Object.assign({},_,N)),M=p===Es?T:I,z={top:E.top-M.top+w.top,bottom:M.bottom-E.bottom+w.bottom,left:E.left-M.left+w.left,right:M.right-E.right+w.right},j=e.modifiersData.offset;if(p===Es&&j){var W=j[i];Object.keys(z).forEach(function(U){var A=[_n,En].indexOf(U)>=0?1:-1,K=[$r,En].indexOf(U)>=0?"y":"x";z[U]+=W[K]*A})}return z}function OX(e,t){t===void 0&&(t={});var r=t,n=r.placement,i=r.boundary,o=r.rootBoundary,a=r.padding,s=r.flipVariations,c=r.allowedAutoPlacements,d=c===void 0?z4:c,u=Ma(n),h=u?s?VC:VC.filter(function(y){return Ma(y)===u}):Il,p=h.filter(function(y){return d.indexOf(y)>=0});p.length===0&&(p=h);var v=p.reduce(function(y,m){return y[m]=fl(e,{placement:m,boundary:i,rootBoundary:o,padding:a})[ni(m)],y},{});return Object.keys(v).sort(function(y,m){return v[y]-v[m]})}function CX(e){if(ni(e)===uS)return[];var t=Su(e);return[UC(e),t,UC(t)]}function IX(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,o=i===void 0?!0:i,a=r.altAxis,s=a===void 0?!0:a,c=r.fallbackPlacements,d=r.padding,u=r.boundary,h=r.rootBoundary,p=r.altBoundary,v=r.flipVariations,y=v===void 0?!0:v,m=r.allowedAutoPlacements,g=t.options.placement,w=ni(g),x=w===g,_=c||(x||!y?[Su(g)]:CX(g)),S=[g].concat(_).reduce(function(D,$){return D.concat(ni($)===uS?OX(t,{placement:$,boundary:u,rootBoundary:h,padding:d,flipVariations:y,allowedAutoPlacements:m}):$)},[]),E=t.rects.reference,I=t.rects.popper,N=new Map,T=!0,M=S[0],z=0;z<S.length;z++){var j=S[z],W=ni(j),U=Ma(j)===Na,A=[$r,En].indexOf(W)>=0,K=A?"width":"height",V=fl(t,{placement:j,boundary:u,rootBoundary:h,altBoundary:p,padding:d}),te=A?U?_n:Vr:U?En:$r;E[K]>I[K]&&(te=Su(te));var G=Su(te),re=[];if(o&&re.push(V[W]<=0),s&&re.push(V[te]<=0,V[G]<=0),re.every(function(D){return D})){M=j,T=!1;break}N.set(j,re)}if(T)for(var P=y?3:1,B=function($){var H=S.find(function(q){var Y=N.get(q);if(Y)return Y.slice(0,$).every(function(ie){return ie})});if(H)return M=H,"break"},X=P;X>0;X--){var Q=B(X);if(Q==="break")break}t.placement!==M&&(t.modifiersData[n]._skip=!0,t.placement=M,t.reset=!0)}}const RX={name:"flip",enabled:!0,phase:"main",fn:IX,requiresIfExists:["offset"],data:{_skip:!1}};function KC(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function YC(e){return[$r,_n,En,Vr].some(function(t){return e[t]>=0})}function NX(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=fl(t,{elementContext:"reference"}),s=fl(t,{altBoundary:!0}),c=KC(a,n),d=KC(s,i,o),u=YC(c),h=YC(d);t.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}const TX={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:NX};function PX(e,t,r){var n=ni(e),i=[Vr,$r].indexOf(n)>=0?-1:1,o=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Vr,_n].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}function MX(e){var t=e.state,r=e.options,n=e.name,i=r.offset,o=i===void 0?[0,0]:i,a=z4.reduce(function(u,h){return u[h]=PX(h,t.rects,o),u},{}),s=a[t.placement],c=s.x,d=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=d),t.modifiersData[n]=a}const kX={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:MX};function AX(e){var t=e.state,r=e.name;t.modifiersData[r]=W4({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const DX={name:"popperOffsets",enabled:!0,phase:"read",fn:AX,data:{}};function jX(e){return e==="x"?"y":"x"}function qX(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,o=i===void 0?!0:i,a=r.altAxis,s=a===void 0?!1:a,c=r.boundary,d=r.rootBoundary,u=r.altBoundary,h=r.padding,p=r.tether,v=p===void 0?!0:p,y=r.tetherOffset,m=y===void 0?0:y,g=fl(t,{boundary:c,rootBoundary:d,padding:h,altBoundary:u}),w=ni(t.placement),x=Ma(t.placement),_=!x,S=hS(w),E=jX(S),I=t.modifiersData.popperOffsets,N=t.rects.reference,T=t.rects.popper,M=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,z=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,W={x:0,y:0};if(I){if(o){var U,A=S==="y"?$r:Vr,K=S==="y"?En:_n,V=S==="y"?"height":"width",te=I[S],G=te+g[A],re=te-g[K],P=v?-T[V]/2:0,B=x===Na?N[V]:T[V],X=x===Na?-T[V]:-N[V],Q=t.elements.arrow,D=v&&Q?fS(Q):{width:0,height:0},$=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:F4(),H=$[A],q=$[K],Y=tl(0,N[V],D[V]),ie=_?N[V]/2-P-Y-H-z.mainAxis:B-Y-H-z.mainAxis,ne=_?-N[V]/2+P+Y+q+z.mainAxis:X+Y+q+z.mainAxis,ve=t.elements.arrow&&Rl(t.elements.arrow),Z=ve?S==="y"?ve.clientTop||0:ve.clientLeft||0:0,J=(U=j==null?void 0:j[S])!=null?U:0,ae=te+ie-J-Z,he=te+ne-J,ue=tl(v?Yu(G,ae):G,te,v?_o(re,he):re);I[S]=ue,W[S]=ue-te}if(s){var de,le=S==="x"?$r:Vr,xe=S==="x"?En:_n,Ee=I[E],Ie=E==="y"?"height":"width",Te=Ee+g[le],Me=Ee-g[xe],Ze=[$r,Vr].indexOf(w)!==-1,tt=(de=j==null?void 0:j[E])!=null?de:0,Fe=Ze?Te:Ee-N[Ie]-T[Ie]-tt+z.altAxis,Le=Ze?Ee+N[Ie]+T[Ie]-tt-z.altAxis:Me,ze=v&&Ze?sX(Fe,Ee,Le):tl(v?Fe:Te,Ee,v?Le:Me);I[E]=ze,W[E]=ze-Ee}t.modifiersData[n]=W}}const zX={name:"preventOverflow",enabled:!0,phase:"main",fn:qX,requiresIfExists:["offset"]};function LX(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function BX(e){return e===sn(e)||!Sn(e)?pS(e):LX(e)}function FX(e){var t=e.getBoundingClientRect(),r=Ta(t.width)/e.offsetWidth||1,n=Ta(t.height)/e.offsetHeight||1;return r!==1||n!==1}function $X(e,t,r){r===void 0&&(r=!1);var n=Sn(t),i=Sn(t)&&FX(t),o=Qi(t),a=Pa(e,i,r),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((ai(t)!=="body"||gS(o))&&(s=BX(t)),Sn(t)?(c=Pa(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=vS(o))),{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function VX(e){var t=new Map,r=new Set,n=[];e.forEach(function(o){t.set(o.name,o)});function i(o){r.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!r.has(s)){var c=t.get(s);c&&i(c)}}),n.push(o)}return e.forEach(function(o){r.has(o.name)||i(o)}),n}function HX(e){var t=VX(e);return tX.reduce(function(r,n){return r.concat(t.filter(function(i){return i.phase===n}))},[])}function WX(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function UX(e){var t=e.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var XC={placement:"bottom",modifiers:[],strategy:"absolute"};function ZC(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function GX(e){e===void 0&&(e={});var t=e,r=t.defaultModifiers,n=r===void 0?[]:r,i=t.defaultOptions,o=i===void 0?XC:i;return function(s,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},XC,o),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},h=[],p=!1,v={state:u,setOptions:function(w){var x=typeof w=="function"?w(u.options):w;m(),u.options=Object.assign({},o,u.options,x),u.scrollParents={reference:To(s)?rl(s):s.contextElement?rl(s.contextElement):[],popper:rl(c)};var _=HX(UX([].concat(n,u.options.modifiers)));return u.orderedModifiers=_.filter(function(S){return S.enabled}),y(),v.update()},forceUpdate:function(){if(!p){var w=u.elements,x=w.reference,_=w.popper;if(ZC(x,_)){u.rects={reference:$X(x,Rl(_),u.options.strategy==="fixed"),popper:fS(_)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(z){return u.modifiersData[z.name]=Object.assign({},z.data)});for(var S=0;S<u.orderedModifiers.length;S++){if(u.reset===!0){u.reset=!1,S=-1;continue}var E=u.orderedModifiers[S],I=E.fn,N=E.options,T=N===void 0?{}:N,M=E.name;typeof I=="function"&&(u=I({state:u,options:T,name:M,instance:v})||u)}}}},update:WX(function(){return new Promise(function(g){v.forceUpdate(),g(u)})}),destroy:function(){m(),p=!0}};if(!ZC(s,c))return v;v.setOptions(d).then(function(g){!p&&d.onFirstUpdate&&d.onFirstUpdate(g)});function y(){u.orderedModifiers.forEach(function(g){var w=g.name,x=g.options,_=x===void 0?{}:x,S=g.effect;if(typeof S=="function"){var E=S({state:u,name:w,instance:v,options:_}),I=function(){};h.push(E||I)}})}function m(){h.forEach(function(g){return g()}),h=[]}return v}}var KX=[mX,DX,vX,iX,kX,RX,zX,dX,TX],YX=GX({defaultModifiers:KX}),jt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yh,JC;function XX(){if(JC)return Yh;JC=1;var e=typeof Element<"u",t=typeof Map=="function",r=typeof Set=="function",n=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function i(o,a){if(o===a)return!0;if(o&&a&&typeof o=="object"&&typeof a=="object"){if(o.constructor!==a.constructor)return!1;var s,c,d;if(Array.isArray(o)){if(s=o.length,s!=a.length)return!1;for(c=s;c--!==0;)if(!i(o[c],a[c]))return!1;return!0}var u;if(t&&o instanceof Map&&a instanceof Map){if(o.size!==a.size)return!1;for(u=o.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;for(u=o.entries();!(c=u.next()).done;)if(!i(c.value[1],a.get(c.value[0])))return!1;return!0}if(r&&o instanceof Set&&a instanceof Set){if(o.size!==a.size)return!1;for(u=o.entries();!(c=u.next()).done;)if(!a.has(c.value[0]))return!1;return!0}if(n&&ArrayBuffer.isView(o)&&ArrayBuffer.isView(a)){if(s=o.length,s!=a.length)return!1;for(c=s;c--!==0;)if(o[c]!==a[c])return!1;return!0}if(o.constructor===RegExp)return o.source===a.source&&o.flags===a.flags;if(o.valueOf!==Object.prototype.valueOf&&typeof o.valueOf=="function"&&typeof a.valueOf=="function")return o.valueOf()===a.valueOf();if(o.toString!==Object.prototype.toString&&typeof o.toString=="function"&&typeof a.toString=="function")return o.toString()===a.toString();if(d=Object.keys(o),s=d.length,s!==Object.keys(a).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(a,d[c]))return!1;if(e&&o instanceof Element)return!1;for(c=s;c--!==0;)if(!((d[c]==="_owner"||d[c]==="__v"||d[c]==="__o")&&o.$$typeof)&&!i(o[d[c]],a[d[c]]))return!1;return!0}return o!==o&&a!==a}return Yh=function(a,s){try{return i(a,s)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},Yh}var ZX=XX();const JX=eo(ZX);var QX=[],Cd=function(t,r,n){n===void 0&&(n={});var i=nt.useRef(null),o={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||QX},a=nt.useState({styles:{popper:{position:o.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=a[0],c=a[1],d=nt.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(v){var y=v.state,m=Object.keys(y.elements);gV.flushSync(function(){c({styles:FC(m.map(function(g){return[g,y.styles[g]||{}]})),attributes:FC(m.map(function(g){return[g,y.attributes[g]]}))})})},requires:["computeStyles"]}},[]),u=nt.useMemo(function(){var p={onFirstUpdate:o.onFirstUpdate,placement:o.placement,strategy:o.strategy,modifiers:[].concat(o.modifiers,[d,{name:"applyStyles",enabled:!1}])};return JX(i.current,p)?i.current||p:(i.current=p,p)},[o.onFirstUpdate,o.placement,o.strategy,o.modifiers,d]),h=nt.useRef();return $C(function(){h.current&&h.current.setOptions(u)},[u]),$C(function(){if(!(t==null||r==null)){var p=n.createPopper||YX,v=p(t,r,u);return h.current=v,function(){v.destroy(),h.current=null}}},[t,r,n.createPopper]),{state:h.current?h.current.state:null,styles:s.styles,attributes:s.attributes,update:h.current?h.current.update:null,forceUpdate:h.current?h.current.forceUpdate:null}};const U4=({tab:e})=>O.jsx(br,{depth:1,className:"flex flex-1 items-center justify-center border-l-[0.5px]",children:O.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-4 text-inactive-text",children:[O.jsx(on,{className:"h-10 w-10"}),O.jsxs("div",{className:"font-semibold",children:["No ",e," Selected"]}),O.jsxs("div",{className:"text-sm",children:["Click on a ",e," in the Sidebar to select it."]})]})});function mS(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xh,QC;function eZ(){if(QC)return Xh;QC=1;function e(){this.__data__=[],this.size=0}return Xh=e,Xh}var Zh,e2;function Va(){if(e2)return Zh;e2=1;function e(t,r){return t===r||t!==t&&r!==r}return Zh=e,Zh}var Jh,t2;function Id(){if(t2)return Jh;t2=1;var e=Va();function t(r,n){for(var i=r.length;i--;)if(e(r[i][0],n))return i;return-1}return Jh=t,Jh}var Qh,r2;function tZ(){if(r2)return Qh;r2=1;var e=Id(),t=Array.prototype,r=t.splice;function n(i){var o=this.__data__,a=e(o,i);if(a<0)return!1;var s=o.length-1;return a==s?o.pop():r.call(o,a,1),--this.size,!0}return Qh=n,Qh}var ep,n2;function rZ(){if(n2)return ep;n2=1;var e=Id();function t(r){var n=this.__data__,i=e(n,r);return i<0?void 0:n[i][1]}return ep=t,ep}var tp,i2;function nZ(){if(i2)return tp;i2=1;var e=Id();function t(r){return e(this.__data__,r)>-1}return tp=t,tp}var rp,o2;function iZ(){if(o2)return rp;o2=1;var e=Id();function t(r,n){var i=this.__data__,o=e(i,r);return o<0?(++this.size,i.push([r,n])):i[o][1]=n,this}return rp=t,rp}var np,a2;function Rd(){if(a2)return np;a2=1;var e=eZ(),t=tZ(),r=rZ(),n=nZ(),i=iZ();function o(a){var s=-1,c=a==null?0:a.length;for(this.clear();++s<c;){var d=a[s];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,np=o,np}var ip,s2;function oZ(){if(s2)return ip;s2=1;var e=Rd();function t(){this.__data__=new e,this.size=0}return ip=t,ip}var op,l2;function aZ(){if(l2)return op;l2=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return op=e,op}var ap,c2;function sZ(){if(c2)return ap;c2=1;function e(t){return this.__data__.get(t)}return ap=e,ap}var sp,u2;function lZ(){if(u2)return sp;u2=1;function e(t){return this.__data__.has(t)}return sp=e,sp}var lp,d2;function G4(){if(d2)return lp;d2=1;var e=typeof jt=="object"&&jt&&jt.Object===Object&&jt;return lp=e,lp}var cp,f2;function Vn(){if(f2)return cp;f2=1;var e=G4(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return cp=r,cp}var up,h2;function Ha(){if(h2)return up;h2=1;var e=Vn(),t=e.Symbol;return up=t,up}var dp,p2;function cZ(){if(p2)return dp;p2=1;var e=Ha(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function o(a){var s=r.call(a,i),c=a[i];try{a[i]=void 0;var d=!0}catch{}var u=n.call(a);return d&&(s?a[i]=c:delete a[i]),u}return dp=o,dp}var fp,v2;function uZ(){if(v2)return fp;v2=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return fp=r,fp}var hp,g2;function ko(){if(g2)return hp;g2=1;var e=Ha(),t=cZ(),r=uZ(),n="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function a(s){return s==null?s===void 0?i:n:o&&o in Object(s)?t(s):r(s)}return hp=a,hp}var pp,m2;function On(){if(m2)return pp;m2=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return pp=e,pp}var vp,b2;function Nl(){if(b2)return vp;b2=1;var e=ko(),t=On(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function a(s){if(!t(s))return!1;var c=e(s);return c==n||c==i||c==r||c==o}return vp=a,vp}var gp,y2;function dZ(){if(y2)return gp;y2=1;var e=Vn(),t=e["__core-js_shared__"];return gp=t,gp}var mp,x2;function fZ(){if(x2)return mp;x2=1;var e=dZ(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return mp=r,mp}var bp,w2;function K4(){if(w2)return bp;w2=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return bp=r,bp}var yp,S2;function hZ(){if(S2)return yp;S2=1;var e=Nl(),t=fZ(),r=On(),n=K4(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,c=a.toString,d=s.hasOwnProperty,u=RegExp("^"+c.call(d).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(p){if(!r(p)||t(p))return!1;var v=e(p)?u:o;return v.test(n(p))}return yp=h,yp}var xp,E2;function pZ(){if(E2)return xp;E2=1;function e(t,r){return t==null?void 0:t[r]}return xp=e,xp}var wp,_2;function Ao(){if(_2)return wp;_2=1;var e=hZ(),t=pZ();function r(n,i){var o=t(n,i);return e(o)?o:void 0}return wp=r,wp}var Sp,O2;function bS(){if(O2)return Sp;O2=1;var e=Ao(),t=Vn(),r=e(t,"Map");return Sp=r,Sp}var Ep,C2;function Nd(){if(C2)return Ep;C2=1;var e=Ao(),t=e(Object,"create");return Ep=t,Ep}var _p,I2;function vZ(){if(I2)return _p;I2=1;var e=Nd();function t(){this.__data__=e?e(null):{},this.size=0}return _p=t,_p}var Op,R2;function gZ(){if(R2)return Op;R2=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return Op=e,Op}var Cp,N2;function mZ(){if(N2)return Cp;N2=1;var e=Nd(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(o){var a=this.__data__;if(e){var s=a[o];return s===t?void 0:s}return n.call(a,o)?a[o]:void 0}return Cp=i,Cp}var Ip,T2;function bZ(){if(T2)return Ip;T2=1;var e=Nd(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var o=this.__data__;return e?o[i]!==void 0:r.call(o,i)}return Ip=n,Ip}var Rp,P2;function yZ(){if(P2)return Rp;P2=1;var e=Nd(),t="__lodash_hash_undefined__";function r(n,i){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=e&&i===void 0?t:i,this}return Rp=r,Rp}var Np,M2;function xZ(){if(M2)return Np;M2=1;var e=vZ(),t=gZ(),r=mZ(),n=bZ(),i=yZ();function o(a){var s=-1,c=a==null?0:a.length;for(this.clear();++s<c;){var d=a[s];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,Np=o,Np}var Tp,k2;function wZ(){if(k2)return Tp;k2=1;var e=xZ(),t=Rd(),r=bS();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return Tp=n,Tp}var Pp,A2;function SZ(){if(A2)return Pp;A2=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return Pp=e,Pp}var Mp,D2;function Td(){if(D2)return Mp;D2=1;var e=SZ();function t(r,n){var i=r.__data__;return e(n)?i[typeof n=="string"?"string":"hash"]:i.map}return Mp=t,Mp}var kp,j2;function EZ(){if(j2)return kp;j2=1;var e=Td();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return kp=t,kp}var Ap,q2;function _Z(){if(q2)return Ap;q2=1;var e=Td();function t(r){return e(this,r).get(r)}return Ap=t,Ap}var Dp,z2;function OZ(){if(z2)return Dp;z2=1;var e=Td();function t(r){return e(this,r).has(r)}return Dp=t,Dp}var jp,L2;function CZ(){if(L2)return jp;L2=1;var e=Td();function t(r,n){var i=e(this,r),o=i.size;return i.set(r,n),this.size+=i.size==o?0:1,this}return jp=t,jp}var qp,B2;function yS(){if(B2)return qp;B2=1;var e=wZ(),t=EZ(),r=_Z(),n=OZ(),i=CZ();function o(a){var s=-1,c=a==null?0:a.length;for(this.clear();++s<c;){var d=a[s];this.set(d[0],d[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=r,o.prototype.has=n,o.prototype.set=i,qp=o,qp}var zp,F2;function IZ(){if(F2)return zp;F2=1;var e=Rd(),t=bS(),r=yS(),n=200;function i(o,a){var s=this.__data__;if(s instanceof e){var c=s.__data__;if(!t||c.length<n-1)return c.push([o,a]),this.size=++s.size,this;s=this.__data__=new r(c)}return s.set(o,a),this.size=s.size,this}return zp=i,zp}var Lp,$2;function Pd(){if($2)return Lp;$2=1;var e=Rd(),t=oZ(),r=aZ(),n=sZ(),i=lZ(),o=IZ();function a(s){var c=this.__data__=new e(s);this.size=c.size}return a.prototype.clear=t,a.prototype.delete=r,a.prototype.get=n,a.prototype.has=i,a.prototype.set=o,Lp=a,Lp}var Bp,V2;function xS(){if(V2)return Bp;V2=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n<i&&r(t[n],n,t)!==!1;);return t}return Bp=e,Bp}var Fp,H2;function Y4(){if(H2)return Fp;H2=1;var e=Ao(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Fp=t,Fp}var $p,W2;function Md(){if(W2)return $p;W2=1;var e=Y4();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return $p=t,$p}var Vp,U2;function kd(){if(U2)return Vp;U2=1;var e=Md(),t=Va(),r=Object.prototype,n=r.hasOwnProperty;function i(o,a,s){var c=o[a];(!(n.call(o,a)&&t(c,s))||s===void 0&&!(a in o))&&e(o,a,s)}return Vp=i,Vp}var Hp,G2;function Tl(){if(G2)return Hp;G2=1;var e=kd(),t=Md();function r(n,i,o,a){var s=!o;o||(o={});for(var c=-1,d=i.length;++c<d;){var u=i[c],h=a?a(o[u],n[u],u,o,n):void 0;h===void 0&&(h=n[u]),s?t(o,u,h):e(o,u,h)}return o}return Hp=r,Hp}var Wp,K2;function RZ(){if(K2)return Wp;K2=1;function e(t,r){for(var n=-1,i=Array(t);++n<t;)i[n]=r(n);return i}return Wp=e,Wp}var Up,Y2;function si(){if(Y2)return Up;Y2=1;function e(t){return t!=null&&typeof t=="object"}return Up=e,Up}var Gp,X2;function NZ(){if(X2)return Gp;X2=1;var e=ko(),t=si(),r="[object Arguments]";function n(i){return t(i)&&e(i)==r}return Gp=n,Gp}var Kp,Z2;function Pl(){if(Z2)return Kp;Z2=1;var e=NZ(),t=si(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(a){return t(a)&&n.call(a,"callee")&&!i.call(a,"callee")};return Kp=o,Kp}var Yp,J2;function Ut(){if(J2)return Yp;J2=1;var e=Array.isArray;return Yp=e,Yp}var Hs={exports:{}},Xp,Q2;function TZ(){if(Q2)return Xp;Q2=1;function e(){return!1}return Xp=e,Xp}Hs.exports;var eI;function Wa(){return eI||(eI=1,(function(e,t){var r=Vn(),n=TZ(),i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===i,s=a?r.Buffer:void 0,c=s?s.isBuffer:void 0,d=c||n;e.exports=d})(Hs,Hs.exports)),Hs.exports}var Zp,tI;function Ad(){if(tI)return Zp;tI=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,i){var o=typeof n;return i=i??e,!!i&&(o=="number"||o!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<i}return Zp=r,Zp}var Jp,rI;function wS(){if(rI)return Jp;rI=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Jp=t,Jp}var Qp,nI;function PZ(){if(nI)return Qp;nI=1;var e=ko(),t=wS(),r=si(),n="[object Arguments]",i="[object Array]",o="[object Boolean]",a="[object Date]",s="[object Error]",c="[object Function]",d="[object Map]",u="[object Number]",h="[object Object]",p="[object RegExp]",v="[object Set]",y="[object String]",m="[object WeakMap]",g="[object ArrayBuffer]",w="[object DataView]",x="[object Float32Array]",_="[object Float64Array]",S="[object Int8Array]",E="[object Int16Array]",I="[object Int32Array]",N="[object Uint8Array]",T="[object Uint8ClampedArray]",M="[object Uint16Array]",z="[object Uint32Array]",j={};j[x]=j[_]=j[S]=j[E]=j[I]=j[N]=j[T]=j[M]=j[z]=!0,j[n]=j[i]=j[g]=j[o]=j[w]=j[a]=j[s]=j[c]=j[d]=j[u]=j[h]=j[p]=j[v]=j[y]=j[m]=!1;function W(U){return r(U)&&t(U.length)&&!!j[e(U)]}return Qp=W,Qp}var ev,iI;function Dd(){if(iI)return ev;iI=1;function e(t){return function(r){return t(r)}}return ev=e,ev}var Ws={exports:{}};Ws.exports;var oI;function SS(){return oI||(oI=1,(function(e,t){var r=G4(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===n,a=o&&r.process,s=(function(){try{var c=i&&i.require&&i.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}})();e.exports=s})(Ws,Ws.exports)),Ws.exports}var tv,aI;function Ml(){if(aI)return tv;aI=1;var e=PZ(),t=Dd(),r=SS(),n=r&&r.isTypedArray,i=n?t(n):e;return tv=i,tv}var rv,sI;function X4(){if(sI)return rv;sI=1;var e=RZ(),t=Pl(),r=Ut(),n=Wa(),i=Ad(),o=Ml(),a=Object.prototype,s=a.hasOwnProperty;function c(d,u){var h=r(d),p=!h&&t(d),v=!h&&!p&&n(d),y=!h&&!p&&!v&&o(d),m=h||p||v||y,g=m?e(d.length,String):[],w=g.length;for(var x in d)(u||s.call(d,x))&&!(m&&(x=="length"||v&&(x=="offset"||x=="parent")||y&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||i(x,w)))&&g.push(x);return g}return rv=c,rv}var nv,lI;function jd(){if(lI)return nv;lI=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return nv=t,nv}var iv,cI;function Z4(){if(cI)return iv;cI=1;function e(t,r){return function(n){return t(r(n))}}return iv=e,iv}var ov,uI;function MZ(){if(uI)return ov;uI=1;var e=Z4(),t=e(Object.keys,Object);return ov=t,ov}var av,dI;function ES(){if(dI)return av;dI=1;var e=jd(),t=MZ(),r=Object.prototype,n=r.hasOwnProperty;function i(o){if(!e(o))return t(o);var a=[];for(var s in Object(o))n.call(o,s)&&s!="constructor"&&a.push(s);return a}return av=i,av}var sv,fI;function Oi(){if(fI)return sv;fI=1;var e=Nl(),t=wS();function r(n){return n!=null&&t(n.length)&&!e(n)}return sv=r,sv}var lv,hI;function to(){if(hI)return lv;hI=1;var e=X4(),t=ES(),r=Oi();function n(i){return r(i)?e(i):t(i)}return lv=n,lv}var cv,pI;function kZ(){if(pI)return cv;pI=1;var e=Tl(),t=to();function r(n,i){return n&&e(i,t(i),n)}return cv=r,cv}var uv,vI;function AZ(){if(vI)return uv;vI=1;function e(t){var r=[];if(t!=null)for(var n in Object(t))r.push(n);return r}return uv=e,uv}var dv,gI;function DZ(){if(gI)return dv;gI=1;var e=On(),t=jd(),r=AZ(),n=Object.prototype,i=n.hasOwnProperty;function o(a){if(!e(a))return r(a);var s=t(a),c=[];for(var d in a)d=="constructor"&&(s||!i.call(a,d))||c.push(d);return c}return dv=o,dv}var fv,mI;function Do(){if(mI)return fv;mI=1;var e=X4(),t=DZ(),r=Oi();function n(i){return r(i)?e(i,!0):t(i)}return fv=n,fv}var hv,bI;function jZ(){if(bI)return hv;bI=1;var e=Tl(),t=Do();function r(n,i){return n&&e(i,t(i),n)}return hv=r,hv}var Us={exports:{}};Us.exports;var yI;function J4(){return yI||(yI=1,(function(e,t){var r=Vn(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===n,a=o?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;function c(d,u){if(u)return d.slice();var h=d.length,p=s?s(h):new d.constructor(h);return d.copy(p),p}e.exports=c})(Us,Us.exports)),Us.exports}var pv,xI;function Q4(){if(xI)return pv;xI=1;function e(t,r){var n=-1,i=t.length;for(r||(r=Array(i));++n<i;)r[n]=t[n];return r}return pv=e,pv}var vv,wI;function e6(){if(wI)return vv;wI=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,o=0,a=[];++n<i;){var s=t[n];r(s,n,t)&&(a[o++]=s)}return a}return vv=e,vv}var gv,SI;function t6(){if(SI)return gv;SI=1;function e(){return[]}return gv=e,gv}var mv,EI;function _S(){if(EI)return mv;EI=1;var e=e6(),t=t6(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(a){return a==null?[]:(a=Object(a),e(i(a),function(s){return n.call(a,s)}))}:t;return mv=o,mv}var bv,_I;function qZ(){if(_I)return bv;_I=1;var e=Tl(),t=_S();function r(n,i){return e(n,t(n),i)}return bv=r,bv}var yv,OI;function OS(){if(OI)return yv;OI=1;function e(t,r){for(var n=-1,i=r.length,o=t.length;++n<i;)t[o+n]=r[n];return t}return yv=e,yv}var xv,CI;function qd(){if(CI)return xv;CI=1;var e=Z4(),t=e(Object.getPrototypeOf,Object);return xv=t,xv}var wv,II;function r6(){if(II)return wv;II=1;var e=OS(),t=qd(),r=_S(),n=t6(),i=Object.getOwnPropertySymbols,o=i?function(a){for(var s=[];a;)e(s,r(a)),a=t(a);return s}:n;return wv=o,wv}var Sv,RI;function zZ(){if(RI)return Sv;RI=1;var e=Tl(),t=r6();function r(n,i){return e(n,t(n),i)}return Sv=r,Sv}var Ev,NI;function n6(){if(NI)return Ev;NI=1;var e=OS(),t=Ut();function r(n,i,o){var a=i(n);return t(n)?a:e(a,o(n))}return Ev=r,Ev}var _v,TI;function i6(){if(TI)return _v;TI=1;var e=n6(),t=_S(),r=to();function n(i){return e(i,r,t)}return _v=n,_v}var Ov,PI;function LZ(){if(PI)return Ov;PI=1;var e=n6(),t=r6(),r=Do();function n(i){return e(i,r,t)}return Ov=n,Ov}var Cv,MI;function BZ(){if(MI)return Cv;MI=1;var e=Ao(),t=Vn(),r=e(t,"DataView");return Cv=r,Cv}var Iv,kI;function FZ(){if(kI)return Iv;kI=1;var e=Ao(),t=Vn(),r=e(t,"Promise");return Iv=r,Iv}var Rv,AI;function o6(){if(AI)return Rv;AI=1;var e=Ao(),t=Vn(),r=e(t,"Set");return Rv=r,Rv}var Nv,DI;function $Z(){if(DI)return Nv;DI=1;var e=Ao(),t=Vn(),r=e(t,"WeakMap");return Nv=r,Nv}var Tv,jI;function Ua(){if(jI)return Tv;jI=1;var e=BZ(),t=bS(),r=FZ(),n=o6(),i=$Z(),o=ko(),a=K4(),s="[object Map]",c="[object Object]",d="[object Promise]",u="[object Set]",h="[object WeakMap]",p="[object DataView]",v=a(e),y=a(t),m=a(r),g=a(n),w=a(i),x=o;return(e&&x(new e(new ArrayBuffer(1)))!=p||t&&x(new t)!=s||r&&x(r.resolve())!=d||n&&x(new n)!=u||i&&x(new i)!=h)&&(x=function(_){var S=o(_),E=S==c?_.constructor:void 0,I=E?a(E):"";if(I)switch(I){case v:return p;case y:return s;case m:return d;case g:return u;case w:return h}return S}),Tv=x,Tv}var Pv,qI;function VZ(){if(qI)return Pv;qI=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n){var i=n.length,o=new n.constructor(i);return i&&typeof n[0]=="string"&&t.call(n,"index")&&(o.index=n.index,o.input=n.input),o}return Pv=r,Pv}var Mv,zI;function a6(){if(zI)return Mv;zI=1;var e=Vn(),t=e.Uint8Array;return Mv=t,Mv}var kv,LI;function CS(){if(LI)return kv;LI=1;var e=a6();function t(r){var n=new r.constructor(r.byteLength);return new e(n).set(new e(r)),n}return kv=t,kv}var Av,BI;function HZ(){if(BI)return Av;BI=1;var e=CS();function t(r,n){var i=n?e(r.buffer):r.buffer;return new r.constructor(i,r.byteOffset,r.byteLength)}return Av=t,Av}var Dv,FI;function WZ(){if(FI)return Dv;FI=1;var e=/\w*$/;function t(r){var n=new r.constructor(r.source,e.exec(r));return n.lastIndex=r.lastIndex,n}return Dv=t,Dv}var jv,$I;function UZ(){if($I)return jv;$I=1;var e=Ha(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function n(i){return r?Object(r.call(i)):{}}return jv=n,jv}var qv,VI;function s6(){if(VI)return qv;VI=1;var e=CS();function t(r,n){var i=n?e(r.buffer):r.buffer;return new r.constructor(i,r.byteOffset,r.length)}return qv=t,qv}var zv,HI;function GZ(){if(HI)return zv;HI=1;var e=CS(),t=HZ(),r=WZ(),n=UZ(),i=s6(),o="[object Boolean]",a="[object Date]",s="[object Map]",c="[object Number]",d="[object RegExp]",u="[object Set]",h="[object String]",p="[object Symbol]",v="[object ArrayBuffer]",y="[object DataView]",m="[object Float32Array]",g="[object Float64Array]",w="[object Int8Array]",x="[object Int16Array]",_="[object Int32Array]",S="[object Uint8Array]",E="[object Uint8ClampedArray]",I="[object Uint16Array]",N="[object Uint32Array]";function T(M,z,j){var W=M.constructor;switch(z){case v:return e(M);case o:case a:return new W(+M);case y:return t(M,j);case m:case g:case w:case x:case _:case S:case E:case I:case N:return i(M,j);case s:return new W;case c:case h:return new W(M);case d:return r(M);case u:return new W;case p:return n(M)}}return zv=T,zv}var Lv,WI;function l6(){if(WI)return Lv;WI=1;var e=On(),t=Object.create,r=(function(){function n(){}return function(i){if(!e(i))return{};if(t)return t(i);n.prototype=i;var o=new n;return n.prototype=void 0,o}})();return Lv=r,Lv}var Bv,UI;function c6(){if(UI)return Bv;UI=1;var e=l6(),t=qd(),r=jd();function n(i){return typeof i.constructor=="function"&&!r(i)?e(t(i)):{}}return Bv=n,Bv}var Fv,GI;function KZ(){if(GI)return Fv;GI=1;var e=Ua(),t=si(),r="[object Map]";function n(i){return t(i)&&e(i)==r}return Fv=n,Fv}var $v,KI;function YZ(){if(KI)return $v;KI=1;var e=KZ(),t=Dd(),r=SS(),n=r&&r.isMap,i=n?t(n):e;return $v=i,$v}var Vv,YI;function XZ(){if(YI)return Vv;YI=1;var e=Ua(),t=si(),r="[object Set]";function n(i){return t(i)&&e(i)==r}return Vv=n,Vv}var Hv,XI;function ZZ(){if(XI)return Hv;XI=1;var e=XZ(),t=Dd(),r=SS(),n=r&&r.isSet,i=n?t(n):e;return Hv=i,Hv}var Wv,ZI;function u6(){if(ZI)return Wv;ZI=1;var e=Pd(),t=xS(),r=kd(),n=kZ(),i=jZ(),o=J4(),a=Q4(),s=qZ(),c=zZ(),d=i6(),u=LZ(),h=Ua(),p=VZ(),v=GZ(),y=c6(),m=Ut(),g=Wa(),w=YZ(),x=On(),_=ZZ(),S=to(),E=Do(),I=1,N=2,T=4,M="[object Arguments]",z="[object Array]",j="[object Boolean]",W="[object Date]",U="[object Error]",A="[object Function]",K="[object GeneratorFunction]",V="[object Map]",te="[object Number]",G="[object Object]",re="[object RegExp]",P="[object Set]",B="[object String]",X="[object Symbol]",Q="[object WeakMap]",D="[object ArrayBuffer]",$="[object DataView]",H="[object Float32Array]",q="[object Float64Array]",Y="[object Int8Array]",ie="[object Int16Array]",ne="[object Int32Array]",ve="[object Uint8Array]",Z="[object Uint8ClampedArray]",J="[object Uint16Array]",ae="[object Uint32Array]",he={};he[M]=he[z]=he[D]=he[$]=he[j]=he[W]=he[H]=he[q]=he[Y]=he[ie]=he[ne]=he[V]=he[te]=he[G]=he[re]=he[P]=he[B]=he[X]=he[ve]=he[Z]=he[J]=he[ae]=!0,he[U]=he[A]=he[Q]=!1;function ue(de,le,xe,Ee,Ie,Te){var Me,Ze=le&I,tt=le&N,Fe=le&T;if(xe&&(Me=Ie?xe(de,Ee,Ie,Te):xe(de)),Me!==void 0)return Me;if(!x(de))return de;var Le=m(de);if(Le){if(Me=p(de),!Ze)return a(de,Me)}else{var ze=h(de),Je=ze==A||ze==K;if(g(de))return o(de,Ze);if(ze==G||ze==M||Je&&!Ie){if(Me=tt||Je?{}:y(de),!Ze)return tt?c(de,i(Me,de)):s(de,n(Me,de))}else{if(!he[ze])return Ie?de:{};Me=v(de,ze,Ze)}}Te||(Te=new e);var rt=Te.get(de);if(rt)return rt;Te.set(de,Me),_(de)?de.forEach(function(Rt){Me.add(ue(Rt,le,xe,Rt,de,Te))}):w(de)&&de.forEach(function(Rt,qt){Me.set(qt,ue(Rt,le,xe,qt,de,Te))});var Pt=Fe?tt?u:d:tt?E:S,gt=Le?void 0:Pt(de);return t(gt||de,function(Rt,qt){gt&&(qt=Rt,Rt=de[qt]),r(Me,qt,ue(Rt,le,xe,qt,de,Te))}),Me}return Wv=ue,Wv}var Uv,JI;function JZ(){if(JI)return Uv;JI=1;var e=u6(),t=4;function r(n){return e(n,t)}return Uv=r,Uv}var Gv,QI;function IS(){if(QI)return Gv;QI=1;function e(t){return function(){return t}}return Gv=e,Gv}var Kv,eR;function QZ(){if(eR)return Kv;eR=1;function e(t){return function(r,n,i){for(var o=-1,a=Object(r),s=i(r),c=s.length;c--;){var d=s[t?c:++o];if(n(a[d],d,a)===!1)break}return r}}return Kv=e,Kv}var Yv,tR;function RS(){if(tR)return Yv;tR=1;var e=QZ(),t=e();return Yv=t,Yv}var Xv,rR;function NS(){if(rR)return Xv;rR=1;var e=RS(),t=to();function r(n,i){return n&&e(n,i,t)}return Xv=r,Xv}var Zv,nR;function eJ(){if(nR)return Zv;nR=1;var e=Oi();function t(r,n){return function(i,o){if(i==null)return i;if(!e(i))return r(i,o);for(var a=i.length,s=n?a:-1,c=Object(i);(n?s--:++s<a)&&o(c[s],s,c)!==!1;);return i}}return Zv=t,Zv}var Jv,iR;function zd(){if(iR)return Jv;iR=1;var e=NS(),t=eJ(),r=t(e);return Jv=r,Jv}var Qv,oR;function jo(){if(oR)return Qv;oR=1;function e(t){return t}return Qv=e,Qv}var eg,aR;function d6(){if(aR)return eg;aR=1;var e=jo();function t(r){return typeof r=="function"?r:e}return eg=t,eg}var tg,sR;function f6(){if(sR)return tg;sR=1;var e=xS(),t=zd(),r=d6(),n=Ut();function i(o,a){var s=n(o)?e:t;return s(o,r(a))}return tg=i,tg}var rg,lR;function h6(){return lR||(lR=1,rg=f6()),rg}var ng,cR;function tJ(){if(cR)return ng;cR=1;var e=zd();function t(r,n){var i=[];return e(r,function(o,a,s){n(o,a,s)&&i.push(o)}),i}return ng=t,ng}var ig,uR;function rJ(){if(uR)return ig;uR=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return ig=t,ig}var og,dR;function nJ(){if(dR)return og;dR=1;function e(t){return this.__data__.has(t)}return og=e,og}var ag,fR;function p6(){if(fR)return ag;fR=1;var e=yS(),t=rJ(),r=nJ();function n(i){var o=-1,a=i==null?0:i.length;for(this.__data__=new e;++o<a;)this.add(i[o])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,ag=n,ag}var sg,hR;function iJ(){if(hR)return sg;hR=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(t[n],n,t))return!0;return!1}return sg=e,sg}var lg,pR;function v6(){if(pR)return lg;pR=1;function e(t,r){return t.has(r)}return lg=e,lg}var cg,vR;function g6(){if(vR)return cg;vR=1;var e=p6(),t=iJ(),r=v6(),n=1,i=2;function o(a,s,c,d,u,h){var p=c&n,v=a.length,y=s.length;if(v!=y&&!(p&&y>v))return!1;var m=h.get(a),g=h.get(s);if(m&&g)return m==s&&g==a;var w=-1,x=!0,_=c&i?new e:void 0;for(h.set(a,s),h.set(s,a);++w<v;){var S=a[w],E=s[w];if(d)var I=p?d(E,S,w,s,a,h):d(S,E,w,a,s,h);if(I!==void 0){if(I)continue;x=!1;break}if(_){if(!t(s,function(N,T){if(!r(_,T)&&(S===N||u(S,N,c,d,h)))return _.push(T)})){x=!1;break}}else if(!(S===E||u(S,E,c,d,h))){x=!1;break}}return h.delete(a),h.delete(s),x}return cg=o,cg}var ug,gR;function oJ(){if(gR)return ug;gR=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(i,o){n[++r]=[o,i]}),n}return ug=e,ug}var dg,mR;function TS(){if(mR)return dg;mR=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(i){n[++r]=i}),n}return dg=e,dg}var fg,bR;function aJ(){if(bR)return fg;bR=1;var e=Ha(),t=a6(),r=Va(),n=g6(),i=oJ(),o=TS(),a=1,s=2,c="[object Boolean]",d="[object Date]",u="[object Error]",h="[object Map]",p="[object Number]",v="[object RegExp]",y="[object Set]",m="[object String]",g="[object Symbol]",w="[object ArrayBuffer]",x="[object DataView]",_=e?e.prototype:void 0,S=_?_.valueOf:void 0;function E(I,N,T,M,z,j,W){switch(T){case x:if(I.byteLength!=N.byteLength||I.byteOffset!=N.byteOffset)return!1;I=I.buffer,N=N.buffer;case w:return!(I.byteLength!=N.byteLength||!j(new t(I),new t(N)));case c:case d:case p:return r(+I,+N);case u:return I.name==N.name&&I.message==N.message;case v:case m:return I==N+"";case h:var U=i;case y:var A=M&a;if(U||(U=o),I.size!=N.size&&!A)return!1;var K=W.get(I);if(K)return K==N;M|=s,W.set(I,N);var V=n(U(I),U(N),M,z,j,W);return W.delete(I),V;case g:if(S)return S.call(I)==S.call(N)}return!1}return fg=E,fg}var hg,yR;function sJ(){if(yR)return hg;yR=1;var e=i6(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(o,a,s,c,d,u){var h=s&t,p=e(o),v=p.length,y=e(a),m=y.length;if(v!=m&&!h)return!1;for(var g=v;g--;){var w=p[g];if(!(h?w in a:n.call(a,w)))return!1}var x=u.get(o),_=u.get(a);if(x&&_)return x==a&&_==o;var S=!0;u.set(o,a),u.set(a,o);for(var E=h;++g<v;){w=p[g];var I=o[w],N=a[w];if(c)var T=h?c(N,I,w,a,o,u):c(I,N,w,o,a,u);if(!(T===void 0?I===N||d(I,N,s,c,u):T)){S=!1;break}E||(E=w=="constructor")}if(S&&!E){var M=o.constructor,z=a.constructor;M!=z&&"constructor"in o&&"constructor"in a&&!(typeof M=="function"&&M instanceof M&&typeof z=="function"&&z instanceof z)&&(S=!1)}return u.delete(o),u.delete(a),S}return hg=i,hg}var pg,xR;function lJ(){if(xR)return pg;xR=1;var e=Pd(),t=g6(),r=aJ(),n=sJ(),i=Ua(),o=Ut(),a=Wa(),s=Ml(),c=1,d="[object Arguments]",u="[object Array]",h="[object Object]",p=Object.prototype,v=p.hasOwnProperty;function y(m,g,w,x,_,S){var E=o(m),I=o(g),N=E?u:i(m),T=I?u:i(g);N=N==d?h:N,T=T==d?h:T;var M=N==h,z=T==h,j=N==T;if(j&&a(m)){if(!a(g))return!1;E=!0,M=!1}if(j&&!M)return S||(S=new e),E||s(m)?t(m,g,w,x,_,S):r(m,g,N,w,x,_,S);if(!(w&c)){var W=M&&v.call(m,"__wrapped__"),U=z&&v.call(g,"__wrapped__");if(W||U){var A=W?m.value():m,K=U?g.value():g;return S||(S=new e),_(A,K,w,x,S)}}return j?(S||(S=new e),n(m,g,w,x,_,S)):!1}return pg=y,pg}var vg,wR;function m6(){if(wR)return vg;wR=1;var e=lJ(),t=si();function r(n,i,o,a,s){return n===i?!0:n==null||i==null||!t(n)&&!t(i)?n!==n&&i!==i:e(n,i,o,a,r,s)}return vg=r,vg}var gg,SR;function cJ(){if(SR)return gg;SR=1;var e=Pd(),t=m6(),r=1,n=2;function i(o,a,s,c){var d=s.length,u=d,h=!c;if(o==null)return!u;for(o=Object(o);d--;){var p=s[d];if(h&&p[2]?p[1]!==o[p[0]]:!(p[0]in o))return!1}for(;++d<u;){p=s[d];var v=p[0],y=o[v],m=p[1];if(h&&p[2]){if(y===void 0&&!(v in o))return!1}else{var g=new e;if(c)var w=c(y,m,v,o,a,g);if(!(w===void 0?t(m,y,r|n,c,g):w))return!1}}return!0}return gg=i,gg}var mg,ER;function b6(){if(ER)return mg;ER=1;var e=On();function t(r){return r===r&&!e(r)}return mg=t,mg}var bg,_R;function uJ(){if(_R)return bg;_R=1;var e=b6(),t=to();function r(n){for(var i=t(n),o=i.length;o--;){var a=i[o],s=n[a];i[o]=[a,s,e(s)]}return i}return bg=r,bg}var yg,OR;function y6(){if(OR)return yg;OR=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return yg=e,yg}var xg,CR;function dJ(){if(CR)return xg;CR=1;var e=cJ(),t=uJ(),r=y6();function n(i){var o=t(i);return o.length==1&&o[0][2]?r(o[0][0],o[0][1]):function(a){return a===i||e(a,i,o)}}return xg=n,xg}var wg,IR;function Ga(){if(IR)return wg;IR=1;var e=ko(),t=si(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return wg=n,wg}var Sg,RR;function PS(){if(RR)return Sg;RR=1;var e=Ut(),t=Ga(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(o,a){if(e(o))return!1;var s=typeof o;return s=="number"||s=="symbol"||s=="boolean"||o==null||t(o)?!0:n.test(o)||!r.test(o)||a!=null&&o in Object(a)}return Sg=i,Sg}var Eg,NR;function fJ(){if(NR)return Eg;NR=1;var e=yS(),t="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var o=function(){var a=arguments,s=i?i.apply(this,a):a[0],c=o.cache;if(c.has(s))return c.get(s);var d=n.apply(this,a);return o.cache=c.set(s,d)||c,d};return o.cache=new(r.Cache||e),o}return r.Cache=e,Eg=r,Eg}var _g,TR;function hJ(){if(TR)return _g;TR=1;var e=fJ(),t=500;function r(n){var i=e(n,function(a){return o.size===t&&o.clear(),a}),o=i.cache;return i}return _g=r,_g}var Og,PR;function pJ(){if(PR)return Og;PR=1;var e=hJ(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(t,function(a,s,c,d){o.push(c?d.replace(r,"$1"):s||a)}),o});return Og=n,Og}var Cg,MR;function Ld(){if(MR)return Cg;MR=1;function e(t,r){for(var n=-1,i=t==null?0:t.length,o=Array(i);++n<i;)o[n]=r(t[n],n,t);return o}return Cg=e,Cg}var Ig,kR;function vJ(){if(kR)return Ig;kR=1;var e=Ha(),t=Ld(),r=Ut(),n=Ga(),i=e?e.prototype:void 0,o=i?i.toString:void 0;function a(s){if(typeof s=="string")return s;if(r(s))return t(s,a)+"";if(n(s))return o?o.call(s):"";var c=s+"";return c=="0"&&1/s==-1/0?"-0":c}return Ig=a,Ig}var Rg,AR;function x6(){if(AR)return Rg;AR=1;var e=vJ();function t(r){return r==null?"":e(r)}return Rg=t,Rg}var Ng,DR;function Bd(){if(DR)return Ng;DR=1;var e=Ut(),t=PS(),r=pJ(),n=x6();function i(o,a){return e(o)?o:t(o,a)?[o]:r(n(o))}return Ng=i,Ng}var Tg,jR;function kl(){if(jR)return Tg;jR=1;var e=Ga();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Tg=t,Tg}var Pg,qR;function Fd(){if(qR)return Pg;qR=1;var e=Bd(),t=kl();function r(n,i){i=e(i,n);for(var o=0,a=i.length;n!=null&&o<a;)n=n[t(i[o++])];return o&&o==a?n:void 0}return Pg=r,Pg}var Mg,zR;function gJ(){if(zR)return Mg;zR=1;var e=Fd();function t(r,n,i){var o=r==null?void 0:e(r,n);return o===void 0?i:o}return Mg=t,Mg}var kg,LR;function mJ(){if(LR)return kg;LR=1;function e(t,r){return t!=null&&r in Object(t)}return kg=e,kg}var Ag,BR;function w6(){if(BR)return Ag;BR=1;var e=Bd(),t=Pl(),r=Ut(),n=Ad(),i=wS(),o=kl();function a(s,c,d){c=e(c,s);for(var u=-1,h=c.length,p=!1;++u<h;){var v=o(c[u]);if(!(p=s!=null&&d(s,v)))break;s=s[v]}return p||++u!=h?p:(h=s==null?0:s.length,!!h&&i(h)&&n(v,h)&&(r(s)||t(s)))}return Ag=a,Ag}var Dg,FR;function S6(){if(FR)return Dg;FR=1;var e=mJ(),t=w6();function r(n,i){return n!=null&&t(n,i,e)}return Dg=r,Dg}var jg,$R;function bJ(){if($R)return jg;$R=1;var e=m6(),t=gJ(),r=S6(),n=PS(),i=b6(),o=y6(),a=kl(),s=1,c=2;function d(u,h){return n(u)&&i(h)?o(a(u),h):function(p){var v=t(p,u);return v===void 0&&v===h?r(p,u):e(h,v,s|c)}}return jg=d,jg}var qg,VR;function E6(){if(VR)return qg;VR=1;function e(t){return function(r){return r==null?void 0:r[t]}}return qg=e,qg}var zg,HR;function yJ(){if(HR)return zg;HR=1;var e=Fd();function t(r){return function(n){return e(n,r)}}return zg=t,zg}var Lg,WR;function xJ(){if(WR)return Lg;WR=1;var e=E6(),t=yJ(),r=PS(),n=kl();function i(o){return r(o)?e(n(o)):t(o)}return Lg=i,Lg}var Bg,UR;function Ci(){if(UR)return Bg;UR=1;var e=dJ(),t=bJ(),r=jo(),n=Ut(),i=xJ();function o(a){return typeof a=="function"?a:a==null?r:typeof a=="object"?n(a)?t(a[0],a[1]):e(a):i(a)}return Bg=o,Bg}var Fg,GR;function _6(){if(GR)return Fg;GR=1;var e=e6(),t=tJ(),r=Ci(),n=Ut();function i(o,a){var s=n(o)?e:t;return s(o,r(a,3))}return Fg=i,Fg}var $g,KR;function wJ(){if(KR)return $g;KR=1;var e=Object.prototype,t=e.hasOwnProperty;function r(n,i){return n!=null&&t.call(n,i)}return $g=r,$g}var Vg,YR;function O6(){if(YR)return Vg;YR=1;var e=wJ(),t=w6();function r(n,i){return n!=null&&t(n,i,e)}return Vg=r,Vg}var Hg,XR;function SJ(){if(XR)return Hg;XR=1;var e=ES(),t=Ua(),r=Pl(),n=Ut(),i=Oi(),o=Wa(),a=jd(),s=Ml(),c="[object Map]",d="[object Set]",u=Object.prototype,h=u.hasOwnProperty;function p(v){if(v==null)return!0;if(i(v)&&(n(v)||typeof v=="string"||typeof v.splice=="function"||o(v)||s(v)||r(v)))return!v.length;var y=t(v);if(y==c||y==d)return!v.size;if(a(v))return!e(v).length;for(var m in v)if(h.call(v,m))return!1;return!0}return Hg=p,Hg}var Wg,ZR;function C6(){if(ZR)return Wg;ZR=1;function e(t){return t===void 0}return Wg=e,Wg}var Ug,JR;function I6(){if(JR)return Ug;JR=1;var e=zd(),t=Oi();function r(n,i){var o=-1,a=t(n)?Array(n.length):[];return e(n,function(s,c,d){a[++o]=i(s,c,d)}),a}return Ug=r,Ug}var Gg,QR;function R6(){if(QR)return Gg;QR=1;var e=Ld(),t=Ci(),r=I6(),n=Ut();function i(o,a){var s=n(o)?e:r;return s(o,t(a,3))}return Gg=i,Gg}var Kg,eN;function EJ(){if(eN)return Kg;eN=1;function e(t,r,n,i){var o=-1,a=t==null?0:t.length;for(i&&a&&(n=t[++o]);++o<a;)n=r(n,t[o],o,t);return n}return Kg=e,Kg}var Yg,tN;function _J(){if(tN)return Yg;tN=1;function e(t,r,n,i,o){return o(t,function(a,s,c){n=i?(i=!1,a):r(n,a,s,c)}),n}return Yg=e,Yg}var Xg,rN;function N6(){if(rN)return Xg;rN=1;var e=EJ(),t=zd(),r=Ci(),n=_J(),i=Ut();function o(a,s,c){var d=i(a)?e:n,u=arguments.length<3;return d(a,r(s,4),c,u,t)}return Xg=o,Xg}var Zg,nN;function OJ(){if(nN)return Zg;nN=1;var e=ko(),t=Ut(),r=si(),n="[object String]";function i(o){return typeof o=="string"||!t(o)&&r(o)&&e(o)==n}return Zg=i,Zg}var Jg,iN;function CJ(){if(iN)return Jg;iN=1;var e=E6(),t=e("length");return Jg=t,Jg}var Qg,oN;function IJ(){if(oN)return Qg;oN=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,o="\\ufe0e\\ufe0f",a="\\u200d",s=RegExp("["+a+e+i+o+"]");function c(d){return s.test(d)}return Qg=c,Qg}var em,aN;function RJ(){if(aN)return em;aN=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,o="\\ufe0e\\ufe0f",a="["+e+"]",s="["+i+"]",c="\\ud83c[\\udffb-\\udfff]",d="(?:"+s+"|"+c+")",u="[^"+e+"]",h="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",y=d+"?",m="["+o+"]?",g="(?:"+v+"(?:"+[u,h,p].join("|")+")"+m+y+")*",w=m+y+g,x="(?:"+[u+s+"?",s,h,p,a].join("|")+")",_=RegExp(c+"(?="+c+")|"+x+w,"g");function S(E){for(var I=_.lastIndex=0;_.test(E);)++I;return I}return em=S,em}var tm,sN;function NJ(){if(sN)return tm;sN=1;var e=CJ(),t=IJ(),r=RJ();function n(i){return t(i)?r(i):e(i)}return tm=n,tm}var rm,lN;function TJ(){if(lN)return rm;lN=1;var e=ES(),t=Ua(),r=Oi(),n=OJ(),i=NJ(),o="[object Map]",a="[object Set]";function s(c){if(c==null)return 0;if(r(c))return n(c)?i(c):c.length;var d=t(c);return d==o||d==a?c.size:e(c).length}return rm=s,rm}var nm,cN;function PJ(){if(cN)return nm;cN=1;var e=xS(),t=l6(),r=NS(),n=Ci(),i=qd(),o=Ut(),a=Wa(),s=Nl(),c=On(),d=Ml();function u(h,p,v){var y=o(h),m=y||a(h)||d(h);if(p=n(p,4),v==null){var g=h&&h.constructor;m?v=y?new g:[]:c(h)?v=s(g)?t(i(h)):{}:v={}}return(m?e:r)(h,function(w,x,_){return p(v,w,x,_)}),v}return nm=u,nm}var im,uN;function MJ(){if(uN)return im;uN=1;var e=Ha(),t=Pl(),r=Ut(),n=e?e.isConcatSpreadable:void 0;function i(o){return r(o)||t(o)||!!(n&&o&&o[n])}return im=i,im}var om,dN;function MS(){if(dN)return om;dN=1;var e=OS(),t=MJ();function r(n,i,o,a,s){var c=-1,d=n.length;for(o||(o=t),s||(s=[]);++c<d;){var u=n[c];i>0&&o(u)?i>1?r(u,i-1,o,a,s):e(s,u):a||(s[s.length]=u)}return s}return om=r,om}var am,fN;function kJ(){if(fN)return am;fN=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return am=e,am}var sm,hN;function T6(){if(hN)return sm;hN=1;var e=kJ(),t=Math.max;function r(n,i,o){return i=t(i===void 0?n.length-1:i,0),function(){for(var a=arguments,s=-1,c=t(a.length-i,0),d=Array(c);++s<c;)d[s]=a[i+s];s=-1;for(var u=Array(i+1);++s<i;)u[s]=a[s];return u[i]=o(d),e(n,this,u)}}return sm=r,sm}var lm,pN;function AJ(){if(pN)return lm;pN=1;var e=IS(),t=Y4(),r=jo(),n=t?function(i,o){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:r;return lm=n,lm}var cm,vN;function DJ(){if(vN)return cm;vN=1;var e=800,t=16,r=Date.now;function n(i){var o=0,a=0;return function(){var s=r(),c=t-(s-a);if(a=s,c>0){if(++o>=e)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return cm=n,cm}var um,gN;function P6(){if(gN)return um;gN=1;var e=AJ(),t=DJ(),r=t(e);return um=r,um}var dm,mN;function $d(){if(mN)return dm;mN=1;var e=jo(),t=T6(),r=P6();function n(i,o){return r(t(i,o,e),i+"")}return dm=n,dm}var fm,bN;function M6(){if(bN)return fm;bN=1;function e(t,r,n,i){for(var o=t.length,a=n+(i?1:-1);i?a--:++a<o;)if(r(t[a],a,t))return a;return-1}return fm=e,fm}var hm,yN;function jJ(){if(yN)return hm;yN=1;function e(t){return t!==t}return hm=e,hm}var pm,xN;function qJ(){if(xN)return pm;xN=1;function e(t,r,n){for(var i=n-1,o=t.length;++i<o;)if(t[i]===r)return i;return-1}return pm=e,pm}var vm,wN;function zJ(){if(wN)return vm;wN=1;var e=M6(),t=jJ(),r=qJ();function n(i,o,a){return o===o?r(i,o,a):e(i,t,a)}return vm=n,vm}var gm,SN;function LJ(){if(SN)return gm;SN=1;var e=zJ();function t(r,n){var i=r==null?0:r.length;return!!i&&e(r,n,0)>-1}return gm=t,gm}var mm,EN;function BJ(){if(EN)return mm;EN=1;function e(t,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;)if(n(r,t[i]))return!0;return!1}return mm=e,mm}var bm,_N;function FJ(){if(_N)return bm;_N=1;function e(){}return bm=e,bm}var ym,ON;function $J(){if(ON)return ym;ON=1;var e=o6(),t=FJ(),r=TS(),n=1/0,i=e&&1/r(new e([,-0]))[1]==n?function(o){return new e(o)}:t;return ym=i,ym}var xm,CN;function VJ(){if(CN)return xm;CN=1;var e=p6(),t=LJ(),r=BJ(),n=v6(),i=$J(),o=TS(),a=200;function s(c,d,u){var h=-1,p=t,v=c.length,y=!0,m=[],g=m;if(u)y=!1,p=r;else if(v>=a){var w=d?null:i(c);if(w)return o(w);y=!1,p=n,g=new e}else g=d?[]:m;e:for(;++h<v;){var x=c[h],_=d?d(x):x;if(x=u||x!==0?x:0,y&&_===_){for(var S=g.length;S--;)if(g[S]===_)continue e;d&&g.push(_),m.push(x)}else p(g,_,u)||(g!==m&&g.push(_),m.push(x))}return m}return xm=s,xm}var wm,IN;function k6(){if(IN)return wm;IN=1;var e=Oi(),t=si();function r(n){return t(n)&&e(n)}return wm=r,wm}var Sm,RN;function HJ(){if(RN)return Sm;RN=1;var e=MS(),t=$d(),r=VJ(),n=k6(),i=t(function(o){return r(e(o,1,n,!0))});return Sm=i,Sm}var Em,NN;function WJ(){if(NN)return Em;NN=1;var e=Ld();function t(r,n){return e(n,function(i){return r[i]})}return Em=t,Em}var _m,TN;function A6(){if(TN)return _m;TN=1;var e=WJ(),t=to();function r(n){return n==null?[]:e(n,t(n))}return _m=r,_m}var Om,PN;function Cn(){if(PN)return Om;PN=1;var e;if(typeof mS=="function")try{e={clone:JZ(),constant:IS(),each:h6(),filter:_6(),has:O6(),isArray:Ut(),isEmpty:SJ(),isFunction:Nl(),isUndefined:C6(),keys:to(),map:R6(),reduce:N6(),size:TJ(),transform:PJ(),union:HJ(),values:A6()}}catch{}return e||(e=window._),Om=e,Om}var Cm,MN;function kS(){if(MN)return Cm;MN=1;var e=Cn();Cm=i;var t="\0",r="\0",n="";function i(u){this._isDirected=e.has(u,"directed")?u.directed:!0,this._isMultigraph=e.has(u,"multigraph")?u.multigraph:!1,this._isCompound=e.has(u,"compound")?u.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(u){return this._label=u,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(u){return e.isFunction(u)||(u=e.constant(u)),this._defaultNodeLabelFn=u,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return e.keys(this._nodes)},i.prototype.sources=function(){var u=this;return e.filter(this.nodes(),function(h){return e.isEmpty(u._in[h])})},i.prototype.sinks=function(){var u=this;return e.filter(this.nodes(),function(h){return e.isEmpty(u._out[h])})},i.prototype.setNodes=function(u,h){var p=arguments,v=this;return e.each(u,function(y){p.length>1?v.setNode(y,h):v.setNode(y)}),this},i.prototype.setNode=function(u,h){return e.has(this._nodes,u)?(arguments.length>1&&(this._nodes[u]=h),this):(this._nodes[u]=arguments.length>1?h:this._defaultNodeLabelFn(u),this._isCompound&&(this._parent[u]=r,this._children[u]={},this._children[r][u]=!0),this._in[u]={},this._preds[u]={},this._out[u]={},this._sucs[u]={},++this._nodeCount,this)},i.prototype.node=function(u){return this._nodes[u]},i.prototype.hasNode=function(u){return e.has(this._nodes,u)},i.prototype.removeNode=function(u){var h=this;if(e.has(this._nodes,u)){var p=function(v){h.removeEdge(h._edgeObjs[v])};delete this._nodes[u],this._isCompound&&(this._removeFromParentsChildList(u),delete this._parent[u],e.each(this.children(u),function(v){h.setParent(v)}),delete this._children[u]),e.each(e.keys(this._in[u]),p),delete this._in[u],delete this._preds[u],e.each(e.keys(this._out[u]),p),delete this._out[u],delete this._sucs[u],--this._nodeCount}return this},i.prototype.setParent=function(u,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(h))h=r;else{h+="";for(var p=h;!e.isUndefined(p);p=this.parent(p))if(p===u)throw new Error("Setting "+h+" as parent of "+u+" would create a cycle");this.setNode(h)}return this.setNode(u),this._removeFromParentsChildList(u),this._parent[u]=h,this._children[h][u]=!0,this},i.prototype._removeFromParentsChildList=function(u){delete this._children[this._parent[u]][u]},i.prototype.parent=function(u){if(this._isCompound){var h=this._parent[u];if(h!==r)return h}},i.prototype.children=function(u){if(e.isUndefined(u)&&(u=r),this._isCompound){var h=this._children[u];if(h)return e.keys(h)}else{if(u===r)return this.nodes();if(this.hasNode(u))return[]}},i.prototype.predecessors=function(u){var h=this._preds[u];if(h)return e.keys(h)},i.prototype.successors=function(u){var h=this._sucs[u];if(h)return e.keys(h)},i.prototype.neighbors=function(u){var h=this.predecessors(u);if(h)return e.union(h,this.successors(u))},i.prototype.isLeaf=function(u){var h;return this.isDirected()?h=this.successors(u):h=this.neighbors(u),h.length===0},i.prototype.filterNodes=function(u){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var p=this;e.each(this._nodes,function(m,g){u(g)&&h.setNode(g,m)}),e.each(this._edgeObjs,function(m){h.hasNode(m.v)&&h.hasNode(m.w)&&h.setEdge(m,p.edge(m))});var v={};function y(m){var g=p.parent(m);return g===void 0||h.hasNode(g)?(v[m]=g,g):g in v?v[g]:y(g)}return this._isCompound&&e.each(h.nodes(),function(m){h.setParent(m,y(m))}),h},i.prototype.setDefaultEdgeLabel=function(u){return e.isFunction(u)||(u=e.constant(u)),this._defaultEdgeLabelFn=u,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return e.values(this._edgeObjs)},i.prototype.setPath=function(u,h){var p=this,v=arguments;return e.reduce(u,function(y,m){return v.length>1?p.setEdge(y,m,h):p.setEdge(y,m),m}),this},i.prototype.setEdge=function(){var u,h,p,v,y=!1,m=arguments[0];typeof m=="object"&&m!==null&&"v"in m?(u=m.v,h=m.w,p=m.name,arguments.length===2&&(v=arguments[1],y=!0)):(u=m,h=arguments[1],p=arguments[3],arguments.length>2&&(v=arguments[2],y=!0)),u=""+u,h=""+h,e.isUndefined(p)||(p=""+p);var g=s(this._isDirected,u,h,p);if(e.has(this._edgeLabels,g))return y&&(this._edgeLabels[g]=v),this;if(!e.isUndefined(p)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(u),this.setNode(h),this._edgeLabels[g]=y?v:this._defaultEdgeLabelFn(u,h,p);var w=c(this._isDirected,u,h,p);return u=w.v,h=w.w,Object.freeze(w),this._edgeObjs[g]=w,o(this._preds[h],u),o(this._sucs[u],h),this._in[h][g]=w,this._out[u][g]=w,this._edgeCount++,this},i.prototype.edge=function(u,h,p){var v=arguments.length===1?d(this._isDirected,arguments[0]):s(this._isDirected,u,h,p);return this._edgeLabels[v]},i.prototype.hasEdge=function(u,h,p){var v=arguments.length===1?d(this._isDirected,arguments[0]):s(this._isDirected,u,h,p);return e.has(this._edgeLabels,v)},i.prototype.removeEdge=function(u,h,p){var v=arguments.length===1?d(this._isDirected,arguments[0]):s(this._isDirected,u,h,p),y=this._edgeObjs[v];return y&&(u=y.v,h=y.w,delete this._edgeLabels[v],delete this._edgeObjs[v],a(this._preds[h],u),a(this._sucs[u],h),delete this._in[h][v],delete this._out[u][v],this._edgeCount--),this},i.prototype.inEdges=function(u,h){var p=this._in[u];if(p){var v=e.values(p);return h?e.filter(v,function(y){return y.v===h}):v}},i.prototype.outEdges=function(u,h){var p=this._out[u];if(p){var v=e.values(p);return h?e.filter(v,function(y){return y.w===h}):v}},i.prototype.nodeEdges=function(u,h){var p=this.inEdges(u,h);if(p)return p.concat(this.outEdges(u,h))};function o(u,h){u[h]?u[h]++:u[h]=1}function a(u,h){--u[h]||delete u[h]}function s(u,h,p,v){var y=""+h,m=""+p;if(!u&&y>m){var g=y;y=m,m=g}return y+n+m+n+(e.isUndefined(v)?t:v)}function c(u,h,p,v){var y=""+h,m=""+p;if(!u&&y>m){var g=y;y=m,m=g}var w={v:y,w:m};return v&&(w.name=v),w}function d(u,h){return s(u,h.v,h.w,h.name)}return Cm}var Im,kN;function UJ(){return kN||(kN=1,Im="2.1.8"),Im}var Rm,AN;function GJ(){return AN||(AN=1,Rm={Graph:kS(),version:UJ()}),Rm}var Nm,DN;function KJ(){if(DN)return Nm;DN=1;var e=Cn(),t=kS();Nm={write:r,read:o};function r(a){var s={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:n(a),edges:i(a)};return e.isUndefined(a.graph())||(s.value=e.clone(a.graph())),s}function n(a){return e.map(a.nodes(),function(s){var c=a.node(s),d=a.parent(s),u={v:s};return e.isUndefined(c)||(u.value=c),e.isUndefined(d)||(u.parent=d),u})}function i(a){return e.map(a.edges(),function(s){var c=a.edge(s),d={v:s.v,w:s.w};return e.isUndefined(s.name)||(d.name=s.name),e.isUndefined(c)||(d.value=c),d})}function o(a){var s=new t(a.options).setGraph(a.value);return e.each(a.nodes,function(c){s.setNode(c.v,c.value),c.parent&&s.setParent(c.v,c.parent)}),e.each(a.edges,function(c){s.setEdge({v:c.v,w:c.w,name:c.name},c.value)}),s}return Nm}var Tm,jN;function YJ(){if(jN)return Tm;jN=1;var e=Cn();Tm=t;function t(r){var n={},i=[],o;function a(s){e.has(n,s)||(n[s]=!0,o.push(s),e.each(r.successors(s),a),e.each(r.predecessors(s),a))}return e.each(r.nodes(),function(s){o=[],a(s),o.length&&i.push(o)}),i}return Tm}var Pm,qN;function D6(){if(qN)return Pm;qN=1;var e=Cn();Pm=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(r){return r.key})},t.prototype.has=function(r){return e.has(this._keyIndices,r)},t.prototype.priority=function(r){var n=this._keyIndices[r];if(n!==void 0)return this._arr[n].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(r,n){var i=this._keyIndices;if(r=String(r),!e.has(i,r)){var o=this._arr,a=o.length;return i[r]=a,o.push({key:r,priority:n}),this._decrease(a),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},t.prototype.decrease=function(r,n){var i=this._keyIndices[r];if(n>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[i].priority+" New: "+n);this._arr[i].priority=n,this._decrease(i)},t.prototype._heapify=function(r){var n=this._arr,i=2*r,o=i+1,a=r;i<n.length&&(a=n[i].priority<n[a].priority?i:a,o<n.length&&(a=n[o].priority<n[a].priority?o:a),a!==r&&(this._swap(r,a),this._heapify(a)))},t.prototype._decrease=function(r){for(var n=this._arr,i=n[r].priority,o;r!==0&&(o=r>>1,!(n[o].priority<i));)this._swap(r,o),r=o},t.prototype._swap=function(r,n){var i=this._arr,o=this._keyIndices,a=i[r],s=i[n];i[r]=s,i[n]=a,o[s.key]=r,o[a.key]=n},Pm}var Mm,zN;function j6(){if(zN)return Mm;zN=1;var e=Cn(),t=D6();Mm=n;var r=e.constant(1);function n(o,a,s,c){return i(o,String(a),s||r,c||function(d){return o.outEdges(d)})}function i(o,a,s,c){var d={},u=new t,h,p,v=function(y){var m=y.v!==h?y.v:y.w,g=d[m],w=s(y),x=p.distance+w;if(w<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+y+" Weight: "+w);x<g.distance&&(g.distance=x,g.predecessor=h,u.decrease(m,x))};for(o.nodes().forEach(function(y){var m=y===a?0:Number.POSITIVE_INFINITY;d[y]={distance:m},u.add(y,m)});u.size()>0&&(h=u.removeMin(),p=d[h],p.distance!==Number.POSITIVE_INFINITY);)c(h).forEach(v);return d}return Mm}var km,LN;function XJ(){if(LN)return km;LN=1;var e=j6(),t=Cn();km=r;function r(n,i,o){return t.transform(n.nodes(),function(a,s){a[s]=e(n,s,i,o)},{})}return km}var Am,BN;function q6(){if(BN)return Am;BN=1;var e=Cn();Am=t;function t(r){var n=0,i=[],o={},a=[];function s(c){var d=o[c]={onStack:!0,lowlink:n,index:n++};if(i.push(c),r.successors(c).forEach(function(p){e.has(o,p)?o[p].onStack&&(d.lowlink=Math.min(d.lowlink,o[p].index)):(s(p),d.lowlink=Math.min(d.lowlink,o[p].lowlink))}),d.lowlink===d.index){var u=[],h;do h=i.pop(),o[h].onStack=!1,u.push(h);while(c!==h);a.push(u)}}return r.nodes().forEach(function(c){e.has(o,c)||s(c)}),a}return Am}var Dm,FN;function ZJ(){if(FN)return Dm;FN=1;var e=Cn(),t=q6();Dm=r;function r(n){return e.filter(t(n),function(i){return i.length>1||i.length===1&&n.hasEdge(i[0],i[0])})}return Dm}var jm,$N;function JJ(){if($N)return jm;$N=1;var e=Cn();jm=r;var t=e.constant(1);function r(i,o,a){return n(i,o||t,a||function(s){return i.outEdges(s)})}function n(i,o,a){var s={},c=i.nodes();return c.forEach(function(d){s[d]={},s[d][d]={distance:0},c.forEach(function(u){d!==u&&(s[d][u]={distance:Number.POSITIVE_INFINITY})}),a(d).forEach(function(u){var h=u.v===d?u.w:u.v,p=o(u);s[d][h]={distance:p,predecessor:d}})}),c.forEach(function(d){var u=s[d];c.forEach(function(h){var p=s[h];c.forEach(function(v){var y=p[d],m=u[v],g=p[v],w=y.distance+m.distance;w<g.distance&&(g.distance=w,g.predecessor=m.predecessor)})})}),s}return jm}var qm,VN;function z6(){if(VN)return qm;VN=1;var e=Cn();qm=t,t.CycleException=r;function t(n){var i={},o={},a=[];function s(c){if(e.has(o,c))throw new r;e.has(i,c)||(o[c]=!0,i[c]=!0,e.each(n.predecessors(c),s),delete o[c],a.push(c))}if(e.each(n.sinks(),s),e.size(i)!==n.nodeCount())throw new r;return a}function r(){}return r.prototype=new Error,qm}var zm,HN;function QJ(){if(HN)return zm;HN=1;var e=z6();zm=t;function t(r){try{e(r)}catch(n){if(n instanceof e.CycleException)return!1;throw n}return!0}return zm}var Lm,WN;function L6(){if(WN)return Lm;WN=1;var e=Cn();Lm=t;function t(n,i,o){e.isArray(i)||(i=[i]);var a=(n.isDirected()?n.successors:n.neighbors).bind(n),s=[],c={};return e.each(i,function(d){if(!n.hasNode(d))throw new Error("Graph does not have node: "+d);r(n,d,o==="post",c,a,s)}),s}function r(n,i,o,a,s,c){e.has(a,i)||(a[i]=!0,o||c.push(i),e.each(s(i),function(d){r(n,d,o,a,s,c)}),o&&c.push(i))}return Lm}var Bm,UN;function eQ(){if(UN)return Bm;UN=1;var e=L6();Bm=t;function t(r,n){return e(r,n,"post")}return Bm}var Fm,GN;function tQ(){if(GN)return Fm;GN=1;var e=L6();Fm=t;function t(r,n){return e(r,n,"pre")}return Fm}var $m,KN;function rQ(){if(KN)return $m;KN=1;var e=Cn(),t=kS(),r=D6();$m=n;function n(i,o){var a=new t,s={},c=new r,d;function u(p){var v=p.v===d?p.w:p.v,y=c.priority(v);if(y!==void 0){var m=o(p);m<y&&(s[v]=d,c.decrease(v,m))}}if(i.nodeCount()===0)return a;e.each(i.nodes(),function(p){c.add(p,Number.POSITIVE_INFINITY),a.setNode(p)}),c.decrease(i.nodes()[0],0);for(var h=!1;c.size()>0;){if(d=c.removeMin(),e.has(s,d))a.setEdge(d,s[d]);else{if(h)throw new Error("Input graph is not connected: "+i);h=!0}i.nodeEdges(d).forEach(u)}return a}return $m}var Vm,YN;function nQ(){return YN||(YN=1,Vm={components:YJ(),dijkstra:j6(),dijkstraAll:XJ(),findCycles:ZJ(),floydWarshall:JJ(),isAcyclic:QJ(),postorder:eQ(),preorder:tQ(),prim:rQ(),tarjan:q6(),topsort:z6()}),Vm}var Hm,XN;function iQ(){if(XN)return Hm;XN=1;var e=GJ();return Hm={Graph:e.Graph,json:KJ(),alg:nQ(),version:e.version},Hm}var Wm,ZN;function $n(){if(ZN)return Wm;ZN=1;var e;if(typeof mS=="function")try{e=iQ()}catch{}return e||(e=window.graphlib),Wm=e,Wm}var Um,JN;function oQ(){if(JN)return Um;JN=1;var e=u6(),t=1,r=4;function n(i){return e(i,t|r)}return Um=n,Um}var Gm,QN;function Vd(){if(QN)return Gm;QN=1;var e=Va(),t=Oi(),r=Ad(),n=On();function i(o,a,s){if(!n(s))return!1;var c=typeof a;return(c=="number"?t(s)&&r(a,s.length):c=="string"&&a in s)?e(s[a],o):!1}return Gm=i,Gm}var Km,eT;function aQ(){if(eT)return Km;eT=1;var e=$d(),t=Va(),r=Vd(),n=Do(),i=Object.prototype,o=i.hasOwnProperty,a=e(function(s,c){s=Object(s);var d=-1,u=c.length,h=u>2?c[2]:void 0;for(h&&r(c[0],c[1],h)&&(u=1);++d<u;)for(var p=c[d],v=n(p),y=-1,m=v.length;++y<m;){var g=v[y],w=s[g];(w===void 0||t(w,i[g])&&!o.call(s,g))&&(s[g]=p[g])}return s});return Km=a,Km}var Ym,tT;function sQ(){if(tT)return Ym;tT=1;var e=Ci(),t=Oi(),r=to();function n(i){return function(o,a,s){var c=Object(o);if(!t(o)){var d=e(a,3);o=r(o),a=function(h){return d(c[h],h,c)}}var u=i(o,a,s);return u>-1?c[d?o[u]:u]:void 0}}return Ym=n,Ym}var Xm,rT;function lQ(){if(rT)return Xm;rT=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Xm=t,Xm}var Zm,nT;function cQ(){if(nT)return Zm;nT=1;var e=lQ(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Zm=r,Zm}var Jm,iT;function uQ(){if(iT)return Jm;iT=1;var e=cQ(),t=On(),r=Ga(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt;function c(d){if(typeof d=="number")return d;if(r(d))return n;if(t(d)){var u=typeof d.valueOf=="function"?d.valueOf():d;d=t(u)?u+"":u}if(typeof d!="string")return d===0?d:+d;d=e(d);var h=o.test(d);return h||a.test(d)?s(d.slice(2),h?2:8):i.test(d)?n:+d}return Jm=c,Jm}var Qm,oT;function B6(){if(oT)return Qm;oT=1;var e=uQ(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var o=i<0?-1:1;return o*r}return i===i?i:0}return Qm=n,Qm}var eb,aT;function dQ(){if(aT)return eb;aT=1;var e=B6();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return eb=t,eb}var tb,sT;function fQ(){if(sT)return tb;sT=1;var e=M6(),t=Ci(),r=dQ(),n=Math.max;function i(o,a,s){var c=o==null?0:o.length;if(!c)return-1;var d=s==null?0:r(s);return d<0&&(d=n(c+d,0)),e(o,t(a,3),d)}return tb=i,tb}var rb,lT;function hQ(){if(lT)return rb;lT=1;var e=sQ(),t=fQ(),r=e(t);return rb=r,rb}var nb,cT;function F6(){if(cT)return nb;cT=1;var e=MS();function t(r){var n=r==null?0:r.length;return n?e(r,1):[]}return nb=t,nb}var ib,uT;function pQ(){if(uT)return ib;uT=1;var e=RS(),t=d6(),r=Do();function n(i,o){return i==null?i:e(i,t(o),r)}return ib=n,ib}var ob,dT;function vQ(){if(dT)return ob;dT=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return ob=e,ob}var ab,fT;function gQ(){if(fT)return ab;fT=1;var e=Md(),t=NS(),r=Ci();function n(i,o){var a={};return o=r(o,3),t(i,function(s,c,d){e(a,c,o(s,c,d))}),a}return ab=n,ab}var sb,hT;function AS(){if(hT)return sb;hT=1;var e=Ga();function t(r,n,i){for(var o=-1,a=r.length;++o<a;){var s=r[o],c=n(s);if(c!=null&&(d===void 0?c===c&&!e(c):i(c,d)))var d=c,u=s}return u}return sb=t,sb}var lb,pT;function mQ(){if(pT)return lb;pT=1;function e(t,r){return t>r}return lb=e,lb}var cb,vT;function bQ(){if(vT)return cb;vT=1;var e=AS(),t=mQ(),r=jo();function n(i){return i&&i.length?e(i,r,t):void 0}return cb=n,cb}var ub,gT;function $6(){if(gT)return ub;gT=1;var e=Md(),t=Va();function r(n,i,o){(o!==void 0&&!t(n[i],o)||o===void 0&&!(i in n))&&e(n,i,o)}return ub=r,ub}var db,mT;function yQ(){if(mT)return db;mT=1;var e=ko(),t=qd(),r=si(),n="[object Object]",i=Function.prototype,o=Object.prototype,a=i.toString,s=o.hasOwnProperty,c=a.call(Object);function d(u){if(!r(u)||e(u)!=n)return!1;var h=t(u);if(h===null)return!0;var p=s.call(h,"constructor")&&h.constructor;return typeof p=="function"&&p instanceof p&&a.call(p)==c}return db=d,db}var fb,bT;function V6(){if(bT)return fb;bT=1;function e(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}return fb=e,fb}var hb,yT;function xQ(){if(yT)return hb;yT=1;var e=Tl(),t=Do();function r(n){return e(n,t(n))}return hb=r,hb}var pb,xT;function wQ(){if(xT)return pb;xT=1;var e=$6(),t=J4(),r=s6(),n=Q4(),i=c6(),o=Pl(),a=Ut(),s=k6(),c=Wa(),d=Nl(),u=On(),h=yQ(),p=Ml(),v=V6(),y=xQ();function m(g,w,x,_,S,E,I){var N=v(g,x),T=v(w,x),M=I.get(T);if(M){e(g,x,M);return}var z=E?E(N,T,x+"",g,w,I):void 0,j=z===void 0;if(j){var W=a(T),U=!W&&c(T),A=!W&&!U&&p(T);z=T,W||U||A?a(N)?z=N:s(N)?z=n(N):U?(j=!1,z=t(T,!0)):A?(j=!1,z=r(T,!0)):z=[]:h(T)||o(T)?(z=N,o(N)?z=y(N):(!u(N)||d(N))&&(z=i(T))):j=!1}j&&(I.set(T,z),S(z,T,_,E,I),I.delete(T)),e(g,x,z)}return pb=m,pb}var vb,wT;function SQ(){if(wT)return vb;wT=1;var e=Pd(),t=$6(),r=RS(),n=wQ(),i=On(),o=Do(),a=V6();function s(c,d,u,h,p){c!==d&&r(d,function(v,y){if(p||(p=new e),i(v))n(c,d,y,u,s,h,p);else{var m=h?h(a(c,y),v,y+"",c,d,p):void 0;m===void 0&&(m=v),t(c,y,m)}},o)}return vb=s,vb}var gb,ST;function EQ(){if(ST)return gb;ST=1;var e=$d(),t=Vd();function r(n){return e(function(i,o){var a=-1,s=o.length,c=s>1?o[s-1]:void 0,d=s>2?o[2]:void 0;for(c=n.length>3&&typeof c=="function"?(s--,c):void 0,d&&t(o[0],o[1],d)&&(c=s<3?void 0:c,s=1),i=Object(i);++a<s;){var u=o[a];u&&n(i,u,a,c)}return i})}return gb=r,gb}var mb,ET;function _Q(){if(ET)return mb;ET=1;var e=SQ(),t=EQ(),r=t(function(n,i,o){e(n,i,o)});return mb=r,mb}var bb,_T;function H6(){if(_T)return bb;_T=1;function e(t,r){return t<r}return bb=e,bb}var yb,OT;function OQ(){if(OT)return yb;OT=1;var e=AS(),t=H6(),r=jo();function n(i){return i&&i.length?e(i,r,t):void 0}return yb=n,yb}var xb,CT;function CQ(){if(CT)return xb;CT=1;var e=AS(),t=Ci(),r=H6();function n(i,o){return i&&i.length?e(i,t(o,2),r):void 0}return xb=n,xb}var wb,IT;function IQ(){if(IT)return wb;IT=1;var e=Vn(),t=function(){return e.Date.now()};return wb=t,wb}var Sb,RT;function RQ(){if(RT)return Sb;RT=1;var e=kd(),t=Bd(),r=Ad(),n=On(),i=kl();function o(a,s,c,d){if(!n(a))return a;s=t(s,a);for(var u=-1,h=s.length,p=h-1,v=a;v!=null&&++u<h;){var y=i(s[u]),m=c;if(y==="__proto__"||y==="constructor"||y==="prototype")return a;if(u!=p){var g=v[y];m=d?d(g,y,v):void 0,m===void 0&&(m=n(g)?g:r(s[u+1])?[]:{})}e(v,y,m),v=v[y]}return a}return Sb=o,Sb}var Eb,NT;function NQ(){if(NT)return Eb;NT=1;var e=Fd(),t=RQ(),r=Bd();function n(i,o,a){for(var s=-1,c=o.length,d={};++s<c;){var u=o[s],h=e(i,u);a(h,u)&&t(d,r(u,i),h)}return d}return Eb=n,Eb}var _b,TT;function TQ(){if(TT)return _b;TT=1;var e=NQ(),t=S6();function r(n,i){return e(n,i,function(o,a){return t(n,a)})}return _b=r,_b}var Ob,PT;function PQ(){if(PT)return Ob;PT=1;var e=F6(),t=T6(),r=P6();function n(i){return r(t(i,void 0,e),i+"")}return Ob=n,Ob}var Cb,MT;function MQ(){if(MT)return Cb;MT=1;var e=TQ(),t=PQ(),r=t(function(n,i){return n==null?{}:e(n,i)});return Cb=r,Cb}var Ib,kT;function kQ(){if(kT)return Ib;kT=1;var e=Math.ceil,t=Math.max;function r(n,i,o,a){for(var s=-1,c=t(e((i-n)/(o||1)),0),d=Array(c);c--;)d[a?c:++s]=n,n+=o;return d}return Ib=r,Ib}var Rb,AT;function AQ(){if(AT)return Rb;AT=1;var e=kQ(),t=Vd(),r=B6();function n(i){return function(o,a,s){return s&&typeof s!="number"&&t(o,a,s)&&(a=s=void 0),o=r(o),a===void 0?(a=o,o=0):a=r(a),s=s===void 0?o<a?1:-1:r(s),e(o,a,s,i)}}return Rb=n,Rb}var Nb,DT;function DQ(){if(DT)return Nb;DT=1;var e=AQ(),t=e();return Nb=t,Nb}var Tb,jT;function jQ(){if(jT)return Tb;jT=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return Tb=e,Tb}var Pb,qT;function qQ(){if(qT)return Pb;qT=1;var e=Ga();function t(r,n){if(r!==n){var i=r!==void 0,o=r===null,a=r===r,s=e(r),c=n!==void 0,d=n===null,u=n===n,h=e(n);if(!d&&!h&&!s&&r>n||s&&c&&u&&!d&&!h||o&&c&&u||!i&&u||!a)return 1;if(!o&&!s&&!h&&r<n||h&&i&&a&&!o&&!s||d&&i&&a||!c&&a||!u)return-1}return 0}return Pb=t,Pb}var Mb,zT;function zQ(){if(zT)return Mb;zT=1;var e=qQ();function t(r,n,i){for(var o=-1,a=r.criteria,s=n.criteria,c=a.length,d=i.length;++o<c;){var u=e(a[o],s[o]);if(u){if(o>=d)return u;var h=i[o];return u*(h=="desc"?-1:1)}}return r.index-n.index}return Mb=t,Mb}var kb,LT;function LQ(){if(LT)return kb;LT=1;var e=Ld(),t=Fd(),r=Ci(),n=I6(),i=jQ(),o=Dd(),a=zQ(),s=jo(),c=Ut();function d(u,h,p){h.length?h=e(h,function(m){return c(m)?function(g){return t(g,m.length===1?m[0]:m)}:m}):h=[s];var v=-1;h=e(h,o(r));var y=n(u,function(m,g,w){var x=e(h,function(_){return _(m)});return{criteria:x,index:++v,value:m}});return i(y,function(m,g){return a(m,g,p)})}return kb=d,kb}var Ab,BT;function BQ(){if(BT)return Ab;BT=1;var e=MS(),t=LQ(),r=$d(),n=Vd(),i=r(function(o,a){if(o==null)return[];var s=a.length;return s>1&&n(o,a[0],a[1])?a=[]:s>2&&n(a[0],a[1],a[2])&&(a=[a[0]]),t(o,e(a,1),[])});return Ab=i,Ab}var Db,FT;function FQ(){if(FT)return Db;FT=1;var e=x6(),t=0;function r(n){var i=++t;return e(n)+i}return Db=r,Db}var jb,$T;function $Q(){if($T)return jb;$T=1;function e(t,r,n){for(var i=-1,o=t.length,a=r.length,s={};++i<o;){var c=i<a?r[i]:void 0;n(s,t[i],c)}return s}return jb=e,jb}var qb,VT;function VQ(){if(VT)return qb;VT=1;var e=kd(),t=$Q();function r(n,i){return t(n||[],i||[],e)}return qb=r,qb}var zb,HT;function It(){if(HT)return zb;HT=1;var e;if(typeof mS=="function")try{e={cloneDeep:oQ(),constant:IS(),defaults:aQ(),each:h6(),filter:_6(),find:hQ(),flatten:F6(),forEach:f6(),forIn:pQ(),has:O6(),isUndefined:C6(),last:vQ(),map:R6(),mapValues:gQ(),max:bQ(),merge:_Q(),min:OQ(),minBy:CQ(),now:IQ(),pick:MQ(),range:DQ(),reduce:N6(),sortBy:BQ(),uniqueId:FQ(),values:A6(),zipObject:VQ()}}catch{}return e||(e=window._),zb=e,zb}var Lb,WT;function HQ(){if(WT)return Lb;WT=1,Lb=e;function e(){var n={};n._next=n._prev=n,this._sentinel=n}e.prototype.dequeue=function(){var n=this._sentinel,i=n._prev;if(i!==n)return t(i),i},e.prototype.enqueue=function(n){var i=this._sentinel;n._prev&&n._next&&t(n),n._next=i._next,i._next._prev=n,i._next=n,n._prev=i},e.prototype.toString=function(){for(var n=[],i=this._sentinel,o=i._prev;o!==i;)n.push(JSON.stringify(o,r)),o=o._prev;return"["+n.join(", ")+"]"};function t(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function r(n,i){if(n!=="_next"&&n!=="_prev")return i}return Lb}var Bb,UT;function WQ(){if(UT)return Bb;UT=1;var e=It(),t=$n().Graph,r=HQ();Bb=i;var n=e.constant(1);function i(d,u){if(d.nodeCount()<=1)return[];var h=s(d,u||n),p=o(h.graph,h.buckets,h.zeroIdx);return e.flatten(e.map(p,function(v){return d.outEdges(v.v,v.w)}),!0)}function o(d,u,h){for(var p=[],v=u[u.length-1],y=u[0],m;d.nodeCount();){for(;m=y.dequeue();)a(d,u,h,m);for(;m=v.dequeue();)a(d,u,h,m);if(d.nodeCount()){for(var g=u.length-2;g>0;--g)if(m=u[g].dequeue(),m){p=p.concat(a(d,u,h,m,!0));break}}}return p}function a(d,u,h,p,v){var y=v?[]:void 0;return e.forEach(d.inEdges(p.v),function(m){var g=d.edge(m),w=d.node(m.v);v&&y.push({v:m.v,w:m.w}),w.out-=g,c(u,h,w)}),e.forEach(d.outEdges(p.v),function(m){var g=d.edge(m),w=m.w,x=d.node(w);x.in-=g,c(u,h,x)}),d.removeNode(p.v),y}function s(d,u){var h=new t,p=0,v=0;e.forEach(d.nodes(),function(g){h.setNode(g,{v:g,in:0,out:0})}),e.forEach(d.edges(),function(g){var w=h.edge(g.v,g.w)||0,x=u(g),_=w+x;h.setEdge(g.v,g.w,_),v=Math.max(v,h.node(g.v).out+=x),p=Math.max(p,h.node(g.w).in+=x)});var y=e.range(v+p+3).map(function(){return new r}),m=p+1;return e.forEach(h.nodes(),function(g){c(y,m,h.node(g))}),{graph:h,buckets:y,zeroIdx:m}}function c(d,u,h){h.out?h.in?d[h.out-h.in+u].enqueue(h):d[d.length-1].enqueue(h):d[0].enqueue(h)}return Bb}var Fb,GT;function UQ(){if(GT)return Fb;GT=1;var e=It(),t=WQ();Fb={run:r,undo:i};function r(o){var a=o.graph().acyclicer==="greedy"?t(o,s(o)):n(o);e.forEach(a,function(c){var d=o.edge(c);o.removeEdge(c),d.forwardName=c.name,d.reversed=!0,o.setEdge(c.w,c.v,d,e.uniqueId("rev"))});function s(c){return function(d){return c.edge(d).weight}}}function n(o){var a=[],s={},c={};function d(u){e.has(c,u)||(c[u]=!0,s[u]=!0,e.forEach(o.outEdges(u),function(h){e.has(s,h.w)?a.push(h):d(h.w)}),delete s[u])}return e.forEach(o.nodes(),d),a}function i(o){e.forEach(o.edges(),function(a){var s=o.edge(a);if(s.reversed){o.removeEdge(a);var c=s.forwardName;delete s.reversed,delete s.forwardName,o.setEdge(a.w,a.v,s,c)}})}return Fb}var $b,KT;function Hr(){if(KT)return $b;KT=1;var e=It(),t=$n().Graph;$b={addDummyNode:r,simplify:n,asNonCompoundGraph:i,successorWeights:o,predecessorWeights:a,intersectRect:s,buildLayerMatrix:c,normalizeRanks:d,removeEmptyRanks:u,addBorderNode:h,maxRank:p,partition:v,time:y,notime:m};function r(g,w,x,_){var S;do S=e.uniqueId(_);while(g.hasNode(S));return x.dummy=w,g.setNode(S,x),S}function n(g){var w=new t().setGraph(g.graph());return e.forEach(g.nodes(),function(x){w.setNode(x,g.node(x))}),e.forEach(g.edges(),function(x){var _=w.edge(x.v,x.w)||{weight:0,minlen:1},S=g.edge(x);w.setEdge(x.v,x.w,{weight:_.weight+S.weight,minlen:Math.max(_.minlen,S.minlen)})}),w}function i(g){var w=new t({multigraph:g.isMultigraph()}).setGraph(g.graph());return e.forEach(g.nodes(),function(x){g.children(x).length||w.setNode(x,g.node(x))}),e.forEach(g.edges(),function(x){w.setEdge(x,g.edge(x))}),w}function o(g){var w=e.map(g.nodes(),function(x){var _={};return e.forEach(g.outEdges(x),function(S){_[S.w]=(_[S.w]||0)+g.edge(S).weight}),_});return e.zipObject(g.nodes(),w)}function a(g){var w=e.map(g.nodes(),function(x){var _={};return e.forEach(g.inEdges(x),function(S){_[S.v]=(_[S.v]||0)+g.edge(S).weight}),_});return e.zipObject(g.nodes(),w)}function s(g,w){var x=g.x,_=g.y,S=w.x-x,E=w.y-_,I=g.width/2,N=g.height/2;if(!S&&!E)throw new Error("Not possible to find intersection inside of the rectangle");var T,M;return Math.abs(E)*I>Math.abs(S)*N?(E<0&&(N=-N),T=N*S/E,M=N):(S<0&&(I=-I),T=I,M=I*E/S),{x:x+T,y:_+M}}function c(g){var w=e.map(e.range(p(g)+1),function(){return[]});return e.forEach(g.nodes(),function(x){var _=g.node(x),S=_.rank;e.isUndefined(S)||(w[S][_.order]=x)}),w}function d(g){var w=e.min(e.map(g.nodes(),function(x){return g.node(x).rank}));e.forEach(g.nodes(),function(x){var _=g.node(x);e.has(_,"rank")&&(_.rank-=w)})}function u(g){var w=e.min(e.map(g.nodes(),function(E){return g.node(E).rank})),x=[];e.forEach(g.nodes(),function(E){var I=g.node(E).rank-w;x[I]||(x[I]=[]),x[I].push(E)});var _=0,S=g.graph().nodeRankFactor;e.forEach(x,function(E,I){e.isUndefined(E)&&I%S!==0?--_:_&&e.forEach(E,function(N){g.node(N).rank+=_})})}function h(g,w,x,_){var S={width:0,height:0};return arguments.length>=4&&(S.rank=x,S.order=_),r(g,"border",S,w)}function p(g){return e.max(e.map(g.nodes(),function(w){var x=g.node(w).rank;if(!e.isUndefined(x))return x}))}function v(g,w){var x={lhs:[],rhs:[]};return e.forEach(g,function(_){w(_)?x.lhs.push(_):x.rhs.push(_)}),x}function y(g,w){var x=e.now();try{return w()}finally{console.log(g+" time: "+(e.now()-x)+"ms")}}function m(g,w){return w()}return $b}var Vb,YT;function GQ(){if(YT)return Vb;YT=1;var e=It(),t=Hr();Vb={run:r,undo:i};function r(o){o.graph().dummyChains=[],e.forEach(o.edges(),function(a){n(o,a)})}function n(o,a){var s=a.v,c=o.node(s).rank,d=a.w,u=o.node(d).rank,h=a.name,p=o.edge(a),v=p.labelRank;if(u!==c+1){o.removeEdge(a);var y,m,g;for(g=0,++c;c<u;++g,++c)p.points=[],m={width:0,height:0,edgeLabel:p,edgeObj:a,rank:c},y=t.addDummyNode(o,"edge",m,"_d"),c===v&&(m.width=p.width,m.height=p.height,m.dummy="edge-label",m.labelpos=p.labelpos),o.setEdge(s,y,{weight:p.weight},h),g===0&&o.graph().dummyChains.push(y),s=y;o.setEdge(s,d,{weight:p.weight},h)}}function i(o){e.forEach(o.graph().dummyChains,function(a){var s=o.node(a),c=s.edgeLabel,d;for(o.setEdge(s.edgeObj,c);s.dummy;)d=o.successors(a)[0],o.removeNode(a),c.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(c.x=s.x,c.y=s.y,c.width=s.width,c.height=s.height),a=d,s=o.node(a)})}return Vb}var Hb,XT;function Xu(){if(XT)return Hb;XT=1;var e=It();Hb={longestPath:t,slack:r};function t(n){var i={};function o(a){var s=n.node(a);if(e.has(i,a))return s.rank;i[a]=!0;var c=e.min(e.map(n.outEdges(a),function(d){return o(d.w)-n.edge(d).minlen}));return(c===Number.POSITIVE_INFINITY||c===void 0||c===null)&&(c=0),s.rank=c}e.forEach(n.sources(),o)}function r(n,i){return n.node(i.w).rank-n.node(i.v).rank-n.edge(i).minlen}return Hb}var Wb,ZT;function W6(){if(ZT)return Wb;ZT=1;var e=It(),t=$n().Graph,r=Xu().slack;Wb=n;function n(s){var c=new t({directed:!1}),d=s.nodes()[0],u=s.nodeCount();c.setNode(d,{});for(var h,p;i(c,s)<u;)h=o(c,s),p=c.hasNode(h.v)?r(s,h):-r(s,h),a(c,s,p);return c}function i(s,c){function d(u){e.forEach(c.nodeEdges(u),function(h){var p=h.v,v=u===p?h.w:p;!s.hasNode(v)&&!r(c,h)&&(s.setNode(v,{}),s.setEdge(u,v,{}),d(v))})}return e.forEach(s.nodes(),d),s.nodeCount()}function o(s,c){return e.minBy(c.edges(),function(d){if(s.hasNode(d.v)!==s.hasNode(d.w))return r(c,d)})}function a(s,c,d){e.forEach(s.nodes(),function(u){c.node(u).rank+=d})}return Wb}var Ub,JT;function KQ(){if(JT)return Ub;JT=1;var e=It(),t=W6(),r=Xu().slack,n=Xu().longestPath,i=$n().alg.preorder,o=$n().alg.postorder,a=Hr().simplify;Ub=s,s.initLowLimValues=h,s.initCutValues=c,s.calcCutValue=u,s.leaveEdge=v,s.enterEdge=y,s.exchangeEdges=m;function s(_){_=a(_),n(_);var S=t(_);h(S),c(S,_);for(var E,I;E=v(S);)I=y(S,_,E),m(S,_,E,I)}function c(_,S){var E=o(_,_.nodes());E=E.slice(0,E.length-1),e.forEach(E,function(I){d(_,S,I)})}function d(_,S,E){var I=_.node(E),N=I.parent;_.edge(E,N).cutvalue=u(_,S,E)}function u(_,S,E){var I=_.node(E),N=I.parent,T=!0,M=S.edge(E,N),z=0;return M||(T=!1,M=S.edge(N,E)),z=M.weight,e.forEach(S.nodeEdges(E),function(j){var W=j.v===E,U=W?j.w:j.v;if(U!==N){var A=W===T,K=S.edge(j).weight;if(z+=A?K:-K,w(_,E,U)){var V=_.edge(E,U).cutvalue;z+=A?-V:V}}}),z}function h(_,S){arguments.length<2&&(S=_.nodes()[0]),p(_,{},1,S)}function p(_,S,E,I,N){var T=E,M=_.node(I);return S[I]=!0,e.forEach(_.neighbors(I),function(z){e.has(S,z)||(E=p(_,S,E,z,I))}),M.low=T,M.lim=E++,N?M.parent=N:delete M.parent,E}function v(_){return e.find(_.edges(),function(S){return _.edge(S).cutvalue<0})}function y(_,S,E){var I=E.v,N=E.w;S.hasEdge(I,N)||(I=E.w,N=E.v);var T=_.node(I),M=_.node(N),z=T,j=!1;T.lim>M.lim&&(z=M,j=!0);var W=e.filter(S.edges(),function(U){return j===x(_,_.node(U.v),z)&&j!==x(_,_.node(U.w),z)});return e.minBy(W,function(U){return r(S,U)})}function m(_,S,E,I){var N=E.v,T=E.w;_.removeEdge(N,T),_.setEdge(I.v,I.w,{}),h(_),c(_,S),g(_,S)}function g(_,S){var E=e.find(_.nodes(),function(N){return!S.node(N).parent}),I=i(_,E);I=I.slice(1),e.forEach(I,function(N){var T=_.node(N).parent,M=S.edge(N,T),z=!1;M||(M=S.edge(T,N),z=!0),S.node(N).rank=S.node(T).rank+(z?M.minlen:-M.minlen)})}function w(_,S,E){return _.hasEdge(S,E)}function x(_,S,E){return E.low<=S.lim&&S.lim<=E.lim}return Ub}var Gb,QT;function YQ(){if(QT)return Gb;QT=1;var e=Xu(),t=e.longestPath,r=W6(),n=KQ();Gb=i;function i(c){switch(c.graph().ranker){case"network-simplex":s(c);break;case"tight-tree":a(c);break;case"longest-path":o(c);break;default:s(c)}}var o=t;function a(c){t(c),r(c)}function s(c){n(c)}return Gb}var Kb,eP;function XQ(){if(eP)return Kb;eP=1;var e=It();Kb=t;function t(i){var o=n(i);e.forEach(i.graph().dummyChains,function(a){for(var s=i.node(a),c=s.edgeObj,d=r(i,o,c.v,c.w),u=d.path,h=d.lca,p=0,v=u[p],y=!0;a!==c.w;){if(s=i.node(a),y){for(;(v=u[p])!==h&&i.node(v).maxRank<s.rank;)p++;v===h&&(y=!1)}if(!y){for(;p<u.length-1&&i.node(v=u[p+1]).minRank<=s.rank;)p++;v=u[p]}i.setParent(a,v),a=i.successors(a)[0]}})}function r(i,o,a,s){var c=[],d=[],u=Math.min(o[a].low,o[s].low),h=Math.max(o[a].lim,o[s].lim),p,v;p=a;do p=i.parent(p),c.push(p);while(p&&(o[p].low>u||h>o[p].lim));for(v=p,p=s;(p=i.parent(p))!==v;)d.push(p);return{path:c.concat(d.reverse()),lca:v}}function n(i){var o={},a=0;function s(c){var d=a;e.forEach(i.children(c),s),o[c]={low:d,lim:a++}}return e.forEach(i.children(),s),o}return Kb}var Yb,tP;function ZQ(){if(tP)return Yb;tP=1;var e=It(),t=Hr();Yb={run:r,cleanup:a};function r(s){var c=t.addDummyNode(s,"root",{},"_root"),d=i(s),u=e.max(e.values(d))-1,h=2*u+1;s.graph().nestingRoot=c,e.forEach(s.edges(),function(v){s.edge(v).minlen*=h});var p=o(s)+1;e.forEach(s.children(),function(v){n(s,c,h,p,u,d,v)}),s.graph().nodeRankFactor=h}function n(s,c,d,u,h,p,v){var y=s.children(v);if(!y.length){v!==c&&s.setEdge(c,v,{weight:0,minlen:d});return}var m=t.addBorderNode(s,"_bt"),g=t.addBorderNode(s,"_bb"),w=s.node(v);s.setParent(m,v),w.borderTop=m,s.setParent(g,v),w.borderBottom=g,e.forEach(y,function(x){n(s,c,d,u,h,p,x);var _=s.node(x),S=_.borderTop?_.borderTop:x,E=_.borderBottom?_.borderBottom:x,I=_.borderTop?u:2*u,N=S!==E?1:h-p[v]+1;s.setEdge(m,S,{weight:I,minlen:N,nestingEdge:!0}),s.setEdge(E,g,{weight:I,minlen:N,nestingEdge:!0})}),s.parent(v)||s.setEdge(c,m,{weight:0,minlen:h+p[v]})}function i(s){var c={};function d(u,h){var p=s.children(u);p&&p.length&&e.forEach(p,function(v){d(v,h+1)}),c[u]=h}return e.forEach(s.children(),function(u){d(u,1)}),c}function o(s){return e.reduce(s.edges(),function(c,d){return c+s.edge(d).weight},0)}function a(s){var c=s.graph();s.removeNode(c.nestingRoot),delete c.nestingRoot,e.forEach(s.edges(),function(d){var u=s.edge(d);u.nestingEdge&&s.removeEdge(d)})}return Yb}var Xb,rP;function JQ(){if(rP)return Xb;rP=1;var e=It(),t=Hr();Xb=r;function r(i){function o(a){var s=i.children(a),c=i.node(a);if(s.length&&e.forEach(s,o),e.has(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(var d=c.minRank,u=c.maxRank+1;d<u;++d)n(i,"borderLeft","_bl",a,c,d),n(i,"borderRight","_br",a,c,d)}}e.forEach(i.children(),o)}function n(i,o,a,s,c,d){var u={width:0,height:0,rank:d,borderType:o},h=c[o][d-1],p=t.addDummyNode(i,"border",u,a);c[o][d]=p,i.setParent(p,s),h&&i.setEdge(h,p,{weight:1})}return Xb}var Zb,nP;function QQ(){if(nP)return Zb;nP=1;var e=It();Zb={adjust:t,undo:r};function t(d){var u=d.graph().rankdir.toLowerCase();(u==="lr"||u==="rl")&&n(d)}function r(d){var u=d.graph().rankdir.toLowerCase();(u==="bt"||u==="rl")&&o(d),(u==="lr"||u==="rl")&&(s(d),n(d))}function n(d){e.forEach(d.nodes(),function(u){i(d.node(u))}),e.forEach(d.edges(),function(u){i(d.edge(u))})}function i(d){var u=d.width;d.width=d.height,d.height=u}function o(d){e.forEach(d.nodes(),function(u){a(d.node(u))}),e.forEach(d.edges(),function(u){var h=d.edge(u);e.forEach(h.points,a),e.has(h,"y")&&a(h)})}function a(d){d.y=-d.y}function s(d){e.forEach(d.nodes(),function(u){c(d.node(u))}),e.forEach(d.edges(),function(u){var h=d.edge(u);e.forEach(h.points,c),e.has(h,"x")&&c(h)})}function c(d){var u=d.x;d.x=d.y,d.y=u}return Zb}var Jb,iP;function eee(){if(iP)return Jb;iP=1;var e=It();Jb=t;function t(r){var n={},i=e.filter(r.nodes(),function(d){return!r.children(d).length}),o=e.max(e.map(i,function(d){return r.node(d).rank})),a=e.map(e.range(o+1),function(){return[]});function s(d){if(!e.has(n,d)){n[d]=!0;var u=r.node(d);a[u.rank].push(d),e.forEach(r.successors(d),s)}}var c=e.sortBy(i,function(d){return r.node(d).rank});return e.forEach(c,s),a}return Jb}var Qb,oP;function tee(){if(oP)return Qb;oP=1;var e=It();Qb=t;function t(n,i){for(var o=0,a=1;a<i.length;++a)o+=r(n,i[a-1],i[a]);return o}function r(n,i,o){for(var a=e.zipObject(o,e.map(o,function(p,v){return v})),s=e.flatten(e.map(i,function(p){return e.sortBy(e.map(n.outEdges(p),function(v){return{pos:a[v.w],weight:n.edge(v).weight}}),"pos")}),!0),c=1;c<o.length;)c<<=1;var d=2*c-1;c-=1;var u=e.map(new Array(d),function(){return 0}),h=0;return e.forEach(s.forEach(function(p){var v=p.pos+c;u[v]+=p.weight;for(var y=0;v>0;)v%2&&(y+=u[v+1]),v=v-1>>1,u[v]+=p.weight;h+=p.weight*y})),h}return Qb}var e0,aP;function ree(){if(aP)return e0;aP=1;var e=It();e0=t;function t(r,n){return e.map(n,function(i){var o=r.inEdges(i);if(o.length){var a=e.reduce(o,function(s,c){var d=r.edge(c),u=r.node(c.v);return{sum:s.sum+d.weight*u.order,weight:s.weight+d.weight}},{sum:0,weight:0});return{v:i,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:i}})}return e0}var t0,sP;function nee(){if(sP)return t0;sP=1;var e=It();t0=t;function t(i,o){var a={};e.forEach(i,function(c,d){var u=a[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:d};e.isUndefined(c.barycenter)||(u.barycenter=c.barycenter,u.weight=c.weight)}),e.forEach(o.edges(),function(c){var d=a[c.v],u=a[c.w];!e.isUndefined(d)&&!e.isUndefined(u)&&(u.indegree++,d.out.push(a[c.w]))});var s=e.filter(a,function(c){return!c.indegree});return r(s)}function r(i){var o=[];function a(d){return function(u){u.merged||(e.isUndefined(u.barycenter)||e.isUndefined(d.barycenter)||u.barycenter>=d.barycenter)&&n(d,u)}}function s(d){return function(u){u.in.push(d),--u.indegree===0&&i.push(u)}}for(;i.length;){var c=i.pop();o.push(c),e.forEach(c.in.reverse(),a(c)),e.forEach(c.out,s(c))}return e.map(e.filter(o,function(d){return!d.merged}),function(d){return e.pick(d,["vs","i","barycenter","weight"])})}function n(i,o){var a=0,s=0;i.weight&&(a+=i.barycenter*i.weight,s+=i.weight),o.weight&&(a+=o.barycenter*o.weight,s+=o.weight),i.vs=o.vs.concat(i.vs),i.barycenter=a/s,i.weight=s,i.i=Math.min(o.i,i.i),o.merged=!0}return t0}var r0,lP;function iee(){if(lP)return r0;lP=1;var e=It(),t=Hr();r0=r;function r(o,a){var s=t.partition(o,function(m){return e.has(m,"barycenter")}),c=s.lhs,d=e.sortBy(s.rhs,function(m){return-m.i}),u=[],h=0,p=0,v=0;c.sort(i(!!a)),v=n(u,d,v),e.forEach(c,function(m){v+=m.vs.length,u.push(m.vs),h+=m.barycenter*m.weight,p+=m.weight,v=n(u,d,v)});var y={vs:e.flatten(u,!0)};return p&&(y.barycenter=h/p,y.weight=p),y}function n(o,a,s){for(var c;a.length&&(c=e.last(a)).i<=s;)a.pop(),o.push(c.vs),s++;return s}function i(o){return function(a,s){return a.barycenter<s.barycenter?-1:a.barycenter>s.barycenter?1:o?s.i-a.i:a.i-s.i}}return r0}var n0,cP;function oee(){if(cP)return n0;cP=1;var e=It(),t=ree(),r=nee(),n=iee();n0=i;function i(s,c,d,u){var h=s.children(c),p=s.node(c),v=p?p.borderLeft:void 0,y=p?p.borderRight:void 0,m={};v&&(h=e.filter(h,function(E){return E!==v&&E!==y}));var g=t(s,h);e.forEach(g,function(E){if(s.children(E.v).length){var I=i(s,E.v,d,u);m[E.v]=I,e.has(I,"barycenter")&&a(E,I)}});var w=r(g,d);o(w,m);var x=n(w,u);if(v&&(x.vs=e.flatten([v,x.vs,y],!0),s.predecessors(v).length)){var _=s.node(s.predecessors(v)[0]),S=s.node(s.predecessors(y)[0]);e.has(x,"barycenter")||(x.barycenter=0,x.weight=0),x.barycenter=(x.barycenter*x.weight+_.order+S.order)/(x.weight+2),x.weight+=2}return x}function o(s,c){e.forEach(s,function(d){d.vs=e.flatten(d.vs.map(function(u){return c[u]?c[u].vs:u}),!0)})}function a(s,c){e.isUndefined(s.barycenter)?(s.barycenter=c.barycenter,s.weight=c.weight):(s.barycenter=(s.barycenter*s.weight+c.barycenter*c.weight)/(s.weight+c.weight),s.weight+=c.weight)}return n0}var i0,uP;function aee(){if(uP)return i0;uP=1;var e=It(),t=$n().Graph;i0=r;function r(i,o,a){var s=n(i),c=new t({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(d){return i.node(d)});return e.forEach(i.nodes(),function(d){var u=i.node(d),h=i.parent(d);(u.rank===o||u.minRank<=o&&o<=u.maxRank)&&(c.setNode(d),c.setParent(d,h||s),e.forEach(i[a](d),function(p){var v=p.v===d?p.w:p.v,y=c.edge(v,d),m=e.isUndefined(y)?0:y.weight;c.setEdge(v,d,{weight:i.edge(p).weight+m})}),e.has(u,"minRank")&&c.setNode(d,{borderLeft:u.borderLeft[o],borderRight:u.borderRight[o]}))}),c}function n(i){for(var o;i.hasNode(o=e.uniqueId("_root")););return o}return i0}var o0,dP;function see(){if(dP)return o0;dP=1;var e=It();o0=t;function t(r,n,i){var o={},a;e.forEach(i,function(s){for(var c=r.parent(s),d,u;c;){if(d=r.parent(c),d?(u=o[d],o[d]=c):(u=a,a=c),u&&u!==c){n.setEdge(u,c);return}c=d}})}return o0}var a0,fP;function lee(){if(fP)return a0;fP=1;var e=It(),t=eee(),r=tee(),n=oee(),i=aee(),o=see(),a=$n().Graph,s=Hr();a0=c;function c(p){var v=s.maxRank(p),y=d(p,e.range(1,v+1),"inEdges"),m=d(p,e.range(v-1,-1,-1),"outEdges"),g=t(p);h(p,g);for(var w=Number.POSITIVE_INFINITY,x,_=0,S=0;S<4;++_,++S){u(_%2?y:m,_%4>=2),g=s.buildLayerMatrix(p);var E=r(p,g);E<w&&(S=0,x=e.cloneDeep(g),w=E)}h(p,x)}function d(p,v,y){return e.map(v,function(m){return i(p,m,y)})}function u(p,v){var y=new a;e.forEach(p,function(m){var g=m.graph().root,w=n(m,g,y,v);e.forEach(w.vs,function(x,_){m.node(x).order=_}),o(m,y,w.vs)})}function h(p,v){e.forEach(v,function(y){e.forEach(y,function(m,g){p.node(m).order=g})})}return a0}var s0,hP;function cee(){if(hP)return s0;hP=1;var e=It(),t=$n().Graph,r=Hr();s0={positionX:y,findType1Conflicts:n,findType2Conflicts:i,addConflict:a,hasConflict:s,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:p,findSmallestWidthAlignment:h,balance:v};function n(w,x){var _={};function S(E,I){var N=0,T=0,M=E.length,z=e.last(I);return e.forEach(I,function(j,W){var U=o(w,j),A=U?w.node(U).order:M;(U||j===z)&&(e.forEach(I.slice(T,W+1),function(K){e.forEach(w.predecessors(K),function(V){var te=w.node(V),G=te.order;(G<N||A<G)&&!(te.dummy&&w.node(K).dummy)&&a(_,V,K)})}),T=W+1,N=A)}),I}return e.reduce(x,S),_}function i(w,x){var _={};function S(I,N,T,M,z){var j;e.forEach(e.range(N,T),function(W){j=I[W],w.node(j).dummy&&e.forEach(w.predecessors(j),function(U){var A=w.node(U);A.dummy&&(A.order<M||A.order>z)&&a(_,U,j)})})}function E(I,N){var T=-1,M,z=0;return e.forEach(N,function(j,W){if(w.node(j).dummy==="border"){var U=w.predecessors(j);U.length&&(M=w.node(U[0]).order,S(N,z,W,T,M),z=W,T=M)}S(N,z,N.length,M,I.length)}),N}return e.reduce(x,E),_}function o(w,x){if(w.node(x).dummy)return e.find(w.predecessors(x),function(_){return w.node(_).dummy})}function a(w,x,_){if(x>_){var S=x;x=_,_=S}var E=w[x];E||(w[x]=E={}),E[_]=!0}function s(w,x,_){if(x>_){var S=x;x=_,_=S}return e.has(w[x],_)}function c(w,x,_,S){var E={},I={},N={};return e.forEach(x,function(T){e.forEach(T,function(M,z){E[M]=M,I[M]=M,N[M]=z})}),e.forEach(x,function(T){var M=-1;e.forEach(T,function(z){var j=S(z);if(j.length){j=e.sortBy(j,function(V){return N[V]});for(var W=(j.length-1)/2,U=Math.floor(W),A=Math.ceil(W);U<=A;++U){var K=j[U];I[z]===z&&M<N[K]&&!s(_,z,K)&&(I[K]=z,I[z]=E[z]=E[K],M=N[K])}}})}),{root:E,align:I}}function d(w,x,_,S,E){var I={},N=u(w,x,_,E),T=E?"borderLeft":"borderRight";function M(W,U){for(var A=N.nodes(),K=A.pop(),V={};K;)V[K]?W(K):(V[K]=!0,A.push(K),A=A.concat(U(K))),K=A.pop()}function z(W){I[W]=N.inEdges(W).reduce(function(U,A){return Math.max(U,I[A.v]+N.edge(A))},0)}function j(W){var U=N.outEdges(W).reduce(function(K,V){return Math.min(K,I[V.w]-N.edge(V))},Number.POSITIVE_INFINITY),A=w.node(W);U!==Number.POSITIVE_INFINITY&&A.borderType!==T&&(I[W]=Math.max(I[W],U))}return M(z,N.predecessors.bind(N)),M(j,N.successors.bind(N)),e.forEach(S,function(W){I[W]=I[_[W]]}),I}function u(w,x,_,S){var E=new t,I=w.graph(),N=m(I.nodesep,I.edgesep,S);return e.forEach(x,function(T){var M;e.forEach(T,function(z){var j=_[z];if(E.setNode(j),M){var W=_[M],U=E.edge(W,j);E.setEdge(W,j,Math.max(N(w,z,M),U||0))}M=z})}),E}function h(w,x){return e.minBy(e.values(x),function(_){var S=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY;return e.forIn(_,function(I,N){var T=g(w,N)/2;S=Math.max(I+T,S),E=Math.min(I-T,E)}),S-E})}function p(w,x){var _=e.values(x),S=e.min(_),E=e.max(_);e.forEach(["u","d"],function(I){e.forEach(["l","r"],function(N){var T=I+N,M=w[T],z;if(M!==x){var j=e.values(M);z=N==="l"?S-e.min(j):E-e.max(j),z&&(w[T]=e.mapValues(M,function(W){return W+z}))}})})}function v(w,x){return e.mapValues(w.ul,function(_,S){if(x)return w[x.toLowerCase()][S];var E=e.sortBy(e.map(w,S));return(E[1]+E[2])/2})}function y(w){var x=r.buildLayerMatrix(w),_=e.merge(n(w,x),i(w,x)),S={},E;e.forEach(["u","d"],function(N){E=N==="u"?x:e.values(x).reverse(),e.forEach(["l","r"],function(T){T==="r"&&(E=e.map(E,function(W){return e.values(W).reverse()}));var M=(N==="u"?w.predecessors:w.successors).bind(w),z=c(w,E,_,M),j=d(w,E,z.root,z.align,T==="r");T==="r"&&(j=e.mapValues(j,function(W){return-W})),S[N+T]=j})});var I=h(w,S);return p(S,I),v(S,w.graph().align)}function m(w,x,_){return function(S,E,I){var N=S.node(E),T=S.node(I),M=0,z;if(M+=N.width/2,e.has(N,"labelpos"))switch(N.labelpos.toLowerCase()){case"l":z=-N.width/2;break;case"r":z=N.width/2;break}if(z&&(M+=_?z:-z),z=0,M+=(N.dummy?x:w)/2,M+=(T.dummy?x:w)/2,M+=T.width/2,e.has(T,"labelpos"))switch(T.labelpos.toLowerCase()){case"l":z=T.width/2;break;case"r":z=-T.width/2;break}return z&&(M+=_?z:-z),z=0,M}}function g(w,x){return w.node(x).width}return s0}var l0,pP;function uee(){if(pP)return l0;pP=1;var e=It(),t=Hr(),r=cee().positionX;l0=n;function n(o){o=t.asNonCompoundGraph(o),i(o),e.forEach(r(o),function(a,s){o.node(s).x=a})}function i(o){var a=t.buildLayerMatrix(o),s=o.graph().ranksep,c=0;e.forEach(a,function(d){var u=e.max(e.map(d,function(h){return o.node(h).height}));e.forEach(d,function(h){o.node(h).y=c+u/2}),c+=u+s})}return l0}var c0,vP;function dee(){if(vP)return c0;vP=1;var e=It(),t=UQ(),r=GQ(),n=YQ(),i=Hr().normalizeRanks,o=XQ(),a=Hr().removeEmptyRanks,s=ZQ(),c=JQ(),d=QQ(),u=lee(),h=uee(),p=Hr(),v=$n().Graph;c0=y;function y(D,$){var H=$&&$.debugTiming?p.time:p.notime;H("layout",function(){var q=H(" buildLayoutGraph",function(){return M(D)});H(" runLayout",function(){m(q,H)}),H(" updateInputGraph",function(){g(D,q)})})}function m(D,$){$(" makeSpaceForEdgeLabels",function(){z(D)}),$(" removeSelfEdges",function(){re(D)}),$(" acyclic",function(){t.run(D)}),$(" nestingGraph.run",function(){s.run(D)}),$(" rank",function(){n(p.asNonCompoundGraph(D))}),$(" injectEdgeLabelProxies",function(){j(D)}),$(" removeEmptyRanks",function(){a(D)}),$(" nestingGraph.cleanup",function(){s.cleanup(D)}),$(" normalizeRanks",function(){i(D)}),$(" assignRankMinMax",function(){W(D)}),$(" removeEdgeLabelProxies",function(){U(D)}),$(" normalize.run",function(){r.run(D)}),$(" parentDummyChains",function(){o(D)}),$(" addBorderSegments",function(){c(D)}),$(" order",function(){u(D)}),$(" insertSelfEdges",function(){P(D)}),$(" adjustCoordinateSystem",function(){d.adjust(D)}),$(" position",function(){h(D)}),$(" positionSelfEdges",function(){B(D)}),$(" removeBorderNodes",function(){G(D)}),$(" normalize.undo",function(){r.undo(D)}),$(" fixupEdgeLabelCoords",function(){V(D)}),$(" undoCoordinateSystem",function(){d.undo(D)}),$(" translateGraph",function(){A(D)}),$(" assignNodeIntersects",function(){K(D)}),$(" reversePoints",function(){te(D)}),$(" acyclic.undo",function(){t.undo(D)})}function g(D,$){e.forEach(D.nodes(),function(H){var q=D.node(H),Y=$.node(H);q&&(q.x=Y.x,q.y=Y.y,$.children(H).length&&(q.width=Y.width,q.height=Y.height))}),e.forEach(D.edges(),function(H){var q=D.edge(H),Y=$.edge(H);q.points=Y.points,e.has(Y,"x")&&(q.x=Y.x,q.y=Y.y)}),D.graph().width=$.graph().width,D.graph().height=$.graph().height}var w=["nodesep","edgesep","ranksep","marginx","marginy"],x={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],S=["width","height"],E={width:0,height:0},I=["minlen","weight","width","height","labeloffset"],N={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function M(D){var $=new v({multigraph:!0,compound:!0}),H=Q(D.graph());return $.setGraph(e.merge({},x,X(H,w),e.pick(H,_))),e.forEach(D.nodes(),function(q){var Y=Q(D.node(q));$.setNode(q,e.defaults(X(Y,S),E)),$.setParent(q,D.parent(q))}),e.forEach(D.edges(),function(q){var Y=Q(D.edge(q));$.setEdge(q,e.merge({},N,X(Y,I),e.pick(Y,T)))}),$}function z(D){var $=D.graph();$.ranksep/=2,e.forEach(D.edges(),function(H){var q=D.edge(H);q.minlen*=2,q.labelpos.toLowerCase()!=="c"&&($.rankdir==="TB"||$.rankdir==="BT"?q.width+=q.labeloffset:q.height+=q.labeloffset)})}function j(D){e.forEach(D.edges(),function($){var H=D.edge($);if(H.width&&H.height){var q=D.node($.v),Y=D.node($.w),ie={rank:(Y.rank-q.rank)/2+q.rank,e:$};p.addDummyNode(D,"edge-proxy",ie,"_ep")}})}function W(D){var $=0;e.forEach(D.nodes(),function(H){var q=D.node(H);q.borderTop&&(q.minRank=D.node(q.borderTop).rank,q.maxRank=D.node(q.borderBottom).rank,$=e.max($,q.maxRank))}),D.graph().maxRank=$}function U(D){e.forEach(D.nodes(),function($){var H=D.node($);H.dummy==="edge-proxy"&&(D.edge(H.e).labelRank=H.rank,D.removeNode($))})}function A(D){var $=Number.POSITIVE_INFINITY,H=0,q=Number.POSITIVE_INFINITY,Y=0,ie=D.graph(),ne=ie.marginx||0,ve=ie.marginy||0;function Z(J){var ae=J.x,he=J.y,ue=J.width,de=J.height;$=Math.min($,ae-ue/2),H=Math.max(H,ae+ue/2),q=Math.min(q,he-de/2),Y=Math.max(Y,he+de/2)}e.forEach(D.nodes(),function(J){Z(D.node(J))}),e.forEach(D.edges(),function(J){var ae=D.edge(J);e.has(ae,"x")&&Z(ae)}),$-=ne,q-=ve,e.forEach(D.nodes(),function(J){var ae=D.node(J);ae.x-=$,ae.y-=q}),e.forEach(D.edges(),function(J){var ae=D.edge(J);e.forEach(ae.points,function(he){he.x-=$,he.y-=q}),e.has(ae,"x")&&(ae.x-=$),e.has(ae,"y")&&(ae.y-=q)}),ie.width=H-$+ne,ie.height=Y-q+ve}function K(D){e.forEach(D.edges(),function($){var H=D.edge($),q=D.node($.v),Y=D.node($.w),ie,ne;H.points?(ie=H.points[0],ne=H.points[H.points.length-1]):(H.points=[],ie=Y,ne=q),H.points.unshift(p.intersectRect(q,ie)),H.points.push(p.intersectRect(Y,ne))})}function V(D){e.forEach(D.edges(),function($){var H=D.edge($);if(e.has(H,"x"))switch((H.labelpos==="l"||H.labelpos==="r")&&(H.width-=H.labeloffset),H.labelpos){case"l":H.x-=H.width/2+H.labeloffset;break;case"r":H.x+=H.width/2+H.labeloffset;break}})}function te(D){e.forEach(D.edges(),function($){var H=D.edge($);H.reversed&&H.points.reverse()})}function G(D){e.forEach(D.nodes(),function($){if(D.children($).length){var H=D.node($),q=D.node(H.borderTop),Y=D.node(H.borderBottom),ie=D.node(e.last(H.borderLeft)),ne=D.node(e.last(H.borderRight));H.width=Math.abs(ne.x-ie.x),H.height=Math.abs(Y.y-q.y),H.x=ie.x+H.width/2,H.y=q.y+H.height/2}}),e.forEach(D.nodes(),function($){D.node($).dummy==="border"&&D.removeNode($)})}function re(D){e.forEach(D.edges(),function($){if($.v===$.w){var H=D.node($.v);H.selfEdges||(H.selfEdges=[]),H.selfEdges.push({e:$,label:D.edge($)}),D.removeEdge($)}})}function P(D){var $=p.buildLayerMatrix(D);e.forEach($,function(H){var q=0;e.forEach(H,function(Y,ie){var ne=D.node(Y);ne.order=ie+q,e.forEach(ne.selfEdges,function(ve){p.addDummyNode(D,"selfedge",{width:ve.label.width,height:ve.label.height,rank:ne.rank,order:ie+ ++q,e:ve.e,label:ve.label},"_se")}),delete ne.selfEdges})})}function B(D){e.forEach(D.nodes(),function($){var H=D.node($);if(H.dummy==="selfedge"){var q=D.node(H.e.v),Y=q.x+q.width/2,ie=q.y,ne=H.x-Y,ve=q.height/2;D.setEdge(H.e,H.label),D.removeNode($),H.label.points=[{x:Y+2*ne/3,y:ie-ve},{x:Y+5*ne/6,y:ie-ve},{x:Y+ne,y:ie},{x:Y+5*ne/6,y:ie+ve},{x:Y+2*ne/3,y:ie+ve}],H.label.x=H.x,H.label.y=H.y}})}function X(D,$){return e.mapValues(e.pick(D,$),Number)}function Q(D){var $={};return e.forEach(D,function(H,q){$[q.toLowerCase()]=H}),$}return c0}var u0,gP;function fee(){if(gP)return u0;gP=1;var e=It(),t=Hr(),r=$n().Graph;u0={debugOrdering:n};function n(i){var o=t.buildLayerMatrix(i),a=new r({compound:!0,multigraph:!0}).setGraph({});return e.forEach(i.nodes(),function(s){a.setNode(s,{label:s}),a.setParent(s,"layer"+i.node(s).rank)}),e.forEach(i.edges(),function(s){a.setEdge(s.v,s.w,{},s.name)}),e.forEach(o,function(s,c){var d="layer"+c;a.setNode(d,{rank:"same"}),e.reduce(s,function(u,h){return a.setEdge(u,h,{style:"invis"}),h})}),a}return u0}var d0,mP;function hee(){return mP||(mP=1,d0="0.8.5"),d0}var f0,bP;function pee(){return bP||(bP=1,f0={graphlib:$n(),layout:dee(),debug:fee(),util:{time:Hr().time,notime:Hr().notime},version:hee()}),f0}var vee=pee();const yP=eo(vee);function gee(e){let t;const r=new Set,n=(d,u)=>{const h=typeof d=="function"?d(t):d;if(h!==t){const p=t;t=u?h:Object.assign({},t,h),r.forEach(v=>v(t,p))}},i=()=>t,o=(d,u=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=u(t);function v(){const y=u(t);if(!h(p,y)){const m=p;d(p=y,m)}}return r.add(v),()=>r.delete(v)},c={setState:n,getState:i,subscribe:(d,u,h)=>u||h?o(d,u,h):(r.add(d),()=>r.delete(d)),destroy:()=>r.clear()};return t=e(n,i,c),c}const mee=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),xP=mee?C.useEffect:C.useLayoutEffect;function bee(e){const t=typeof e=="function"?gee(e):e,r=(n=t.getState,i=Object.is)=>{const[,o]=C.useReducer(g=>g+1,0),a=t.getState(),s=C.useRef(a),c=C.useRef(n),d=C.useRef(i),u=C.useRef(!1),h=C.useRef();h.current===void 0&&(h.current=n(a));let p,v=!1;(s.current!==a||c.current!==n||d.current!==i||u.current)&&(p=n(a),v=!i(h.current,p)),xP(()=>{v&&(h.current=p),s.current=a,c.current=n,d.current=i,u.current=!1});const y=C.useRef(a);xP(()=>{const g=()=>{try{const x=t.getState(),_=c.current(x);d.current(h.current,_)||(s.current=x,h.current=_,o())}catch{u.current=!0,o()}},w=t.subscribe(g);return t.getState()!==y.current&&g(),w},[]);const m=v?p:h.current;return C.useDebugValue(m),m};return Object.assign(r,t),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[r,t];return{next(){const i=n.length<=0;return{value:n.shift(),done:i}}}},r}function yee(){const e=C.createContext(void 0);return{Provider:({initialStore:i,createStore:o,children:a})=>{const s=C.useRef();return s.current||(i&&(console.warn("Provider initialStore is deprecated and will be removed in the next version."),o||(o=()=>i)),s.current=o()),C.createElement(e.Provider,{value:s.current},a)},useStore:(i,o=Object.is)=>{const a=C.useContext(e);if(!a)throw new Error("Seems like you have not used zustand provider as an ancestor.");return a(i,o)},useStoreApi:()=>{const i=C.useContext(e);if(!i)throw new Error("Seems like you have not used zustand provider as an ancestor.");return C.useMemo(()=>({getState:i.getState,setState:i.setState,subscribe:i.subscribe,destroy:i.destroy}),[i])}}}var xee={value:()=>{}};function Hd(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Eu(r)}function Eu(e){this._=e}function wee(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Eu.prototype=Hd.prototype={constructor:Eu,on:function(e,t){var r=this._,n=wee(e+"",r),i,o=-1,a=n.length;if(arguments.length<2){for(;++o<a;)if((i=(e=n[o]).type)&&(i=See(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=n[o]).type)r[i]=wP(r[i],e.name,t);else if(t==null)for(i in r)r[i]=wP(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Eu(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,o;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],n=0,i=o.length;n<i;++n)o[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,o=n.length;i<o;++i)n[i].value.apply(t,r)}};function See(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function wP(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=xee,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var Dw="http://www.w3.org/1999/xhtml";const SP={svg:"http://www.w3.org/2000/svg",xhtml:Dw,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Wd(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),SP.hasOwnProperty(t)?{space:SP[t],local:e}:e}function Eee(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Dw&&t.documentElement.namespaceURI===Dw?t.createElement(e):t.createElementNS(r,e)}}function _ee(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function U6(e){var t=Wd(e);return(t.local?_ee:Eee)(t)}function Oee(){}function DS(e){return e==null?Oee:function(){return this.querySelector(e)}}function Cee(e){typeof e!="function"&&(e=DS(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var o=t[i],a=o.length,s=n[i]=new Array(a),c,d,u=0;u<a;++u)(c=o[u])&&(d=e.call(c,c.__data__,u,o))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new ln(n,this._parents)}function Iee(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ree(){return[]}function G6(e){return e==null?Ree:function(){return this.querySelectorAll(e)}}function Nee(e){return function(){return Iee(e.apply(this,arguments))}}function Tee(e){typeof e=="function"?e=Nee(e):e=G6(e);for(var t=this._groups,r=t.length,n=[],i=[],o=0;o<r;++o)for(var a=t[o],s=a.length,c,d=0;d<s;++d)(c=a[d])&&(n.push(e.call(c,c.__data__,d,a)),i.push(c));return new ln(n,i)}function K6(e){return function(){return this.matches(e)}}function Y6(e){return function(t){return t.matches(e)}}var Pee=Array.prototype.find;function Mee(e){return function(){return Pee.call(this.children,e)}}function kee(){return this.firstElementChild}function Aee(e){return this.select(e==null?kee:Mee(typeof e=="function"?e:Y6(e)))}var Dee=Array.prototype.filter;function jee(){return Array.from(this.children)}function qee(e){return function(){return Dee.call(this.children,e)}}function zee(e){return this.selectAll(e==null?jee:qee(typeof e=="function"?e:Y6(e)))}function Lee(e){typeof e!="function"&&(e=K6(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var o=t[i],a=o.length,s=n[i]=[],c,d=0;d<a;++d)(c=o[d])&&e.call(c,c.__data__,d,o)&&s.push(c);return new ln(n,this._parents)}function X6(e){return new Array(e.length)}function Bee(){return new ln(this._enter||this._groups.map(X6),this._parents)}function Zu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Zu.prototype={constructor:Zu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Fee(e){return function(){return e}}function $ee(e,t,r,n,i,o){for(var a=0,s,c=t.length,d=o.length;a<d;++a)(s=t[a])?(s.__data__=o[a],n[a]=s):r[a]=new Zu(e,o[a]);for(;a<c;++a)(s=t[a])&&(i[a]=s)}function Vee(e,t,r,n,i,o,a){var s,c,d=new Map,u=t.length,h=o.length,p=new Array(u),v;for(s=0;s<u;++s)(c=t[s])&&(p[s]=v=a.call(c,c.__data__,s,t)+"",d.has(v)?i[s]=c:d.set(v,c));for(s=0;s<h;++s)v=a.call(e,o[s],s,o)+"",(c=d.get(v))?(n[s]=c,c.__data__=o[s],d.delete(v)):r[s]=new Zu(e,o[s]);for(s=0;s<u;++s)(c=t[s])&&d.get(p[s])===c&&(i[s]=c)}function Hee(e){return e.__data__}function Wee(e,t){if(!arguments.length)return Array.from(this,Hee);var r=t?Vee:$ee,n=this._parents,i=this._groups;typeof e!="function"&&(e=Fee(e));for(var o=i.length,a=new Array(o),s=new Array(o),c=new Array(o),d=0;d<o;++d){var u=n[d],h=i[d],p=h.length,v=Uee(e.call(u,u&&u.__data__,d,n)),y=v.length,m=s[d]=new Array(y),g=a[d]=new Array(y),w=c[d]=new Array(p);r(u,h,m,g,w,v,t);for(var x=0,_=0,S,E;x<y;++x)if(S=m[x]){for(x>=_&&(_=x+1);!(E=g[_])&&++_<y;);S._next=E||null}}return a=new ln(a,n),a._enter=s,a._exit=c,a}function Uee(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Gee(){return new ln(this._exit||this._groups.map(X6),this._parents)}function Kee(e,t,r){var n=this.enter(),i=this,o=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?o.remove():r(o),n&&i?n.merge(i).order():i}function Yee(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,o=n.length,a=Math.min(i,o),s=new Array(i),c=0;c<a;++c)for(var d=r[c],u=n[c],h=d.length,p=s[c]=new Array(h),v,y=0;y<h;++y)(v=d[y]||u[y])&&(p[y]=v);for(;c<i;++c)s[c]=r[c];return new ln(s,this._parents)}function Xee(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,o=n[i],a;--i>=0;)(a=n[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function Zee(e){e||(e=Jee);function t(h,p){return h&&p?e(h.__data__,p.__data__):!h-!p}for(var r=this._groups,n=r.length,i=new Array(n),o=0;o<n;++o){for(var a=r[o],s=a.length,c=i[o]=new Array(s),d,u=0;u<s;++u)(d=a[u])&&(c[u]=d);c.sort(t)}return new ln(i,this._parents).order()}function Jee(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Qee(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ete(){return Array.from(this)}function tte(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,o=n.length;i<o;++i){var a=n[i];if(a)return a}return null}function rte(){let e=0;for(const t of this)++e;return e}function nte(){return!this.node()}function ite(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],o=0,a=i.length,s;o<a;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function ote(e){return function(){this.removeAttribute(e)}}function ate(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ste(e,t){return function(){this.setAttribute(e,t)}}function lte(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function cte(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function ute(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function dte(e,t){var r=Wd(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?ate:ote:typeof t=="function"?r.local?ute:cte:r.local?lte:ste)(r,t))}function Z6(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function fte(e){return function(){this.style.removeProperty(e)}}function hte(e,t,r){return function(){this.style.setProperty(e,t,r)}}function pte(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function vte(e,t,r){return arguments.length>1?this.each((t==null?fte:typeof t=="function"?pte:hte)(e,t,r??"")):ka(this.node(),e)}function ka(e,t){return e.style.getPropertyValue(t)||Z6(e).getComputedStyle(e,null).getPropertyValue(t)}function gte(e){return function(){delete this[e]}}function mte(e,t){return function(){this[e]=t}}function bte(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function yte(e,t){return arguments.length>1?this.each((t==null?gte:typeof t=="function"?bte:mte)(e,t)):this.node()[e]}function J6(e){return e.trim().split(/^|\s+/)}function jS(e){return e.classList||new Q6(e)}function Q6(e){this._node=e,this._names=J6(e.getAttribute("class")||"")}Q6.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function eq(e,t){for(var r=jS(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function tq(e,t){for(var r=jS(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function xte(e){return function(){eq(this,e)}}function wte(e){return function(){tq(this,e)}}function Ste(e,t){return function(){(t.apply(this,arguments)?eq:tq)(this,e)}}function Ete(e,t){var r=J6(e+"");if(arguments.length<2){for(var n=jS(this.node()),i=-1,o=r.length;++i<o;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?Ste:t?xte:wte)(r,t))}function _te(){this.textContent=""}function Ote(e){return function(){this.textContent=e}}function Cte(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ite(e){return arguments.length?this.each(e==null?_te:(typeof e=="function"?Cte:Ote)(e)):this.node().textContent}function Rte(){this.innerHTML=""}function Nte(e){return function(){this.innerHTML=e}}function Tte(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Pte(e){return arguments.length?this.each(e==null?Rte:(typeof e=="function"?Tte:Nte)(e)):this.node().innerHTML}function Mte(){this.nextSibling&&this.parentNode.appendChild(this)}function kte(){return this.each(Mte)}function Ate(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Dte(){return this.each(Ate)}function jte(e){var t=typeof e=="function"?e:U6(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qte(){return null}function zte(e,t){var r=typeof e=="function"?e:U6(e),n=t==null?qte:typeof t=="function"?t:DS(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function Lte(){var e=this.parentNode;e&&e.removeChild(this)}function Bte(){return this.each(Lte)}function Fte(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $te(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vte(e){return this.select(e?$te:Fte)}function Hte(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Wte(e){return function(t){e.call(this,t,this.__data__)}}function Ute(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function Gte(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,o;r<i;++r)o=t[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++n]=o;++n?t.length=n:delete this.__on}}}function Kte(e,t,r){return function(){var n=this.__on,i,o=Wte(t);if(n){for(var a=0,s=n.length;a<s;++a)if((i=n[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=r),i.value=t;return}}this.addEventListener(e.type,o,r),i={type:e.type,name:e.name,value:t,listener:o,options:r},n?n.push(i):this.__on=[i]}}function Yte(e,t,r){var n=Ute(e+""),i,o=n.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,d=s.length,u;c<d;++c)for(i=0,u=s[c];i<o;++i)if((a=n[i]).type===u.type&&a.name===u.name)return u.value}return}for(s=t?Kte:Gte,i=0;i<o;++i)this.each(s(n[i],t,r));return this}function rq(e,t,r){var n=Z6(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Xte(e,t){return function(){return rq(this,e,t)}}function Zte(e,t){return function(){return rq(this,e,t.apply(this,arguments))}}function Jte(e,t){return this.each((typeof t=="function"?Zte:Xte)(e,t))}function*Qte(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,o=n.length,a;i<o;++i)(a=n[i])&&(yield a)}var nq=[null];function ln(e,t){this._groups=e,this._parents=t}function Al(){return new ln([[document.documentElement]],nq)}function ere(){return this}ln.prototype=Al.prototype={constructor:ln,select:Cee,selectAll:Tee,selectChild:Aee,selectChildren:zee,filter:Lee,data:Wee,enter:Bee,exit:Gee,join:Kee,merge:Yee,selection:ere,order:Xee,sort:Zee,call:Qee,nodes:ete,node:tte,size:rte,empty:nte,each:ite,attr:dte,style:vte,property:yte,classed:Ete,text:Ite,html:Pte,raise:kte,lower:Dte,append:jte,insert:zte,remove:Bte,clone:Vte,datum:Hte,on:Yte,dispatch:Jte,[Symbol.iterator]:Qte};function jn(e){return typeof e=="string"?new ln([[document.querySelector(e)]],[document.documentElement]):new ln([[e]],nq)}function tre(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ti(e,t){if(e=tre(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const rre={passive:!1},hl={capture:!0,passive:!1};function h0(e){e.stopImmediatePropagation()}function Sa(e){e.preventDefault(),e.stopImmediatePropagation()}function iq(e){var t=e.document.documentElement,r=jn(e).on("dragstart.drag",Sa,hl);"onselectstart"in t?r.on("selectstart.drag",Sa,hl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function oq(e,t){var r=e.document.documentElement,n=jn(e).on("dragstart.drag",null);t&&(n.on("click.drag",Sa,hl),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Gc=e=>()=>e;function jw(e,{sourceEvent:t,subject:r,target:n,identifier:i,active:o,x:a,y:s,dx:c,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}jw.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nre(e){return!e.ctrlKey&&!e.button}function ire(){return this.parentNode}function ore(e,t){return t??{x:e.x,y:e.y}}function are(){return navigator.maxTouchPoints||"ontouchstart"in this}function sre(){var e=nre,t=ire,r=ore,n=are,i={},o=Hd("start","drag","end"),a=0,s,c,d,u,h=0;function p(S){S.on("mousedown.drag",v).filter(n).on("touchstart.drag",g).on("touchmove.drag",w,rre).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(S,E){if(!(u||!e.call(this,S,E))){var I=_(this,t.call(this,S,E),S,E,"mouse");I&&(jn(S.view).on("mousemove.drag",y,hl).on("mouseup.drag",m,hl),iq(S.view),h0(S),d=!1,s=S.clientX,c=S.clientY,I("start",S))}}function y(S){if(Sa(S),!d){var E=S.clientX-s,I=S.clientY-c;d=E*E+I*I>h}i.mouse("drag",S)}function m(S){jn(S.view).on("mousemove.drag mouseup.drag",null),oq(S.view,d),Sa(S),i.mouse("end",S)}function g(S,E){if(e.call(this,S,E)){var I=S.changedTouches,N=t.call(this,S,E),T=I.length,M,z;for(M=0;M<T;++M)(z=_(this,N,S,E,I[M].identifier,I[M]))&&(h0(S),z("start",S,I[M]))}}function w(S){var E=S.changedTouches,I=E.length,N,T;for(N=0;N<I;++N)(T=i[E[N].identifier])&&(Sa(S),T("drag",S,E[N]))}function x(S){var E=S.changedTouches,I=E.length,N,T;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),N=0;N<I;++N)(T=i[E[N].identifier])&&(h0(S),T("end",S,E[N]))}function _(S,E,I,N,T,M){var z=o.copy(),j=ti(M||I,E),W,U,A;if((A=r.call(S,new jw("beforestart",{sourceEvent:I,target:p,identifier:T,active:a,x:j[0],y:j[1],dx:0,dy:0,dispatch:z}),N))!=null)return W=A.x-j[0]||0,U=A.y-j[1]||0,function K(V,te,G){var re=j,P;switch(V){case"start":i[T]=K,P=a++;break;case"end":delete i[T],--a;case"drag":j=ti(G||te,E),P=a;break}z.call(V,S,new jw(V,{sourceEvent:te,subject:A,target:p,identifier:T,active:P,x:j[0]+W,y:j[1]+U,dx:j[0]-re[0],dy:j[1]-re[1],dispatch:z}),N)}}return p.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Gc(!!S),p):e},p.container=function(S){return arguments.length?(t=typeof S=="function"?S:Gc(S),p):t},p.subject=function(S){return arguments.length?(r=typeof S=="function"?S:Gc(S),p):r},p.touchable=function(S){return arguments.length?(n=typeof S=="function"?S:Gc(!!S),p):n},p.on=function(){var S=o.on.apply(o,arguments);return S===o?p:S},p.clickDistance=function(S){return arguments.length?(h=(S=+S)*S,p):Math.sqrt(h)},p}function qS(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function aq(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Dl(){}var pl=.7,Ju=1/pl,Ea="\\s*([+-]?\\d+)\\s*",vl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ii="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lre=/^#([0-9a-f]{3,8})$/,cre=new RegExp(`^rgb\\(${Ea},${Ea},${Ea}\\)$`),ure=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),dre=new RegExp(`^rgba\\(${Ea},${Ea},${Ea},${vl}\\)$`),fre=new RegExp(`^rgba\\(${ii},${ii},${ii},${vl}\\)$`),hre=new RegExp(`^hsl\\(${vl},${ii},${ii}\\)$`),pre=new RegExp(`^hsla\\(${vl},${ii},${ii},${vl}\\)$`),EP={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};qS(Dl,gl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_P,formatHex:_P,formatHex8:vre,formatHsl:gre,formatRgb:OP,toString:OP});function _P(){return this.rgb().formatHex()}function vre(){return this.rgb().formatHex8()}function gre(){return sq(this).formatHsl()}function OP(){return this.rgb().formatRgb()}function gl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=lre.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?CP(t):r===3?new Fr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Kc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Kc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=cre.exec(e))?new Fr(t[1],t[2],t[3],1):(t=ure.exec(e))?new Fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dre.exec(e))?Kc(t[1],t[2],t[3],t[4]):(t=fre.exec(e))?Kc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=hre.exec(e))?NP(t[1],t[2]/100,t[3]/100,1):(t=pre.exec(e))?NP(t[1],t[2]/100,t[3]/100,t[4]):EP.hasOwnProperty(e)?CP(EP[e]):e==="transparent"?new Fr(NaN,NaN,NaN,0):null}function CP(e){return new Fr(e>>16&255,e>>8&255,e&255,1)}function Kc(e,t,r,n){return n<=0&&(e=t=r=NaN),new Fr(e,t,r,n)}function mre(e){return e instanceof Dl||(e=gl(e)),e?(e=e.rgb(),new Fr(e.r,e.g,e.b,e.opacity)):new Fr}function qw(e,t,r,n){return arguments.length===1?mre(e):new Fr(e,t,r,n??1)}function Fr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}qS(Fr,qw,aq(Dl,{brighter(e){return e=e==null?Ju:Math.pow(Ju,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pl:Math.pow(pl,e),new Fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fr(Oo(this.r),Oo(this.g),Oo(this.b),Qu(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:IP,formatHex:IP,formatHex8:bre,formatRgb:RP,toString:RP}));function IP(){return`#${xo(this.r)}${xo(this.g)}${xo(this.b)}`}function bre(){return`#${xo(this.r)}${xo(this.g)}${xo(this.b)}${xo((isNaN(this.opacity)?1:this.opacity)*255)}`}function RP(){const e=Qu(this.opacity);return`${e===1?"rgb(":"rgba("}${Oo(this.r)}, ${Oo(this.g)}, ${Oo(this.b)}${e===1?")":`, ${e})`}`}function Qu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Oo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function xo(e){return e=Oo(e),(e<16?"0":"")+e.toString(16)}function NP(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new qn(e,t,r,n)}function sq(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof Dl||(e=gl(e)),!e)return new qn;if(e instanceof qn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,c=(o+i)/2;return s?(t===o?a=(r-n)/s+(r<n)*6:r===o?a=(n-t)/s+2:a=(t-r)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new qn(a,s,c,e.opacity)}function yre(e,t,r,n){return arguments.length===1?sq(e):new qn(e,t,r,n??1)}function qn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}qS(qn,yre,aq(Dl,{brighter(e){return e=e==null?Ju:Math.pow(Ju,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pl:Math.pow(pl,e),new qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Fr(p0(e>=240?e-240:e+120,i,n),p0(e,i,n),p0(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new qn(TP(this.h),Yc(this.s),Yc(this.l),Qu(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=Qu(this.opacity);return`${e===1?"hsl(":"hsla("}${TP(this.h)}, ${Yc(this.s)*100}%, ${Yc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function TP(e){return e=(e||0)%360,e<0?e+360:e}function Yc(e){return Math.max(0,Math.min(1,e||0))}function p0(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const lq=e=>()=>e;function xre(e,t){return function(r){return e+r*t}}function wre(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Sre(e){return(e=+e)==1?cq:function(t,r){return r-t?wre(t,r,e):lq(isNaN(t)?r:t)}}function cq(e,t){var r=t-e;return r?xre(e,r):lq(isNaN(e)?t:e)}const PP=(function e(t){var r=Sre(t);function n(i,o){var a=r((i=qw(i)).r,(o=qw(o)).r),s=r(i.g,o.g),c=r(i.b,o.b),d=cq(i.opacity,o.opacity);return function(u){return i.r=a(u),i.g=s(u),i.b=c(u),i.opacity=d(u),i+""}}return n.gamma=e,n})(1);function Gi(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var zw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,v0=new RegExp(zw.source,"g");function Ere(e){return function(){return e}}function _re(e){return function(t){return e(t)+""}}function Ore(e,t){var r=zw.lastIndex=v0.lastIndex=0,n,i,o,a=-1,s=[],c=[];for(e=e+"",t=t+"";(n=zw.exec(e))&&(i=v0.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,c.push({i:a,x:Gi(n,i)})),r=v0.lastIndex;return r<t.length&&(o=t.slice(r),s[a]?s[a]+=o:s[++a]=o),s.length<2?c[0]?_re(c[0].x):Ere(t):(t=c.length,function(d){for(var u=0,h;u<t;++u)s[(h=c[u]).i]=h.x(d);return s.join("")})}var MP=180/Math.PI,Lw={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function uq(e,t,r,n,i,o){var a,s,c;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(c=e*r+t*n)&&(r-=e*c,n-=t*c),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,c/=s),e*n<t*r&&(e=-e,t=-t,c=-c,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*MP,skewX:Math.atan(c)*MP,scaleX:a,scaleY:s}}var Xc;function Cre(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Lw:uq(t.a,t.b,t.c,t.d,t.e,t.f)}function Ire(e){return e==null||(Xc||(Xc=document.createElementNS("http://www.w3.org/2000/svg","g")),Xc.setAttribute("transform",e),!(e=Xc.transform.baseVal.consolidate()))?Lw:(e=e.matrix,uq(e.a,e.b,e.c,e.d,e.e,e.f))}function dq(e,t,r,n){function i(d){return d.length?d.pop()+" ":""}function o(d,u,h,p,v,y){if(d!==h||u!==p){var m=v.push("translate(",null,t,null,r);y.push({i:m-4,x:Gi(d,h)},{i:m-2,x:Gi(u,p)})}else(h||p)&&v.push("translate("+h+t+p+r)}function a(d,u,h,p){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),p.push({i:h.push(i(h)+"rotate(",null,n)-2,x:Gi(d,u)})):u&&h.push(i(h)+"rotate("+u+n)}function s(d,u,h,p){d!==u?p.push({i:h.push(i(h)+"skewX(",null,n)-2,x:Gi(d,u)}):u&&h.push(i(h)+"skewX("+u+n)}function c(d,u,h,p,v,y){if(d!==h||u!==p){var m=v.push(i(v)+"scale(",null,",",null,")");y.push({i:m-4,x:Gi(d,h)},{i:m-2,x:Gi(u,p)})}else(h!==1||p!==1)&&v.push(i(v)+"scale("+h+","+p+")")}return function(d,u){var h=[],p=[];return d=e(d),u=e(u),o(d.translateX,d.translateY,u.translateX,u.translateY,h,p),a(d.rotate,u.rotate,h,p),s(d.skewX,u.skewX,h,p),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,h,p),d=u=null,function(v){for(var y=-1,m=p.length,g;++y<m;)h[(g=p[y]).i]=g.x(v);return h.join("")}}}var Rre=dq(Cre,"px, ","px)","deg)"),Nre=dq(Ire,", ",")",")"),Tre=1e-12;function kP(e){return((e=Math.exp(e))+1/e)/2}function Pre(e){return((e=Math.exp(e))-1/e)/2}function Mre(e){return((e=Math.exp(2*e))-1)/(e+1)}const kre=(function e(t,r,n){function i(o,a){var s=o[0],c=o[1],d=o[2],u=a[0],h=a[1],p=a[2],v=u-s,y=h-c,m=v*v+y*y,g,w;if(m<Tre)w=Math.log(p/d)/t,g=function(N){return[s+N*v,c+N*y,d*Math.exp(t*N*w)]};else{var x=Math.sqrt(m),_=(p*p-d*d+n*m)/(2*d*r*x),S=(p*p-d*d-n*m)/(2*p*r*x),E=Math.log(Math.sqrt(_*_+1)-_),I=Math.log(Math.sqrt(S*S+1)-S);w=(I-E)/t,g=function(N){var T=N*w,M=kP(E),z=d/(r*x)*(M*Mre(t*T+E)-Pre(E));return[s+z*v,c+z*y,d*M/kP(t*T+E)]}}return g.duration=w*1e3*t/Math.SQRT2,g}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,c=s*s;return e(a,s,c)},i})(Math.SQRT2,2,4);var Aa=0,Gs=0,_s=0,fq=1e3,ed,Ks,td=0,Po=0,Ud=0,ml=typeof performance=="object"&&performance.now?performance:Date,hq=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function zS(){return Po||(hq(Are),Po=ml.now()+Ud)}function Are(){Po=0}function rd(){this._call=this._time=this._next=null}rd.prototype=pq.prototype={constructor:rd,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?zS():+r)+(t==null?0:+t),!this._next&&Ks!==this&&(Ks?Ks._next=this:ed=this,Ks=this),this._call=e,this._time=r,Bw()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bw())}};function pq(e,t,r){var n=new rd;return n.restart(e,t,r),n}function Dre(){zS(),++Aa;for(var e=ed,t;e;)(t=Po-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Aa}function AP(){Po=(td=ml.now())+Ud,Aa=Gs=0;try{Dre()}finally{Aa=0,qre(),Po=0}}function jre(){var e=ml.now(),t=e-td;t>fq&&(Ud-=t,td=e)}function qre(){for(var e,t=ed,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:ed=r);Ks=e,Bw(n)}function Bw(e){if(!Aa){Gs&&(Gs=clearTimeout(Gs));var t=e-Po;t>24?(e<1/0&&(Gs=setTimeout(AP,e-ml.now()-Ud)),_s&&(_s=clearInterval(_s))):(_s||(td=ml.now(),_s=setInterval(jre,fq)),Aa=1,hq(AP))}}function DP(e,t,r){var n=new rd;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var zre=Hd("start","end","cancel","interrupt"),Lre=[],vq=0,jP=1,Fw=2,_u=3,qP=4,$w=5,Ou=6;function Gd(e,t,r,n,i,o){var a=e.__transition;if(!a)e.__transition={};else if(r in a)return;Bre(e,r,{name:t,index:n,group:i,on:zre,tween:Lre,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:vq})}function LS(e,t){var r=Hn(e,t);if(r.state>vq)throw new Error("too late; already scheduled");return r}function li(e,t){var r=Hn(e,t);if(r.state>_u)throw new Error("too late; already running");return r}function Hn(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Bre(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=pq(o,0,r.time);function o(d){r.state=jP,r.timer.restart(a,r.delay,r.time),r.delay<=d&&a(d-r.delay)}function a(d){var u,h,p,v;if(r.state!==jP)return c();for(u in n)if(v=n[u],v.name===r.name){if(v.state===_u)return DP(a);v.state===qP?(v.state=Ou,v.timer.stop(),v.on.call("interrupt",e,e.__data__,v.index,v.group),delete n[u]):+u<t&&(v.state=Ou,v.timer.stop(),v.on.call("cancel",e,e.__data__,v.index,v.group),delete n[u])}if(DP(function(){r.state===_u&&(r.state=qP,r.timer.restart(s,r.delay,r.time),s(d))}),r.state=Fw,r.on.call("start",e,e.__data__,r.index,r.group),r.state===Fw){for(r.state=_u,i=new Array(p=r.tween.length),u=0,h=-1;u<p;++u)(v=r.tween[u].value.call(e,e.__data__,r.index,r.group))&&(i[++h]=v);i.length=h+1}}function s(d){for(var u=d<r.duration?r.ease.call(null,d/r.duration):(r.timer.restart(c),r.state=$w,1),h=-1,p=i.length;++h<p;)i[h].call(e,u);r.state===$w&&(r.on.call("end",e,e.__data__,r.index,r.group),c())}function c(){r.state=Ou,r.timer.stop(),delete n[t];for(var d in n)return;delete e.__transition}}function Cu(e,t){var r=e.__transition,n,i,o=!0,a;if(r){t=t==null?null:t+"";for(a in r){if((n=r[a]).name!==t){o=!1;continue}i=n.state>Fw&&n.state<$w,n.state=Ou,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[a]}o&&delete e.__transition}}function Fre(e){return this.each(function(){Cu(this,e)})}function $re(e,t){var r,n;return function(){var i=li(this,e),o=i.tween;if(o!==r){n=r=o;for(var a=0,s=n.length;a<s;++a)if(n[a].name===t){n=n.slice(),n.splice(a,1);break}}i.tween=n}}function Vre(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var o=li(this,e),a=o.tween;if(a!==n){i=(n=a).slice();for(var s={name:t,value:r},c=0,d=i.length;c<d;++c)if(i[c].name===t){i[c]=s;break}c===d&&i.push(s)}o.tween=i}}function Hre(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=Hn(this.node(),r).tween,i=0,o=n.length,a;i<o;++i)if((a=n[i]).name===e)return a.value;return null}return this.each((t==null?$re:Vre)(r,e,t))}function BS(e,t,r){var n=e._id;return e.each(function(){var i=li(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return Hn(i,n).value[t]}}function gq(e,t){var r;return(typeof t=="number"?Gi:t instanceof gl?PP:(r=gl(t))?(t=r,PP):Ore)(e,t)}function Wre(e){return function(){this.removeAttribute(e)}}function Ure(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Gre(e,t,r){var n,i=r+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===n?o:o=t(n=a,r)}}function Kre(e,t,r){var n,i=r+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===n?o:o=t(n=a,r)}}function Yre(e,t,r){var n,i,o;return function(){var a,s=r(this),c;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=s+"",a===c?null:a===n&&c===i?o:(i=c,o=t(n=a,s)))}}function Xre(e,t,r){var n,i,o;return function(){var a,s=r(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=s+"",a===c?null:a===n&&c===i?o:(i=c,o=t(n=a,s)))}}function Zre(e,t){var r=Wd(e),n=r==="transform"?Nre:gq;return this.attrTween(e,typeof t=="function"?(r.local?Xre:Yre)(r,n,BS(this,"attr."+e,t)):t==null?(r.local?Ure:Wre)(r):(r.local?Kre:Gre)(r,n,t))}function Jre(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function Qre(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function ene(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Qre(e,o)),r}return i._value=t,i}function tne(e,t){var r,n;function i(){var o=t.apply(this,arguments);return o!==n&&(r=(n=o)&&Jre(e,o)),r}return i._value=t,i}function rne(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=Wd(e);return this.tween(r,(n.local?ene:tne)(n,t))}function nne(e,t){return function(){LS(this,e).delay=+t.apply(this,arguments)}}function ine(e,t){return t=+t,function(){LS(this,e).delay=t}}function one(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?nne:ine)(t,e)):Hn(this.node(),t).delay}function ane(e,t){return function(){li(this,e).duration=+t.apply(this,arguments)}}function sne(e,t){return t=+t,function(){li(this,e).duration=t}}function lne(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ane:sne)(t,e)):Hn(this.node(),t).duration}function cne(e,t){if(typeof t!="function")throw new Error;return function(){li(this,e).ease=t}}function une(e){var t=this._id;return arguments.length?this.each(cne(t,e)):Hn(this.node(),t).ease}function dne(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;li(this,e).ease=r}}function fne(e){if(typeof e!="function")throw new Error;return this.each(dne(this._id,e))}function hne(e){typeof e!="function"&&(e=K6(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var o=t[i],a=o.length,s=n[i]=[],c,d=0;d<a;++d)(c=o[d])&&e.call(c,c.__data__,d,o)&&s.push(c);return new _i(n,this._parents,this._name,this._id)}function pne(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,o=Math.min(n,i),a=new Array(n),s=0;s<o;++s)for(var c=t[s],d=r[s],u=c.length,h=a[s]=new Array(u),p,v=0;v<u;++v)(p=c[v]||d[v])&&(h[v]=p);for(;s<n;++s)a[s]=t[s];return new _i(a,this._parents,this._name,this._id)}function vne(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function gne(e,t,r){var n,i,o=vne(t)?LS:li;return function(){var a=o(this,e),s=a.on;s!==n&&(i=(n=s).copy()).on(t,r),a.on=i}}function mne(e,t){var r=this._id;return arguments.length<2?Hn(this.node(),r).on.on(e):this.each(gne(r,e,t))}function bne(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function yne(){return this.on("end.remove",bne(this._id))}function xne(e){var t=this._name,r=this._id;typeof e!="function"&&(e=DS(e));for(var n=this._groups,i=n.length,o=new Array(i),a=0;a<i;++a)for(var s=n[a],c=s.length,d=o[a]=new Array(c),u,h,p=0;p<c;++p)(u=s[p])&&(h=e.call(u,u.__data__,p,s))&&("__data__"in u&&(h.__data__=u.__data__),d[p]=h,Gd(d[p],t,r,p,d,Hn(u,r)));return new _i(o,this._parents,t,r)}function wne(e){var t=this._name,r=this._id;typeof e!="function"&&(e=G6(e));for(var n=this._groups,i=n.length,o=[],a=[],s=0;s<i;++s)for(var c=n[s],d=c.length,u,h=0;h<d;++h)if(u=c[h]){for(var p=e.call(u,u.__data__,h,c),v,y=Hn(u,r),m=0,g=p.length;m<g;++m)(v=p[m])&&Gd(v,t,r,m,p,y);o.push(p),a.push(u)}return new _i(o,a,t,r)}var Sne=Al.prototype.constructor;function Ene(){return new Sne(this._groups,this._parents)}function _ne(e,t){var r,n,i;return function(){var o=ka(this,e),a=(this.style.removeProperty(e),ka(this,e));return o===a?null:o===r&&a===n?i:i=t(r=o,n=a)}}function mq(e){return function(){this.style.removeProperty(e)}}function One(e,t,r){var n,i=r+"",o;return function(){var a=ka(this,e);return a===i?null:a===n?o:o=t(n=a,r)}}function Cne(e,t,r){var n,i,o;return function(){var a=ka(this,e),s=r(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),ka(this,e))),a===c?null:a===n&&c===i?o:(i=c,o=t(n=a,s))}}function Ine(e,t){var r,n,i,o="style."+t,a="end."+o,s;return function(){var c=li(this,e),d=c.on,u=c.value[o]==null?s||(s=mq(t)):void 0;(d!==r||i!==u)&&(n=(r=d).copy()).on(a,i=u),c.on=n}}function Rne(e,t,r){var n=(e+="")=="transform"?Rre:gq;return t==null?this.styleTween(e,_ne(e,n)).on("end.style."+e,mq(e)):typeof t=="function"?this.styleTween(e,Cne(e,n,BS(this,"style."+e,t))).each(Ine(this._id,e)):this.styleTween(e,One(e,n,t),r).on("end.style."+e,null)}function Nne(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function Tne(e,t,r){var n,i;function o(){var a=t.apply(this,arguments);return a!==i&&(n=(i=a)&&Nne(e,a,r)),n}return o._value=t,o}function Pne(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,Tne(e,t,r??""))}function Mne(e){return function(){this.textContent=e}}function kne(e){return function(){var t=e(this);this.textContent=t??""}}function Ane(e){return this.tween("text",typeof e=="function"?kne(BS(this,"text",e)):Mne(e==null?"":e+""))}function Dne(e){return function(t){this.textContent=e.call(this,t)}}function jne(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&Dne(i)),t}return n._value=e,n}function qne(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,jne(e))}function zne(){for(var e=this._name,t=this._id,r=bq(),n=this._groups,i=n.length,o=0;o<i;++o)for(var a=n[o],s=a.length,c,d=0;d<s;++d)if(c=a[d]){var u=Hn(c,t);Gd(c,e,r,d,a,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new _i(n,this._parents,e,r)}function Lne(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(o,a){var s={value:a},c={value:function(){--i===0&&o()}};r.each(function(){var d=li(this,n),u=d.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),d.on=t}),i===0&&o()})}var Bne=0;function _i(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function bq(){return++Bne}var yi=Al.prototype;_i.prototype={constructor:_i,select:xne,selectAll:wne,selectChild:yi.selectChild,selectChildren:yi.selectChildren,filter:hne,merge:pne,selection:Ene,transition:zne,call:yi.call,nodes:yi.nodes,node:yi.node,size:yi.size,empty:yi.empty,each:yi.each,on:mne,attr:Zre,attrTween:rne,style:Rne,styleTween:Pne,text:Ane,textTween:qne,remove:yne,tween:Hre,delay:one,duration:lne,ease:une,easeVarying:fne,end:Lne,[Symbol.iterator]:yi[Symbol.iterator]};function Fne(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var $ne={time:null,delay:0,duration:250,ease:Fne};function Vne(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Hne(e){var t,r;e instanceof _i?(t=e._id,e=e._name):(t=bq(),(r=$ne).time=zS(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,o=0;o<i;++o)for(var a=n[o],s=a.length,c,d=0;d<s;++d)(c=a[d])&&Gd(c,e,t,d,a,r||Vne(c,t));return new _i(n,this._parents,e,t)}Al.prototype.interrupt=Fre;Al.prototype.transition=Hne;const Zc=e=>()=>e;function Wne(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}function Si(e,t,r){this.k=e,this.x=t,this.y=r}Si.prototype={constructor:Si,scale:function(e){return e===1?this:new Si(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Si(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 Co=new Si(1,0,0);Si.prototype;function g0(e){e.stopImmediatePropagation()}function Os(e){e.preventDefault(),e.stopImmediatePropagation()}function Une(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Gne(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function zP(){return this.__zoom||Co}function Kne(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Yne(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xne(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],o=e.invertY(t[0][1])-r[0][1],a=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function Zne(){var e=Une,t=Gne,r=Xne,n=Kne,i=Yne,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,c=kre,d=Hd("start","zoom","end"),u,h,p,v=500,y=150,m=0,g=10;function w(A){A.property("__zoom",zP).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",z).filter(i).on("touchstart.zoom",j).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(A,K,V,te){var G=A.selection?A.selection():A;G.property("__zoom",zP),A!==G?E(A,K,V,te):G.interrupt().each(function(){I(this,arguments).event(te).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},w.scaleBy=function(A,K,V,te){w.scaleTo(A,function(){var G=this.__zoom.k,re=typeof K=="function"?K.apply(this,arguments):K;return G*re},V,te)},w.scaleTo=function(A,K,V,te){w.transform(A,function(){var G=t.apply(this,arguments),re=this.__zoom,P=V==null?S(G):typeof V=="function"?V.apply(this,arguments):V,B=re.invert(P),X=typeof K=="function"?K.apply(this,arguments):K;return r(_(x(re,X),P,B),G,a)},V,te)},w.translateBy=function(A,K,V,te){w.transform(A,function(){return r(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof V=="function"?V.apply(this,arguments):V),t.apply(this,arguments),a)},null,te)},w.translateTo=function(A,K,V,te,G){w.transform(A,function(){var re=t.apply(this,arguments),P=this.__zoom,B=te==null?S(re):typeof te=="function"?te.apply(this,arguments):te;return r(Co.translate(B[0],B[1]).scale(P.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof V=="function"?-V.apply(this,arguments):-V),re,a)},te,G)};function x(A,K){return K=Math.max(o[0],Math.min(o[1],K)),K===A.k?A:new Si(K,A.x,A.y)}function _(A,K,V){var te=K[0]-V[0]*A.k,G=K[1]-V[1]*A.k;return te===A.x&&G===A.y?A:new Si(A.k,te,G)}function S(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function E(A,K,V,te){A.on("start.zoom",function(){I(this,arguments).event(te).start()}).on("interrupt.zoom end.zoom",function(){I(this,arguments).event(te).end()}).tween("zoom",function(){var G=this,re=arguments,P=I(G,re).event(te),B=t.apply(G,re),X=V==null?S(B):typeof V=="function"?V.apply(G,re):V,Q=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),D=G.__zoom,$=typeof K=="function"?K.apply(G,re):K,H=c(D.invert(X).concat(Q/D.k),$.invert(X).concat(Q/$.k));return function(q){if(q===1)q=$;else{var Y=H(q),ie=Q/Y[2];q=new Si(ie,X[0]-Y[0]*ie,X[1]-Y[1]*ie)}P.zoom(null,q)}})}function I(A,K,V){return!V&&A.__zooming||new N(A,K)}function N(A,K){this.that=A,this.args=K,this.active=0,this.sourceEvent=null,this.extent=t.apply(A,K),this.taps=0}N.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,K){return this.mouse&&A!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var K=jn(this.that).datum();d.call(A,this.that,new Wne(A,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:d}),K)}};function T(A,...K){if(!e.apply(this,arguments))return;var V=I(this,K).event(A),te=this.__zoom,G=Math.max(o[0],Math.min(o[1],te.k*Math.pow(2,n.apply(this,arguments)))),re=ti(A);if(V.wheel)(V.mouse[0][0]!==re[0]||V.mouse[0][1]!==re[1])&&(V.mouse[1]=te.invert(V.mouse[0]=re)),clearTimeout(V.wheel);else{if(te.k===G)return;V.mouse=[re,te.invert(re)],Cu(this),V.start()}Os(A),V.wheel=setTimeout(P,y),V.zoom("mouse",r(_(x(te,G),V.mouse[0],V.mouse[1]),V.extent,a));function P(){V.wheel=null,V.end()}}function M(A,...K){if(p||!e.apply(this,arguments))return;var V=A.currentTarget,te=I(this,K,!0).event(A),G=jn(A.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",Q,!0),re=ti(A,V),P=A.clientX,B=A.clientY;iq(A.view),g0(A),te.mouse=[re,this.__zoom.invert(re)],Cu(this),te.start();function X(D){if(Os(D),!te.moved){var $=D.clientX-P,H=D.clientY-B;te.moved=$*$+H*H>m}te.event(D).zoom("mouse",r(_(te.that.__zoom,te.mouse[0]=ti(D,V),te.mouse[1]),te.extent,a))}function Q(D){G.on("mousemove.zoom mouseup.zoom",null),oq(D.view,te.moved),Os(D),te.event(D).end()}}function z(A,...K){if(e.apply(this,arguments)){var V=this.__zoom,te=ti(A.changedTouches?A.changedTouches[0]:A,this),G=V.invert(te),re=V.k*(A.shiftKey?.5:2),P=r(_(x(V,re),te,G),t.apply(this,K),a);Os(A),s>0?jn(this).transition().duration(s).call(E,P,te,A):jn(this).call(w.transform,P,te,A)}}function j(A,...K){if(e.apply(this,arguments)){var V=A.touches,te=V.length,G=I(this,K,A.changedTouches.length===te).event(A),re,P,B,X;for(g0(A),P=0;P<te;++P)B=V[P],X=ti(B,this),X=[X,this.__zoom.invert(X),B.identifier],G.touch0?!G.touch1&&G.touch0[2]!==X[2]&&(G.touch1=X,G.taps=0):(G.touch0=X,re=!0,G.taps=1+!!u);u&&(u=clearTimeout(u)),re&&(G.taps<2&&(h=X[0],u=setTimeout(function(){u=null},v)),Cu(this),G.start())}}function W(A,...K){if(this.__zooming){var V=I(this,K).event(A),te=A.changedTouches,G=te.length,re,P,B,X;for(Os(A),re=0;re<G;++re)P=te[re],B=ti(P,this),V.touch0&&V.touch0[2]===P.identifier?V.touch0[0]=B:V.touch1&&V.touch1[2]===P.identifier&&(V.touch1[0]=B);if(P=V.that.__zoom,V.touch1){var Q=V.touch0[0],D=V.touch0[1],$=V.touch1[0],H=V.touch1[1],q=(q=$[0]-Q[0])*q+(q=$[1]-Q[1])*q,Y=(Y=H[0]-D[0])*Y+(Y=H[1]-D[1])*Y;P=x(P,Math.sqrt(q/Y)),B=[(Q[0]+$[0])/2,(Q[1]+$[1])/2],X=[(D[0]+H[0])/2,(D[1]+H[1])/2]}else if(V.touch0)B=V.touch0[0],X=V.touch0[1];else return;V.zoom("touch",r(_(P,B,X),V.extent,a))}}function U(A,...K){if(this.__zooming){var V=I(this,K).event(A),te=A.changedTouches,G=te.length,re,P;for(g0(A),p&&clearTimeout(p),p=setTimeout(function(){p=null},v),re=0;re<G;++re)P=te[re],V.touch0&&V.touch0[2]===P.identifier?delete V.touch0:V.touch1&&V.touch1[2]===P.identifier&&delete V.touch1;if(V.touch1&&!V.touch0&&(V.touch0=V.touch1,delete V.touch1),V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2&&(P=ti(P,this),Math.hypot(h[0]-P[0],h[1]-P[1])<g)){var B=jn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return w.wheelDelta=function(A){return arguments.length?(n=typeof A=="function"?A:Zc(+A),w):n},w.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Zc(!!A),w):e},w.touchable=function(A){return arguments.length?(i=typeof A=="function"?A:Zc(!!A),w):i},w.extent=function(A){return arguments.length?(t=typeof A=="function"?A:Zc([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),w):t},w.scaleExtent=function(A){return arguments.length?(o[0]=+A[0],o[1]=+A[1],w):[o[0],o[1]]},w.translateExtent=function(A){return arguments.length?(a[0][0]=+A[0][0],a[1][0]=+A[1][0],a[0][1]=+A[0][1],a[1][1]=+A[1][1],w):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},w.constrain=function(A){return arguments.length?(r=A,w):r},w.duration=function(A){return arguments.length?(s=+A,w):s},w.interpolate=function(A){return arguments.length?(c=A,w):c},w.on=function(){var A=d.on.apply(d,arguments);return A===d?w:A},w.clickDistance=function(A){return arguments.length?(m=(A=+A)*A,w):Math.sqrt(m)},w.tapDistance=function(A){return arguments.length?(g=+A,w):g},w}function it(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yq(e,t){if(e){if(typeof e=="string")return Vw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vw(e,t)}}function Jne(e){if(Array.isArray(e))return e}function Qne(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(e);!(i=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));i=!0);}catch(c){o=!0,s=c}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function eie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
58
58
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xe(e,t){return Jne(e)||Qne(e,t)||yq(e,t)||eie()}var Da;(function(e){e.Strict="strict",e.Loose="loose"})(Da||(Da={}));var Mo;(function(e){e.Lines="lines",e.Dots="dots"})(Mo||(Mo={}));var _a;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(_a||(_a={}));var Yi;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Yi||(Yi={}));var nd;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(nd||(nd={}));var Oe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Oe||(Oe={}));var FS=function(t){return{width:t.offsetWidth,height:t.offsetHeight}},Oa=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;return Math.min(Math.max(t,r),n)},xq=function(t,r){return{x:Oa(t.x,r[0][0],r[1][0]),y:Oa(t.y,r[0][1],r[1][1])}},wq=function(t){var r,n;return((r=t.getRootNode)===null||r===void 0?void 0:r.call(t))||((n=window)===null||n===void 0?void 0:n.document)},tie=function(t,r){return{x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}},id=function(t){var r=t.x,n=t.y,i=t.width,o=t.height;return{x:r,y:n,x2:r+i,y2:n+o}},rie=function(t){var r=t.x,n=t.y,i=t.x2,o=t.y2;return{x:r,y:n,width:i-r,height:o-n}},Sq=function(t){return!isNaN(t)&&isFinite(t)},ur=Symbol("internals");function LP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ys(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LP(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BP(e,t){var r=e.find(function(d){return d.id===t.parentNode});if(r){var n=t.position.x+t.width-r.width,i=t.position.y+t.height-r.height;if(n>0||i>0||t.position.x<0||t.position.y<0){var o,a;if(r.style=Ys({},r.style)||{},r.style.width=(o=r.style.width)!==null&&o!==void 0?o:r.width,r.style.height=(a=r.style.height)!==null&&a!==void 0?a:r.height,n>0&&(r.style.width+=n),i>0&&(r.style.height+=i),t.position.x<0){var s=Math.abs(t.position.x);r.position.x=r.position.x-s,r.style.width+=s,t.position.x=0}if(t.position.y<0){var c=Math.abs(t.position.y);r.position.y=r.position.y-c,r.style.height+=c,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function Eq(e,t){if(e.some(function(n){return n.type==="reset"}))return e.filter(function(n){return n.type==="reset"}).map(function(n){return n.item});var r=e.filter(function(n){return n.type==="add"}).map(function(n){return n.item});return t.reduce(function(n,i){var o=e.find(function(c){return c.id===i.id});if(o)switch(o.type){case"select":return n.push(Ys(Ys({},i),{},{selected:o.selected})),n;case"position":{var a=Ys({},i);return typeof o.position<"u"&&(a.position=o.position),typeof o.positionAbsolute<"u"&&(a.positionAbsolute=o.positionAbsolute),typeof o.dragging<"u"&&(a.dragging=o.dragging),a.expandParent&&BP(n,a),n.push(a),n}case"dimensions":{var s=Ys({},i);return typeof o.dimensions<"u"&&(s.width=o.dimensions.width,s.height=o.dimensions.height),s.expandParent&&BP(n,s),n.push(s),n}case"remove":return n}return n.push(i),n},r)}function _q(e,t){return Eq(e,t)}function nie(e,t){return Eq(e,t)}var Ki=function(t,r){return{id:t,type:"select",selected:r}};function ya(e,t){return e.reduce(function(r,n){var i=t.includes(n.id);return!n.selected&&i?(n.selected=!0,r.push(Ki(n.id,!0))):n.selected&&!i&&(n.selected=!1,r.push(Ki(n.id,!1))),r},[])}function FP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oq(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FP(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var $P=function(t,r,n){var i=r.querySelectorAll(t);if(!i||!i.length)return null;var o=Array.from(i),a=r.getBoundingClientRect();return o.map(function(s){var c=s.getBoundingClientRect();return Oq({id:s.getAttribute("data-handleid"),position:s.getAttribute("data-handlepos"),x:(c.left-a.left)/n,y:(c.top-a.top)/n},FS(s))})};function Cs(e,t,r){return r===void 0?r:function(n){var i=t().nodeInternals.get(e);r(n,Oq({},i))}}function Cq(e){var t=e.id,r=e.store,n=r.getState(),i=n.addSelectedNodes,o=n.unselectNodesAndEdges,a=n.multiSelectionActive,s=n.nodeInternals,c=s.get(t);r.setState({nodesSelectionActive:!1}),c.selected?c.selected&&a&&o({nodes:[c]}):i([t])}function VP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VP(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var iie=function(t){return"id"in t&&"source"in t&&"target"in t},oie=function(t){var r=t.source,n=t.sourceHandle,i=t.target,o=t.targetHandle;return"reactflow__edge-".concat(r).concat(n||"","-").concat(i).concat(o||"")},Hw=function(t,r){if(typeof t>"u")return"";if(typeof t=="string")return t;var n=r?"".concat(r,"__"):"";return"".concat(n).concat(Object.keys(t).sort().map(function(i){return"".concat(i,"=").concat(t[i])}).join("&"))},aie=function(t,r){return r.some(function(n){return n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)})},sie=function(t,r){if(!t.source||!t.target)return process.env.NODE_ENV==="development"&&console.warn("[React Flow]: Can't create edge. An edge needs a source and a target. Help: https://reactflow.dev/error#600"),r;var n;return iie(t)?n=nl({},t):n=nl(nl({},t),{},{id:oie(t)}),aie(n,r)?r:r.concat(n)},Iq=function(t,r,n,i){var o=t.x,a=t.y,s=Xe(r,3),c=s[0],d=s[1],u=s[2],h=Xe(i,2),p=h[0],v=h[1],y={x:(o-c)/u,y:(a-d)/u};return n?{x:p*Math.round(y.x/p),y:v*Math.round(y.y/v)}:y},$S=function(t){if(t.length===0)return{x:0,y:0,width:0,height:0};var r=t.reduce(function(n,i){var o=i.positionAbsolute,a=i.position,s=i.width,c=i.height;return tie(n,id({x:o?o.x:a.x,y:o?o.y:a.y,width:s||0,height:c||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return rie(r)},Rq=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,1],i=Xe(n,3),o=i[0],a=i[1],s=i[2],c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,u=id({x:(r.x-o)/s,y:(r.y-a)/s,width:r.width/s,height:r.height/s}),h=[];return t.forEach(function(p){var v=p.positionAbsolute,y=p.width,m=p.height,g=p.selectable,w=g===void 0?!0:g;if(d&&!w)return!1;var x=id(nl(nl({},v),{},{width:y||0,height:m||0})),_=Math.max(0,Math.min(u.x2,x.x2)-Math.max(u.x,x.x)),S=Math.max(0,Math.min(u.y2,x.y2)-Math.max(u.y,x.y)),E=Math.ceil(_*S),I=typeof y>"u"||typeof m>"u"||y===null||m===null,N=c&&E>0,T=(y||0)*(m||0),M=I||N||E>=T;M&&h.push(p)}),h},Nq=function(t,r){var n=t.map(function(i){return i.id});return r.filter(function(i){return n.includes(i.source)||n.includes(i.target)})},Tq=function(t,r,n,i,o){var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:.1,s=r/(t.width*(1+a)),c=n/(t.height*(1+a)),d=Math.min(s,c),u=Oa(d,i,o),h=t.x+t.width/2,p=t.y+t.height/2,v=r/2-h*u,y=n/2-p*u;return[v,y,u]},mo=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return t.transition().duration(r)};function HP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HP(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pq(e,t,r,n){var i,o,a,s,c,d,u,h,p,v,y,m;if(!e.parentNode)return n;var g=t.get(e.parentNode);return Pq(g,t,r,{x:((i=n.x)!==null&&i!==void 0?i:0)+((o=(a=g.position)===null||a===void 0?void 0:a.x)!==null&&o!==void 0?o:0),y:((s=n.y)!==null&&s!==void 0?s:0)+((c=(d=g.position)===null||d===void 0?void 0:d.y)!==null&&c!==void 0?c:0),z:((u=(h=g[ur])===null||h===void 0?void 0:h.z)!==null&&u!==void 0?u:0)>((p=n.z)!==null&&p!==void 0?p:0)?(v=(y=g[ur])===null||y===void 0?void 0:y.z)!==null&&v!==void 0?v:0:(m=n.z)!==null&&m!==void 0?m:0})}function m0(e,t){var r=new Map,n={};return e.forEach(function(i){var o,a=Sq(i.zIndex)?i.zIndex:i.selected?1e3:0,s=t.get(i.id),c=xa(xa({width:s==null?void 0:s.width,height:s==null?void 0:s.height},i),{},{positionAbsolute:{x:i.position.x,y:i.position.y}});i.parentNode&&(c.parentNode=i.parentNode,n[i.parentNode]=!0),Object.defineProperty(c,ur,{enumerable:!1,value:{handleBounds:s==null||(o=s[ur])===null||o===void 0?void 0:o.handleBounds,z:a}}),r.set(i.id,c)}),r.forEach(function(i){if(i.parentNode&&!r.has(i.parentNode))throw new Error("Parent node ".concat(i.parentNode," not found"));if(i.parentNode||n[i.id]){var o,a,s=Pq(i,r,n,xa(xa({},i.position),{},{z:(o=(a=i[ur])===null||a===void 0?void 0:a.z)!==null&&o!==void 0?o:0})),c=s.x,d=s.y,u=s.z;i.positionAbsolute={x:c,y:d},i[ur].z=u,n[i.id]&&(i[ur].isParent=!0)}}),r}function Mq(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e(),n=r.nodeInternals,i=r.width,o=r.height,a=r.minZoom,s=r.maxZoom,c=r.d3Zoom,d=r.d3Selection,u=r.fitViewOnInitDone,h=r.fitViewOnInit;if((t.initial&&!u&&h||!t.initial)&&c&&d){var p=Array.from(n.values()).filter(function(T){return t.includeHiddenNodes?T.width&&T.height:!T.hidden}),v=p.every(function(T){return T.width&&T.height});if(p.length>0&&v){var y,m,g,w=$S(p),x=Tq(w,i,o,(y=t.minZoom)!==null&&y!==void 0?y:a,(m=t.maxZoom)!==null&&m!==void 0?m:s,(g=t.padding)!==null&&g!==void 0?g:.1),_=Xe(x,3),S=_[0],E=_[1],I=_[2],N=Co.translate(S,E).scale(I);return typeof t.duration=="number"&&t.duration>0?c.transform(mo(d,t.duration),N):c.transform(d,N),!0}}return!1}function lie(e,t){return e.forEach(function(r){var n=t.get(r.id);if(n){var i;t.set(n.id,xa(xa({},n),{},(i={},it(i,ur,n[ur]),it(i,"selected",r.selected),i)))}}),new Map(t)}function cie(e,t){return t.map(function(r){var n=e.find(function(i){return i.id===r.id});return n&&(r.selected=n.selected),r})}function Jc(e){var t=e.changedNodes,r=e.changedEdges,n=e.get,i=e.set,o=n(),a=o.nodeInternals,s=o.edges,c=o.onNodesChange,d=o.onEdgesChange,u=o.hasDefaultNodes,h=o.hasDefaultEdges;t!=null&&t.length&&(u&&i({nodeInternals:lie(t,a)}),c==null||c(t)),r!=null&&r.length&&(h&&i({edges:cie(r,s)}),d==null||d(r))}var Ww=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],WP={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:Ww,nodeExtent:Ww,nodesSelectionActive:!1,userSelectionActive:!1,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionMode:Da.Strict,domNode:null,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,reactFlowVersion:"10.3.17",connectionStartHandle:null,connectOnClick:!0};function UP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UP(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var VS=yee(),uie=VS.Provider,Vt=VS.useStore,Nr=VS.useStoreApi,die=function(){return bee(function(t,r){return Jn(Jn({},WP),{},{setNodes:function(i){t({nodeInternals:m0(i,r().nodeInternals)})},setEdges:function(i){var o=r(),a=o.defaultEdgeOptions,s=a===void 0?{}:a;t({edges:i.map(function(c){return Jn(Jn({},s),c)})})},setDefaultNodesAndEdges:function(i,o){var a=typeof i<"u",s=typeof o<"u",c=a?m0(i,new Map):new Map,d=s?o:[];t({nodeInternals:c,edges:d,hasDefaultNodes:a,hasDefaultEdges:s})},updateNodeDimensions:function(i){var o=r(),a=o.onNodesChange,s=o.nodeInternals,c=o.fitViewOnInit,d=o.fitViewOnInitDone,u=o.fitViewOnInitOptions,h=o.domNode,p=h==null?void 0:h.querySelector(".react-flow__viewport");if(p){var v=window.getComputedStyle(p),y=new window.DOMMatrixReadOnly(v.transform),m=y.m22,g=i.reduce(function(x,_){var S=s.get(_.id);if(S){var E=FS(_.nodeElement),I=!!(E.width&&E.height&&(S.width!==E.width||S.height!==E.height||_.forceUpdate));I&&(s.set(S.id,Jn(Jn({},S),{},it({},ur,Jn(Jn({},S[ur]),{},{handleBounds:{source:$P(".source",_.nodeElement,m),target:$P(".target",_.nodeElement,m)}})),E)),x.push({id:S.id,type:"dimensions",dimensions:E}))}return x},[]),w=d||c&&!d&&Mq(r,Jn({initial:!0},u));t({nodeInternals:new Map(s),fitViewOnInitDone:w}),(g==null?void 0:g.length)>0&&(a==null||a(g))}},updateNodePositions:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=r(),c=s.onNodesChange,d=s.nodeInternals,u=s.hasDefaultNodes;if(u||c){var h=i.map(function(y){var m={id:y.id,type:"position",dragging:a};return o&&(m.positionAbsolute=y.positionAbsolute,m.position=y.position),m});if(h!=null&&h.length){if(u){var p=_q(h,Array.from(d.values())),v=m0(p,d);t({nodeInternals:v})}c==null||c(h)}}},addSelectedNodes:function(i){var o=r(),a=o.multiSelectionActive,s=o.nodeInternals,c=o.edges,d,u=null;a?d=i.map(function(h){return Ki(h,!0)}):(d=ya(Array.from(s.values()),i),u=ya(c,[])),Jc({changedNodes:d,changedEdges:u,get:r,set:t})},addSelectedEdges:function(i){var o=r(),a=o.multiSelectionActive,s=o.edges,c=o.nodeInternals,d,u=null;a?d=i.map(function(h){return Ki(h,!0)}):(d=ya(s,i),u=ya(Array.from(c.values()),[])),Jc({changedNodes:u,changedEdges:d,get:r,set:t})},unselectNodesAndEdges:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=i.nodes,a=i.edges,s=r(),c=s.nodeInternals,d=s.edges,u=o||Array.from(c.values()),h=a||d,p=u.map(function(y){return y.selected=!1,Ki(y.id,!1)}),v=h.map(function(y){return Ki(y.id,!1)});Jc({changedNodes:p,changedEdges:v,get:r,set:t})},setMinZoom:function(i){var o=r(),a=o.d3Zoom,s=o.maxZoom;a==null||a.scaleExtent([i,s]),t({minZoom:i})},setMaxZoom:function(i){var o=r(),a=o.d3Zoom,s=o.minZoom;a==null||a.scaleExtent([s,i]),t({maxZoom:i})},setTranslateExtent:function(i){var o=r(),a=o.d3Zoom;a==null||a.translateExtent(i),t({translateExtent:i})},resetSelectedElements:function(){var i=r(),o=i.nodeInternals,a=i.edges,s=Array.from(o.values()),c=s.filter(function(u){return u.selected}).map(function(u){return Ki(u.id,!1)}),d=a.filter(function(u){return u.selected}).map(function(u){return Ki(u.id,!1)});Jc({changedNodes:c,changedEdges:d,get:r,set:t})},setNodeExtent:function(i){var o=r(),a=o.nodeInternals;a.forEach(function(s){s.positionAbsolute=xq(s.position,i)}),t({nodeExtent:i,nodeInternals:new Map(a)})},reset:function(){return t(Jn({},WP))}})})};function cn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,n;r<e.length;r++)(n=cn(e[r]))!==""&&(t+=(t&&" ")+n);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}function Wr(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Object.is(e[r[n]],t[r[n]]))return!1;return!0}function fie(e){if(Array.isArray(e))return Vw(e)}function hie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
59
59
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Io(e){return fie(e)||hie(e)||yq(e)||pie()}var vie={zoomIn:function(){},zoomOut:function(){},zoomTo:function(t){},getZoom:function(){return 1},setViewport:function(t){},getViewport:function(){return{x:0,y:0,zoom:1}},fitView:function(){},setCenter:function(t,r){},fitBounds:function(t){},project:function(t){return t},viewportInitialized:!1},gie=function(t){return{d3Zoom:t.d3Zoom,d3Selection:t.d3Selection}},mie=function(){var t=Nr(),r=Vt(gie,Wr),n=r.d3Zoom,i=r.d3Selection,o=C.useMemo(function(){return i&&n?{zoomIn:function(s){return n.scaleBy(mo(i,s==null?void 0:s.duration),1.2)},zoomOut:function(s){return n.scaleBy(mo(i,s==null?void 0:s.duration),1/1.2)},zoomTo:function(s,c){return n.scaleTo(mo(i,c==null?void 0:c.duration),s)},getZoom:function(){return t.getState().transform[2]},setViewport:function(s,c){var d,u,h,p=Xe(t.getState().transform,3),v=p[0],y=p[1],m=p[2],g=Co.translate((d=s.x)!==null&&d!==void 0?d:v,(u=s.y)!==null&&u!==void 0?u:y).scale((h=s.zoom)!==null&&h!==void 0?h:m);n.transform(mo(i,c==null?void 0:c.duration),g)},getViewport:function(){var s=Xe(t.getState().transform,3),c=s[0],d=s[1],u=s[2];return{x:c,y:d,zoom:u}},fitView:function(s){return Mq(t.getState,s)},setCenter:function(s,c,d){var u=t.getState(),h=u.width,p=u.height,v=u.maxZoom,y=typeof(d==null?void 0:d.zoom)<"u"?d.zoom:v,m=h/2-s*y,g=p/2-c*y,w=Co.translate(m,g).scale(y);n.transform(mo(i,d==null?void 0:d.duration),w)},fitBounds:function(s,c){var d,u=t.getState(),h=u.width,p=u.height,v=u.minZoom,y=u.maxZoom,m=Tq(s,h,p,v,y,(d=c==null?void 0:c.padding)!==null&&d!==void 0?d:.1),g=Xe(m,3),w=g[0],x=g[1],_=g[2],S=Co.translate(w,x).scale(_);n.transform(mo(i,c==null?void 0:c.duration),S)},project:function(s){var c=t.getState(),d=c.transform,u=c.snapToGrid,h=c.snapGrid;return Iq(s,d,u,h)},viewportInitialized:!0}:vie},[n,i]);return o};function GP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?GP(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kq(){var e=mie(),t=Nr(),r=C.useCallback(function(){var h=t.getState(),p=h.nodeInternals,v=Array.from(p.values());return v.map(function(y){return sa({},y)})},[]),n=C.useCallback(function(h){var p=t.getState(),v=p.nodeInternals;return v.get(h)},[]),i=C.useCallback(function(){var h=t.getState(),p=h.edges,v=p===void 0?[]:p;return v.map(function(y){return sa({},y)})},[]),o=C.useCallback(function(h){var p=t.getState(),v=p.edges,y=v===void 0?[]:v;return y.find(function(m){return m.id===h})},[]),a=C.useCallback(function(h){var p=t.getState(),v=p.nodeInternals,y=p.setNodes,m=p.hasDefaultNodes,g=p.onNodesChange,w=Array.from(v.values()),x=typeof h=="function"?h(w):h;if(m)y(x);else if(g){var _=x.length===0?w.map(function(S){return{type:"remove",id:S.id}}):x.map(function(S){return{item:S,type:"reset"}});g(_)}},[]),s=C.useCallback(function(h){var p=t.getState(),v=p.edges,y=v===void 0?[]:v,m=p.setEdges,g=p.hasDefaultEdges,w=p.onEdgesChange,x=typeof h=="function"?h(y):h;if(g)m(x);else if(w){var _=x.length===0?y.map(function(S){return{type:"remove",id:S.id}}):x.map(function(S){return{item:S,type:"reset"}});w(_)}},[]),c=C.useCallback(function(h){var p=Array.isArray(h)?h:[h],v=t.getState(),y=v.nodeInternals,m=v.setNodes,g=v.hasDefaultNodes,w=v.onNodesChange;if(g){var x=Array.from(y.values()),_=[].concat(x,Io(p));m(_)}else if(w){var S=p.map(function(E){return{item:E,type:"add"}});w(S)}},[]),d=C.useCallback(function(h){var p=Array.isArray(h)?h:[h],v=t.getState(),y=v.edges,m=y===void 0?[]:y,g=v.setEdges,w=v.hasDefaultEdges,x=v.onEdgesChange;if(w)g([].concat(Io(m),Io(p)));else if(x){var _=p.map(function(S){return{item:S,type:"add"}});x(_)}},[]),u=C.useCallback(function(){var h=t.getState(),p=h.nodeInternals,v=h.edges,y=v===void 0?[]:v,m=h.transform,g=Array.from(p.values()),w=Xe(m,3),x=w[0],_=w[1],S=w[2];return{nodes:g.map(function(E){return sa({},E)}),edges:y.map(function(E){return sa({},E)}),viewport:{x,y:_,zoom:S}}},[]);return C.useMemo(function(){return sa(sa({},e),{},{getNodes:r,getNode:n,getEdges:i,getEdge:o,setNodes:a,setEdges:s,addNodes:c,addEdges:d,toObject:u})},[e,r,n,i,o,a,s,c,d,u])}function bie(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function Kd(e,t){if(e==null)return{};var r=bie(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yie(){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},C.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function xie(){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},C.createElement("path",{d:"M0 0h32v4.2H0z"}))}function wie(){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},C.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function Sie(){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},C.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function Eie(){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},C.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}var _ie=["children","className"];function KP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?KP(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):KP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Qc=function(t){var r=t.children,n=t.className,i=Kd(t,_ie);return C.createElement("button",Oie({type:"button",className:cn(["react-flow__controls-button",n])},i),r)},Cie=function(t){return t.nodesDraggable&&t.nodesConnectable&&t.elementsSelectable},Iie=function(t){var r=t.style,n=t.showZoom,i=n===void 0?!0:n,o=t.showFitView,a=o===void 0?!0:o,s=t.showInteractive,c=s===void 0?!0:s,d=t.fitViewOptions,u=t.onZoomIn,h=t.onZoomOut,p=t.onFitView,v=t.onInteractiveChange,y=t.className,m=t.children,g=Nr(),w=C.useState(!1),x=Xe(w,2),_=x[0],S=x[1],E=Vt(Cie),I=kq(),N=I.zoomIn,T=I.zoomOut,M=I.fitView;if(C.useEffect(function(){S(!0)},[]),!_)return null;var z=function(){N==null||N(),u==null||u()},j=function(){T==null||T(),h==null||h()},W=function(){M==null||M(d),p==null||p()},U=function(){g.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),v==null||v(!E)};return C.createElement("div",{className:cn(["react-flow__controls",y]),style:r},i&&C.createElement(C.Fragment,null,C.createElement(Qc,{onClick:z,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in"},C.createElement(yie,null)),C.createElement(Qc,{onClick:j,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out"},C.createElement(xie,null))),a&&C.createElement(Qc,{className:"react-flow__controls-fitview",onClick:W,title:"fit view","aria-label":"fit view"},C.createElement(wie,null)),c&&C.createElement(Qc,{className:"react-flow__controls-interactive",onClick:U,title:"toggle interactivity","aria-label":"toggle interactivity"},E?C.createElement(Eie,null):C.createElement(Sie,null)),m)};Iie.displayName="Controls";var Rie=function(t,r,n){return C.createElement("path",{stroke:n,strokeWidth:r,d:"M".concat(t/2," 0 V").concat(t," M0 ").concat(t/2," H").concat(t)})},Nie=function(t,r){return C.createElement("circle",{cx:t,cy:t,r:t,fill:r})},eu;function YP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function XP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YP(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Tie=(eu={},it(eu,Mo.Dots,"#81818a"),it(eu,Mo.Lines,"#eee"),eu),Pie=function(t){return t.transform},Aq=function(t){var r=t.variant,n=r===void 0?Mo.Dots:r,i=t.gap,o=i===void 0?15:i,a=t.size,s=a===void 0?.4:a,c=t.color,d=t.style,u=t.className,h=C.useRef(null),p=C.useState(null),v=Xe(p,2),y=v[0],m=v[1],g=Vt(Pie),w=Xe(g,3),x=w[0],_=w[1],S=w[2];C.useEffect(function(){var j=document.querySelectorAll(".react-flow__background"),W=Array.from(j).findIndex(function(U){return U===h.current});m("pattern-".concat(W))},[]);var E=o*S||1,I=x%E,N=_%E,T=n===Mo.Lines,M=c||Tie[n],z=T?Rie(E,s,M):Nie(s*S,M);return C.createElement("svg",{className:cn(["react-flow__background","react-flow__container",u]),style:XP(XP({},d),{},{width:"100%",height:"100%"}),ref:h},y&&C.createElement(C.Fragment,null,C.createElement("pattern",{id:y,x:I,y:N,width:E,height:E,patternUnits:"userSpaceOnUse"},z),C.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#".concat(y,")")})))};Aq.displayName="Background";var Mie=C.memo(Aq),kie=["paid-pro","paid-sponsor","paid-enterprise","paid-custom"];function Aie(e){var t=e.proOptions,r=e.position,n=r===void 0?"bottom-right":r;if(t!=null&&t.account&&kie.includes(t==null?void 0:t.account)&&t!==null&&t!==void 0&&t.hideAttribution)return null;var i="".concat(n).split("-");return C.createElement("div",{className:cn(["react-flow__attribution"].concat(Io(i))),"data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev/pricing"},C.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer"},"React Flow"))}var Die=["x","y","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","children","className"];function ZP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function jie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZP(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var qie=function(t){var r=t.x,n=t.y,i=t.label,o=t.labelStyle,a=o===void 0?{}:o,s=t.labelShowBg,c=s===void 0?!0:s,d=t.labelBgStyle,u=d===void 0?{}:d,h=t.labelBgPadding,p=h===void 0?[2,4]:h,v=t.labelBgBorderRadius,y=v===void 0?2:v,m=t.children,g=t.className,w=Kd(t,Die),x=C.useRef(null),_=C.useState({x:0,y:0,width:0,height:0}),S=Xe(_,2),E=S[0],I=S[1],N=cn(["react-flow__edge-textwrapper",g]);return C.useEffect(function(){if(x.current){var T=x.current.getBBox();I({x:T.x,y:T.y,width:T.width,height:T.height})}},[i]),typeof i>"u"||!i?null:C.createElement("g",jie({transform:"translate(".concat(r-E.width/2," ").concat(n-E.height/2,")"),className:N},w),c&&C.createElement("rect",{width:E.width+2*p[0],x:-p[0],y:-p[1],height:E.height+2*p[1],className:"react-flow__edge-textbg",style:u,rx:y,ry:y}),C.createElement("text",{className:"react-flow__edge-text",y:E.height/2,dy:"0.3em",ref:x,style:a},i),m)},zie=C.memo(qie),Yd=(function(e){var t=e.path,r=e.centerX,n=e.centerY,i=e.label,o=e.labelStyle,a=e.labelShowBg,s=e.labelBgStyle,c=e.labelBgPadding,d=e.labelBgBorderRadius,u=e.style,h=e.markerEnd,p=e.markerStart,v=i?C.createElement(zie,{x:r,y:n,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:c,labelBgBorderRadius:d}):null;return C.createElement(C.Fragment,null,C.createElement("path",{style:u,d:t,className:"react-flow__edge-path",markerEnd:h,markerStart:p}),v)});function od(e){var t=e.pos,r=e.x1,n=e.y1,i=e.x2,o=e.y2,a,s;switch(t){case Oe.Left:case Oe.Right:a=.5*(r+i),s=n;break;case Oe.Top:case Oe.Bottom:a=r,s=.5*(n+o);break}return[a,s]}function Dq(e){var t=e.sourceX,r=e.sourceY,n=e.sourcePosition,i=n===void 0?Oe.Bottom:n,o=e.targetX,a=e.targetY,s=e.targetPosition,c=s===void 0?Oe.Top:s,d=od({pos:i,x1:t,y1:r,x2:o,y2:a}),u=Xe(d,2),h=u[0],p=u[1],v=od({pos:c,x1:o,y1:a,x2:t,y2:r}),y=Xe(v,2),m=y[0],g=y[1];return"M".concat(t,",").concat(r," C").concat(h,",").concat(p," ").concat(m,",").concat(g," ").concat(o,",").concat(a)}function Lie(e){var t=e.sourceX,r=e.sourceY,n=e.sourcePosition,i=n===void 0?Oe.Bottom:n,o=e.targetX,a=e.targetY,s=e.targetPosition,c=s===void 0?Oe.Top:s,d=od({pos:i,x1:t,y1:r,x2:o,y2:a}),u=Xe(d,2),h=u[0],p=u[1],v=od({pos:c,x1:o,y1:a,x2:t,y2:r}),y=Xe(v,2),m=y[0],g=y[1],w=t*.125+h*.375+m*.375+o*.125,x=r*.125+p*.375+g*.375+a*.125,_=Math.abs(w-t),S=Math.abs(x-r);return[w,x,_,S]}var jq=C.memo(function(e){var t=e.sourceX,r=e.sourceY,n=e.targetX,i=e.targetY,o=e.sourcePosition,a=o===void 0?Oe.Bottom:o,s=e.targetPosition,c=s===void 0?Oe.Top:s,d=e.label,u=e.labelStyle,h=e.labelShowBg,p=e.labelBgStyle,v=e.labelBgPadding,y=e.labelBgBorderRadius,m=e.style,g=e.markerEnd,w=e.markerStart,x={sourceX:t,sourceY:r,sourcePosition:a,targetX:n,targetY:i,targetPosition:c},_=Dq(x),S=Lie(x),E=Xe(S,2),I=E[0],N=E[1];return C.createElement(Yd,{path:_,centerX:I,centerY:N,label:d,labelStyle:u,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:y,style:m,markerEnd:g,markerStart:w})});function JP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JP(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var QP=[Oe.Left,Oe.Right],qq=function(t){var r=t.sourceX,n=t.sourceY,i=t.targetX,o=t.targetY,a=t.sourcePosition,s=a===void 0?Oe.Bottom:a,c=t.targetPosition,d=c===void 0?Oe.Top:c,u=QP.includes(s),h=QP.includes(d),p=u&&!h||h&&!u;if(p){var v=u?Math.abs(i-r):0,y=r>i?r-v:r+v,m=u?0:Math.abs(o-n),g=n<o?n+m:n-m;return[y,g,v,m]}var w=Math.abs(i-r)/2,x=i<r?i+w:i-w,_=Math.abs(o-n)/2,S=o<n?o+_:o-_;return[x,S,w,_]};function Is(e,t,r){return r===void 0?r:function(n){var i=t().edges.find(function(o){return o.id===e});r(n,Bie({},i))}}var b0=function(t,r,n){return"L ".concat(t,",").concat(r-n,"Q ").concat(t,",").concat(r," ").concat(t+n,",").concat(r)},y0=function(t,r,n){return"L ".concat(t+n,",").concat(r,"Q ").concat(t,",").concat(r," ").concat(t,",").concat(r-n)},x0=function(t,r,n){return"L ".concat(t,",").concat(r-n,"Q ").concat(t,",").concat(r," ").concat(t-n,",").concat(r)},w0=function(t,r,n){return"L ".concat(t-n,",").concat(r,"Q ").concat(t,",").concat(r," ").concat(t,",").concat(r-n)},S0=function(t,r,n){return"L ".concat(t+n,",").concat(r,"Q ").concat(t,",").concat(r," ").concat(t,",").concat(r+n)},E0=function(t,r,n){return"L ".concat(t,",").concat(r+n,"Q ").concat(t,",").concat(r," ").concat(t+n,",").concat(r)},_0=function(t,r,n){return"L ".concat(t,",").concat(r+n,"Q ").concat(t,",").concat(r," ").concat(t-n,",").concat(r)},O0=function(t,r,n){return"L ".concat(t-n,",").concat(r,"Q ").concat(t,",").concat(r," ").concat(t,",").concat(r+n)};function Uw(e){var t=e.sourceX,r=e.sourceY,n=e.sourcePosition,i=n===void 0?Oe.Bottom:n,o=e.targetX,a=e.targetY,s=e.targetPosition,c=s===void 0?Oe.Top:s,d=e.borderRadius,u=d===void 0?5:d,h=e.centerX,p=e.centerY,v=qq({sourceX:t,sourceY:r,targetX:o,targetY:a}),y=Xe(v,4),m=y[0],g=y[1],w=y[2],x=y[3],_=Math.min(u,Math.abs(o-t)),S=Math.min(u,Math.abs(a-r)),E=Math.min(_,S,w,x),I=[Oe.Left,Oe.Right],N=typeof h<"u"?h:m,T=typeof p<"u"?p:g,M=null,z=null;return t<=o?(M=r<=a?b0(t,T,E):E0(t,T,E),z=r<=a?O0(o,T,E):w0(o,T,E)):(M=r<a?x0(t,T,E):_0(t,T,E),z=r<a?S0(o,T,E):y0(o,T,E)),I.includes(i)&&I.includes(c)?t<=o?(M=r<=a?O0(N,r,E):w0(N,r,E),z=r<=a?b0(N,a,E):E0(N,a,E)):(i===Oe.Right&&c===Oe.Left||i===Oe.Left&&c===Oe.Right||i===Oe.Left&&c===Oe.Left)&&(M=r<=a?S0(N,r,E):y0(N,r,E),z=r<=a?x0(N,a,E):_0(N,a,E)):I.includes(i)&&!I.includes(c)?(t<=o?M=r<=a?O0(o,r,E):w0(o,r,E):M=r<=a?S0(o,r,E):y0(o,r,E),z=""):!I.includes(i)&&I.includes(c)&&(t<=o?M=r<=a?b0(t,a,E):E0(t,a,E):M=r<=a?x0(t,a,E):_0(t,a,E),z=""),"M ".concat(t,",").concat(r).concat(M).concat(z,"L ").concat(o,",").concat(a)}var HS=C.memo(function(e){var t=e.sourceX,r=e.sourceY,n=e.targetX,i=e.targetY,o=e.label,a=e.labelStyle,s=e.labelShowBg,c=e.labelBgStyle,d=e.labelBgPadding,u=e.labelBgBorderRadius,h=e.style,p=e.sourcePosition,v=p===void 0?Oe.Bottom:p,y=e.targetPosition,m=y===void 0?Oe.Top:y,g=e.markerEnd,w=e.markerStart,x=e.borderRadius,_=x===void 0?5:x,S=qq({sourceX:t,sourceY:r,targetX:n,targetY:i,sourcePosition:v,targetPosition:m}),E=Xe(S,2),I=E[0],N=E[1],T=Uw({sourceX:t,sourceY:r,sourcePosition:v,targetX:n,targetY:i,targetPosition:m,borderRadius:_});return C.createElement(Yd,{path:T,centerX:I,centerY:N,label:o,labelStyle:a,labelShowBg:s,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:h,markerEnd:g,markerStart:w})});function e5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function t5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?e5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var zq=C.memo(function(e){return C.createElement(HS,t5(t5({},e),{},{borderRadius:0}))}),Lq=C.memo(function(e){var t=e.sourceX,r=e.sourceY,n=e.targetX,i=e.targetY,o=e.label,a=e.labelStyle,s=e.labelShowBg,c=e.labelBgStyle,d=e.labelBgPadding,u=e.labelBgBorderRadius,h=e.style,p=e.markerEnd,v=e.markerStart,y=Math.abs(i-r)/2,m=i<r?i+y:i-y,g=Math.abs(n-t)/2,w=n<t?n+g:n-g,x="M ".concat(t,",").concat(r,"L ").concat(n,",").concat(i);return C.createElement(Yd,{path:x,centerX:w,centerY:m,label:o,labelStyle:a,labelShowBg:s,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:u,style:h,markerEnd:p,markerStart:v})});function tu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ad(e){var t=e.pos,r=e.x1,n=e.y1,i=e.x2,o=e.y2,a=e.c,s,c;switch(t){case Oe.Left:s=r-tu(r-i,a),c=n;break;case Oe.Right:s=r+tu(i-r,a),c=n;break;case Oe.Top:s=r,c=n-tu(n-o,a);break;case Oe.Bottom:s=r,c=n+tu(o-n,a);break}return[s,c]}function Xd(e){var t=e.sourceX,r=e.sourceY,n=e.sourcePosition,i=n===void 0?Oe.Bottom:n,o=e.targetX,a=e.targetY,s=e.targetPosition,c=s===void 0?Oe.Top:s,d=e.curvature,u=d===void 0?.25:d,h=ad({pos:i,x1:t,y1:r,x2:o,y2:a,c:u}),p=Xe(h,2),v=p[0],y=p[1],m=ad({pos:c,x1:o,y1:a,x2:t,y2:r,c:u}),g=Xe(m,2),w=g[0],x=g[1];return"M".concat(t,",").concat(r," C").concat(v,",").concat(y," ").concat(w,",").concat(x," ").concat(o,",").concat(a)}function Fie(e){var t=e.sourceX,r=e.sourceY,n=e.sourcePosition,i=n===void 0?Oe.Bottom:n,o=e.targetX,a=e.targetY,s=e.targetPosition,c=s===void 0?Oe.Top:s,d=e.curvature,u=d===void 0?.25:d,h=ad({pos:i,x1:t,y1:r,x2:o,y2:a,c:u}),p=Xe(h,2),v=p[0],y=p[1],m=ad({pos:c,x1:o,y1:a,x2:t,y2:r,c:u}),g=Xe(m,2),w=g[0],x=g[1],_=t*.125+v*.375+w*.375+o*.125,S=r*.125+y*.375+x*.375+a*.125,E=Math.abs(_-t),I=Math.abs(S-r);return[_,S,E,I]}var Gw=C.memo(function(e){var t=e.sourceX,r=e.sourceY,n=e.targetX,i=e.targetY,o=e.sourcePosition,a=o===void 0?Oe.Bottom:o,s=e.targetPosition,c=s===void 0?Oe.Top:s,d=e.label,u=e.labelStyle,h=e.labelShowBg,p=e.labelBgStyle,v=e.labelBgPadding,y=e.labelBgBorderRadius,m=e.style,g=e.markerEnd,w=e.markerStart,x=e.curvature,_={sourceX:t,sourceY:r,sourcePosition:a,targetX:n,targetY:i,targetPosition:c,curvature:x},S=Xd(_),E=Fie(_),I=Xe(E,2),N=I[0],T=I[1];return C.createElement(Yd,{path:S,centerX:N,centerY:T,label:d,labelStyle:u,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:y,style:m,markerEnd:g,markerStart:w})}),WS=C.createContext(null),$ie=WS.Provider;WS.Consumer;function Kw(e,t,r,n,i,o,a){var s=a.elementFromPoint(e.clientX,e.clientY),c=(s==null?void 0:s.classList.contains("target"))||!1,d=(s==null?void 0:s.classList.contains("source"))||!1,u={elementBelow:s,isValid:!1,connection:{source:null,target:null,sourceHandle:null,targetHandle:null},isHoveringHandle:!1};if(s&&(c||d)){u.isHoveringHandle=!0;var h=s.getAttribute("data-nodeid"),p=s.getAttribute("data-handleid"),v=r?{source:h,sourceHandle:p,target:n,targetHandle:i}:{source:n,sourceHandle:i,target:h,targetHandle:p};u.connection=v;var y=t===Da.Strict?r&&d||!r&&c:!0;y&&(u.isValid=o(v))}return u}function C0(e){e==null||e.classList.remove("react-flow__handle-valid"),e==null||e.classList.remove("react-flow__handle-connecting")}function Bq(e){var t=e.event,r=e.handleId,n=e.nodeId,i=e.onConnect,o=e.isTarget,a=e.getState,s=e.setState,c=e.isValidConnection,d=e.elementEdgeUpdaterType,u=e.onEdgeUpdateEnd,h=t.target.closest(".react-flow"),p=wq(t.target);if(!p)return;var v=p.elementFromPoint(t.clientX,t.clientY),y=v==null?void 0:v.classList.contains("target"),m=v==null?void 0:v.classList.contains("source");if(!h||!y&&!m&&!d)return;var g=a(),w=g.onConnectStart,x=g.connectionMode,_=d||(y?"target":"source"),S=h.getBoundingClientRect(),E;s({connectionPosition:{x:t.clientX-S.left,y:t.clientY-S.top},connectionNodeId:n,connectionHandleId:r,connectionHandleType:_}),w==null||w(t,{nodeId:n,handleId:r,handleType:_});function I(T){s({connectionPosition:{x:T.clientX-S.left,y:T.clientY-S.top}});var M=Kw(T,x,o,n,r,c,p),z=M.connection,j=M.elementBelow,W=M.isValid,U=M.isHoveringHandle;if(!U)return C0(E);z.source!==z.target&&j&&(C0(E),E=j,j.classList.add("react-flow__handle-connecting"),j.classList.toggle("react-flow__handle-valid",W))}function N(T){var M=a(),z=M.onConnectStop,j=M.onConnectEnd,W=Kw(T,x,o,n,r,c,p),U=W.connection,A=W.isValid;z==null||z(T),A&&(i==null||i(U)),j==null||j(T),d&&u&&u(T),C0(E),s({connectionNodeId:null,connectionHandleId:null,connectionHandleType:null}),p.removeEventListener("mousemove",I),p.removeEventListener("mouseup",N)}p.addEventListener("mousemove",I),p.addEventListener("mouseup",N)}var Vie=["type","position","isValidConnection","isConnectable","id","onConnect","children","className","onMouseDown"];function r5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function I0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?r5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):r5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Hie=function(){return!0},Wie=function(t){return{connectionStartHandle:t.connectionStartHandle,connectOnClick:t.connectOnClick}},Fq=C.forwardRef(function(e,t){var r=e.type,n=r===void 0?"source":r,i=e.position,o=i===void 0?Oe.Top:i,a=e.isValidConnection,s=a===void 0?Hie:a,c=e.isConnectable,d=c===void 0?!0:c,u=e.id,h=e.onConnect,p=e.children,v=e.className,y=e.onMouseDown,m=Kd(e,Vie),g=Nr(),w=C.useContext(WS),x=Vt(Wie,Wr),_=x.connectionStartHandle,S=x.connectOnClick,E=u||null,I=n==="target",N=function(j){var W=g.getState(),U=W.defaultEdgeOptions,A=W.onConnect,K=W.hasDefaultEdges,V=I0(I0({},U),j);if(K){var te=g.getState(),G=te.edges;g.setState({edges:sie(V,G)})}A==null||A(V),h==null||h(V)},T=function(j){j.button===0&&Bq({event:j,handleId:E,nodeId:w,onConnect:N,isTarget:I,getState:g.getState,setState:g.setState,isValidConnection:s}),y==null||y(j)},M=function(j){var W=g.getState(),U=W.onClickConnectStart,A=W.onClickConnectStop,K=W.onClickConnectEnd,V=W.connectionMode;if(!_){U==null||U(j,{nodeId:w,handleId:E,handleType:n}),g.setState({connectionStartHandle:{nodeId:w,type:n,handleId:E}});return}var te=wq(j.target),G=Kw(j,V,_.type==="target",_.nodeId,_.handleId||null,s,te),re=G.connection,P=G.isValid;A==null||A(j),P&&N(re),K==null||K(j),g.setState({connectionStartHandle:null})};return C.createElement("div",I0({"data-handleid":E,"data-nodeid":w,"data-handlepos":o,className:cn(["react-flow__handle","react-flow__handle-".concat(o),"nodrag",v,{source:!I,target:I,connectable:d,connecting:(_==null?void 0:_.nodeId)===w&&(_==null?void 0:_.handleId)===E&&(_==null?void 0:_.type)===n}]),onMouseDown:T,onClick:S?M:void 0,ref:t},m),p)});Fq.displayName="Handle";var sd=C.memo(Fq),$q=function(t){var r=t.data,n=t.isConnectable,i=t.targetPosition,o=i===void 0?Oe.Top:i,a=t.sourcePosition,s=a===void 0?Oe.Bottom:a;return C.createElement(C.Fragment,null,C.createElement(sd,{type:"target",position:o,isConnectable:n}),r==null?void 0:r.label,C.createElement(sd,{type:"source",position:s,isConnectable:n}))};$q.displayName="DefaultNode";var Yw=C.memo($q),Vq=function(t){var r=t.data,n=t.isConnectable,i=t.sourcePosition,o=i===void 0?Oe.Bottom:i;return C.createElement(C.Fragment,null,r==null?void 0:r.label,C.createElement(sd,{type:"source",position:o,isConnectable:n}))};Vq.displayName="InputNode";var Hq=C.memo(Vq),Wq=function(t){var r=t.data,n=t.isConnectable,i=t.targetPosition,o=i===void 0?Oe.Top:i;return C.createElement(C.Fragment,null,C.createElement(sd,{type:"target",position:o,isConnectable:n}),r==null?void 0:r.label)};Wq.displayName="OutputNode";var Uq=C.memo(Wq),Uie=function(t){return{selectedNodes:Array.from(t.nodeInternals.values()).filter(function(r){return r.selected}),selectedEdges:t.edges.filter(function(r){return r.selected})}},Gie=function(t,r){var n=t.selectedNodes.map(function(s){return s.id}),i=r.selectedNodes.map(function(s){return s.id}),o=t.selectedEdges.map(function(s){return s.id}),a=r.selectedEdges.map(function(s){return s.id});return Wr(n,i)&&Wr(o,a)};function Kie(e){var t=e.onSelectionChange,r=Vt(Uie,Gie),n=r.selectedNodes,i=r.selectedEdges;return C.useEffect(function(){t({nodes:n,edges:i})},[n,i]),null}var Yie=C.memo(Kie),Xie=function(t){return{setNodes:t.setNodes,setEdges:t.setEdges,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset}};function Vi(e,t){C.useEffect(function(){typeof e<"u"&&t(e)},[e])}function bt(e,t,r){C.useEffect(function(){typeof t<"u"&&r(it({},e,t))},[t])}var Zie=function(t){var r=t.nodes,n=t.edges,i=t.defaultNodes,o=t.defaultEdges,a=t.onConnect,s=t.onConnectStart,c=t.onConnectStop,d=t.onConnectEnd,u=t.onClickConnectStart,h=t.onClickConnectStop,p=t.onClickConnectEnd,v=t.nodesDraggable,y=t.nodesConnectable,m=t.minZoom,g=t.maxZoom,w=t.nodeExtent,x=t.onNodesChange,_=t.onEdgesChange,S=t.elementsSelectable,E=t.connectionMode,I=t.snapGrid,N=t.snapToGrid,T=t.translateExtent,M=t.connectOnClick,z=t.defaultEdgeOptions,j=t.fitView,W=t.fitViewOptions,U=t.onNodesDelete,A=t.onEdgesDelete,K=t.onNodeDrag,V=t.onNodeDragStart,te=t.onNodeDragStop,G=t.onSelectionDrag,re=t.onSelectionDragStart,P=t.onSelectionDragStop,B=Vt(Xie,Wr),X=B.setNodes,Q=B.setEdges,D=B.setDefaultNodesAndEdges,$=B.setMinZoom,H=B.setMaxZoom,q=B.setTranslateExtent,Y=B.setNodeExtent,ie=B.reset,ne=Nr();return C.useEffect(function(){return D(i,o),function(){ie()}},[]),bt("defaultEdgeOptions",z,ne.setState),bt("connectionMode",E,ne.setState),bt("onConnect",a,ne.setState),bt("onConnectStart",s,ne.setState),bt("onConnectStop",c,ne.setState),bt("onConnectEnd",d,ne.setState),bt("onClickConnectStart",u,ne.setState),bt("onClickConnectStop",h,ne.setState),bt("onClickConnectEnd",p,ne.setState),bt("nodesDraggable",v,ne.setState),bt("nodesConnectable",y,ne.setState),bt("elementsSelectable",S,ne.setState),bt("snapToGrid",N,ne.setState),bt("snapGrid",I,ne.setState),bt("onNodesChange",x,ne.setState),bt("onEdgesChange",_,ne.setState),bt("connectOnClick",M,ne.setState),bt("fitViewOnInit",j,ne.setState),bt("fitViewOnInitOptions",W,ne.setState),bt("onNodesDelete",U,ne.setState),bt("onEdgesDelete",A,ne.setState),bt("onNodeDrag",K,ne.setState),bt("onNodeDragStart",V,ne.setState),bt("onNodeDragStop",te,ne.setState),bt("onSelectionDrag",G,ne.setState),bt("onSelectionDragStart",re,ne.setState),bt("onSelectionDragStop",P,ne.setState),Vi(r,X),Vi(n,Q),Vi(i,X),Vi(o,Q),Vi(m,$),Vi(g,H),Vi(T,q),Vi(w,Y),null},Jie=".react-flow{height:100%;overflow:hidden;position:relative;width:100%}.react-flow__container{height:100%;left:0;position:absolute;top:0;width:100%}.react-flow__pane{z-index:1}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selectionpane{z-index:5}.react-flow .react-flow__edges{overflow:visible;pointer-events:none}.react-flow .react-flow__connectionline{z-index:1001}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.inactive{pointer-events:none}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edge-path{fill:none}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__connection-path{fill:none}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:-webkit-grab;cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{pointer-events:none;position:absolute}.react-flow__handle.connectable{pointer-events:all}.react-flow__handle-bottom{bottom:-4px;left:50%;top:auto;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{left:-4px;top:50%;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__controls{bottom:20px;left:15px;position:absolute;z-index:5}.react-flow__controls-button{border:none;height:24px;width:24px}.react-flow__controls-button svg{width:100%}.react-flow__minimap{bottom:20px;position:absolute;right:15px;z-index:5}.react-flow__attribution{background:hsla(0,0%,100%,.5);color:#999;font-size:10px;padding:2px 3px;position:absolute;z-index:1000}.react-flow__attribution a{color:#555;text-decoration:none}.react-flow__attribution.top{top:0}.react-flow__attribution.bottom{bottom:0}.react-flow__attribution.left{left:0}.react-flow__attribution.right{right:0}.react-flow__attribution.center{left:50%;transform:translateX(-50%)}",Qie=Jie,eoe=".react-flow__edge.selected .react-flow__edge-path{stroke:#555}.react-flow__edge.animated path{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-path{stroke:#b1b1b7;stroke-width:1}.react-flow__edge-text{font-size:10px}.react-flow__edge-textbg{fill:#fff}.react-flow__connection-path{stroke:#b1b1b7;stroke-width:1}.react-flow__node{cursor:-webkit-grab;cursor:grab}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background:#fff;border:1px solid #1a192b;border-radius:3px;color:#222;font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selected,.react-flow__node-group.selected,.react-flow__node-input.selected,.react-flow__node-output.selected{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-default .react-flow__handle,.react-flow__node-group .react-flow__handle,.react-flow__node-input .react-flow__handle,.react-flow__node-output .react-flow__handle{background:#1a192b}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:0 1px 4px 1px rgba(0,0,0,.08)}.react-flow__node-default.selectable.selected,.react-flow__node-group.selectable.selected,.react-flow__node-input.selectable.selected,.react-flow__node-output.selectable.selected{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background:hsla(0,0%,94%,.25);border-color:#1a192b}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__handle{background:#555;border:1px solid #fff;border-radius:100%;height:6px;width:6px}.react-flow__handle.connectable{cursor:crosshair}.react-flow__minimap{background-color:#fff}.react-flow__controls{box-shadow:0 0 2px 1px rgba(0,0,0,.08)}.react-flow__controls-button{align-items:center;background:#fefefe;border-bottom:1px solid #eee;box-sizing:content-box;cursor:pointer;display:flex;height:16px;justify-content:center;padding:5px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:16px}.react-flow__controls-button svg{max-height:12px;max-width:12px}.react-flow__controls-button:hover{background:#f4f4f4}",toe=eoe,roe=function(t,r,n){return n===Oe.Left?t-r:n===Oe.Right?t+r:t},noe=function(t,r,n){return n===Oe.Top?t-r:n===Oe.Bottom?t+r:t},n5=function(t){var r=t.className,n=t.position,i=t.centerX,o=t.centerY,a=t.radius,s=a===void 0?10:a;return C.createElement("circle",{className:cn(["react-flow__edgeupdater",r]),cx:roe(i,s,n),cy:noe(o,s,n),r:s,stroke:"transparent",fill:"transparent"})},la=(function(e){var t=function(n){var i=n.id,o=n.className,a=n.type,s=n.data,c=n.onClick,d=n.onEdgeDoubleClick,u=n.selected,h=n.animated,p=n.label,v=n.labelStyle,y=n.labelShowBg,m=n.labelBgStyle,g=n.labelBgPadding,w=n.labelBgBorderRadius,x=n.style,_=n.source,S=n.target,E=n.sourceX,I=n.sourceY,N=n.targetX,T=n.targetY,M=n.sourcePosition,z=n.targetPosition,j=n.elementsSelectable,W=n.hidden,U=n.sourceHandleId,A=n.targetHandleId,K=n.onContextMenu,V=n.onMouseEnter,te=n.onMouseMove,G=n.onMouseLeave,re=n.edgeUpdaterRadius,P=n.onEdgeUpdate,B=n.onEdgeUpdateStart,X=n.onEdgeUpdateEnd,Q=n.markerEnd,D=n.markerStart,$=n.rfId,H=C.useState(!1),q=Xe(H,2),Y=q[0],ie=q[1],ne=Nr(),ve=function(ze){var Je=ne.getState(),rt=Je.edges,Pt=Je.addSelectedEdges,gt=rt.find(function(Rt){return Rt.id===i});j&&(ne.setState({nodesSelectionActive:!1}),Pt([i])),c==null||c(ze,gt)},Z=Is(i,ne.getState,d),J=Is(i,ne.getState,K),ae=Is(i,ne.getState,V),he=Is(i,ne.getState,te),ue=Is(i,ne.getState,G),de=function(ze,Je){var rt=Je?S:_,Pt=(Je?A:U)||null,gt=Je?"target":"source",Rt=function(){return!0},qt=Je,Ot=ne.getState().edges.find(function(ar){return ar.id===i});B==null||B(ze,Ot,gt);var Gr=X?function(ar){return X(ar,Ot,gt)}:void 0,Kr=function(Nn){return P==null?void 0:P(Ot,Nn)};Bq({event:ze,handleId:Pt,nodeId:rt,onConnect:Kr,isTarget:qt,getState:ne.getState,setState:ne.setState,isValidConnection:Rt,elementEdgeUpdaterType:gt,onEdgeUpdateEnd:Gr})},le=function(ze){return de(ze,!0)},xe=function(ze){return de(ze,!1)},Ee=function(){return ie(!0)},Ie=function(){return ie(!1)},Te=C.useMemo(function(){return"url(#".concat(Hw(D,$),")")},[D,$]),Me=C.useMemo(function(){return"url(#".concat(Hw(Q,$),")")},[Q,$]);if(W)return null;var Ze=!j&&!c,tt=typeof P<"u",Fe=cn(["react-flow__edge","react-flow__edge-".concat(a),o,{selected:u,animated:h,inactive:Ze,updating:Y}]);return C.createElement("g",{className:Fe,onClick:ve,onDoubleClick:Z,onContextMenu:J,onMouseEnter:ae,onMouseMove:he,onMouseLeave:ue},C.createElement(e,{id:i,source:_,target:S,selected:u,animated:h,label:p,labelStyle:v,labelShowBg:y,labelBgStyle:m,labelBgPadding:g,labelBgBorderRadius:w,data:s,style:x,sourceX:E,sourceY:I,targetX:N,targetY:T,sourcePosition:M,targetPosition:z,sourceHandleId:U,targetHandleId:A,markerStart:Te,markerEnd:Me,"data-testid":"rf__edge-".concat(i)}),tt&&C.createElement("g",{onMouseDown:le,onMouseEnter:Ee,onMouseOut:Ie},C.createElement(n5,{position:M,centerX:E,centerY:I,radius:re})),tt&&C.createElement("g",{onMouseDown:xe,onMouseEnter:Ee,onMouseOut:Ie},C.createElement(n5,{position:z,centerX:N,centerY:T,radius:re})))};return t.displayName="EdgeWrapper",C.memo(t)});function i5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function o5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?i5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ioe(e){var t={default:la(e.default||Gw),straight:la(e.bezier||Lq),step:la(e.step||zq),smoothstep:la(e.step||HS),simplebezier:la(e.simplebezier||jq)},r={},n=Object.keys(e).filter(function(i){return!["default","bezier"].includes(i)}).reduce(function(i,o){return i[o]=la(e[o]||Gw),i},r);return o5(o5({},t),n)}function a5(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,n=((r==null?void 0:r.x)||0)+t.x,i=((r==null?void 0:r.y)||0)+t.y,o=(r==null?void 0:r.width)||t.width,a=(r==null?void 0:r.height)||t.height;switch(e){case Oe.Top:return{x:n+o/2,y:i};case Oe.Right:return{x:n+o,y:i+a/2};case Oe.Bottom:return{x:n+o/2,y:i+a};case Oe.Left:return{x:n,y:i+a/2}}}function s5(e,t){if(!e)return null;var r=null;return e.length===1||!t?r=e[0]:t&&(r=e.find(function(n){return n.id===t})),typeof r>"u"?null:r}var ooe=function(t,r,n,i,o,a){var s=a5(n,t,r),c=a5(a,i,o);return{sourceX:s.x,sourceY:s.y,targetX:c.x,targetY:c.y}};function aoe(e){var t=e.sourcePos,r=e.targetPos,n=e.sourceWidth,i=e.sourceHeight,o=e.targetWidth,a=e.targetHeight,s=e.width,c=e.height,d=e.transform,u={x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x+n,r.x+o),y2:Math.max(t.y+i,r.y+a)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);var h=id({x:(0-d[0])/d[2],y:(0-d[1])/d[2],width:s/d[2],height:c/d[2]}),p=Math.max(0,Math.min(h.x2,u.x2)-Math.max(h.x,u.x)),v=Math.max(0,Math.min(h.y2,u.y2)-Math.max(h.y,u.y)),y=Math.ceil(p*v);return y>0}function l5(e,t){var r,n,i,o,a,s=e.get(t),c=(s==null||(r=s[ur])===null||r===void 0?void 0:r.handleBounds)||null,d=!s||!c||!s.width||!s.height||typeof((n=s.positionAbsolute)===null||n===void 0?void 0:n.x)>"u"||typeof((i=s.positionAbsolute)===null||i===void 0?void 0:i.y)>"u";return[{x:(s==null||(o=s.positionAbsolute)===null||o===void 0?void 0:o.x)||0,y:(s==null||(a=s.positionAbsolute)===null||a===void 0?void 0:a.y)||0,width:(s==null?void 0:s.width)||0,height:(s==null?void 0:s.height)||0},c,!d]}var soe=typeof document<"u"?document:null,ld=(function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{target:soe},r=C.useState(!1),n=Xe(r,2),i=n[0],o=n[1],a=C.useRef(new Set([])),s=C.useMemo(function(){if(e!==null){var h=Array.isArray(e)?e:[e],p=h.filter(function(y){return typeof y=="string"}).map(function(y){return y.split("+")}),v=p.reduce(function(y,m){return y.concat.apply(y,Io(m))},[]);return[p,v]}return[[],[]]},[e]),c=Xe(s,2),d=c[0],u=c[1];return C.useEffect(function(){if(e!==null){var h,p,v=function(w){if(d5(w))return!1;var x=u5(w.code,u);a.current.add(w[x]),c5(d,a.current,!1)&&(w.preventDefault(),o(!0))},y=function(w){if(d5(w))return!1;var x=u5(w.code,u);c5(d,a.current,!0)?(o(!1),a.current.clear()):a.current.delete(w[x])},m=function(){a.current.clear(),o(!1)};return t==null||(h=t.target)===null||h===void 0||h.addEventListener("keydown",v),t==null||(p=t.target)===null||p===void 0||p.addEventListener("keyup",y),window.addEventListener("blur",m),function(){var g,w;t==null||(g=t.target)===null||g===void 0||g.removeEventListener("keydown",v),t==null||(w=t.target)===null||w===void 0||w.removeEventListener("keyup",y),window.removeEventListener("blur",m)}}},[e,o]),i});function c5(e,t,r){return e.filter(function(n){return r||n.length===t.size}).some(function(n){return n.every(function(i){return t.has(i)})})}function u5(e,t){return t.includes(e)?"code":"key"}function d5(e){var t,r=((t=e.composedPath)===null||t===void 0?void 0:t.call(e)[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(r==null?void 0:r.nodeName)||(r==null?void 0:r.hasAttribute("contenteditable"))}var loe=function(t){return{onNodesChange:t.onNodesChange,onEdgesChange:t.onEdgesChange}},coe=(function(e){var t=e.deleteKeyCode,r=e.multiSelectionKeyCode,n=Nr(),i=Vt(loe,Wr),o=i.onNodesChange,a=i.onEdgesChange,s=ld(t),c=ld(r);C.useEffect(function(){var d=n.getState(),u=d.nodeInternals,h=d.edges,p=d.hasDefaultNodes,v=d.hasDefaultEdges,y=d.onNodesDelete,m=d.onEdgesDelete,g=Array.from(u.values()),w=g.reduce(function(T,M){return(!M.selected&&M.parentNode&&T.find(function(z){return z.id===M.parentNode})||M.selected)&&T.push(M),T},[]),x=h.filter(function(T){return T.selected});if(s&&(w||x)){var _=Nq(w,h),S=[].concat(Io(x),Io(_)),E=S.reduce(function(T,M){return T.includes(M.id)||T.push(M.id),T},[]);if((v||p)&&(v&&n.setState({edges:h.filter(function(T){return!E.includes(T.id)})}),p&&(w.forEach(function(T){u.delete(T.id)}),n.setState({nodeInternals:new Map(u)}))),E.length>0&&(m==null||m(S),a)){var I=E.map(function(T){return{id:T,type:"remove"}});a(I)}if(w.length>0&&(y==null||y(w),o)){var N=w.map(function(T){return{id:T.id,type:"remove"}});o(N)}n.setState({nodesSelectionActive:!1})}},[s,o,a]),C.useEffect(function(){n.setState({multiSelectionActive:c})},[c])});function uoe(e){var t=Nr();C.useEffect(function(){var r,n=function(){if(e.current){var o=FS(e.current);process.env.NODE_ENV==="development"&&(o.height===0||o.width===0)&&console.warn("[React Flow]: The React Flow parent container needs a width and a height to render the graph. Help: https://reactflow.dev/error#400"),t.setState({width:o.width||500,height:o.height||500})}};return n(),window.onresize=n,e.current&&(r=new ResizeObserver(function(){return n()}),r.observe(e.current)),function(){window.onresize=null,r&&e.current&&r.unobserve(e.current)}},[])}var doe=function(t,r){return t.x!==r.x||t.y!==r.y||t.zoom!==r.k},R0=function(t){return{x:t.x,y:t.y,zoom:t.k}},ru=function(t,r){return t.target.closest(".".concat(r))},foe=function(t){return{d3Zoom:t.d3Zoom,d3Selection:t.d3Selection,d3ZoomHandler:t.d3ZoomHandler}},hoe=function(t){var r=t.onMove,n=t.onMoveStart,i=t.onMoveEnd,o=t.zoomOnScroll,a=o===void 0?!0:o,s=t.zoomOnPinch,c=s===void 0?!0:s,d=t.panOnScroll,u=d===void 0?!1:d,h=t.panOnScrollSpeed,p=h===void 0?.5:h,v=t.panOnScrollMode,y=v===void 0?_a.Free:v,m=t.zoomOnDoubleClick,g=m===void 0?!0:m,w=t.selectionKeyPressed,x=t.elementsSelectable,_=t.panOnDrag,S=_===void 0?!0:_,E=t.translateExtent,I=t.minZoom,N=t.maxZoom,T=t.defaultZoom,M=T===void 0?1:T,z=t.defaultPosition,j=z===void 0?[0,0]:z,W=t.zoomActivationKeyCode,U=t.preventScrolling,A=U===void 0?!0:U,K=t.children,V=t.noWheelClassName,te=t.noPanClassName,G=Nr(),re=C.useRef(!1),P=C.useRef(null),B=C.useRef({x:0,y:0,zoom:0}),X=Vt(foe,Wr),Q=X.d3Zoom,D=X.d3Selection,$=X.d3ZoomHandler,H=ld(W);return uoe(P),C.useEffect(function(){if(P.current){var q,Y=Zne().scaleExtent([I,N]).translateExtent(E),ie=jn(P.current).call(Y),ne=Oa(j[0],E[0][0],E[1][0]),ve=Oa(j[1],E[0][1],E[1][1]),Z=Oa(M,I,N),J=Co.translate(ne,ve).scale(Z);Y.transform(ie,J),G.setState({d3Zoom:Y,d3Selection:ie,d3ZoomHandler:ie.on("wheel.zoom"),transform:[ne,ve,Z],domNode:(q=ie.node())===null||q===void 0?void 0:q.closest(".react-flow")})}},[]),C.useEffect(function(){D&&Q&&(u&&!H?D.on("wheel",function(q){if(ru(q,V))return!1;q.preventDefault(),q.stopImmediatePropagation();var Y=D.property("__zoom").k||1;if(q.ctrlKey&&c){var ie=ti(q),ne=-q.deltaY*(q.deltaMode===1?.05:q.deltaMode?1:.002)*10,ve=Y*Math.pow(2,ne);Q.scaleTo(D,ve,ie);return}var Z=q.deltaMode===1?20:1,J=y===_a.Vertical?0:q.deltaX*Z,ae=y===_a.Horizontal?0:q.deltaY*Z;Q.translateBy(D,-(J/Y)*p,-(ae/Y)*p)}).on("wheel.zoom",null):typeof $<"u"&&D.on("wheel",function(q){if(!A||ru(q,V))return null;q.preventDefault()}).on("wheel.zoom",$))},[u,y,D,Q,$,H,c,A,V]),C.useEffect(function(){Q&&(w&&!re.current?Q.on("zoom",null):w||Q.on("zoom",function(q){if(G.setState({transform:[q.transform.x,q.transform.y,q.transform.k]}),r){var Y=R0(q.transform);r(q.sourceEvent,Y)}}))},[w,Q,r]),C.useEffect(function(){Q&&Q.on("start",function(q){if(re.current=!0,n){var Y=R0(q.transform);B.current=Y,n(q.sourceEvent,Y)}})},[Q,n]),C.useEffect(function(){Q&&Q.on("end",function(q){if(re.current=!1,i&&doe(B.current,q.transform)){var Y=R0(q.transform);B.current=Y,i(q.sourceEvent,Y)}})},[Q,i]),C.useEffect(function(){Q&&Q.filter(function(q){var Y=H||a,ie=c&&q.ctrlKey;return!S&&!Y&&!u&&!g&&!c||w||!g&&q.type==="dblclick"||ru(q,V)&&q.type==="wheel"||ru(q,te)&&q.type!=="wheel"||!c&&q.ctrlKey&&q.type==="wheel"||!Y&&!u&&!ie&&q.type==="wheel"||!S&&(q.type==="mousedown"||q.type==="touchstart")?!1:(!q.ctrlKey||q.type==="wheel")&&!q.button})},[Q,a,c,u,g,S,w,x,H]),C.createElement("div",{className:"react-flow__renderer react-flow__container",ref:P},K)};function f5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function h5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?f5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function p5(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}var poe=function(t){return{userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable}},v5={startX:0,startY:0,x:0,y:0,width:0,height:0,draw:!1},voe=C.memo(function(e){var t=e.selectionKeyPressed,r=Nr(),n=C.useRef(0),i=C.useRef(0),o=C.useRef(),a=C.useState(v5),s=Xe(a,2),c=s[0],d=s[1],u=Vt(poe,Wr),h=u.userSelectionActive,p=u.elementsSelectable,v=h||t;if(!p||!v)return null;var y=function(){d(v5),r.setState({userSelectionActive:!1}),n.current=0,i.current=0},m=function(S){var E=S.target.closest(".react-flow");o.current=E.getBoundingClientRect();var I=p5(S,o.current);d({width:0,height:0,startX:I.x,startY:I.y,x:I.x,y:I.y,draw:!0}),r.setState({userSelectionActive:!0,nodesSelectionActive:!1})},g=function(S){var E,I;if(!(!t||!c.draw||!o.current)){var N=p5(S,o.current),T=(E=c.startX)!==null&&E!==void 0?E:0,M=(I=c.startY)!==null&&I!==void 0?I:0,z=h5(h5({},c),{},{x:N.x<T?N.x:T,y:N.y<M?N.y:M,width:Math.abs(N.x-T),height:Math.abs(N.y-M)}),j=r.getState(),W=j.nodeInternals,U=j.edges,A=j.transform,K=j.onNodesChange,V=j.onEdgesChange,te=Array.from(W.values()),G=Rq(W,z,A,!1,!0),re=Nq(G,U).map(function(Q){return Q.id}),P=G.map(function(Q){return Q.id});if(n.current!==P.length){n.current=P.length;var B=ya(te,P);B.length&&(K==null||K(B))}if(i.current!==re.length){i.current=re.length;var X=ya(U,re);X.length&&(V==null||V(X))}d(z)}},w=function(){r.setState({nodesSelectionActive:n.current>0}),y()},x=function(){r.setState({nodesSelectionActive:!1}),y()};return C.createElement("div",{className:"react-flow__selectionpane react-flow__container",onMouseDown:m,onMouseMove:g,onMouseUp:w,onMouseLeave:x},c.draw&&C.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:c.width,height:c.height,transform:"translate(".concat(c.x,"px, ").concat(c.y,"px)")}}))});function g5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function m5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?g5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gq(e,t){if(!e.parentNode)return!1;var r=t.get(e.parentNode);return r?r.selected?!0:Gq(r,t):!1}function b5(e,t,r){var n=e;do{var i;if((i=n)!==null&&i!==void 0&&i.matches(t))return!0;if(n===r.current)return!1;n=n.parentElement}while(n);return!1}function goe(e,t,r){return Array.from(e.values()).filter(function(n){return(n.selected||n.id===r)&&(!n.parentNode||!Gq(n,e))}).map(function(n){var i,o,a,s;return{id:n.id,position:n.position||{x:0,y:0},positionAbsolute:n.positionAbsolute||{x:0,y:0},distance:{x:t.x-((i=(o=n.positionAbsolute)===null||o===void 0?void 0:o.x)!==null&&i!==void 0?i:0),y:t.y-((a=(s=n.positionAbsolute)===null||s===void 0?void 0:s.y)!==null&&a!==void 0?a:0)},delta:{x:0,y:0},extent:n.extent,parentNode:n.parentNode,width:n.width,height:n.height}})}function moe(e,t,r,n,i,o){var a=Xe(n,2),s=a[0],c=a[1],d=e.extent||o,u={x:t.x-e.distance.x,y:t.y-e.distance.y};if(r&&(u.x=s*Math.round(u.x/s),u.y=c*Math.round(u.y/c)),e.extent==="parent")if(e.parentNode&&e.width&&e.height){var h=i.get(e.parentNode);d=h!=null&&h.positionAbsolute&&h!==null&&h!==void 0&&h.width&&h!==null&&h!==void 0&&h.height?[[h.positionAbsolute.x,h.positionAbsolute.y],[h.positionAbsolute.x+h.width-e.width,h.positionAbsolute.y+h.height-e.height]]:d}else process.env.NODE_ENV==="development"&&console.warn("[React Flow]: Only child nodes can use a parent extent. Help: https://reactflow.dev/error#500"),d=o;else if(e.extent&&e.parentNode){var p,v,y,m,g=i.get(e.parentNode),w=(p=g==null||(v=g.positionAbsolute)===null||v===void 0?void 0:v.x)!==null&&p!==void 0?p:0,x=(y=g==null||(m=g.positionAbsolute)===null||m===void 0?void 0:m.y)!==null&&y!==void 0?y:0;d=[[e.extent[0][0]+w,e.extent[0][1]+x],[e.extent[1][0]+w,e.extent[1][1]+x]]}var _={x:0,y:0};if(e.parentNode){var S,E,I,N,T=i.get(e.parentNode);_={x:(S=T==null||(E=T.positionAbsolute)===null||E===void 0?void 0:E.x)!==null&&S!==void 0?S:0,y:(I=T==null||(N=T.positionAbsolute)===null||N===void 0?void 0:N.y)!==null&&I!==void 0?I:0}}return e.positionAbsolute=d?xq(u,d):u,e.position={x:e.positionAbsolute.x-_.x,y:e.positionAbsolute.y-_.y},e}function N0(e){var t=e.nodeId,r=e.dragItems,n=e.nodeInternals,i=r.map(function(o){var a=n.get(o.id);return m5(m5({},a),{},{position:o.position,positionAbsolute:o.positionAbsolute})});return[t?i.find(function(o){return o.id===t}):i[0],i]}function T0(e){return function(t,r,n){return e==null?void 0:e(t,n)}}function Kq(e){var t=e.nodeRef,r=e.disabled,n=r===void 0?!1:r,i=e.noDragClassName,o=e.handleSelector,a=e.nodeId,s=e.isSelectable,c=e.selectNodesOnDrag,d=C.useState(!1),u=Xe(d,2),h=u[0],p=u[1],v=Nr(),y=C.useRef(),m=C.useRef({x:null,y:null}),g=C.useCallback(function(w){var x=w.sourceEvent,_=v.getState(),S=_.transform,E=_.snapGrid,I=_.snapToGrid,N=x.touches?x.touches[0].clientX:x.clientX,T=x.touches?x.touches[0].clientY:x.clientY,M=Iq({x:N,y:T},S,I,E);return M},[]);return C.useEffect(function(){if(t!=null&&t.current){var w=jn(t.current);if(n)w.on(".drag",null);else{var x=sre().on("start",function(_){var S=v.getState(),E=S.nodeInternals,I=S.multiSelectionActive,N=S.unselectNodesAndEdges,T=S.onNodeDragStart,M=S.onSelectionDragStart,z=a?T:T0(M);if(!c&&!I&&a){var j;(j=E.get(a))!==null&&j!==void 0&&j.selected||N()}a&&s&&c&&Cq({id:a,store:v});var W=g(_);if(m.current=W,y.current=goe(E,W,a),z&&y.current){var U=N0({nodeId:a,dragItems:y.current,nodeInternals:E}),A=Xe(U,2),K=A[0],V=A[1];z(_.sourceEvent,K,V)}}).on("drag",function(_){var S=v.getState(),E=S.updateNodePositions,I=S.snapToGrid,N=S.snapGrid,T=S.nodeInternals,M=S.nodeExtent,z=S.onNodeDrag,j=S.onSelectionDrag,W=g(_);if((m.current.x!==W.x||m.current.y!==W.y)&&y.current){m.current=W,y.current=y.current.map(function(G){return moe(G,W,I,N,T,M)});var U=a?z:T0(j);if(E(y.current,!0,!0),p(!0),U){var A=N0({nodeId:a,dragItems:y.current,nodeInternals:T}),K=Xe(A,2),V=K[0],te=K[1];U(_.sourceEvent,V,te)}}_.on("end",function(G){if(p(!1),y.current){var re=v.getState(),P=re.updateNodePositions,B=re.nodeInternals,X=re.onNodeDragStop,Q=re.onSelectionDragStop,D=a?X:T0(Q);if(P(y.current,!1,!1),D){var $=N0({nodeId:a,dragItems:y.current,nodeInternals:B}),H=Xe($,2),q=H[0],Y=H[1];D(G.sourceEvent,q,Y)}}})}).filter(function(_){var S=_.target,E=!_.button&&(!i||!b5(S,".".concat(i),t))&&(!o||b5(S,o,t));return E});return w.call(x),function(){w.on(".drag",null)}}}},[t,n,i,o,s,v,a,c,g]),h}function y5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function boe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?y5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var yoe=function(t){return boe({transformString:"translate(".concat(t.transform[0],"px,").concat(t.transform[1],"px) scale(").concat(t.transform[2],")"),userSelectionActive:t.userSelectionActive},$S(Array.from(t.nodeInternals.values()).filter(function(r){return r.selected})))},xoe=function(t){var r=Array.from(t.nodeInternals.values()).filter(function(n){return n.selected});return $S(r)};function woe(e){var t=e.onSelectionContextMenu,r=e.noPanClassName,n=Nr(),i=Vt(yoe,Wr),o=i.transformString,a=i.userSelectionActive,s=Vt(xoe,Wr),c=s.width,d=s.height,u=s.x,h=s.y,p=C.useRef(null);if(Kq({nodeRef:p}),a||!c||!d)return null;var v=t?function(y){var m=Array.from(n.getState().nodeInternals.values()).filter(function(g){return g.selected});t(y,m)}:void 0;return C.createElement("div",{className:cn(["react-flow__nodesselection","react-flow__container",r]),style:{transform:o}},C.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:v,style:{width:c,height:d,top:h,left:u}}))}var Soe=C.memo(woe),Eoe=function(t){return t.nodesSelectionActive},Yq=function(t){var r=t.children,n=t.onPaneClick,i=t.onPaneContextMenu,o=t.onPaneScroll,a=t.deleteKeyCode,s=t.onMove,c=t.onMoveStart,d=t.onMoveEnd,u=t.selectionKeyCode,h=t.multiSelectionKeyCode,p=t.zoomActivationKeyCode,v=t.elementsSelectable,y=t.zoomOnScroll,m=t.zoomOnPinch,g=t.panOnScroll,w=t.panOnScrollSpeed,x=t.panOnScrollMode,_=t.zoomOnDoubleClick,S=t.panOnDrag,E=t.translateExtent,I=t.minZoom,N=t.maxZoom,T=t.defaultZoom,M=t.defaultPosition,z=t.preventScrolling,j=t.onSelectionContextMenu,W=t.noWheelClassName,U=t.noPanClassName,A=Nr(),K=Vt(Eoe),V=ld(u);coe({deleteKeyCode:a,multiSelectionKeyCode:h});var te=function(B){n==null||n(B),A.getState().resetSelectedElements(),A.setState({nodesSelectionActive:!1})},G=i?function(P){return i(P)}:void 0,re=o?function(P){return o(P)}:void 0;return C.createElement(hoe,{onMove:s,onMoveStart:c,onMoveEnd:d,selectionKeyPressed:V,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:m,panOnScroll:g,panOnScrollSpeed:w,panOnScrollMode:x,zoomOnDoubleClick:_,panOnDrag:S,translateExtent:E,minZoom:I,maxZoom:N,defaultZoom:T,defaultPosition:M,zoomActivationKeyCode:p,preventScrolling:z,noWheelClassName:W,noPanClassName:U},r,C.createElement(voe,{selectionKeyPressed:V}),K&&C.createElement(Soe,{onSelectionContextMenu:j,noPanClassName:U}),C.createElement("div",{className:"react-flow__pane react-flow__container",onClick:te,onContextMenu:G,onWheel:re}))};Yq.displayName="FlowRenderer";var _oe=C.memo(Yq);function Ooe(e){var t=Vt(C.useCallback(function(r){return e?Rq(r.nodeInternals,{x:0,y:0,width:r.width,height:r.height},r.transform,!0):Array.from(r.nodeInternals.values())},[e]));return t}var Coe=function(t){return{nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,elementsSelectable:t.elementsSelectable,updateNodeDimensions:t.updateNodeDimensions}},Xq=function(t){var r=Vt(Coe,Wr),n=r.nodesDraggable,i=r.nodesConnectable,o=r.elementsSelectable,a=r.updateNodeDimensions,s=Ooe(t.onlyRenderVisibleElements),c=C.useRef(),d=C.useMemo(function(){if(typeof ResizeObserver>"u")return null;var u=new ResizeObserver(function(h){var p=h.map(function(v){return{id:v.target.getAttribute("data-id"),nodeElement:v.target,forceUpdate:!0}});a(p)});return c.current=u,u},[]);return C.useEffect(function(){return function(){var u;c==null||(u=c.current)===null||u===void 0||u.disconnect()}},[]),C.createElement("div",{className:"react-flow__nodes react-flow__container"},s.map(function(u){var h,p,v,y,m,g,w,x=u.type||"default";t.nodeTypes[x]||(process.env.NODE_ENV==="development"&&console.warn('[React Flow]: Node type "'.concat(x,'" not found. Using fallback type "default". Help: https://reactflow.dev/error#300')),x="default");var _=t.nodeTypes[x]||t.nodeTypes.default,S=!!(u.draggable||n&&typeof u.draggable>"u"),E=!!(u.selectable||o&&typeof u.selectable>"u"),I=!!(u.connectable||i&&typeof u.connectable>"u");return C.createElement(_,{key:u.id,id:u.id,className:u.className,style:u.style,type:x,data:u.data,sourcePosition:u.sourcePosition||Oe.Bottom,targetPosition:u.targetPosition||Oe.Top,hidden:u.hidden,xPos:(h=(p=u.positionAbsolute)===null||p===void 0?void 0:p.x)!==null&&h!==void 0?h:0,yPos:(v=(y=u.positionAbsolute)===null||y===void 0?void 0:y.y)!==null&&v!==void 0?v:0,selectNodesOnDrag:t.selectNodesOnDrag,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,selected:!!u.selected,isDraggable:S,isSelectable:E,isConnectable:I,resizeObserver:d,dragHandle:u.dragHandle,zIndex:(m=(g=u[ur])===null||g===void 0?void 0:g.z)!==null&&m!==void 0?m:0,isParent:!!((w=u[ur])!==null&&w!==void 0&&w.isParent),noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,initialized:!!u.width&&!!u.height})}))};Xq.displayName="NodeRenderer";var Ioe=C.memo(Xq),ca;function x5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function w5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Roe=(ca={},it(ca,Oe.Left,Oe.Right),it(ca,Oe.Right,Oe.Left),it(ca,Oe.Top,Oe.Bottom),it(ca,Oe.Bottom,Oe.Top),ca),Noe=(function(e){var t,r,n,i,o,a=e.connectionNodeId,s=e.connectionHandleType,c=e.connectionLineStyle,d=e.connectionLineType,u=d===void 0?Yi.Bezier:d,h=e.isConnectable,p=e.CustomConnectionLineComponent,v=Vt(C.useCallback(function(re){return{fromNode:re.nodeInternals.get(a),handleId:re.connectionHandleId,toX:(re.connectionPosition.x-re.transform[0])/re.transform[2],toY:(re.connectionPosition.y-re.transform[1])/re.transform[2]}},[a]),Wr),y=v.fromNode,m=v.handleId,g=v.toX,w=v.toY,x=y==null||(t=y[ur])===null||t===void 0?void 0:t.handleBounds;if(!y||!h||!(x!=null&&x[s]))return null;var _=x[s],S=m?_.find(function(re){return re.id===m}):_[0],E=S?S.x+S.width/2:((r=y==null?void 0:y.width)!==null&&r!==void 0?r:0)/2,I=S?S.y+S.height/2:(n=y==null?void 0:y.height)!==null&&n!==void 0?n:0,N=((y==null||(i=y.positionAbsolute)===null||i===void 0?void 0:i.x)||0)+E,T=((y==null||(o=y.positionAbsolute)===null||o===void 0?void 0:o.y)||0)+I,M=S==null?void 0:S.position;if(!M)return null;var z=Roe[M],j,W,U,A,K,V;switch(s){case"source":j=N,W=T,U=M,A=g,K=w,V=z;break;case"target":j=g,W=w,U=z,A=N,K=T,V=M;break}if(p)return C.createElement("g",{className:"react-flow__connection"},C.createElement(p,{connectionLineType:u,connectionLineStyle:c,fromNode:y,fromHandle:S,fromX:N,fromY:T,toX:g,toY:w,fromPosition:M,toPosition:z,sourcePosition:U,targetPosition:V,sourceNode:y,sourceHandle:S,targetX:A,targetY:K,sourceX:j,sourceY:W}));var te="",G={sourceX:j,sourceY:W,sourcePosition:U,targetX:A,targetY:K,targetPosition:V};return u===Yi.Bezier?te=Xd(G):u===Yi.Step?te=Uw(w5(w5({},G),{},{borderRadius:0})):u===Yi.SmoothStep?te=Uw(G):u===Yi.SimpleBezier?te=Dq(G):te="M".concat(j,",").concat(W," ").concat(A,",").concat(K),C.createElement("g",{className:"react-flow__connection"},C.createElement("path",{d:te,className:"react-flow__connection-path",style:c}))});function Xw(e){"@babel/helpers - typeof";return Xw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xw(e)}var nu,Toe=function(t){var r=t.color,n=r===void 0?"none":r,i=t.strokeWidth,o=i===void 0?1:i;return C.createElement("polyline",{stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:o,fill:"none",points:"-5,-4 0,0 -5,4"})},Poe=function(t){var r=t.color,n=r===void 0?"none":r,i=t.strokeWidth,o=i===void 0?1:i;return C.createElement("polyline",{stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:o,fill:n,points:"-5,-4 0,0 -5,4 -5,-4"})},S5=(nu={},it(nu,nd.Arrow,Toe),it(nu,nd.ArrowClosed,Poe),nu);function Moe(e){var t=C.useMemo(function(){var r=S5.hasOwnProperty(e);return r?S5[e]:(process.env.NODE_ENV==="development"&&console.warn('[React Flow]: Marker type "'.concat(e,`" doesn't exist. Help: https://reactflow.dev/error#900`)),function(){return null})},[e]);return t}function E5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function koe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Aoe=function(t){var r=t.id,n=t.type,i=t.color,o=t.width,a=o===void 0?12.5:o,s=t.height,c=s===void 0?12.5:s,d=t.markerUnits,u=d===void 0?"strokeWidth":d,h=t.strokeWidth,p=t.orient,v=p===void 0?"auto":p,y=Moe(n);return C.createElement("marker",{className:"react-flow__arrowhead",id:r,markerWidth:"".concat(a),markerHeight:"".concat(c),viewBox:"-10 -10 20 20",markerUnits:u,orient:v,refX:"0",refY:"0"},C.createElement(y,{color:i,strokeWidth:h}))},Doe=function(t){var r=t.defaultColor,n=t.rfId;return function(i){var o=[];return i.edges.reduce(function(a,s){return[s.markerStart,s.markerEnd].forEach(function(c){if(c&&Xw(c)==="object"){var d=Hw(c,n);o.includes(d)||(a.push(koe({id:d,color:c.color||r},c)),o.push(d))}}),a},[]).sort(function(a,s){return a.id.localeCompare(s.id)})}},Zq=function(t){var r=t.defaultColor,n=t.rfId,i=Vt(C.useCallback(Doe({defaultColor:r,rfId:n}),[r,n]),function(o,a){return!(o.length!==a.length||o.some(function(s,c){return s.id!==a[c].id}))});return C.createElement("defs",null,i.map(function(o){return C.createElement(Aoe,{id:o.id,key:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient})}))};Zq.displayName="MarkerDefinitions";var joe=C.memo(Zq),qoe=[{level:0,isMaxLevel:!0,edges:[]}];function zoe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=-1,i=e.reduce(function(a,s){var c=Sq(s.zIndex),d=c?s.zIndex:0;if(r){var u,h,p,v;d=c?s.zIndex:Math.max(((u=t.get(s.source))===null||u===void 0||(h=u[ur])===null||h===void 0?void 0:h.z)||0,((p=t.get(s.target))===null||p===void 0||(v=p[ur])===null||v===void 0?void 0:v.z)||0)}return a[d]?a[d].push(s):a[d]=[s],n=d>n?d:n,a},{}),o=Object.entries(i).map(function(a){var s=Xe(a,2),c=s[0],d=s[1],u=+c;return{edges:d,level:u,isMaxLevel:u===n}});return o.length===0?qoe:o}function Loe(e,t,r){var n=Vt(C.useCallback(function(i){return e?i.edges.filter(function(o){var a=t.get(o.source),s=t.get(o.target);return(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&aoe({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:s.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:s.width,targetHeight:s.height,width:i.width,height:i.height,transform:i.transform})}):i.edges},[e,t]));return zoe(n,t,r)}var Boe=function(t){return{connectionNodeId:t.connectionNodeId,connectionHandleType:t.connectionHandleType,nodesConnectable:t.nodesConnectable,elementsSelectable:t.elementsSelectable,width:t.width,height:t.height,connectionMode:t.connectionMode,nodeInternals:t.nodeInternals}},Jq=function(t){var r=Vt(Boe,Wr),n=r.connectionNodeId,i=r.connectionHandleType,o=r.nodesConnectable,a=r.elementsSelectable,s=r.width,c=r.height,d=r.connectionMode,u=r.nodeInternals,h=Loe(t.onlyRenderVisibleElements,u,t.elevateEdgesOnSelect);if(!s)return null;var p=t.connectionLineType,v=t.defaultMarkerColor,y=t.connectionLineStyle,m=t.connectionLineComponent,g=t.connectionLineContainerStyle,w=n&&i;return C.createElement(C.Fragment,null,h.map(function(x){var _=x.level,S=x.edges,E=x.isMaxLevel;return C.createElement("svg",{key:_,style:{zIndex:_},width:s,height:c,className:"react-flow__edges react-flow__container"},E&&C.createElement(joe,{defaultColor:v,rfId:t.rfId}),C.createElement("g",null,S.map(function(I){var N=l5(u,I.source),T=Xe(N,3),M=T[0],z=T[1],j=T[2],W=l5(u,I.target),U=Xe(W,3),A=U[0],K=U[1],V=U[2];if(!j||!V)return null;var te=I.type||"default";t.edgeTypes[te]||(console.warn('[React Flow]: Edge type "'.concat(te,'" not found. Using fallback type "default". Help: https://reactflow.dev/error#300')),te="default");var G=t.edgeTypes[te]||t.edgeTypes.default,re=d===Da.Strict?K.target:K.target||K.source,P=s5(z.source,I.sourceHandle||null),B=s5(re,I.targetHandle||null),X=(P==null?void 0:P.position)||Oe.Bottom,Q=(B==null?void 0:B.position)||Oe.Top;if(!P)return process.env.NODE_ENV==="development"&&console.warn("[React Flow]: Couldn't create edge for source handle id: ".concat(I.sourceHandle,"; edge id: ").concat(I.id,". Help: https://reactflow.dev/error#800")),null;if(!B)return process.env.NODE_ENV==="development"&&console.warn("[React Flow]: Couldn't create edge for target handle id: ".concat(I.targetHandle,"; edge id: ").concat(I.id,". Help: https://reactflow.dev/error#800")),null;var D=ooe(M,P,X,A,B,Q),$=D.sourceX,H=D.sourceY,q=D.targetX,Y=D.targetY;return C.createElement(G,{key:I.id,id:I.id,className:cn([I.className,t.noPanClassName]),type:te,data:I.data,selected:!!I.selected,animated:!!I.animated,hidden:!!I.hidden,label:I.label,labelStyle:I.labelStyle,labelShowBg:I.labelShowBg,labelBgStyle:I.labelBgStyle,labelBgPadding:I.labelBgPadding,labelBgBorderRadius:I.labelBgBorderRadius,style:I.style,source:I.source,target:I.target,sourceHandleId:I.sourceHandle,targetHandleId:I.targetHandle,markerEnd:I.markerEnd,markerStart:I.markerStart,sourceX:$,sourceY:H,targetX:q,targetY:Y,sourcePosition:X,targetPosition:Q,elementsSelectable:a,onEdgeUpdate:t.onEdgeUpdate,onContextMenu:t.onEdgeContextMenu,onMouseEnter:t.onEdgeMouseEnter,onMouseMove:t.onEdgeMouseMove,onMouseLeave:t.onEdgeMouseLeave,onClick:t.onEdgeClick,edgeUpdaterRadius:t.edgeUpdaterRadius,onEdgeDoubleClick:t.onEdgeDoubleClick,onEdgeUpdateStart:t.onEdgeUpdateStart,onEdgeUpdateEnd:t.onEdgeUpdateEnd,rfId:t.rfId})})))}),w&&C.createElement("svg",{style:g,width:s,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},C.createElement(Noe,{connectionNodeId:n,connectionHandleType:i,connectionLineStyle:y,connectionLineType:p,isConnectable:o,CustomConnectionLineComponent:m})))};Jq.displayName="EdgeRenderer";var Foe=C.memo(Jq),$oe=function(t){return"translate(".concat(t.transform[0],"px,").concat(t.transform[1],"px) scale(").concat(t.transform[2],")")};function Voe(e){var t=e.children,r=Vt($oe);return C.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:r}},t)}function Hoe(e){var t=kq(),r=C.useRef(!1);C.useEffect(function(){!r.current&&t.viewportInitialized&&e&&(setTimeout(function(){return e(t)},1),r.current=!0)},[e,t.viewportInitialized])}var Qq=function(t){var r=t.nodeTypes,n=t.edgeTypes,i=t.onMove,o=t.onMoveStart,a=t.onMoveEnd,s=t.onInit,c=t.onNodeClick,d=t.onEdgeClick,u=t.onNodeDoubleClick,h=t.onEdgeDoubleClick,p=t.onNodeMouseEnter,v=t.onNodeMouseMove,y=t.onNodeMouseLeave,m=t.onNodeContextMenu,g=t.onSelectionContextMenu,w=t.connectionLineType,x=t.connectionLineStyle,_=t.connectionLineComponent,S=t.connectionLineContainerStyle,E=t.selectionKeyCode,I=t.multiSelectionKeyCode,N=t.zoomActivationKeyCode,T=t.deleteKeyCode,M=t.onlyRenderVisibleElements,z=t.elementsSelectable,j=t.selectNodesOnDrag,W=t.translateExtent,U=t.minZoom,A=t.maxZoom,K=t.defaultZoom,V=t.defaultPosition,te=t.preventScrolling,G=t.defaultMarkerColor,re=t.zoomOnScroll,P=t.zoomOnPinch,B=t.panOnScroll,X=t.panOnScrollSpeed,Q=t.panOnScrollMode,D=t.zoomOnDoubleClick,$=t.panOnDrag,H=t.onPaneClick,q=t.onPaneScroll,Y=t.onPaneContextMenu,ie=t.onEdgeUpdate,ne=t.onEdgeContextMenu,ve=t.onEdgeMouseEnter,Z=t.onEdgeMouseMove,J=t.onEdgeMouseLeave,ae=t.edgeUpdaterRadius,he=t.onEdgeUpdateStart,ue=t.onEdgeUpdateEnd,de=t.noDragClassName,le=t.noWheelClassName,xe=t.noPanClassName,Ee=t.elevateEdgesOnSelect,Ie=t.id;return Hoe(s),C.createElement(_oe,{onPaneClick:H,onPaneContextMenu:Y,onPaneScroll:q,deleteKeyCode:T,selectionKeyCode:E,multiSelectionKeyCode:I,zoomActivationKeyCode:N,elementsSelectable:z,onMove:i,onMoveStart:o,onMoveEnd:a,zoomOnScroll:re,zoomOnPinch:P,zoomOnDoubleClick:D,panOnScroll:B,panOnScrollSpeed:X,panOnScrollMode:Q,panOnDrag:$,translateExtent:W,minZoom:U,maxZoom:A,defaultZoom:K,defaultPosition:V,onSelectionContextMenu:g,preventScrolling:te,noDragClassName:de,noWheelClassName:le,noPanClassName:xe},C.createElement(Voe,null,C.createElement(Foe,{edgeTypes:n,onEdgeClick:d,onEdgeDoubleClick:h,connectionLineType:w,connectionLineStyle:x,connectionLineComponent:_,connectionLineContainerStyle:S,onEdgeUpdate:ie,onlyRenderVisibleElements:M,onEdgeContextMenu:ne,onEdgeMouseEnter:ve,onEdgeMouseMove:Z,onEdgeMouseLeave:J,onEdgeUpdateStart:he,onEdgeUpdateEnd:ue,edgeUpdaterRadius:ae,defaultMarkerColor:G,noPanClassName:xe,elevateEdgesOnSelect:!!Ee,rfId:Ie}),C.createElement(Ioe,{nodeTypes:r,onNodeClick:c,onNodeDoubleClick:u,onNodeMouseEnter:p,onNodeMouseMove:v,onNodeMouseLeave:y,onNodeContextMenu:m,selectNodesOnDrag:j,onlyRenderVisibleElements:M,noPanClassName:xe,noDragClassName:de})))};Qq.displayName="GraphView";var Woe=C.memo(Qq),ez=function(){return null};ez.displayName="GroupNode";function _5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function O5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Rs=(function(e){var t=function(n){var i=n.id,o=n.type,a=n.data,s=n.xPos,c=n.yPos,d=n.selected,u=n.onClick,h=n.onMouseEnter,p=n.onMouseMove,v=n.onMouseLeave,y=n.onContextMenu,m=n.onDoubleClick,g=n.style,w=n.className,x=n.isDraggable,_=n.isSelectable,S=n.isConnectable,E=n.selectNodesOnDrag,I=n.sourcePosition,N=n.targetPosition,T=n.hidden,M=n.resizeObserver,z=n.dragHandle,j=n.zIndex,W=n.isParent,U=n.noPanClassName,A=n.noDragClassName,K=n.initialized,V=Nr(),te=C.useRef(null),G=C.useRef(I),re=C.useRef(N),P=C.useRef(o),B=_||x||u||h||p||v,X=Cs(i,V.getState,h),Q=Cs(i,V.getState,p),D=Cs(i,V.getState,v),$=Cs(i,V.getState,y),H=Cs(i,V.getState,m),q=function(ne){if(_&&(!E||!x)&&Cq({id:i,store:V}),u){var ve=V.getState().nodeInternals.get(i);u(ne,O5({},ve))}};C.useEffect(function(){if(te.current&&!T){var ie=te.current;return M==null||M.observe(ie),function(){return M==null?void 0:M.unobserve(ie)}}},[T]),C.useEffect(function(){var ie=P.current!==o,ne=G.current!==I,ve=re.current!==N;te.current&&(ie||ne||ve)&&(ie&&(P.current=o),ne&&(G.current=I),ve&&(re.current=N),V.getState().updateNodeDimensions([{id:i,nodeElement:te.current,forceUpdate:!0}]))},[i,o,I,N]);var Y=Kq({nodeRef:te,disabled:T||!x,noDragClassName:A,handleSelector:z,nodeId:i,isSelectable:_,selectNodesOnDrag:E});return T?null:C.createElement("div",{className:cn(["react-flow__node","react-flow__node-".concat(o),U,w,{selected:d,selectable:_,parent:W}]),ref:te,style:O5({zIndex:j,transform:"translate(".concat(s,"px,").concat(c,"px)"),pointerEvents:B?"all":"none",visibility:K?"visible":"hidden"},g),onMouseEnter:X,onMouseMove:Q,onMouseLeave:D,onContextMenu:$,onClick:q,onDoubleClick:H,"data-testid":"rf__node-".concat(i),"data-id":i},C.createElement($ie,{value:i},C.createElement(e,{id:i,data:a,type:o,xPos:s,yPos:c,selected:d,isConnectable:S,sourcePosition:I,targetPosition:N,dragging:Y,dragHandle:z,zIndex:j})))};return t.displayName="NodeWrapper",C.memo(t)});function C5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function I5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?C5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Uoe(e){var t={input:Rs(e.input||Hq),default:Rs(e.default||Yw),output:Rs(e.output||Uq),group:Rs(e.group||ez)},r={},n=Object.keys(e).filter(function(i){return!["input","default","output","group"].includes(i)}).reduce(function(i,o){return i[o]=Rs(e[o]||Yw),i},r);return I5(I5({},t),n)}function R5(e,t){var r=C.useRef(null),n=C.useMemo(function(){if(process.env.NODE_ENV==="development"){var i=Object.keys(e);Wr(r.current,i)&&console.warn("[React Flow]: It looks like you have 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. Help: https://reactflow.dev/error#200"),r.current=i}return t(e)},[e]);return n}function N5(e){if(!(!e||typeof document>"u")){var t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");t.appendChild(r),r.appendChild(document.createTextNode(e))}}var tz=function(t){var r=t.children,n=!0;try{Nr()}catch{n=!1}return n?C.createElement(C.Fragment,null,r):C.createElement(uie,{createStore:die},r)};tz.displayName="ReactFlowWrapper";var Goe=["nodes","edges","defaultNodes","defaultEdges","className","nodeTypes","edgeTypes","onNodeClick","onEdgeClick","onInit","onMove","onMoveStart","onMoveEnd","onConnect","onConnectStart","onConnectStop","onConnectEnd","onClickConnectStart","onClickConnectStop","onClickConnectEnd","onNodeMouseEnter","onNodeMouseMove","onNodeMouseLeave","onNodeContextMenu","onNodeDoubleClick","onNodeDragStart","onNodeDrag","onNodeDragStop","onNodesDelete","onEdgesDelete","onSelectionChange","onSelectionDragStart","onSelectionDrag","onSelectionDragStop","onSelectionContextMenu","connectionMode","connectionLineType","connectionLineStyle","connectionLineComponent","connectionLineContainerStyle","deleteKeyCode","selectionKeyCode","multiSelectionKeyCode","zoomActivationKeyCode","snapToGrid","snapGrid","onlyRenderVisibleElements","selectNodesOnDrag","nodesDraggable","nodesConnectable","elementsSelectable","minZoom","maxZoom","defaultZoom","defaultPosition","translateExtent","preventScrolling","nodeExtent","defaultMarkerColor","zoomOnScroll","zoomOnPinch","panOnScroll","panOnScrollSpeed","panOnScrollMode","zoomOnDoubleClick","panOnDrag","onPaneClick","onPaneScroll","onPaneContextMenu","children","onEdgeUpdate","onEdgeContextMenu","onEdgeDoubleClick","onEdgeMouseEnter","onEdgeMouseMove","onEdgeMouseLeave","onEdgeUpdateStart","onEdgeUpdateEnd","edgeUpdaterRadius","onNodesChange","onEdgesChange","noDragClassName","noWheelClassName","noPanClassName","fitView","fitViewOptions","connectOnClick","attributionPosition","proOptions","defaultEdgeOptions","elevateEdgesOnSelect"];function T5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function P5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T5(Object(r),!0).forEach(function(n){it(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T5(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}N5(Qie),N5(toe);var Koe={input:Hq,default:Yw,output:Uq},Yoe={default:Gw,straight:Lq,step:zq,smoothstep:HS,simplebezier:jq},Xoe=[15,15],Zoe=[0,0],rz=C.forwardRef(function(e,t){var r=e.nodes,n=e.edges,i=e.defaultNodes,o=e.defaultEdges,a=e.className,s=e.nodeTypes,c=s===void 0?Koe:s,d=e.edgeTypes,u=d===void 0?Yoe:d,h=e.onNodeClick,p=e.onEdgeClick,v=e.onInit,y=e.onMove,m=e.onMoveStart,g=e.onMoveEnd,w=e.onConnect,x=e.onConnectStart,_=e.onConnectStop,S=e.onConnectEnd,E=e.onClickConnectStart,I=e.onClickConnectStop,N=e.onClickConnectEnd,T=e.onNodeMouseEnter,M=e.onNodeMouseMove,z=e.onNodeMouseLeave,j=e.onNodeContextMenu,W=e.onNodeDoubleClick,U=e.onNodeDragStart,A=e.onNodeDrag,K=e.onNodeDragStop,V=e.onNodesDelete,te=e.onEdgesDelete,G=e.onSelectionChange,re=e.onSelectionDragStart,P=e.onSelectionDrag,B=e.onSelectionDragStop,X=e.onSelectionContextMenu,Q=e.connectionMode,D=Q===void 0?Da.Strict:Q,$=e.connectionLineType,H=$===void 0?Yi.Bezier:$,q=e.connectionLineStyle,Y=e.connectionLineComponent,ie=e.connectionLineContainerStyle,ne=e.deleteKeyCode,ve=ne===void 0?"Backspace":ne,Z=e.selectionKeyCode,J=Z===void 0?"Shift":Z,ae=e.multiSelectionKeyCode,he=ae===void 0?"Meta":ae,ue=e.zoomActivationKeyCode,de=ue===void 0?"Meta":ue,le=e.snapToGrid,xe=le===void 0?!1:le,Ee=e.snapGrid,Ie=Ee===void 0?Xoe:Ee,Te=e.onlyRenderVisibleElements,Me=Te===void 0?!1:Te,Ze=e.selectNodesOnDrag,tt=Ze===void 0?!0:Ze,Fe=e.nodesDraggable,Le=e.nodesConnectable,ze=e.elementsSelectable,Je=e.minZoom,rt=Je===void 0?.5:Je,Pt=e.maxZoom,gt=Pt===void 0?2:Pt,Rt=e.defaultZoom,qt=Rt===void 0?1:Rt,Ot=e.defaultPosition,Gr=Ot===void 0?Zoe:Ot,Kr=e.translateExtent,ar=Kr===void 0?Ww:Kr,Nn=e.preventScrolling,io=Nn===void 0?!0:Nn,zt=e.nodeExtent,Mt=e.defaultMarkerColor,Lt=Mt===void 0?"#b1b1b7":Mt,fr=e.zoomOnScroll,kt=fr===void 0?!0:fr,At=e.zoomOnPinch,hr=At===void 0?!0:At,Mr=e.panOnScroll,Et=Mr===void 0?!1:Mr,Bt=e.panOnScrollSpeed,pr=Bt===void 0?.5:Bt,vr=e.panOnScrollMode,yr=vr===void 0?_a.Free:vr,sr=e.zoomOnDoubleClick,Tn=sr===void 0?!0:sr,Un=e.panOnDrag,Za=Un===void 0?!0:Un,Gn=e.onPaneClick,Ja=e.onPaneScroll,Kn=e.onPaneContextMenu,Ri=e.children,Bo=e.onEdgeUpdate,Fo=e.onEdgeContextMenu,ke=e.onEdgeDoubleClick,$e=e.onEdgeMouseEnter,xr=e.onEdgeMouseMove,Ht=e.onEdgeMouseLeave,wr=e.onEdgeUpdateStart,Sr=e.onEdgeUpdateEnd,tr=e.edgeUpdaterRadius,un=tr===void 0?10:tr,Yr=e.onNodesChange,ci=e.onEdgesChange,Ni=e.noDragClassName,Qa=Ni===void 0?"nodrag":Ni,es=e.noWheelClassName,$l=es===void 0?"nowheel":es,ts=e.noPanClassName,pf=ts===void 0?"nopan":ts,Vl=e.fitView,vf=Vl===void 0?!1:Vl,gf=e.fitViewOptions,rs=e.connectOnClick,Hl=rs===void 0?!0:rs,Wl=e.attributionPosition,ns=e.proOptions,mf=e.defaultEdgeOptions,is=e.elevateEdgesOnSelect,$o=is===void 0?!1:is,oo=Kd(e,Goe),bf=R5(c,Uoe),Ul=R5(u,ioe);return C.createElement("div",P5(P5({},oo),{},{ref:t,className:cn(["react-flow",a])}),C.createElement(tz,null,C.createElement(Woe,{onInit:v,onMove:y,onMoveStart:m,onMoveEnd:g,onNodeClick:h,onEdgeClick:p,onNodeMouseEnter:T,onNodeMouseMove:M,onNodeMouseLeave:z,onNodeContextMenu:j,onNodeDoubleClick:W,nodeTypes:bf,edgeTypes:Ul,connectionLineType:H,connectionLineStyle:q,connectionLineComponent:Y,connectionLineContainerStyle:ie,selectionKeyCode:J,deleteKeyCode:ve,multiSelectionKeyCode:he,zoomActivationKeyCode:de,onlyRenderVisibleElements:Me,selectNodesOnDrag:tt,translateExtent:ar,minZoom:rt,maxZoom:gt,defaultZoom:qt,defaultPosition:Gr,preventScrolling:io,zoomOnScroll:kt,zoomOnPinch:hr,zoomOnDoubleClick:Tn,panOnScroll:Et,panOnScrollSpeed:pr,panOnScrollMode:yr,panOnDrag:Za,onPaneClick:Gn,onPaneScroll:Ja,onPaneContextMenu:Kn,onSelectionContextMenu:X,onEdgeUpdate:Bo,onEdgeContextMenu:Fo,onEdgeDoubleClick:ke,onEdgeMouseEnter:$e,onEdgeMouseMove:xr,onEdgeMouseLeave:Ht,onEdgeUpdateStart:wr,onEdgeUpdateEnd:Sr,edgeUpdaterRadius:un,defaultMarkerColor:Lt,noDragClassName:Qa,noWheelClassName:$l,noPanClassName:pf,elevateEdgesOnSelect:$o,id:oo==null?void 0:oo.id}),C.createElement(Zie,{nodes:r,edges:n,defaultNodes:i,defaultEdges:o,onConnect:w,onConnectStart:x,onConnectStop:_,onConnectEnd:S,onClickConnectStart:E,onClickConnectStop:I,onClickConnectEnd:N,nodesDraggable:Fe,nodesConnectable:Le,elementsSelectable:ze,minZoom:rt,maxZoom:gt,nodeExtent:zt,onNodesChange:Yr,onEdgesChange:ci,snapToGrid:xe,snapGrid:Ie,connectionMode:D,translateExtent:ar,connectOnClick:Hl,defaultEdgeOptions:mf,fitView:vf,fitViewOptions:gf,onNodesDelete:V,onEdgesDelete:te,onNodeDragStart:U,onNodeDrag:A,onNodeDragStop:K,onSelectionDrag:P,onSelectionDragStart:re,onSelectionDragStop:B}),G&&C.createElement(Yie,{onSelectionChange:G}),Ri,C.createElement(Aie,{proOptions:ns,position:Wl})))});rz.displayName="ReactFlow";function nz(e){return function(t){var r=C.useState(t),n=Xe(r,2),i=n[0],o=n[1],a=C.useCallback(function(s){return o(function(c){return e(s,c)})},[]);return[i,o,a]}}var Joe=nz(_q),Qoe=nz(nie);function M5(e,t){const{width:r,height:n,positionAbsolute:i}=e,o=t.positionAbsolute,a=r/2,s=n/2,c=i.x+a,d=i.y+s,u=o.x+a,h=o.y+s,p=(u-c)/(2*a)-(h-d)/(2*s),v=(u-c)/(2*a)+(h-d)/(2*s),y=1/(Math.abs(p)+Math.abs(v)),m=y*p,g=y*v,w=a*(m+g)+c,x=s*(-m+g)+d;return{x:w,y:x}}function k5(e,t){const r={...e.positionAbsolute,...e},n=Math.round(r.x),i=Math.round(r.y),o=Math.round(t.x),a=Math.round(t.y);return o<=n+1?Oe.Left:o>=n+r.width-1?Oe.Right:a<=i+1?Oe.Top:a>=r.y+r.height-1?Oe.Bottom:Oe.Top}function iz(e,t){const r=M5(e,t),n=M5(t,e),i=k5(e,r),o=k5(t,n);return{sx:r.x,sy:r.y,tx:n.x,ty:n.y,sourcePos:i,targetPos:o}}const eae=({targetX:e,targetY:t,sourcePosition:r,targetPosition:n,sourceNode:i})=>{if(!i)return null;const o={id:"connection-target",width:1,height:1,position:{x:e,y:t}},{sx:a,sy:s}=iz(i,o),c=Xd({sourceX:a,sourceY:s,sourcePosition:r,targetPosition:n,targetX:e,targetY:t});return O.jsxs("g",{children:[O.jsx("path",{fill:"none",stroke:"#222",strokeWidth:1.5,className:"animated",d:c}),O.jsx("circle",{cx:e,cy:t,fill:"#fff",r:3,stroke:"#222",strokeWidth:1.5})]})},tae=({id:e,source:t,target:r,markerEnd:n,style:i})=>{const o=Vt(C.useCallback(y=>y.nodeInternals.get(t),[t])),a=Vt(C.useCallback(y=>y.nodeInternals.get(r),[r]));if(!o||!a)return null;const{sx:s,sy:c,tx:d,ty:u,sourcePos:h,targetPos:p}=iz(o,a),v=Xd({sourceX:s,sourceY:c,sourcePosition:h,targetPosition:p,targetX:d,targetY:u});return O.jsx("path",{id:e,className:"react-flow__edge-path",d:v,markerEnd:n,style:i})},A5=172,D5=36,rae={custom:tae},nae=(e,t,r="LR")=>{const n=new yP.graphlib.Graph;n.setDefaultEdgeLabel(()=>({}));const i=r==="LR";return n.setGraph({rankdir:r}),e.forEach(o=>{n.setNode(o.id,{width:A5,height:D5})}),t.forEach(o=>{n.setEdge(o.source,o.target)}),yP.layout(n),e.forEach(o=>{const a=n.node(o.id);return o.targetPosition=i?Oe.Left:Oe.Top,o.sourcePosition=i?Oe.Right:Oe.Bottom,o.position={x:a.x-A5/2,y:a.y-D5/2},o}),{nodes:e,edges:t}},iae=()=>{},oae=({data:e,dict:t,onSelect:r=iae})=>{const{nodes:n,edges:i}=nae(Object.values(t).filter(h=>h.id===e.selected||e.parents.flat().includes(h.id)||e.children.flat().includes(h.id)).map(h=>({id:h.id,type:h.parents.length===0?"input":h.includes.length===0?"output":"default",sourcePosition:Oe.Right,targetPosition:Oe.Left,data:{label:h.privilege},position:{x:0,y:0},className:h.id===e.selected?"highlighted":"",selected:h.id===e.selected})),e.links.map(({source:h,target:p})=>({id:`e${h}-${p}`,source:h,target:p}))),[o,a,s]=Joe(n),[c,d,u]=Qoe(i);return C.useEffect(()=>{a([...n]),d([...i])},[e]),O.jsx(rz,{nodes:o,edges:c,fitView:!0,onNodesChange:s,onEdgesChange:u,onNodeClick:(h,p)=>{r(p.id)},defaultZoom:.5,edgeTypes:rae,connectionLineComponent:eae,children:O.jsx(Mie,{variant:Mo.Dots,color:"#81818140",gap:18,size:1})})};var oz=(e=>(e.method="methods",e.entityCollection="entityselMethod",e.dataClass="dataclassMethod",e.dataStore="dsMethod",e.entity="entityMethod",e.attribute="attributes",e.singletonMethod="singletonMethod",e))(oz||{});const az=e=>{switch(e){case"entityCollection":return pe.ESubPermissionType.ENTITY_SEL_METHOD;case"dataClass":return pe.ESubPermissionType.DATACLASS_METHOD;case"dataStore":return pe.ESubPermissionType.DS_METHOD;case"entity":return pe.ESubPermissionType.ENTITY_METHOD;default:return pe.EPermissionType.METHOD}},j5=(e=[],t,r)=>{var i;const n=[];for(const o of e)(i=o[oz[r]])==null||i.forEach(a=>{if(`${o.name.toLowerCase()}.${a.name.toLowerCase()}`.includes(t)||!t){const c={applyTo:`${o.name}.${a.name}`,type:r};r===pe.EPermissionType.METHOD&&(c.subType=az(a.applyTo)),n.push(c)}});return n},aae=(e=[],t)=>{var n;const r=[];for(const i of e)(n=i.methods)==null||n.forEach(o=>{(`${i.name.toLowerCase()}.${o.name.toLowerCase()}`.includes(t)||!t)&&r.push({applyTo:`${i.name}.${o.name}`,type:pe.EPermissionType.SINGLETON_METHOD})});return r};function US(e,t=[],r=[],n=[]){const i=j5(r,e,pe.EPermissionType.ATTRIBUTE),o=j5(r,e,pe.EPermissionType.METHOD),a=aae(n,e),s=t.filter(h=>!e||`ds.${h.name.toLowerCase()}`.includes(e)).map(h=>({applyTo:`ds.${h.name}`,type:pe.ESubPermissionType.DS_METHOD})),c=[],d=[];return r.filter(h=>h.name.toLowerCase().includes(e)).forEach(h=>{c.push({applyTo:h.name,type:pe.EPermissionType.DATACLASS})}),n.filter(h=>h.name.toLowerCase().includes(e)).forEach(h=>{d.push({applyTo:h.name,type:pe.EPermissionType.SINGLETON})}),[...[{applyTo:"ds",type:pe.EPermissionType.DATASTORE}].filter(h=>!e||`ds.${h.applyTo.toLowerCase()}`.includes(e)),...s,...c,...i,...o,...d,...a].reduce((h,p)=>{const v=["datastore","singleton","dataclass","attribute","dsMethod","dataclassMethod","entityMethod","entityselMethod","singletonMethod"],[y,m]=p.applyTo.split("."),g=h.find(w=>w.prefix===y);return g?(g.resources=[...g.resources,p].sort((w,x)=>{const _=v.indexOf(w.type),S=v.indexOf(x.type);return _>S?1:-1}),g.type=m?g.type:p.type,[...h].sort((w,x)=>{const _=v.indexOf(w.type),S=v.indexOf(x.type);return _>S?1:-1})):[...h,{prefix:y,type:m?null:p.type,resources:[p]}]},[]).reduce((h,p)=>[...h,...p.resources],[])}const sae=(e=[],t=[],r=[])=>{const n=US("",e,t,r),i={ds:{applyTo:"ds",type:pe.EPermissionType.DATASTORE,methods:[],dataClasses:[],singletons:[]}},o=(s,c)=>s.applyTo.localeCompare(c.applyTo);n.forEach(s=>{const[c,d]=s.applyTo.split(".");if(d||(s.type===pe.EPermissionType.DATACLASS?i.ds.dataClasses.push({applyTo:c,type:pe.EPermissionType.DATACLASS,methods:[],attributes:[]}):s.type===pe.EPermissionType.SINGLETON&&i.ds.singletons.push({applyTo:c,type:pe.EPermissionType.SINGLETON,methods:[],attributes:[]})),d){const u=(h,p,v)=>{h.forEach(y=>{y.applyTo===c&&y[p].push(v)})};[pe.ESubPermissionType.DS_METHOD,pe.ESubPermissionType.DATACLASS_METHOD,pe.ESubPermissionType.ENTITY_METHOD,pe.ESubPermissionType.ENTITY_SEL_METHOD].includes(s.type)?c==="ds"?i.ds.methods.push(s):u(i.ds.dataClasses,"methods",s):s.type===pe.EPermissionType.ATTRIBUTE?(u(i.ds.dataClasses,"attributes",s),u(i.ds.singletons,"attributes",s)):s.type===pe.EPermissionType.SINGLETON_METHOD&&u(i.ds.singletons,"methods",s)}});const a=s=>{s.forEach(c=>{c.methods&&c.methods.sort(o),c.attributes&&c.attributes.sort(o)})};return i.ds.methods.sort(o),i.ds.dataClasses.sort(o),i.ds.singletons.sort(o),a(i.ds.dataClasses),a(i.ds.singletons),i},sz=(e,t=[])=>{const r={};return Object.entries(e).forEach(([n,i])=>{r[n]={...i,resources:i.resources.map(o=>{var a,s,c;if(o.type===pe.EPermissionType.METHOD&&t.length){const[d,u]=o.resource.split("."),h=d==="ds"?"dataStore":((c=(s=(a=t.find(p=>p.name===d))==null?void 0:a.methods)==null?void 0:s.find(p=>p.name===u))==null?void 0:c.applyTo)||"dataClass";return{...o,type:o.type,subType:az(h)}}return o})}}),r},lz=(e,t)=>Object.entries(e).map(([r,n])=>{const i=n.resources.map(o=>{var d,u,h,p,v,y,m,g;const[a,s]=o.resource.split(".");let c=!0;switch(o.type){case pe.EPermissionType.DATASTORE:c=!!t;break;case pe.EPermissionType.METHOD:a==="ds"?c=!!t.methods.find(w=>w.name===s&&w.applyTo==="dataStore"):c=!!((u=(d=t.dataClasses[a])==null?void 0:d.methods)!=null&&u.find(w=>w.name===s));break;case pe.ESubPermissionType.DS_METHOD:c=!!t.methods.find(w=>w.name===s&&w.applyTo==="dataStore");break;case pe.EPermissionType.DATACLASS:c=!!t.dataClasses[a];break;case pe.EPermissionType.ATTRIBUTE:c=!!((p=(h=t.dataClasses[a])==null?void 0:h.attributes)!=null&&p.find(w=>w.name===s));break;case pe.ESubPermissionType.ENTITY_SEL_METHOD:c=!!((v=t.dataClasses[a])!=null&&v.methods.find(w=>w.name===s&&w.applyTo==="entityCollection"));break;case pe.ESubPermissionType.DATACLASS_METHOD:c=!!((y=t.dataClasses[a])!=null&&y.methods.find(w=>w.name===s&&w.applyTo==="dataClass"));break;case pe.ESubPermissionType.ENTITY_METHOD:c=!!((m=t.dataClasses[a])!=null&&m.methods.find(w=>w.name===s&&w.applyTo==="entity"));break;case pe.EPermissionType.SINGLETON_METHOD:c=!!((g=t.singletons[a])!=null&&g.methods.find(w=>w.name===s));break;case pe.EPermissionType.SINGLETON:c=!!t.singletons[a];break;default:c=!0}return{...o,exists:c}});return{[r]:{...n,resources:i}}}).reduce((r,n)=>({...r,...n}),{});var P0={exports:{}};/*!
|
|
60
60
|
Copyright (c) 2018 Jed Watson.
|
|
@@ -88,7 +88,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
88
88
|
`)+we+`return __p
|
|
89
89
|
}`;var We=IO(function(){return ot(F,Pe+"return "+we).apply(r,ee)});if(We.source=we,mh(We))throw We;return We}function E$(l){return ct(l).toLowerCase()}function _$(l){return ct(l).toUpperCase()}function O$(l,f,b){if(l=ct(l),l&&(b||f===r))return DE(l);if(!l||!(f=Qr(f)))return l;var R=Pn(l),k=Pn(f),F=jE(R,k),ee=qE(R,k)+1;return qi(R,F,ee).join("")}function C$(l,f,b){if(l=ct(l),l&&(b||f===r))return l.slice(0,LE(l)+1);if(!l||!(f=Qr(f)))return l;var R=Pn(l),k=qE(R,Pn(f))+1;return qi(R,0,k).join("")}function I$(l,f,b){if(l=ct(l),l&&(b||f===r))return l.replace(sr,"");if(!l||!(f=Qr(f)))return l;var R=Pn(l),k=jE(R,Pn(f));return qi(R,k).join("")}function R$(l,f){var b=j,R=W;if(Nt(f)){var k="separator"in f?f.separator:k;b="length"in f?He(f.length):b,R="omission"in f?Qr(f.omission):R}l=ct(l);var F=l.length;if(Wo(l)){var ee=Pn(l);F=ee.length}if(b>=F)return l;var oe=b-Uo(R);if(oe<1)return R;var ce=ee?qi(ee,0,oe).join(""):l.slice(0,oe);if(k===r)return ce+R;if(ee&&(oe+=ce.length-oe),bh(k)){if(l.slice(oe).search(k)){var me,be=ce;for(k.global||(k=Af(k.source,ct(Fo.exec(k))+"g")),k.lastIndex=0;me=k.exec(be);)var we=me.index;ce=ce.slice(0,we===r?oe:we)}}else if(l.indexOf(Qr(k),oe)!=oe){var _e=ce.lastIndexOf(k);_e>-1&&(ce=ce.slice(0,_e))}return ce+R}function N$(l){return l=ct(l),l&&fr.test(l)?l.replace(Mt,o7):l}var T$=Qo(function(l,f,b){return l+(b?" ":"")+f.toUpperCase()}),Sh=I_("toUpperCase");function CO(l,f,b){return l=ct(l),f=b?r:f,f===r?e7(l)?l7(l):WL(l):l.match(f)||[]}var IO=Ue(function(l,f){try{return Xr(l,r,f)}catch(b){return mh(b)?b:new Be(b)}}),P$=hi(function(l,f){return Zr(f,function(b){b=kn(b),Yn(l,b,vh(l[b],l))}),l});function M$(l){var f=l==null?0:l.length,b=De();return l=f?Ct(l,function(R){if(typeof R[1]!="function")throw new fn(a);return[b(R[0]),R[1]]}):[],Ue(function(R){for(var k=-1;++k<f;){var F=l[k];if(Xr(F[0],this,R))return Xr(F[1],this,R)}})}function k$(l){return o8(pn(l,p))}function Eh(l){return function(){return l}}function A$(l,f){return l==null||l!==l?f:l}var D$=N_(),j$=N_(!0);function jr(l){return l}function _h(l){return o_(typeof l=="function"?l:pn(l,p))}function q$(l){return s_(pn(l,p))}function z$(l,f){return l_(l,pn(f,p))}var L$=Ue(function(l,f){return function(b){return hs(b,l,f)}}),B$=Ue(function(l,f){return function(b){return hs(l,b,f)}});function Oh(l,f,b){var R=rr(f),k=fc(f,R);b==null&&!(Nt(f)&&(k.length||!R.length))&&(b=f,f=l,l=this,k=fc(f,rr(f)));var F=!(Nt(b)&&"chain"in b)||!!b.chain,ee=vi(l);return Zr(k,function(oe){var ce=f[oe];l[oe]=ce,ee&&(l.prototype[oe]=function(){var me=this.__chain__;if(F||me){var be=l(this.__wrapped__),we=be.__actions__=kr(this.__actions__);return we.push({func:ce,args:arguments,thisArg:l}),be.__chain__=me,be}return ce.apply(l,Pi([this.value()],arguments))})}),l}function F$(){return lr._===this&&(lr._=p7),this}function Ch(){}function $$(l){return l=He(l),Ue(function(f){return c_(f,l)})}var V$=rh(Ct),H$=rh(TE),W$=rh(If);function RO(l){return ch(l)?Rf(kn(l)):S8(l)}function U$(l){return function(f){return l==null?r:fo(l,f)}}var G$=P_(),K$=P_(!0);function Ih(){return[]}function Rh(){return!1}function Y$(){return{}}function X$(){return""}function Z$(){return!0}function J$(l,f){if(l=He(l),l<1||l>re)return[];var b=X,R=gr(l,X);f=De(f),l-=X;for(var k=Pf(R,f);++b<l;)f(b);return k}function Q$(l){return Ve(l)?Ct(l,kn):en(l)?[l]:kr(G_(ct(l)))}function eV(l){var f=++f7;return ct(l)+f}var tV=bc(function(l,f){return l+f},0),rV=nh("ceil"),nV=bc(function(l,f){return l/f},1),iV=nh("floor");function oV(l){return l&&l.length?dc(l,jr,$f):r}function aV(l,f){return l&&l.length?dc(l,De(f,2),$f):r}function sV(l){return kE(l,jr)}function lV(l,f){return kE(l,De(f,2))}function cV(l){return l&&l.length?dc(l,jr,Uf):r}function uV(l,f){return l&&l.length?dc(l,De(f,2),Uf):r}var dV=bc(function(l,f){return l*f},1),fV=nh("round"),hV=bc(function(l,f){return l-f},0);function pV(l){return l&&l.length?Tf(l,jr):0}function vV(l,f){return l&&l.length?Tf(l,De(f,2)):0}return L.after=zF,L.ary=iO,L.assign=O9,L.assignIn=bO,L.assignInWith=yO,L.assignWith=yh,L.at=C9,L.before=oO,L.bind=vh,L.bindAll=P$,L.bindKey=aO,L.castArray=XF,L.chain=tO,L.chunk=oB,L.compact=aB,L.concat=sB,L.cond=M$,L.conforms=k$,L.constant=Eh,L.countBy=vF,L.create=I9,L.curry=sO,L.curryRight=lO,L.debounce=cO,L.defaults=R9,L.defaultsDeep=N9,L.defer=LF,L.delay=BF,L.difference=lB,L.differenceBy=cB,L.differenceWith=uB,L.drop=dB,L.dropRight=fB,L.dropRightWhile=hB,L.dropWhile=pB,L.fill=vB,L.filter=mF,L.flatMap=xF,L.flatMapDeep=wF,L.flatMapDepth=SF,L.flatten=Z_,L.flattenDeep=gB,L.flattenDepth=mB,L.flip=FF,L.flow=D$,L.flowRight=j$,L.fromPairs=bB,L.functions=j9,L.functionsIn=q9,L.groupBy=EF,L.initial=xB,L.intersection=wB,L.intersectionBy=SB,L.intersectionWith=EB,L.invert=L9,L.invertBy=B9,L.invokeMap=OF,L.iteratee=_h,L.keyBy=CF,L.keys=rr,L.keysIn=Dr,L.map=Oc,L.mapKeys=$9,L.mapValues=V9,L.matches=q$,L.matchesProperty=z$,L.memoize=Ic,L.merge=H9,L.mergeWith=xO,L.method=L$,L.methodOf=B$,L.mixin=Oh,L.negate=Rc,L.nthArg=$$,L.omit=W9,L.omitBy=U9,L.once=$F,L.orderBy=IF,L.over=V$,L.overArgs=VF,L.overEvery=H$,L.overSome=W$,L.partial=gh,L.partialRight=uO,L.partition=RF,L.pick=G9,L.pickBy=wO,L.property=RO,L.propertyOf=U$,L.pull=IB,L.pullAll=Q_,L.pullAllBy=RB,L.pullAllWith=NB,L.pullAt=TB,L.range=G$,L.rangeRight=K$,L.rearg=HF,L.reject=PF,L.remove=PB,L.rest=WF,L.reverse=hh,L.sampleSize=kF,L.set=Y9,L.setWith=X9,L.shuffle=AF,L.slice=MB,L.sortBy=qF,L.sortedUniq=LB,L.sortedUniqBy=BB,L.split=y$,L.spread=UF,L.tail=FB,L.take=$B,L.takeRight=VB,L.takeRightWhile=HB,L.takeWhile=WB,L.tap=aF,L.throttle=GF,L.thru=_c,L.toArray=vO,L.toPairs=SO,L.toPairsIn=EO,L.toPath=Q$,L.toPlainObject=mO,L.transform=Z9,L.unary=KF,L.union=UB,L.unionBy=GB,L.unionWith=KB,L.uniq=YB,L.uniqBy=XB,L.uniqWith=ZB,L.unset=J9,L.unzip=ph,L.unzipWith=eO,L.update=Q9,L.updateWith=e$,L.values=ra,L.valuesIn=t$,L.without=JB,L.words=CO,L.wrap=YF,L.xor=QB,L.xorBy=eF,L.xorWith=tF,L.zip=rF,L.zipObject=nF,L.zipObjectDeep=iF,L.zipWith=oF,L.entries=SO,L.entriesIn=EO,L.extend=bO,L.extendWith=yO,Oh(L,L),L.add=tV,L.attempt=IO,L.camelCase=o$,L.capitalize=_O,L.ceil=rV,L.clamp=r$,L.clone=ZF,L.cloneDeep=QF,L.cloneDeepWith=e9,L.cloneWith=JF,L.conformsTo=t9,L.deburr=OO,L.defaultTo=A$,L.divide=nV,L.endsWith=a$,L.eq=An,L.escape=s$,L.escapeRegExp=l$,L.every=gF,L.find=bF,L.findIndex=Y_,L.findKey=T9,L.findLast=yF,L.findLastIndex=X_,L.findLastKey=P9,L.floor=iV,L.forEach=rO,L.forEachRight=nO,L.forIn=M9,L.forInRight=k9,L.forOwn=A9,L.forOwnRight=D9,L.get=xh,L.gt=r9,L.gte=n9,L.has=z9,L.hasIn=wh,L.head=J_,L.identity=jr,L.includes=_F,L.indexOf=yB,L.inRange=n$,L.invoke=F9,L.isArguments=vo,L.isArray=Ve,L.isArrayBuffer=i9,L.isArrayLike=Ar,L.isArrayLikeObject=Ft,L.isBoolean=o9,L.isBuffer=zi,L.isDate=a9,L.isElement=s9,L.isEmpty=l9,L.isEqual=c9,L.isEqualWith=u9,L.isError=mh,L.isFinite=d9,L.isFunction=vi,L.isInteger=dO,L.isLength=Nc,L.isMap=fO,L.isMatch=f9,L.isMatchWith=h9,L.isNaN=p9,L.isNative=v9,L.isNil=m9,L.isNull=g9,L.isNumber=hO,L.isObject=Nt,L.isObjectLike=Dt,L.isPlainObject=ys,L.isRegExp=bh,L.isSafeInteger=b9,L.isSet=pO,L.isString=Tc,L.isSymbol=en,L.isTypedArray=ta,L.isUndefined=y9,L.isWeakMap=x9,L.isWeakSet=w9,L.join=_B,L.kebabCase=c$,L.last=gn,L.lastIndexOf=OB,L.lowerCase=u$,L.lowerFirst=d$,L.lt=S9,L.lte=E9,L.max=oV,L.maxBy=aV,L.mean=sV,L.meanBy=lV,L.min=cV,L.minBy=uV,L.stubArray=Ih,L.stubFalse=Rh,L.stubObject=Y$,L.stubString=X$,L.stubTrue=Z$,L.multiply=dV,L.nth=CB,L.noConflict=F$,L.noop=Ch,L.now=Cc,L.pad=f$,L.padEnd=h$,L.padStart=p$,L.parseInt=v$,L.random=i$,L.reduce=NF,L.reduceRight=TF,L.repeat=g$,L.replace=m$,L.result=K9,L.round=fV,L.runInContext=se,L.sample=MF,L.size=DF,L.snakeCase=b$,L.some=jF,L.sortedIndex=kB,L.sortedIndexBy=AB,L.sortedIndexOf=DB,L.sortedLastIndex=jB,L.sortedLastIndexBy=qB,L.sortedLastIndexOf=zB,L.startCase=x$,L.startsWith=w$,L.subtract=hV,L.sum=pV,L.sumBy=vV,L.template=S$,L.times=J$,L.toFinite=gi,L.toInteger=He,L.toLength=gO,L.toLower=E$,L.toNumber=mn,L.toSafeInteger=_9,L.toString=ct,L.toUpper=_$,L.trim=O$,L.trimEnd=C$,L.trimStart=I$,L.truncate=R$,L.unescape=N$,L.uniqueId=eV,L.upperCase=T$,L.upperFirst=Sh,L.each=rO,L.eachRight=nO,L.first=J_,Oh(L,(function(){var l={};return Xn(L,function(f,b){lt.call(L.prototype,b)||(l[b]=f)}),l})(),{chain:!1}),L.VERSION=n,Zr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){L[l].placeholder=L}),Zr(["drop","take"],function(l,f){Qe.prototype[l]=function(b){b=b===r?1:Yt(He(b),0);var R=this.__filtered__&&!f?new Qe(this):this.clone();return R.__filtered__?R.__takeCount__=gr(b,R.__takeCount__):R.__views__.push({size:gr(b,X),type:l+(R.__dir__<0?"Right":"")}),R},Qe.prototype[l+"Right"]=function(b){return this.reverse()[l](b).reverse()}}),Zr(["filter","map","takeWhile"],function(l,f){var b=f+1,R=b==K||b==te;Qe.prototype[l]=function(k){var F=this.clone();return F.__iteratees__.push({iteratee:De(k,3),type:b}),F.__filtered__=F.__filtered__||R,F}}),Zr(["head","last"],function(l,f){var b="take"+(f?"Right":"");Qe.prototype[l]=function(){return this[b](1).value()[0]}}),Zr(["initial","tail"],function(l,f){var b="drop"+(f?"":"Right");Qe.prototype[l]=function(){return this.__filtered__?new Qe(this):this[b](1)}}),Qe.prototype.compact=function(){return this.filter(jr)},Qe.prototype.find=function(l){return this.filter(l).head()},Qe.prototype.findLast=function(l){return this.reverse().find(l)},Qe.prototype.invokeMap=Ue(function(l,f){return typeof l=="function"?new Qe(this):this.map(function(b){return hs(b,l,f)})}),Qe.prototype.reject=function(l){return this.filter(Rc(De(l)))},Qe.prototype.slice=function(l,f){l=He(l);var b=this;return b.__filtered__&&(l>0||f<0)?new Qe(b):(l<0?b=b.takeRight(-l):l&&(b=b.drop(l)),f!==r&&(f=He(f),b=f<0?b.dropRight(-f):b.take(f-l)),b)},Qe.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Qe.prototype.toArray=function(){return this.take(X)},Xn(Qe.prototype,function(l,f){var b=/^(?:filter|find|map|reject)|While$/.test(f),R=/^(?:head|last)$/.test(f),k=L[R?"take"+(f=="last"?"Right":""):f],F=R||/^find/.test(f);k&&(L.prototype[f]=function(){var ee=this.__wrapped__,oe=R?[1]:arguments,ce=ee instanceof Qe,me=oe[0],be=ce||Ve(ee),we=function(Ye){var et=k.apply(L,Pi([Ye],oe));return R&&_e?et[0]:et};be&&b&&typeof me=="function"&&me.length!=1&&(ce=be=!1);var _e=this.__chain__,Pe=!!this.__actions__.length,qe=F&&!_e,We=ce&&!Pe;if(!F&&be){ee=We?ee:new Qe(this);var Ae=l.apply(ee,oe);return Ae.__actions__.push({func:_c,args:[we],thisArg:r}),new hn(Ae,_e)}return qe&&We?l.apply(this,oe):(Ae=this.thru(we),qe?R?Ae.value()[0]:Ae.value():Ae)})}),Zr(["pop","push","shift","sort","splice","unshift"],function(l){var f=Xl[l],b=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",R=/^(?:pop|shift)$/.test(l);L.prototype[l]=function(){var k=arguments;if(R&&!this.__chain__){var F=this.value();return f.apply(Ve(F)?F:[],k)}return this[b](function(ee){return f.apply(Ve(ee)?ee:[],k)})}}),Xn(Qe.prototype,function(l,f){var b=L[f];if(b){var R=b.name+"";lt.call(Xo,R)||(Xo[R]=[]),Xo[R].push({name:f,func:b})}}),Xo[mc(r,x).name]=[{name:"wrapper",func:r}],Qe.prototype.clone=T7,Qe.prototype.reverse=P7,Qe.prototype.value=M7,L.prototype.at=sF,L.prototype.chain=lF,L.prototype.commit=cF,L.prototype.next=uF,L.prototype.plant=fF,L.prototype.reverse=hF,L.prototype.toJSON=L.prototype.valueOf=L.prototype.value=pF,L.prototype.first=L.prototype.head,as&&(L.prototype[as]=dF),L}),Go=c7();ao?((ao.exports=Go)._=Go,Ef._=Go):lr._=Go}).call(uae)})(Xs,Xs.exports)),Xs.exports}var Xi=dae();function cz(e,t){const r=C.useRef([e]),n=C.useRef(0),i=C.useRef(!1),o=C.useRef(!1),[,a]=C.useReducer(u=>u+1,0);C.useEffect(()=>{if(i.current){i.current=!1;return}const u=n.current;if(Xi.isEqual(r.current[u],e)){o.current=!1;return}if(!o.current){r.current=[e],n.current=0,a();return}o.current=!1;const h=[...r.current.slice(0,u+1),e];r.current=h,n.current=h.length-1,a()},[e]);const s=C.useCallback(()=>{n.current<=0||(n.current-=1,i.current=!0,t(r.current[n.current]),a())},[t]),c=C.useCallback(()=>{n.current>=r.current.length-1||(n.current+=1,i.current=!0,t(r.current[n.current]),a())},[t]),d=C.useCallback(()=>{o.current=!0},[]);return{canUndo:n.current>0,canRedo:n.current<r.current.length-1,undo:s,redo:c,markEdit:d}}function fae(){const e=Ke.useAppDispatch(),t=Ke.useAppSelector(Ke.selectRoles),r=Ke.useAppSelector(Ke.selectPrivileges),n=Ke.useAppSelector(Ke.selectRolesFlags),i=Ke.useAppSelector(Ke.selectRolesAndPrivileges,(g,w)=>Xi.isEqual(g,w)),o=Ke.useAppSelector(Ke.selectCatalog),a=Ke.useAppSelector(Ke.selectQodly),s=Ke.useAppSelector(Ke.selectSelectedTab),c=Ke.useAppSelector(Ke.selectForceLogin),d=Ke.useAppSelector(Ke.selectRestrictedByDefault),u=Ke.useAppSelector(Ke.selectGuestPrivilege),h=Ke.useAppSelector(Ke.selectCatalogMethods),p=Ke.useAppSelector(Ke.selectDataclasses),v=Ke.useAppSelector(Ke.selectSingletons),y=C.useCallback(g=>{const{roles:w,privileges:x,forceLogin:_,restrictedByDefault:S}=pe.sanitizeRoles(g);e(Ke.updateRolesAndPrivileges({roles:w,privileges:x})),e(Ke.toggleForceLogin(_??!1)),e(Ke.toggleRestrictedByDefault(S??!1))},[e]),m=cz(i,y);return{getRoles:()=>t,getPrivileges:()=>r,getRolesFlags:()=>n,getRolesAndPrivileges:()=>i,getCatalog:()=>o,getQodly:()=>a,getSelectedTab:()=>s,getForceLogin:()=>c??!1,getRestrictedByDefault:()=>d??!1,getGuestPrivilege:()=>u??null,getCatalogMethods:()=>h,getDataclasses:()=>p,getSingletons:()=>v,getHost:()=>"web",getHistory:()=>({canUndo:m.canUndo,canRedo:m.canRedo}),actions:{updateRoles:g=>{m.markEdit(),e(Ke.updateRoles(g))},updatePrivileges:g=>{m.markEdit(),e(Ke.updatePrivileges(g))},setRolesContent:g=>{e(Ke.setRolesContent(g))},toggleTab:g=>{e(Ke.toggleTab(g))},toggleForceLogin:g=>{m.markEdit(),e(Ke.toggleForceLogin(g))},toggleRestrictedByDefault:g=>{m.markEdit(),e(Ke.toggleRestrictedByDefault(g))},setTabFlags:(g,w)=>{e(Ke.setTabFlags({path:g,flags:w}))},openModal:async g=>await e(Ke.openModal(g)).unwrap(),undo:m.undo,redo:m.redo}}}const uz=C.createContext(null),dz=({children:e,adapter:t})=>O.jsx(uz.Provider,{value:t,children:e}),Tr=()=>{const e=C.useContext(uz);if(!e)throw new Error("useEditorStateAdapter must be used within an EditorStateAdapterProvider");return e};var Zw=function(e,t){return Zw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Zw(e,t)};function jl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Zw(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Jw(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qw(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return o}function e1(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}function oi(e){return typeof e=="function"}function fz(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var M0=fz(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
90
90
|
`+r.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
|
91
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function t1(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Zd=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Jw(a),c=s.next();!c.done;c=s.next()){var d=c.value;d.remove(this)}}catch(m){t={error:m}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var u=this.initialTeardown;if(oi(u))try{u()}catch(m){o=m instanceof M0?m.errors:[m]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var p=Jw(h),v=p.next();!v.done;v=p.next()){var y=v.value;try{L5(y)}catch(m){o=o??[],m instanceof M0?o=e1(e1([],Qw(o)),Qw(m.errors)):o.push(m)}}}catch(m){n={error:m}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}}if(o)throw new M0(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)L5(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&t1(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&t1(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),hz=Zd.EMPTY;function pz(e){return e instanceof Zd||e&&"closed"in e&&oi(e.remove)&&oi(e.add)&&oi(e.unsubscribe)}function L5(e){oi(e)?e():e.unsubscribe()}var hae={Promise:void 0},pae={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,e1([e,t],Qw(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function vae(e){pae.setTimeout(function(){throw e})}function B5(){}function Iu(e){e()}var GS=(function(e){jl(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,pz(r)&&r.add(n)):n.destination=bae,n}return t.create=function(r,n,i){return new r1(r,n,i)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Zd),gae=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){iu(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){iu(n)}else iu(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){iu(r)}},e})(),r1=(function(e){jl(t,e);function t(r,n,i){var o=e.call(this)||this,a;return oi(r)||!r?a={next:r??void 0,error:n??void 0,complete:i??void 0}:a=r,o.destination=new gae(a),o}return t})(GS);function iu(e){vae(e)}function mae(e){throw e}var bae={closed:!0,next:B5,error:mae,complete:B5},yae=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function xae(e){return e}function wae(e){return e.length===0?xae:e.length===1?e[0]:function(r){return e.reduce(function(n,i){return i(n)},r)}}var F5=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=Eae(t)?t:new r1(t,r,n);return Iu(function(){var a=i,s=a.operator,c=a.source;o.add(s?s.call(o,c):c?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=$5(r),new r(function(i,o){var a=new r1({next:function(s){try{t(s)}catch(c){o(c),a.unsubscribe()}},error:o,complete:i});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[yae]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return wae(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=$5(t),new t(function(n,i){var o;r.subscribe(function(a){return o=a},function(a){return i(a)},function(){return n(o)})})},e.create=function(t){return new e(t)},e})();function $5(e){var t;return(t=e??hae.Promise)!==null&&t!==void 0?t:Promise}function Sae(e){return e&&oi(e.next)&&oi(e.error)&&oi(e.complete)}function Eae(e){return e&&e instanceof GS||Sae(e)&&pz(e)}function _ae(e){return oi(e==null?void 0:e.lift)}function Oae(e){return function(t){if(_ae(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Cae(e,t,r,n,i){return new Iae(e,t,r,n,i)}var Iae=(function(e){jl(t,e);function t(r,n,i,o,a,s){var c=e.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(d){try{n(d)}catch(u){r.error(u)}}:e.prototype._next,c._error=o?function(d){try{o(d)}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=i?function(){try{i()}catch(d){r.error(d)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(GS),Rae=fz(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),vz=(function(e){jl(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new V5(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Rae},t.prototype.next=function(r){var n=this;Iu(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=Jw(n.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(r)}}catch(d){i={error:d}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;Iu(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;Iu(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?hz:(this.currentObservers=null,s.push(r),new Zd(function(){n.currentObservers=null,t1(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,a=n.isStopped;i?r.error(o):a&&r.complete()},t.prototype.asObservable=function(){var r=new F5;return r.source=this,r},t.create=function(r,n){return new V5(r,n)},t})(F5),V5=(function(e){jl(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:hz},t})(vz);function Nae(e,t){return Oae(function(r,n){var i=0;r.subscribe(Cae(n,function(o){return e.call(t,o,i++)&&n.next(o)}))})}var k0={},Ns={},ou={},H5;function gz(){if(H5)return ou;H5=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.default=r;let e;const t=new Uint8Array(16);function r(){if(!e&&(e=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!e))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(t)}return ou}var ua={},Ts={},Ps={},W5;function Tae(){if(W5)return Ps;W5=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.default=void 0;var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return Ps.default=e,Ps}var U5;function Jd(){if(U5)return Ts;U5=1,Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.default=void 0;var e=t(Tae());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){return typeof i=="string"&&e.default.test(i)}var n=r;return Ts.default=n,Ts}var G5;function Qd(){if(G5)return ua;G5=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.default=void 0,ua.unsafeStringify=n;var e=t(Jd());function t(a){return a&&a.__esModule?a:{default:a}}const r=[];for(let a=0;a<256;++a)r.push((a+256).toString(16).slice(1));function n(a,s=0){return r[a[s+0]]+r[a[s+1]]+r[a[s+2]]+r[a[s+3]]+"-"+r[a[s+4]]+r[a[s+5]]+"-"+r[a[s+6]]+r[a[s+7]]+"-"+r[a[s+8]]+r[a[s+9]]+"-"+r[a[s+10]]+r[a[s+11]]+r[a[s+12]]+r[a[s+13]]+r[a[s+14]]+r[a[s+15]]}function i(a,s=0){const c=n(a,s);if(!(0,e.default)(c))throw TypeError("Stringified UUID is invalid");return c}var o=i;return ua.default=o,ua}var K5;function Pae(){if(K5)return Ns;K5=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.default=void 0;var e=r(gz()),t=Qd();function r(d){return d&&d.__esModule?d:{default:d}}let n,i,o=0,a=0;function s(d,u,h){let p=u&&h||0;const v=u||new Array(16);d=d||{};let y=d.node||n,m=d.clockseq!==void 0?d.clockseq:i;if(y==null||m==null){const E=d.random||(d.rng||e.default)();y==null&&(y=n=[E[0]|1,E[1],E[2],E[3],E[4],E[5]]),m==null&&(m=i=(E[6]<<8|E[7])&16383)}let g=d.msecs!==void 0?d.msecs:Date.now(),w=d.nsecs!==void 0?d.nsecs:a+1;const x=g-o+(w-a)/1e4;if(x<0&&d.clockseq===void 0&&(m=m+1&16383),(x<0||g>o)&&d.nsecs===void 0&&(w=0),w>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=g,a=w,i=m,g+=122192928e5;const _=((g&268435455)*1e4+w)%4294967296;v[p++]=_>>>24&255,v[p++]=_>>>16&255,v[p++]=_>>>8&255,v[p++]=_&255;const S=g/4294967296*1e4&268435455;v[p++]=S>>>8&255,v[p++]=S&255,v[p++]=S>>>24&15|16,v[p++]=S>>>16&255,v[p++]=m>>>8|128,v[p++]=m&255;for(let E=0;E<6;++E)v[p+E]=y[E];return u||(0,t.unsafeStringify)(v)}var c=s;return Ns.default=c,Ns}var Ms={},Hi={},ks={},Y5;function mz(){if(Y5)return ks;Y5=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.default=void 0;var e=t(Jd());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){if(!(0,e.default)(i))throw TypeError("Invalid UUID");let o;const a=new Uint8Array(16);return a[0]=(o=parseInt(i.slice(0,8),16))>>>24,a[1]=o>>>16&255,a[2]=o>>>8&255,a[3]=o&255,a[4]=(o=parseInt(i.slice(9,13),16))>>>8,a[5]=o&255,a[6]=(o=parseInt(i.slice(14,18),16))>>>8,a[7]=o&255,a[8]=(o=parseInt(i.slice(19,23),16))>>>8,a[9]=o&255,a[10]=(o=parseInt(i.slice(24,36),16))/1099511627776&255,a[11]=o/4294967296&255,a[12]=o>>>24&255,a[13]=o>>>16&255,a[14]=o>>>8&255,a[15]=o&255,a}var n=r;return ks.default=n,ks}var X5;function bz(){if(X5)return Hi;X5=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.URL=Hi.DNS=void 0,Hi.default=a;var e=Qd(),t=r(mz());function r(s){return s&&s.__esModule?s:{default:s}}function n(s){s=unescape(encodeURIComponent(s));const c=[];for(let d=0;d<s.length;++d)c.push(s.charCodeAt(d));return c}const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Hi.DNS=i;const o="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Hi.URL=o;function a(s,c,d){function u(h,p,v,y){var m;if(typeof h=="string"&&(h=n(h)),typeof p=="string"&&(p=(0,t.default)(p)),((m=p)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let g=new Uint8Array(16+h.length);if(g.set(p),g.set(h,p.length),g=d(g),g[6]=g[6]&15|c,g[8]=g[8]&63|128,v){y=y||0;for(let w=0;w<16;++w)v[y+w]=g[w];return v}return(0,e.unsafeStringify)(g)}try{u.name=s}catch{}return u.DNS=i,u.URL=o,u}return Hi}var As={},Z5;function Mae(){if(Z5)return As;Z5=1,Object.defineProperty(As,"__esModule",{value:!0}),As.default=void 0;function e(v){if(typeof v=="string"){const y=unescape(encodeURIComponent(v));v=new Uint8Array(y.length);for(let m=0;m<y.length;++m)v[m]=y.charCodeAt(m)}return t(n(i(v),v.length*8))}function t(v){const y=[],m=v.length*32,g="0123456789abcdef";for(let w=0;w<m;w+=8){const x=v[w>>5]>>>w%32&255,_=parseInt(g.charAt(x>>>4&15)+g.charAt(x&15),16);y.push(_)}return y}function r(v){return(v+64>>>9<<4)+14+1}function n(v,y){v[y>>5]|=128<<y%32,v[r(y)-1]=y;let m=1732584193,g=-271733879,w=-1732584194,x=271733878;for(let _=0;_<v.length;_+=16){const S=m,E=g,I=w,N=x;m=c(m,g,w,x,v[_],7,-680876936),x=c(x,m,g,w,v[_+1],12,-389564586),w=c(w,x,m,g,v[_+2],17,606105819),g=c(g,w,x,m,v[_+3],22,-1044525330),m=c(m,g,w,x,v[_+4],7,-176418897),x=c(x,m,g,w,v[_+5],12,1200080426),w=c(w,x,m,g,v[_+6],17,-1473231341),g=c(g,w,x,m,v[_+7],22,-45705983),m=c(m,g,w,x,v[_+8],7,1770035416),x=c(x,m,g,w,v[_+9],12,-1958414417),w=c(w,x,m,g,v[_+10],17,-42063),g=c(g,w,x,m,v[_+11],22,-1990404162),m=c(m,g,w,x,v[_+12],7,1804603682),x=c(x,m,g,w,v[_+13],12,-40341101),w=c(w,x,m,g,v[_+14],17,-1502002290),g=c(g,w,x,m,v[_+15],22,1236535329),m=d(m,g,w,x,v[_+1],5,-165796510),x=d(x,m,g,w,v[_+6],9,-1069501632),w=d(w,x,m,g,v[_+11],14,643717713),g=d(g,w,x,m,v[_],20,-373897302),m=d(m,g,w,x,v[_+5],5,-701558691),x=d(x,m,g,w,v[_+10],9,38016083),w=d(w,x,m,g,v[_+15],14,-660478335),g=d(g,w,x,m,v[_+4],20,-405537848),m=d(m,g,w,x,v[_+9],5,568446438),x=d(x,m,g,w,v[_+14],9,-1019803690),w=d(w,x,m,g,v[_+3],14,-187363961),g=d(g,w,x,m,v[_+8],20,1163531501),m=d(m,g,w,x,v[_+13],5,-1444681467),x=d(x,m,g,w,v[_+2],9,-51403784),w=d(w,x,m,g,v[_+7],14,1735328473),g=d(g,w,x,m,v[_+12],20,-1926607734),m=u(m,g,w,x,v[_+5],4,-378558),x=u(x,m,g,w,v[_+8],11,-2022574463),w=u(w,x,m,g,v[_+11],16,1839030562),g=u(g,w,x,m,v[_+14],23,-35309556),m=u(m,g,w,x,v[_+1],4,-1530992060),x=u(x,m,g,w,v[_+4],11,1272893353),w=u(w,x,m,g,v[_+7],16,-155497632),g=u(g,w,x,m,v[_+10],23,-1094730640),m=u(m,g,w,x,v[_+13],4,681279174),x=u(x,m,g,w,v[_],11,-358537222),w=u(w,x,m,g,v[_+3],16,-722521979),g=u(g,w,x,m,v[_+6],23,76029189),m=u(m,g,w,x,v[_+9],4,-640364487),x=u(x,m,g,w,v[_+12],11,-421815835),w=u(w,x,m,g,v[_+15],16,530742520),g=u(g,w,x,m,v[_+2],23,-995338651),m=h(m,g,w,x,v[_],6,-198630844),x=h(x,m,g,w,v[_+7],10,1126891415),w=h(w,x,m,g,v[_+14],15,-1416354905),g=h(g,w,x,m,v[_+5],21,-57434055),m=h(m,g,w,x,v[_+12],6,1700485571),x=h(x,m,g,w,v[_+3],10,-1894986606),w=h(w,x,m,g,v[_+10],15,-1051523),g=h(g,w,x,m,v[_+1],21,-2054922799),m=h(m,g,w,x,v[_+8],6,1873313359),x=h(x,m,g,w,v[_+15],10,-30611744),w=h(w,x,m,g,v[_+6],15,-1560198380),g=h(g,w,x,m,v[_+13],21,1309151649),m=h(m,g,w,x,v[_+4],6,-145523070),x=h(x,m,g,w,v[_+11],10,-1120210379),w=h(w,x,m,g,v[_+2],15,718787259),g=h(g,w,x,m,v[_+9],21,-343485551),m=o(m,S),g=o(g,E),w=o(w,I),x=o(x,N)}return[m,g,w,x]}function i(v){if(v.length===0)return[];const y=v.length*8,m=new Uint32Array(r(y));for(let g=0;g<y;g+=8)m[g>>5]|=(v[g/8]&255)<<g%32;return m}function o(v,y){const m=(v&65535)+(y&65535);return(v>>16)+(y>>16)+(m>>16)<<16|m&65535}function a(v,y){return v<<y|v>>>32-y}function s(v,y,m,g,w,x){return o(a(o(o(y,v),o(g,x)),w),m)}function c(v,y,m,g,w,x,_){return s(y&m|~y&g,v,y,w,x,_)}function d(v,y,m,g,w,x,_){return s(y&g|m&~g,v,y,w,x,_)}function u(v,y,m,g,w,x,_){return s(y^m^g,v,y,w,x,_)}function h(v,y,m,g,w,x,_){return s(m^(y|~g),v,y,w,x,_)}var p=e;return As.default=p,As}var J5;function kae(){if(J5)return Ms;J5=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.default=void 0;var e=r(bz()),t=r(Mae());function r(o){return o&&o.__esModule?o:{default:o}}var i=(0,e.default)("v3",48,t.default);return Ms.default=i,Ms}var Ds={},js={},Q5;function Aae(){if(Q5)return js;Q5=1,Object.defineProperty(js,"__esModule",{value:!0}),js.default=void 0;var t={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};return js.default=t,js}var eM;function Dae(){if(eM)return Ds;eM=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=void 0;var e=n(Aae()),t=n(gz()),r=Qd();function n(a){return a&&a.__esModule?a:{default:a}}function i(a,s,c){if(e.default.randomUUID&&!s&&!a)return e.default.randomUUID();a=a||{};const d=a.random||(a.rng||t.default)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,s){c=c||0;for(let u=0;u<16;++u)s[c+u]=d[u];return s}return(0,r.unsafeStringify)(d)}var o=i;return Ds.default=o,Ds}var qs={},zs={},tM;function jae(){if(tM)return zs;tM=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.default=void 0;function e(i,o,a,s){switch(i){case 0:return o&a^~o&s;case 1:return o^a^s;case 2:return o&a^o&s^a&s;case 3:return o^a^s}}function t(i,o){return i<<o|i>>>32-o}function r(i){const o=[1518500249,1859775393,2400959708,3395469782],a=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof i=="string"){const u=unescape(encodeURIComponent(i));i=[];for(let h=0;h<u.length;++h)i.push(u.charCodeAt(h))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);const s=i.length/4+2,c=Math.ceil(s/16),d=new Array(c);for(let u=0;u<c;++u){const h=new Uint32Array(16);for(let p=0;p<16;++p)h[p]=i[u*64+p*4]<<24|i[u*64+p*4+1]<<16|i[u*64+p*4+2]<<8|i[u*64+p*4+3];d[u]=h}d[c-1][14]=(i.length-1)*8/Math.pow(2,32),d[c-1][14]=Math.floor(d[c-1][14]),d[c-1][15]=(i.length-1)*8&4294967295;for(let u=0;u<c;++u){const h=new Uint32Array(80);for(let w=0;w<16;++w)h[w]=d[u][w];for(let w=16;w<80;++w)h[w]=t(h[w-3]^h[w-8]^h[w-14]^h[w-16],1);let p=a[0],v=a[1],y=a[2],m=a[3],g=a[4];for(let w=0;w<80;++w){const x=Math.floor(w/20),_=t(p,5)+e(x,v,y,m)+g+o[x]+h[w]>>>0;g=m,m=y,y=t(v,30)>>>0,v=p,p=_}a[0]=a[0]+p>>>0,a[1]=a[1]+v>>>0,a[2]=a[2]+y>>>0,a[3]=a[3]+m>>>0,a[4]=a[4]+g>>>0}return[a[0]>>24&255,a[0]>>16&255,a[0]>>8&255,a[0]&255,a[1]>>24&255,a[1]>>16&255,a[1]>>8&255,a[1]&255,a[2]>>24&255,a[2]>>16&255,a[2]>>8&255,a[2]&255,a[3]>>24&255,a[3]>>16&255,a[3]>>8&255,a[3]&255,a[4]>>24&255,a[4]>>16&255,a[4]>>8&255,a[4]&255]}var n=r;return zs.default=n,zs}var rM;function qae(){if(rM)return qs;rM=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.default=void 0;var e=r(bz()),t=r(jae());function r(o){return o&&o.__esModule?o:{default:o}}var i=(0,e.default)("v5",80,t.default);return qs.default=i,qs}var Ls={},nM;function zae(){if(nM)return Ls;nM=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.default=void 0;var e="00000000-0000-0000-0000-000000000000";return Ls.default=e,Ls}var Bs={},iM;function Lae(){if(iM)return Bs;iM=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.default=void 0;var e=t(Jd());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){if(!(0,e.default)(i))throw TypeError("Invalid UUID");return parseInt(i.slice(14,15),16)}var n=r;return Bs.default=n,Bs}var oM;function Bae(){return oM||(oM=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return a.default}});var t=u(Pae()),r=u(kae()),n=u(Dae()),i=u(qae()),o=u(zae()),a=u(Lae()),s=u(Jd()),c=u(Qd()),d=u(mz());function u(h){return h&&h.__esModule?h:{default:h}}})(k0)),k0}var A0,aM;function Fae(){if(aM)return A0;aM=1;function e(t,r){if(!t||!r||!t.length||!r.length)throw new Error("Bad alphabet");this.srcAlphabet=t,this.dstAlphabet=r}return e.prototype.convert=function(t){var r,n,i,o={},a=this.srcAlphabet.length,s=this.dstAlphabet.length,c=t.length,d=typeof t=="string"?"":[];if(!this.isValid(t))throw new Error('Number "'+t+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return t;for(r=0;r<c;r++)o[r]=this.srcAlphabet.indexOf(t[r]);do{for(n=0,i=0,r=0;r<c;r++)n=n*a+o[r],n>=s?(o[i++]=parseInt(n/s,10),n=n%s):i>0&&(o[i++]=0);c=i,d=this.dstAlphabet.slice(n,n+1).concat(d)}while(i!==0);return d},e.prototype.isValid=function(t){for(var r=0;r<t.length;++r)if(this.srcAlphabet.indexOf(t[r])===-1)return!1;return!0},A0=e,A0}var D0,sM;function $ae(){if(sM)return D0;sM=1;var e=Fae();function t(r,n){var i=new e(r,n);return function(o){return i.convert(o)}}return t.BIN="01",t.OCT="01234567",t.DEC="0123456789",t.HEX="0123456789abcdef",D0=t,D0}var j0,lM;function Vae(){if(lM)return j0;lM=1;const{v4:e,validate:t}=Bae(),r=$ae(),n={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},i={consistentLength:!0};let o;const a=(d,u,h)=>{const p=u(d.toLowerCase().replace(/-/g,""));return!h||!h.consistentLength?p:p.padStart(h.shortIdLength,h.paddingChar)},s=(d,u)=>{const p=u(d).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[p[1],p[2],p[3],p[4],p[5]].join("-")},c=d=>Math.ceil(Math.log(2**128)/Math.log(d));return j0=(()=>{const d=(u,h)=>{const p=u||n.flickrBase58,v={...i,...h};if([...new Set(Array.from(p))].length!==p.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const y=c(p.length),m={shortIdLength:y,consistentLength:v.consistentLength,paddingChar:p[0]},g=r(r.HEX,p),w=r(p,r.HEX),x=()=>a(e(),g,m),S={alphabet:p,fromUUID:E=>a(E,g,m),maxLength:y,generate:x,new:x,toUUID:E=>s(E,w),uuid:e,validate:(E,I=!1)=>{if(!E||typeof E!="string")return!1;const N=v.consistentLength?E.length===y:E.length<=y,T=E.split("").every(M=>p.includes(M));return I===!1?N&&T:N&&T&&t(s(E,w))}};return Object.freeze(S),S};return d.constants=n,d.uuid=e,d.generate=()=>(o||(o=d(n.flickrBase58).generate),o()),d})(),j0}var yz=Vae();const xz=new vz;function Hae(e,t){switch(t.type){case"UPDATE_ROLES":return{...e,roles:t.payload,flags:{...e.flags,touched:!0}};case"UPDATE_PRIVILEGES":return{...e,privileges:t.payload,flags:{...e.flags,touched:!0}};case"SET_ROLES_CONTENT":{const{content:r,flags:n={},...i}=t.payload,o=pe.sanitizeRoles(r),a={...e.flags,...n};return{...e,...o,...i,flags:a}}case"TOGGLE_TAB":return{...e,selectedTab:t.payload};case"TOGGLE_FORCE_LOGIN":return e.forceLogin===t.payload?e:{...e,forceLogin:t.payload,flags:{...e.flags,touched:!0}};case"TOGGLE_RESTRICTED_BY_DEFAULT":return e.restrictedByDefault===t.payload?e:{...e,restrictedByDefault:t.payload,flags:{...e.flags,touched:!0}};case"SET_FLAGS":return{...e,flags:{...e.flags,...t.payload}};case"CREATE_MODAL":return{...e,modals:{...e.modals,list:[...e.modals.list,t.payload]}};case"REMOVE_MODAL":return{...e,modals:{...e.modals,list:e.modals.list.filter(r=>r.id!==t.payload)}};case"CLOSE_MODAL":{const{id:r,reason:n}=t.payload;let i;if(n)if(e.modals.list.find(a=>a.id===r))i={...e,modals:{...e.modals,list:e.modals.list.map(a=>a.id===r?{...a,closeReason:n,isOpen:!1}:a)}};else return e;else i={...e,modals:{...e.modals,list:e.modals.list.filter(o=>o.id!==r)}};return xz.next(i.modals),i}case"EDIT_MODAL":{const{id:r,...n}=t.payload;return e.modals.list.find(o=>o.id===r)?{...e,modals:{...e.modals,list:e.modals.list.map(o=>o.id===r?{...o,...n}:o)}}:e}default:return e}}const KS=C.createContext(null),Wae=()=>({roles:{},privileges:{},flags:{touched:!1},date:void 0,selectedTab:"roles",forceLogin:!1,restrictedByDefault:!1,modals:{list:[]}}),Uae=({children:e,catalog:t=null,qodly:r=!1,host:n,onSetTabFlags:i,history:o,initialState:a})=>{const[s,c]=C.useReducer(Hae,{...Wae(),...a}),d=C.useMemo(()=>t?pe.parseCatalog(t):null,[t]),u=C.useMemo(()=>({catalog:d,qodly:r,host:n,onSetTabFlags:i,history:o}),[d,r,n,i,o]);return O.jsx(KS.Provider,{value:{state:s,dispatch:c,external:u},children:e})};function Gae(){var s,c,d,u;const e=C.useContext(KS);if(!e)throw new Error("useReducerAdapter must be used within a ReducerAdapterProvider");const{state:t,dispatch:r,external:n}=e,i=C.useMemo(()=>pe.rolesToAPI({roles:t.roles,privileges:t.privileges,forceLogin:t.forceLogin,restrictedByDefault:t.restrictedByDefault}),[t.roles,t.privileges,t.forceLogin,t.restrictedByDefault]),o=C.useCallback(h=>{const{roles:p,privileges:v,forceLogin:y,restrictedByDefault:m}=pe.sanitizeRoles(h);r({type:"UPDATE_ROLES",payload:p}),r({type:"UPDATE_PRIVILEGES",payload:v}),r({type:"TOGGLE_FORCE_LOGIN",payload:y??!1}),r({type:"TOGGLE_RESTRICTED_BY_DEFAULT",payload:m??!1})},[r]),a=cz(i,o);return{getRoles:C.useCallback(()=>t.roles,[t.roles]),getPrivileges:C.useCallback(()=>t.privileges,[t.privileges]),getRolesFlags:C.useCallback(()=>t.flags,[t.flags]),getRolesAndPrivileges:C.useCallback(()=>i,[i]),getCatalog:C.useCallback(()=>n.catalog??null,[n.catalog]),getQodly:C.useCallback(()=>n.qodly??!1,[n.qodly]),getSelectedTab:C.useCallback(()=>t.selectedTab,[t.selectedTab]),getForceLogin:C.useCallback(()=>t.forceLogin??!1,[t.forceLogin]),getRestrictedByDefault:C.useCallback(()=>t.restrictedByDefault??!1,[t.restrictedByDefault]),getGuestPrivilege:C.useCallback(()=>Object.values(t.privileges).find(({privilege:h})=>h==="guest")??null,[t.privileges]),getCatalogMethods:C.useCallback(()=>{var h;return((h=n.catalog)==null?void 0:h.methods)??[]},[n.catalog]),getDataclasses:C.useCallback(()=>{var h;return((h=n.catalog)==null?void 0:h.dataClasses)??{}},[n.catalog]),getSingletons:C.useCallback(()=>{var h;return((h=n.catalog)==null?void 0:h.singletons)??{}},[n.catalog]),getHost:C.useCallback(()=>n.host??"web",[n.host]),getHistory:C.useCallback(()=>{var h,p;return{canUndo:((h=n.history)==null?void 0:h.canUndo)??a.canUndo,canRedo:((p=n.history)==null?void 0:p.canRedo)??a.canRedo}},[a.canUndo,a.canRedo,(s=n.history)==null?void 0:s.canUndo,(c=n.history)==null?void 0:c.canRedo]),actions:{updateRoles:C.useCallback(h=>{a.markEdit(),r({type:"UPDATE_ROLES",payload:h})},[a.markEdit]),updatePrivileges:C.useCallback(h=>{a.markEdit(),r({type:"UPDATE_PRIVILEGES",payload:h})},[a.markEdit]),setRolesContent:C.useCallback(h=>{r({type:"SET_ROLES_CONTENT",payload:h})},[]),toggleTab:C.useCallback(h=>{r({type:"TOGGLE_TAB",payload:h})},[]),toggleForceLogin:C.useCallback(h=>{a.markEdit(),r({type:"TOGGLE_FORCE_LOGIN",payload:h})},[a.markEdit]),toggleRestrictedByDefault:C.useCallback(h=>{a.markEdit(),r({type:"TOGGLE_RESTRICTED_BY_DEFAULT",payload:h})},[a.markEdit]),setTabFlags:C.useCallback((h,p)=>{n.onSetTabFlags&&n.onSetTabFlags(h,p)},[n.onSetTabFlags]),openModal:C.useCallback(async h=>{const{type:p=pe.ModalType.ALERT}=h,v=yz.generate();return r({type:"CREATE_MODAL",payload:{id:v,type:p,isOpen:!0,...h}}),p===pe.ModalType.CONFIRM?new Promise(y=>{const m=xz.pipe(Nae(g=>{const w=g.list.find(x=>x.id===v);return w!==void 0&&!w.isOpen})).subscribe(g=>{var x;const w=g.list.find(_=>_.id===v);if(w){const _=w.closeReason===pe.ModalCloseReason.CONFIRMED,S=Xi.entries(((x=w.views)==null?void 0:x.toggles)||{}).reduce((E,I)=>({...E,[I[0]]:I[1].value}),{});r({type:"REMOVE_MODAL",payload:v}),m.unsubscribe(),y({confirmed:_,options:S})}})}):{confirmed:!1}},[r]),undo:C.useCallback(()=>{var h;if((h=n.history)!=null&&h.onUndo){n.history.onUndo();return}a.undo()},[(d=n.history)==null?void 0:d.onUndo,a.undo]),redo:C.useCallback(()=>{var h;if((h=n.history)!=null&&h.onRedo){n.history.onRedo();return}a.redo()},[(u=n.history)==null?void 0:u.onRedo,a.redo])}}}function Kae(){const e=C.useContext(KS);if(!e)throw new Error("useModals must be used within a ReducerAdapterProvider");const{state:t,dispatch:r}=e;return{modals:t.modals.list,closeModal:C.useCallback(n=>{r({type:"CLOSE_MODAL",payload:n})},[r]),editModal:C.useCallback(n=>{r({type:"EDIT_MODAL",payload:n})},[r]),removeModal:C.useCallback(n=>{r({type:"REMOVE_MODAL",payload:n})},[r])}}const q0=({child:e,parent:t,status:r})=>{const n=Tr(),i=n.getPrivileges();function o(){const s=pe.addPrivilegeIn(t.id,e.id,i);n.actions.updatePrivileges(s)}function a(){const s=pe.removePrivilegeFrom(t.id,e.id,i);n.actions.updatePrivileges(s)}return O.jsxs(vu,{color:r==="included"?"primary":"dark",onClick:r==="included"?a:o,disabled:r==="disabled",children:[e.privilege,O.jsx(ja,{className:an("transform transition-transform",{"rotate-45":r==="included"})})]})},Yae=({selectedPrivilege:e,privileges:t,onSelect:r,setShowIncluded:n,showIncluded:i})=>{const o=Object.values(t),a=pe.getPrivilegeById(e.id,t);let s=a?pe.populateShallow(a.includes,t):[],c=a?pe.populateShallow(pe.parents(a.id,t),t):[],d=a?pe.populateShallow(pe.allowed(a.id,t),t):[];return[s,c,d]=[s,c,d].map(u=>u.filter(h=>(h==null?void 0:h.privilege)!=="guest")),o.length<2&&s.length+c.length+d.length===0?null:O.jsxs(br,{depth:1,className:"w-full border-b p-4",children:[O.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[" ",o.length>2?O.jsx("h4",{className:"text-[13px] font-semibold",children:"Include a privilege"}):O.jsx("div",{}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Fu,{onChange:()=>n(!i),checked:i}),O.jsx("label",{className:"text-xs",children:" Show inherited permissions"})]})]}),O.jsxs("div",{className:"flex flex-wrap items-start justify-start gap-1",children:[s.map(u=>O.jsx(q0,{child:u,parent:e,status:"included",onSelect:r,currentPrivilegeId:u.id},u.id)),d.map(u=>O.jsx(q0,{child:u,parent:e,status:"available",onSelect:r,currentPrivilegeId:u.id},u.id)),c.map(u=>O.jsx(q0,{child:u,parent:e,status:"disabled",onSelect:r,currentPrivilegeId:u.id},u.id))]})]})};function da(e,t,r){let n=r.initialDeps??[],i,o=!0;function a(){var s,c,d;let u;r.key&&((s=r.debug)!=null&&s.call(r))&&(u=Date.now());const h=e();if(!(h.length!==n.length||h.some((y,m)=>n[m]!==y)))return i;n=h;let v;if(r.key&&((c=r.debug)!=null&&c.call(r))&&(v=Date.now()),i=t(...h),r.key&&((d=r.debug)!=null&&d.call(r))){const y=Math.round((Date.now()-u)*100)/100,m=Math.round((Date.now()-v)*100)/100,g=m/16,w=(x,_)=>{for(x=String(x);x.length<_;)x=" "+x;return x};console.info(`%c⏱ ${w(m,5)} /${w(y,5)} ms`,`
|
|
91
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function t1(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Zd=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=Jw(a),c=s.next();!c.done;c=s.next()){var d=c.value;d.remove(this)}}catch(m){t={error:m}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var u=this.initialTeardown;if(oi(u))try{u()}catch(m){o=m instanceof M0?m.errors:[m]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var p=Jw(h),v=p.next();!v.done;v=p.next()){var y=v.value;try{L5(y)}catch(m){o=o??[],m instanceof M0?o=e1(e1([],Qw(o)),Qw(m.errors)):o.push(m)}}}catch(m){n={error:m}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(n)throw n.error}}}if(o)throw new M0(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)L5(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&t1(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&t1(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),hz=Zd.EMPTY;function pz(e){return e instanceof Zd||e&&"closed"in e&&oi(e.remove)&&oi(e.add)&&oi(e.unsubscribe)}function L5(e){oi(e)?e():e.unsubscribe()}var hae={Promise:void 0},pae={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,e1([e,t],Qw(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function vae(e){pae.setTimeout(function(){throw e})}function B5(){}function Iu(e){e()}var GS=(function(e){jl(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,pz(r)&&r.add(n)):n.destination=bae,n}return t.create=function(r,n,i){return new r1(r,n,i)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Zd),gae=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){iu(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){iu(n)}else iu(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){iu(r)}},e})(),r1=(function(e){jl(t,e);function t(r,n,i){var o=e.call(this)||this,a;return oi(r)||!r?a={next:r??void 0,error:n??void 0,complete:i??void 0}:a=r,o.destination=new gae(a),o}return t})(GS);function iu(e){vae(e)}function mae(e){throw e}var bae={closed:!0,next:B5,error:mae,complete:B5},yae=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function xae(e){return e}function wae(e){return e.length===0?xae:e.length===1?e[0]:function(r){return e.reduce(function(n,i){return i(n)},r)}}var F5=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var i=this,o=Eae(t)?t:new r1(t,r,n);return Iu(function(){var a=i,s=a.operator,c=a.source;o.add(s?s.call(o,c):c?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=$5(r),new r(function(i,o){var a=new r1({next:function(s){try{t(s)}catch(c){o(c),a.unsubscribe()}},error:o,complete:i});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[yae]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return wae(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=$5(t),new t(function(n,i){var o;r.subscribe(function(a){return o=a},function(a){return i(a)},function(){return n(o)})})},e.create=function(t){return new e(t)},e})();function $5(e){var t;return(t=e??hae.Promise)!==null&&t!==void 0?t:Promise}function Sae(e){return e&&oi(e.next)&&oi(e.error)&&oi(e.complete)}function Eae(e){return e&&e instanceof GS||Sae(e)&&pz(e)}function _ae(e){return oi(e==null?void 0:e.lift)}function Oae(e){return function(t){if(_ae(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Cae(e,t,r,n,i){return new Iae(e,t,r,n,i)}var Iae=(function(e){jl(t,e);function t(r,n,i,o,a,s){var c=e.call(this,r)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=n?function(d){try{n(d)}catch(u){r.error(u)}}:e.prototype._next,c._error=o?function(d){try{o(d)}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=i?function(){try{i()}catch(d){r.error(d)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(GS),Rae=fz(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),vz=(function(e){jl(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new V5(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Rae},t.prototype.next=function(r){var n=this;Iu(function(){var i,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=Jw(n.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(r)}}catch(d){i={error:d}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(r){var n=this;Iu(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var i=n.observers;i.length;)i.shift().error(r)}})},t.prototype.complete=function(){var r=this;Iu(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?hz:(this.currentObservers=null,s.push(r),new Zd(function(){n.currentObservers=null,t1(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,i=n.hasError,o=n.thrownError,a=n.isStopped;i?r.error(o):a&&r.complete()},t.prototype.asObservable=function(){var r=new F5;return r.source=this,r},t.create=function(r,n){return new V5(r,n)},t})(F5),V5=(function(e){jl(t,e);function t(r,n){var i=e.call(this)||this;return i.destination=r,i.source=n,i}return t.prototype.next=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,r)},t.prototype.error=function(r){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&i!==void 0?i:hz},t})(vz);function Nae(e,t){return Oae(function(r,n){var i=0;r.subscribe(Cae(n,function(o){return e.call(t,o,i++)&&n.next(o)}))})}var k0={},Ns={},ou={},H5;function gz(){if(H5)return ou;H5=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.default=r;let e;const t=new Uint8Array(16);function r(){if(!e&&(e=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!e))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(t)}return ou}var ua={},Ts={},Ps={},W5;function Tae(){if(W5)return Ps;W5=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.default=void 0;var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return Ps.default=e,Ps}var U5;function Jd(){if(U5)return Ts;U5=1,Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.default=void 0;var e=t(Tae());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){return typeof i=="string"&&e.default.test(i)}var n=r;return Ts.default=n,Ts}var G5;function Qd(){if(G5)return ua;G5=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.default=void 0,ua.unsafeStringify=n;var e=t(Jd());function t(a){return a&&a.__esModule?a:{default:a}}const r=[];for(let a=0;a<256;++a)r.push((a+256).toString(16).slice(1));function n(a,s=0){return r[a[s+0]]+r[a[s+1]]+r[a[s+2]]+r[a[s+3]]+"-"+r[a[s+4]]+r[a[s+5]]+"-"+r[a[s+6]]+r[a[s+7]]+"-"+r[a[s+8]]+r[a[s+9]]+"-"+r[a[s+10]]+r[a[s+11]]+r[a[s+12]]+r[a[s+13]]+r[a[s+14]]+r[a[s+15]]}function i(a,s=0){const c=n(a,s);if(!(0,e.default)(c))throw TypeError("Stringified UUID is invalid");return c}var o=i;return ua.default=o,ua}var K5;function Pae(){if(K5)return Ns;K5=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.default=void 0;var e=r(gz()),t=Qd();function r(d){return d&&d.__esModule?d:{default:d}}let n,i,o=0,a=0;function s(d,u,h){let p=u&&h||0;const v=u||new Array(16);d=d||{};let y=d.node||n,m=d.clockseq!==void 0?d.clockseq:i;if(y==null||m==null){const E=d.random||(d.rng||e.default)();y==null&&(y=n=[E[0]|1,E[1],E[2],E[3],E[4],E[5]]),m==null&&(m=i=(E[6]<<8|E[7])&16383)}let g=d.msecs!==void 0?d.msecs:Date.now(),w=d.nsecs!==void 0?d.nsecs:a+1;const x=g-o+(w-a)/1e4;if(x<0&&d.clockseq===void 0&&(m=m+1&16383),(x<0||g>o)&&d.nsecs===void 0&&(w=0),w>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=g,a=w,i=m,g+=122192928e5;const _=((g&268435455)*1e4+w)%4294967296;v[p++]=_>>>24&255,v[p++]=_>>>16&255,v[p++]=_>>>8&255,v[p++]=_&255;const S=g/4294967296*1e4&268435455;v[p++]=S>>>8&255,v[p++]=S&255,v[p++]=S>>>24&15|16,v[p++]=S>>>16&255,v[p++]=m>>>8|128,v[p++]=m&255;for(let E=0;E<6;++E)v[p+E]=y[E];return u||(0,t.unsafeStringify)(v)}var c=s;return Ns.default=c,Ns}var Ms={},Hi={},ks={},Y5;function mz(){if(Y5)return ks;Y5=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.default=void 0;var e=t(Jd());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){if(!(0,e.default)(i))throw TypeError("Invalid UUID");let o;const a=new Uint8Array(16);return a[0]=(o=parseInt(i.slice(0,8),16))>>>24,a[1]=o>>>16&255,a[2]=o>>>8&255,a[3]=o&255,a[4]=(o=parseInt(i.slice(9,13),16))>>>8,a[5]=o&255,a[6]=(o=parseInt(i.slice(14,18),16))>>>8,a[7]=o&255,a[8]=(o=parseInt(i.slice(19,23),16))>>>8,a[9]=o&255,a[10]=(o=parseInt(i.slice(24,36),16))/1099511627776&255,a[11]=o/4294967296&255,a[12]=o>>>24&255,a[13]=o>>>16&255,a[14]=o>>>8&255,a[15]=o&255,a}var n=r;return ks.default=n,ks}var X5;function bz(){if(X5)return Hi;X5=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.URL=Hi.DNS=void 0,Hi.default=a;var e=Qd(),t=r(mz());function r(s){return s&&s.__esModule?s:{default:s}}function n(s){s=unescape(encodeURIComponent(s));const c=[];for(let d=0;d<s.length;++d)c.push(s.charCodeAt(d));return c}const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Hi.DNS=i;const o="6ba7b811-9dad-11d1-80b4-00c04fd430c8";Hi.URL=o;function a(s,c,d){function u(h,p,v,y){var m;if(typeof h=="string"&&(h=n(h)),typeof p=="string"&&(p=(0,t.default)(p)),((m=p)===null||m===void 0?void 0:m.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let g=new Uint8Array(16+h.length);if(g.set(p),g.set(h,p.length),g=d(g),g[6]=g[6]&15|c,g[8]=g[8]&63|128,v){y=y||0;for(let w=0;w<16;++w)v[y+w]=g[w];return v}return(0,e.unsafeStringify)(g)}try{u.name=s}catch{}return u.DNS=i,u.URL=o,u}return Hi}var As={},Z5;function Mae(){if(Z5)return As;Z5=1,Object.defineProperty(As,"__esModule",{value:!0}),As.default=void 0;function e(v){if(typeof v=="string"){const y=unescape(encodeURIComponent(v));v=new Uint8Array(y.length);for(let m=0;m<y.length;++m)v[m]=y.charCodeAt(m)}return t(n(i(v),v.length*8))}function t(v){const y=[],m=v.length*32,g="0123456789abcdef";for(let w=0;w<m;w+=8){const x=v[w>>5]>>>w%32&255,_=parseInt(g.charAt(x>>>4&15)+g.charAt(x&15),16);y.push(_)}return y}function r(v){return(v+64>>>9<<4)+14+1}function n(v,y){v[y>>5]|=128<<y%32,v[r(y)-1]=y;let m=1732584193,g=-271733879,w=-1732584194,x=271733878;for(let _=0;_<v.length;_+=16){const S=m,E=g,I=w,N=x;m=c(m,g,w,x,v[_],7,-680876936),x=c(x,m,g,w,v[_+1],12,-389564586),w=c(w,x,m,g,v[_+2],17,606105819),g=c(g,w,x,m,v[_+3],22,-1044525330),m=c(m,g,w,x,v[_+4],7,-176418897),x=c(x,m,g,w,v[_+5],12,1200080426),w=c(w,x,m,g,v[_+6],17,-1473231341),g=c(g,w,x,m,v[_+7],22,-45705983),m=c(m,g,w,x,v[_+8],7,1770035416),x=c(x,m,g,w,v[_+9],12,-1958414417),w=c(w,x,m,g,v[_+10],17,-42063),g=c(g,w,x,m,v[_+11],22,-1990404162),m=c(m,g,w,x,v[_+12],7,1804603682),x=c(x,m,g,w,v[_+13],12,-40341101),w=c(w,x,m,g,v[_+14],17,-1502002290),g=c(g,w,x,m,v[_+15],22,1236535329),m=d(m,g,w,x,v[_+1],5,-165796510),x=d(x,m,g,w,v[_+6],9,-1069501632),w=d(w,x,m,g,v[_+11],14,643717713),g=d(g,w,x,m,v[_],20,-373897302),m=d(m,g,w,x,v[_+5],5,-701558691),x=d(x,m,g,w,v[_+10],9,38016083),w=d(w,x,m,g,v[_+15],14,-660478335),g=d(g,w,x,m,v[_+4],20,-405537848),m=d(m,g,w,x,v[_+9],5,568446438),x=d(x,m,g,w,v[_+14],9,-1019803690),w=d(w,x,m,g,v[_+3],14,-187363961),g=d(g,w,x,m,v[_+8],20,1163531501),m=d(m,g,w,x,v[_+13],5,-1444681467),x=d(x,m,g,w,v[_+2],9,-51403784),w=d(w,x,m,g,v[_+7],14,1735328473),g=d(g,w,x,m,v[_+12],20,-1926607734),m=u(m,g,w,x,v[_+5],4,-378558),x=u(x,m,g,w,v[_+8],11,-2022574463),w=u(w,x,m,g,v[_+11],16,1839030562),g=u(g,w,x,m,v[_+14],23,-35309556),m=u(m,g,w,x,v[_+1],4,-1530992060),x=u(x,m,g,w,v[_+4],11,1272893353),w=u(w,x,m,g,v[_+7],16,-155497632),g=u(g,w,x,m,v[_+10],23,-1094730640),m=u(m,g,w,x,v[_+13],4,681279174),x=u(x,m,g,w,v[_],11,-358537222),w=u(w,x,m,g,v[_+3],16,-722521979),g=u(g,w,x,m,v[_+6],23,76029189),m=u(m,g,w,x,v[_+9],4,-640364487),x=u(x,m,g,w,v[_+12],11,-421815835),w=u(w,x,m,g,v[_+15],16,530742520),g=u(g,w,x,m,v[_+2],23,-995338651),m=h(m,g,w,x,v[_],6,-198630844),x=h(x,m,g,w,v[_+7],10,1126891415),w=h(w,x,m,g,v[_+14],15,-1416354905),g=h(g,w,x,m,v[_+5],21,-57434055),m=h(m,g,w,x,v[_+12],6,1700485571),x=h(x,m,g,w,v[_+3],10,-1894986606),w=h(w,x,m,g,v[_+10],15,-1051523),g=h(g,w,x,m,v[_+1],21,-2054922799),m=h(m,g,w,x,v[_+8],6,1873313359),x=h(x,m,g,w,v[_+15],10,-30611744),w=h(w,x,m,g,v[_+6],15,-1560198380),g=h(g,w,x,m,v[_+13],21,1309151649),m=h(m,g,w,x,v[_+4],6,-145523070),x=h(x,m,g,w,v[_+11],10,-1120210379),w=h(w,x,m,g,v[_+2],15,718787259),g=h(g,w,x,m,v[_+9],21,-343485551),m=o(m,S),g=o(g,E),w=o(w,I),x=o(x,N)}return[m,g,w,x]}function i(v){if(v.length===0)return[];const y=v.length*8,m=new Uint32Array(r(y));for(let g=0;g<y;g+=8)m[g>>5]|=(v[g/8]&255)<<g%32;return m}function o(v,y){const m=(v&65535)+(y&65535);return(v>>16)+(y>>16)+(m>>16)<<16|m&65535}function a(v,y){return v<<y|v>>>32-y}function s(v,y,m,g,w,x){return o(a(o(o(y,v),o(g,x)),w),m)}function c(v,y,m,g,w,x,_){return s(y&m|~y&g,v,y,w,x,_)}function d(v,y,m,g,w,x,_){return s(y&g|m&~g,v,y,w,x,_)}function u(v,y,m,g,w,x,_){return s(y^m^g,v,y,w,x,_)}function h(v,y,m,g,w,x,_){return s(m^(y|~g),v,y,w,x,_)}var p=e;return As.default=p,As}var J5;function kae(){if(J5)return Ms;J5=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.default=void 0;var e=r(bz()),t=r(Mae());function r(o){return o&&o.__esModule?o:{default:o}}var i=(0,e.default)("v3",48,t.default);return Ms.default=i,Ms}var Ds={},js={},Q5;function Aae(){if(Q5)return js;Q5=1,Object.defineProperty(js,"__esModule",{value:!0}),js.default=void 0;var t={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};return js.default=t,js}var eM;function Dae(){if(eM)return Ds;eM=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.default=void 0;var e=n(Aae()),t=n(gz()),r=Qd();function n(a){return a&&a.__esModule?a:{default:a}}function i(a,s,c){if(e.default.randomUUID&&!s&&!a)return e.default.randomUUID();a=a||{};const d=a.random||(a.rng||t.default)();if(d[6]=d[6]&15|64,d[8]=d[8]&63|128,s){c=c||0;for(let u=0;u<16;++u)s[c+u]=d[u];return s}return(0,r.unsafeStringify)(d)}var o=i;return Ds.default=o,Ds}var qs={},zs={},tM;function jae(){if(tM)return zs;tM=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.default=void 0;function e(i,o,a,s){switch(i){case 0:return o&a^~o&s;case 1:return o^a^s;case 2:return o&a^o&s^a&s;case 3:return o^a^s}}function t(i,o){return i<<o|i>>>32-o}function r(i){const o=[1518500249,1859775393,2400959708,3395469782],a=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof i=="string"){const u=unescape(encodeURIComponent(i));i=[];for(let h=0;h<u.length;++h)i.push(u.charCodeAt(h))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);const s=i.length/4+2,c=Math.ceil(s/16),d=new Array(c);for(let u=0;u<c;++u){const h=new Uint32Array(16);for(let p=0;p<16;++p)h[p]=i[u*64+p*4]<<24|i[u*64+p*4+1]<<16|i[u*64+p*4+2]<<8|i[u*64+p*4+3];d[u]=h}d[c-1][14]=(i.length-1)*8/Math.pow(2,32),d[c-1][14]=Math.floor(d[c-1][14]),d[c-1][15]=(i.length-1)*8&4294967295;for(let u=0;u<c;++u){const h=new Uint32Array(80);for(let w=0;w<16;++w)h[w]=d[u][w];for(let w=16;w<80;++w)h[w]=t(h[w-3]^h[w-8]^h[w-14]^h[w-16],1);let p=a[0],v=a[1],y=a[2],m=a[3],g=a[4];for(let w=0;w<80;++w){const x=Math.floor(w/20),_=t(p,5)+e(x,v,y,m)+g+o[x]+h[w]>>>0;g=m,m=y,y=t(v,30)>>>0,v=p,p=_}a[0]=a[0]+p>>>0,a[1]=a[1]+v>>>0,a[2]=a[2]+y>>>0,a[3]=a[3]+m>>>0,a[4]=a[4]+g>>>0}return[a[0]>>24&255,a[0]>>16&255,a[0]>>8&255,a[0]&255,a[1]>>24&255,a[1]>>16&255,a[1]>>8&255,a[1]&255,a[2]>>24&255,a[2]>>16&255,a[2]>>8&255,a[2]&255,a[3]>>24&255,a[3]>>16&255,a[3]>>8&255,a[3]&255,a[4]>>24&255,a[4]>>16&255,a[4]>>8&255,a[4]&255]}var n=r;return zs.default=n,zs}var rM;function qae(){if(rM)return qs;rM=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.default=void 0;var e=r(bz()),t=r(jae());function r(o){return o&&o.__esModule?o:{default:o}}var i=(0,e.default)("v5",80,t.default);return qs.default=i,qs}var Ls={},nM;function zae(){if(nM)return Ls;nM=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.default=void 0;var e="00000000-0000-0000-0000-000000000000";return Ls.default=e,Ls}var Bs={},iM;function Lae(){if(iM)return Bs;iM=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.default=void 0;var e=t(Jd());function t(i){return i&&i.__esModule?i:{default:i}}function r(i){if(!(0,e.default)(i))throw TypeError("Invalid UUID");return parseInt(i.slice(14,15),16)}var n=r;return Bs.default=n,Bs}var oM;function Bae(){return oM||(oM=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"v1",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"v3",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"v4",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"validate",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return a.default}});var t=u(Pae()),r=u(kae()),n=u(Dae()),i=u(qae()),o=u(zae()),a=u(Lae()),s=u(Jd()),c=u(Qd()),d=u(mz());function u(h){return h&&h.__esModule?h:{default:h}}})(k0)),k0}var A0,aM;function Fae(){if(aM)return A0;aM=1;function e(t,r){if(!t||!r||!t.length||!r.length)throw new Error("Bad alphabet");this.srcAlphabet=t,this.dstAlphabet=r}return e.prototype.convert=function(t){var r,n,i,o={},a=this.srcAlphabet.length,s=this.dstAlphabet.length,c=t.length,d=typeof t=="string"?"":[];if(!this.isValid(t))throw new Error('Number "'+t+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return t;for(r=0;r<c;r++)o[r]=this.srcAlphabet.indexOf(t[r]);do{for(n=0,i=0,r=0;r<c;r++)n=n*a+o[r],n>=s?(o[i++]=parseInt(n/s,10),n=n%s):i>0&&(o[i++]=0);c=i,d=this.dstAlphabet.slice(n,n+1).concat(d)}while(i!==0);return d},e.prototype.isValid=function(t){for(var r=0;r<t.length;++r)if(this.srcAlphabet.indexOf(t[r])===-1)return!1;return!0},A0=e,A0}var D0,sM;function $ae(){if(sM)return D0;sM=1;var e=Fae();function t(r,n){var i=new e(r,n);return function(o){return i.convert(o)}}return t.BIN="01",t.OCT="01234567",t.DEC="0123456789",t.HEX="0123456789abcdef",D0=t,D0}var j0,lM;function Vae(){if(lM)return j0;lM=1;const{v4:e,validate:t}=Bae(),r=$ae(),n={cookieBase90:"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!#$%&'()*+-./:<=>?@[]^_`{|}~",flickrBase58:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",uuid25Base36:"0123456789abcdefghijklmnopqrstuvwxyz"},i={consistentLength:!0};let o;const a=(d,u,h)=>{const p=u(d.toLowerCase().replace(/-/g,""));return!h||!h.consistentLength?p:p.padStart(h.shortIdLength,h.paddingChar)},s=(d,u)=>{const p=u(d).padStart(32,"0").match(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/);return[p[1],p[2],p[3],p[4],p[5]].join("-")},c=d=>Math.ceil(Math.log(2**128)/Math.log(d));return j0=(()=>{const d=(u,h)=>{const p=u||n.flickrBase58,v={...i,...h};if([...new Set(Array.from(p))].length!==p.length)throw new Error("The provided Alphabet has duplicate characters resulting in unreliable results");const y=c(p.length),m={shortIdLength:y,consistentLength:v.consistentLength,paddingChar:p[0]},g=r(r.HEX,p),w=r(p,r.HEX),x=()=>a(e(),g,m),S={alphabet:p,fromUUID:E=>a(E,g,m),maxLength:y,generate:x,new:x,toUUID:E=>s(E,w),uuid:e,validate:(E,I=!1)=>{if(!E||typeof E!="string")return!1;const N=v.consistentLength?E.length===y:E.length<=y,T=E.split("").every(M=>p.includes(M));return I===!1?N&&T:N&&T&&t(s(E,w))}};return Object.freeze(S),S};return d.constants=n,d.uuid=e,d.generate=()=>(o||(o=d(n.flickrBase58).generate),o()),d})(),j0}var yz=Vae();const xz=new vz;function Hae(e,t){switch(t.type){case"UPDATE_ROLES":return{...e,roles:t.payload,flags:{...e.flags,touched:!0}};case"UPDATE_PRIVILEGES":return{...e,privileges:t.payload,flags:{...e.flags,touched:!0}};case"SET_ROLES_CONTENT":{const{content:r,flags:n={},...i}=t.payload,o=pe.sanitizeRoles(r),a={...e.flags,...n};return{...e,...o,...i,flags:a}}case"TOGGLE_TAB":return{...e,selectedTab:t.payload};case"TOGGLE_FORCE_LOGIN":return e.forceLogin===t.payload?e:{...e,forceLogin:t.payload,flags:{...e.flags,touched:!0}};case"TOGGLE_RESTRICTED_BY_DEFAULT":return e.restrictedByDefault===t.payload?e:{...e,restrictedByDefault:t.payload,flags:{...e.flags,touched:!0}};case"SET_FLAGS":return{...e,flags:{...e.flags,...t.payload}};case"CREATE_MODAL":return{...e,modals:{...e.modals,list:[...e.modals.list,t.payload]}};case"REMOVE_MODAL":return{...e,modals:{...e.modals,list:e.modals.list.filter(r=>r.id!==t.payload)}};case"CLOSE_MODAL":{const{id:r,reason:n}=t.payload;let i;if(n)if(e.modals.list.find(a=>a.id===r))i={...e,modals:{...e.modals,list:e.modals.list.map(a=>a.id===r?{...a,closeReason:n,isOpen:!1}:a)}};else return e;else i={...e,modals:{...e.modals,list:e.modals.list.filter(o=>o.id!==r)}};return xz.next(i.modals),i}case"EDIT_MODAL":{const{id:r,...n}=t.payload;return e.modals.list.find(o=>o.id===r)?{...e,modals:{...e.modals,list:e.modals.list.map(o=>o.id===r?{...o,...n}:o)}}:e}default:return e}}const KS=C.createContext(null),Wae=()=>({roles:{},privileges:{},flags:{touched:!1},date:void 0,selectedTab:"roles",forceLogin:!1,restrictedByDefault:!1,modals:{list:[]}}),Uae=({children:e,catalog:t=null,qodly:r=!1,host:n,onSetTabFlags:i,history:o,selectedTab:a,onTabChange:s,initialState:c})=>{const[d,u]=C.useReducer(Hae,{...Wae(),...c}),h=C.useMemo(()=>t?pe.parseCatalog(t):null,[t]),p=C.useMemo(()=>({catalog:h,qodly:r,host:n,onSetTabFlags:i,history:o,selectedTab:a,onTabChange:s}),[h,r,n,i,o,a,s]);return O.jsx(KS.Provider,{value:{state:d,dispatch:u,external:p},children:e})};function Gae(){var s,c,d,u;const e=C.useContext(KS);if(!e)throw new Error("useReducerAdapter must be used within a ReducerAdapterProvider");const{state:t,dispatch:r,external:n}=e,i=C.useMemo(()=>pe.rolesToAPI({roles:t.roles,privileges:t.privileges,forceLogin:t.forceLogin,restrictedByDefault:t.restrictedByDefault}),[t.roles,t.privileges,t.forceLogin,t.restrictedByDefault]),o=C.useCallback(h=>{const{roles:p,privileges:v,forceLogin:y,restrictedByDefault:m}=pe.sanitizeRoles(h);r({type:"UPDATE_ROLES",payload:p}),r({type:"UPDATE_PRIVILEGES",payload:v}),r({type:"TOGGLE_FORCE_LOGIN",payload:y??!1}),r({type:"TOGGLE_RESTRICTED_BY_DEFAULT",payload:m??!1})},[r]),a=cz(i,o);return{getRoles:C.useCallback(()=>t.roles,[t.roles]),getPrivileges:C.useCallback(()=>t.privileges,[t.privileges]),getRolesFlags:C.useCallback(()=>t.flags,[t.flags]),getRolesAndPrivileges:C.useCallback(()=>i,[i]),getCatalog:C.useCallback(()=>n.catalog??null,[n.catalog]),getQodly:C.useCallback(()=>n.qodly??!1,[n.qodly]),getSelectedTab:C.useCallback(()=>n.selectedTab??t.selectedTab,[n.selectedTab,t.selectedTab]),getForceLogin:C.useCallback(()=>t.forceLogin??!1,[t.forceLogin]),getRestrictedByDefault:C.useCallback(()=>t.restrictedByDefault??!1,[t.restrictedByDefault]),getGuestPrivilege:C.useCallback(()=>Object.values(t.privileges).find(({privilege:h})=>h==="guest")??null,[t.privileges]),getCatalogMethods:C.useCallback(()=>{var h;return((h=n.catalog)==null?void 0:h.methods)??[]},[n.catalog]),getDataclasses:C.useCallback(()=>{var h;return((h=n.catalog)==null?void 0:h.dataClasses)??{}},[n.catalog]),getSingletons:C.useCallback(()=>{var h;return((h=n.catalog)==null?void 0:h.singletons)??{}},[n.catalog]),getHost:C.useCallback(()=>n.host??"web",[n.host]),getHistory:C.useCallback(()=>{var h,p;return{canUndo:((h=n.history)==null?void 0:h.canUndo)??a.canUndo,canRedo:((p=n.history)==null?void 0:p.canRedo)??a.canRedo}},[a.canUndo,a.canRedo,(s=n.history)==null?void 0:s.canUndo,(c=n.history)==null?void 0:c.canRedo]),actions:{updateRoles:C.useCallback(h=>{a.markEdit(),r({type:"UPDATE_ROLES",payload:h})},[a.markEdit]),updatePrivileges:C.useCallback(h=>{a.markEdit(),r({type:"UPDATE_PRIVILEGES",payload:h})},[a.markEdit]),setRolesContent:C.useCallback(h=>{r({type:"SET_ROLES_CONTENT",payload:h})},[]),toggleTab:C.useCallback(h=>{n.onTabChange&&n.onTabChange(h),n.selectedTab===void 0&&r({type:"TOGGLE_TAB",payload:h})},[n.onTabChange,n.selectedTab]),toggleForceLogin:C.useCallback(h=>{a.markEdit(),r({type:"TOGGLE_FORCE_LOGIN",payload:h})},[a.markEdit]),toggleRestrictedByDefault:C.useCallback(h=>{a.markEdit(),r({type:"TOGGLE_RESTRICTED_BY_DEFAULT",payload:h})},[a.markEdit]),setTabFlags:C.useCallback((h,p)=>{n.onSetTabFlags&&n.onSetTabFlags(h,p)},[n.onSetTabFlags]),openModal:C.useCallback(async h=>{const{type:p=pe.ModalType.ALERT}=h,v=yz.generate();return r({type:"CREATE_MODAL",payload:{id:v,type:p,isOpen:!0,...h}}),p===pe.ModalType.CONFIRM?new Promise(y=>{const m=xz.pipe(Nae(g=>{const w=g.list.find(x=>x.id===v);return w!==void 0&&!w.isOpen})).subscribe(g=>{var x;const w=g.list.find(_=>_.id===v);if(w){const _=w.closeReason===pe.ModalCloseReason.CONFIRMED,S=Xi.entries(((x=w.views)==null?void 0:x.toggles)||{}).reduce((E,I)=>({...E,[I[0]]:I[1].value}),{});r({type:"REMOVE_MODAL",payload:v}),m.unsubscribe(),y({confirmed:_,options:S})}})}):{confirmed:!1}},[r]),undo:C.useCallback(()=>{var h;if((h=n.history)!=null&&h.onUndo){n.history.onUndo();return}a.undo()},[(d=n.history)==null?void 0:d.onUndo,a.undo]),redo:C.useCallback(()=>{var h;if((h=n.history)!=null&&h.onRedo){n.history.onRedo();return}a.redo()},[(u=n.history)==null?void 0:u.onRedo,a.redo])}}}function Kae(){const e=C.useContext(KS);if(!e)throw new Error("useModals must be used within a ReducerAdapterProvider");const{state:t,dispatch:r}=e;return{modals:t.modals.list,closeModal:C.useCallback(n=>{r({type:"CLOSE_MODAL",payload:n})},[r]),editModal:C.useCallback(n=>{r({type:"EDIT_MODAL",payload:n})},[r]),removeModal:C.useCallback(n=>{r({type:"REMOVE_MODAL",payload:n})},[r])}}const q0=({child:e,parent:t,status:r})=>{const n=Tr(),i=n.getPrivileges();function o(){const s=pe.addPrivilegeIn(t.id,e.id,i);n.actions.updatePrivileges(s)}function a(){const s=pe.removePrivilegeFrom(t.id,e.id,i);n.actions.updatePrivileges(s)}return O.jsxs(vu,{color:r==="included"?"primary":"dark",onClick:r==="included"?a:o,disabled:r==="disabled",children:[e.privilege,O.jsx(ja,{className:an("transform transition-transform",{"rotate-45":r==="included"})})]})},Yae=({selectedPrivilege:e,privileges:t,onSelect:r,setShowIncluded:n,showIncluded:i})=>{const o=Object.values(t),a=pe.getPrivilegeById(e.id,t);let s=a?pe.populateShallow(a.includes,t):[],c=a?pe.populateShallow(pe.parents(a.id,t),t):[],d=a?pe.populateShallow(pe.allowed(a.id,t),t):[];return[s,c,d]=[s,c,d].map(u=>u.filter(h=>(h==null?void 0:h.privilege)!=="guest")),o.length<2&&s.length+c.length+d.length===0?null:O.jsxs(br,{depth:1,className:"w-full border-b p-4",children:[O.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[" ",o.length>2?O.jsx("h4",{className:"text-[13px] font-semibold",children:"Include a privilege"}):O.jsx("div",{}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Fu,{onChange:()=>n(!i),checked:i}),O.jsx("label",{className:"text-xs",children:" Show inherited permissions"})]})]}),O.jsxs("div",{className:"flex flex-wrap items-start justify-start gap-1",children:[s.map(u=>O.jsx(q0,{child:u,parent:e,status:"included",onSelect:r,currentPrivilegeId:u.id},u.id)),d.map(u=>O.jsx(q0,{child:u,parent:e,status:"available",onSelect:r,currentPrivilegeId:u.id},u.id)),c.map(u=>O.jsx(q0,{child:u,parent:e,status:"disabled",onSelect:r,currentPrivilegeId:u.id},u.id))]})]})};function da(e,t,r){let n=r.initialDeps??[],i,o=!0;function a(){var s,c,d;let u;r.key&&((s=r.debug)!=null&&s.call(r))&&(u=Date.now());const h=e();if(!(h.length!==n.length||h.some((y,m)=>n[m]!==y)))return i;n=h;let v;if(r.key&&((c=r.debug)!=null&&c.call(r))&&(v=Date.now()),i=t(...h),r.key&&((d=r.debug)!=null&&d.call(r))){const y=Math.round((Date.now()-u)*100)/100,m=Math.round((Date.now()-v)*100)/100,g=m/16,w=(x,_)=>{for(x=String(x);x.length<_;)x=" "+x;return x};console.info(`%c⏱ ${w(m,5)} /${w(y,5)} ms`,`
|
|
92
92
|
font-size: .6rem;
|
|
93
93
|
font-weight: bold;
|
|
94
94
|
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,r==null?void 0:r.key)}return r!=null&&r.onChange&&!(o&&r.skipInitialOnChange)&&r.onChange(i),o=!1,i}return a.updateDeps=s=>{n=s},a}function cM(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Xae=(e,t)=>Math.abs(e-t)<1.01,Zae=(e,t,r)=>{let n;return function(...i){e.clearTimeout(n),n=e.setTimeout(()=>t.apply(this,i),r)}},uM=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},Jae=e=>e,Qae=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let i=t;i<=r;i++)n.push(i);return n},ese=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;const i=a=>{const{width:s,height:c}=a;t({width:Math.round(s),height:Math.round(c)})};if(i(uM(r)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(a=>{const s=()=>{const c=a[0];if(c!=null&&c.borderBoxSize){const d=c.borderBoxSize[0];if(d){i({width:d.inlineSize,height:d.blockSize});return}}i(uM(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return o.observe(r,{box:"border-box"}),()=>{o.unobserve(r)}},dM={passive:!0},fM=typeof window>"u"?!0:"onscrollend"in window,tse=(e,t)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;let i=0;const o=e.options.useScrollendEvent&&fM?()=>{}:Zae(n,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=u=>()=>{const{horizontal:h,isRtl:p}=e.options;i=h?r.scrollLeft*(p&&-1||1):r.scrollTop,o(),t(i,u)},s=a(!0),c=a(!1);r.addEventListener("scroll",s,dM);const d=e.options.useScrollendEvent&&fM;return d&&r.addEventListener("scrollend",c,dM),()=>{r.removeEventListener("scroll",s),d&&r.removeEventListener("scrollend",c)}},rse=(e,t,r)=>{if(t!=null&&t.borderBoxSize){const n=t.borderBoxSize[0];if(n)return Math.round(n[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},nse=(e,{adjustments:t=0,behavior:r},n)=>{var i,o;const a=e+t;(o=(i=n.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[n.options.horizontal?"left":"top"]:a,behavior:r})};class ise{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var r,n,i;return((i=(n=(r=this.targetWindow)==null?void 0:r.performance)==null?void 0:n.now)==null?void 0:i.call(n))??Date.now()},this.observer=(()=>{let r=null;const n=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{const a=()=>{const s=o.target,c=this.indexFromElement(s);if(!s.isConnected){this.observer.unobserve(s);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(s,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=n())==null||i.disconnect(),r=null},observe:i=>{var o;return(o=n())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=n())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=r=>{Object.entries(r).forEach(([n,i])=>{typeof i>"u"&&delete r[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Jae,rangeExtractor:Qae,onChange:()=>{},measureElement:rse,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...r}},this.notify=r=>{var n,i;(i=(n=this.options).onChange)==null||i.call(n,this,r)},this.maybeNotify=da(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(r,n)=>{const i=new Map,o=new Map;for(let a=n-1;a>=0;a--){const s=r[a];if(i.has(s.lane))continue;const c=o.get(s.lane);if(c==null||s.end>c.end?o.set(s.lane,s):s.end<c.end&&i.set(s.lane,!0),i.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((a,s)=>a.end===s.end?a.index-s.index:a.end-s.end)[0]:void 0},this.getMeasurementOptions=da(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(r,n,i,o,a,s)=>(this.prevLanes!==void 0&&this.prevLanes!==s&&(this.lanesChangedFlag=!0),this.prevLanes=s,this.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:n,scrollMargin:i,getItemKey:o,enabled:a,lanes:s}),{key:!1}),this.getMeasurements=da(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:r,paddingStart:n,scrollMargin:i,getItemKey:o,enabled:a,lanes:s},c)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>r)for(const p of this.laneAssignments.keys())p>=r&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===r&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,d),h=new Array(s).fill(void 0);for(let p=0;p<d;p++){const v=u[p];v&&(h[v.lane]=p)}for(let p=d;p<r;p++){const v=o(p),y=this.laneAssignments.get(p);let m,g;if(y!==void 0&&this.options.lanes>1){m=y;const S=h[m],E=S!==void 0?u[S]:void 0;g=E?E.end+this.options.gap:n+i}else{const S=this.options.lanes===1?u[p-1]:this.getFurthestMeasurement(u,p);g=S?S.end+this.options.gap:n+i,m=S?S.lane:p%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(p,m)}const w=c.get(v),x=typeof w=="number"?w:this.options.estimateSize(p),_=g+x;u[p]={index:p,start:g,size:x,end:_,key:v,lane:m},h[m]=p}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=da(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,n,i,o)=>this.range=r.length>0&&n>0?ose({measurements:r,outerSize:n,scrollOffset:i,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=da(()=>{let r=null,n=null;const i=this.calculateRange();return i&&(r=i.startIndex,n=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,n]},(r,n,i,o,a)=>o===null||a===null?[]:r({startIndex:o,endIndex:a,overscan:n,count:i}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=r=>{const n=this.options.indexAttribute,i=r.getAttribute(n);return i?parseInt(i,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=r=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(i!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,i-o),s=Math.min(this.options.count-1,i+o);return r>=a&&r<=s}return!0},this.measureElement=r=>{if(!r){this.elementsCache.forEach((a,s)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(s))});return}const n=this.indexFromElement(r),i=this.options.getItemKey(n),o=this.elementsCache.get(i);o!==r&&(o&&this.observer.unobserve(o),this.observer.observe(r),this.elementsCache.set(i,r)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(r,void 0,this))},this.resizeItem=(r,n)=>{var i;const o=this.measurementsCache[r];if(!o)return;const a=this.itemSizeCache.get(o.key)??o.size,s=n-a;s!==0&&(((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.getVirtualItems=da(()=>[this.getVirtualIndexes(),this.getMeasurements()],(r,n)=>{const i=[];for(let o=0,a=r.length;o<a;o++){const s=r[o],c=n[s];i.push(c)}return i},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=r=>{const n=this.getMeasurements();if(n.length!==0)return cM(n[wz(0,n.length-1,i=>cM(n[i]).start,r)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const r=this.scrollElement.document.documentElement;return this.options.horizontal?r.scrollWidth-this.scrollElement.innerWidth:r.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(r,n,i=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),a=this.getScrollOffset();n==="auto"&&(n=r>=a+o?"end":"start"),n==="center"?r+=(i-o)/2:n==="end"&&(r-=o);const s=this.getMaxScrollOffset();return Math.max(Math.min(s,r),0)},this.getOffsetForIndex=(r,n="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const i=this.getSize(),o=this.getScrollOffset(),a=this.measurementsCache[r];if(!a)return;if(n==="auto")if(a.end>=o+i-this.options.scrollPaddingEnd)n="end";else if(a.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];if(n==="end"&&r===this.options.count-1)return[this.getMaxScrollOffset(),n];const s=n==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,n,a.size),n]},this.scrollToOffset=(r,{align:n="start",behavior:i="auto"}={})=>{const o=this.getOffsetForAlignment(r,n),a=this.now();this.scrollState={index:null,align:n,behavior:i,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(r,{align:n="auto",behavior:i="auto"}={})=>{r=Math.max(0,Math.min(r,this.options.count-1));const o=this.getOffsetForIndex(r,n);if(!o)return;const[a,s]=o,c=this.now();this.scrollState={index:r,align:s,behavior:i,startedAt:c,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(r,{behavior:n="auto"}={})=>{const i=this.getScrollOffset()+r,o=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var r;const n=this.getMeasurements();let i;if(n.length===0)i=this.options.paddingStart;else if(this.options.lanes===1)i=((r=n[n.length-1])==null?void 0:r.end)??0;else{const o=Array(this.options.lanes).fill(null);let a=n.length-1;for(;a>=0&&o.some(s=>s===null);){const s=n[a];o[s.lane]===null&&(o[s.lane]=s.end),a--}i=Math.max(...o.filter(s=>s!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(r,{adjustments:n,behavior:i})=>{this.options.scrollToFn(r,{behavior:i,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=n?n[0]:this.scrollState.lastTargetOffset,o=1,a=i!==this.scrollState.lastTargetOffset;if(!a&&Xae(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,a&&(this.scrollState.lastTargetOffset=i,this.scrollState.behavior="auto",this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const wz=(e,t,r,n)=>{for(;e<=t;){const i=(e+t)/2|0,o=r(i);if(o<n)e=i+1;else if(o>n)t=i-1;else return i}return e>0?e-1:0};function ose({measurements:e,outerSize:t,scrollOffset:r,lanes:n}){const i=e.length-1,o=c=>e[c].start;if(e.length<=n)return{startIndex:0,endIndex:i};let a=wz(0,i,o,r),s=a;if(n===1)for(;s<i&&e[s].end<r+t;)s++;else if(n>1){const c=Array(n).fill(0);for(;s<i&&c.some(u=>u<r+t);){const u=e[s];c[u.lane]=u.end,s++}const d=Array(n).fill(r+t);for(;a>=0&&d.some(u=>u>=r);){const u=e[a];d[u.lane]=u.start,a--}a=Math.max(0,a-a%n),s=Math.min(i,s+(n-1-s%n))}return{startIndex:a,endIndex:s}}const hM=typeof document<"u"?nt.useLayoutEffect:nt.useEffect;function ase({useFlushSync:e=!0,...t}){const r=nt.useReducer(()=>({}),{})[1],n={...t,onChange:(o,a)=>{var s;e&&a?xn.flushSync(r):r(),(s=t.onChange)==null||s.call(t,o,a)}},[i]=nt.useState(()=>new ise(n));return i.setOptions(n),hM(()=>i._didMount(),[]),hM(()=>i._willUpdate()),i}function cd(e){return ase({observeElementRect:ese,observeElementOffset:tse,scrollToFn:nse,...e})}const sse=({item:e,depth:t})=>{const r=Tr(),[n,i]=C.useState(!1),o=r.getPrivileges(),a=pe.populateShallow(e.includes,o);return O.jsxs("div",{className:"py-1 text-xs text-body",children:[O.jsxs("div",{className:"flex items-center",children:[O.jsx("button",{className:"-ml-1",onClick:s=>{s.stopPropagation(),i(!n)},children:O.jsx(uj,{className:an("h-4 w-4",{"tranform rotate-90":n})})})," ",O.jsx("div",{children:e.privilege})]}),O.jsx("div",{className:"border-l pl-2",style:{marginLeft:t?t*4:3},children:n&&O.jsx(Sz,{depth:t+1,data:a})})]})},Sz=({data:e,depth:t=0})=>e.map(r=>r.includes.length?O.jsx(sse,{item:r,depth:t},r.id):O.jsx("div",{className:an("py-1 text-xs",{}),children:r.privilege},r.id)),Br=()=>document.querySelector(`.${XD.ROLES_EDITOR_SCOPE_CLASS}`)||document.body,ef=({container:e,...t})=>O.jsx(pe.Portal,{...t,container:e||Br()}),pM=C.memo(function({privilege:t,selectedPrivilege:r,onSelect:n,isGuest:i=!1}){const o=Tr(),a=o.getPrivileges(),s=pe.populateShallow(t.includes,a),[c,d]=C.useState(!1),[u,h]=C.useState(t.privilege),[p,v]=C.useState(null),y=pe.useOutsideClick(()=>{c&&w()});pe.useDidMountEffect(()=>{t.privilege!==u&&h(t.privilege)},[t.privilege]);function m(){d(!0),v(null)}function g(){d(!1),h(t.privilege)}function w(){v(null);try{pe.validateName(u);const S=pe.renamePrivilege(u,t.id,a);o.actions.updatePrivileges(S),d(!1)}catch(S){v(S.message)}}const x=async S=>{S.stopPropagation();const{confirmed:E}=await o.actions.openModal({title:"Delete Privilege",type:pe.ModalType.CONFIRM,color:pe.ModalColor.DANGER,message:"Are you sure you want to remove this Privilege?",icon:"FdWarningDanger"});if(E){const I=pe.removePrivilege(t.id,a);if((r==null?void 0:r.id)!==t.id){o.actions.updatePrivileges(I);return}const N=Object.keys(I).filter(T=>I[T].privilege!=="guest");if(N.length===0)n(null);else{const T=Object.keys(a).filter(W=>a[W].privilege!=="guest"),M=T.indexOf(t.id),z=Math.max(0,M-1),j=T[z];M===0?n(I[N[0]]):I[j]?n(I[j]):n(I[N[0]])}o.actions.updatePrivileges(I)}},_=C.useMemo(()=>t.resources.some(S=>S.exists===!1),[t]);return O.jsx(Lr,{container:Br(),color:"negative",icon:O.jsx(wi,{}),label:"This privilege uses non-existing resources",isHidden:!_,className:"w-full",usePortal:!0,children:O.jsxs(br,{depth:4,borderType:(r==null?void 0:r.id)===t.id?"primary":_?"negative":"light",className:an("w-full rounded border p-2"),role:"button","data-cy":"privilegeCard",onClick:()=>{n(t)},ref:y,children:[O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex flex-1 items-center",children:[O.jsx("span",{className:"mr-4",children:i?O.jsx(wV,{className:"h-6 w-6"}):O.jsx(pd,{className:"h-6 w-6"})}),c?O.jsxs(wt.Root,{color:p?"negative":"primary",className:"flex-1 mr-2",children:[O.jsx(wt.Group,{className:"border-input-focus-border",children:O.jsx(wt.Field,{autoFocus:!0,value:u,onChange:S=>h(S.target.value),onKeyDown:S=>{S.key==="Enter"&&w(),S.key==="Escape"&&g()},type:"text"})}),p&&O.jsx(wt.Message,{children:p})]}):O.jsx("span",{className:"inline-block grow overflow-hidden truncate whitespace-nowrap text-xs font-bold",children:u})]}),i?O.jsx("div",{className:"flex items-center justify-center",children:O.jsx(Lr,{icon:O.jsx(wi,{}),label:O.jsx("div",{className:"max-w-xs flex-1 min-w-0 wrap-break-word whitespace-normal py-1",children:"Guest privileges are used to indicate resources accessible without any permission required (e.g. an authenticate function)"}),usePortal:!0,children:O.jsx(on,{className:"h-4 w-4"})})}):O.jsx("div",{className:"flex items-center gap-x-2",children:c?O.jsxs(O.Fragment,{children:[O.jsx(Jt,{variant:"ghost",color:"white",onClick:g,children:O.jsx("span",{children:O.jsx(ej,{className:"h-4 w-4"})})}),O.jsx(Jt,{variant:"ghost",color:"white",onClick:w,children:O.jsx("span",{children:O.jsx(mV,{className:"h-4 w-4"})})})]}):O.jsxs(O.Fragment,{children:[O.jsx(Jt,{variant:"ghost",color:"white",onClick:m,children:O.jsx(cj,{className:"h-4 w-4"})}),O.jsx(Jt,{variant:"ghost",color:"white",onClick:x,children:O.jsx(pj,{className:"h-4 w-4"})})]})})]}),s.length?O.jsx("div",{className:"ml-10.75",children:O.jsx(Sz,{data:s})}):null]})})}),lse=({privileges:e,selectPrivilege:t,selectedPrivilege:r})=>{const n=Tr(),i=n.getGuestPrivilege(),o=n.getCatalog(),a=C.useMemo(()=>{if(o===null||!i)return i;const u=sz({guest:i},Object.values((o==null?void 0:o.dataClasses)??{}));return lz(u,o).guest},[e,o]),s=C.useMemo(()=>Object.entries(e).filter(([,u])=>u.privilege!=="guest").sort(([,u],[,h])=>pe.localeCompare(u.privilege,h.privilege)),[e]),c=C.useRef(null),d=cd({count:s.length,getScrollElement:()=>c.current,estimateSize:()=>72,overscan:5});return O.jsxs("div",{ref:c,className:"flex flex-1 flex-col overflow-auto p-4 pb-10 pt-1",children:[a?O.jsx("div",{className:"mb-4",children:O.jsx(pM,{privilege:a,onSelect:t,selectedPrivilege:r,privileges:e,isGuest:!0})}):null,s.length?O.jsx("div",{style:{position:"relative",height:`${d.getTotalSize()}px`},children:d.getVirtualItems().map(u=>{const[h,p]=s[u.index];return O.jsx("div",{ref:d.measureElement,"data-index":u.index,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${u.start}px)`,paddingBottom:"16px"},children:O.jsx(pM,{privilege:p,onSelect:t,selectedPrivilege:r,privileges:e})},h)})}):O.jsx("div",{className:"flex h-full items-center justify-center",children:O.jsx("div",{className:"flex flex-1 items-center justify-center",children:O.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-4 text-inactive-text",children:[O.jsx(on,{className:"h-10 w-10"}),O.jsx("div",{className:"font-semibold",children:"There are no privileges"}),O.jsxs("div",{className:"flex items-center text-sm",children:["Create a new Privilege by clicking on the"," ",O.jsx(ja,{className:"ml-2 inline h-4 w-4"})]})]})})})]})};var au={exports:{}},su={exports:{}},ft={};/** @license React v16.13.1
|
|
@@ -115,6 +115,6 @@ Valid keys: `+JSON.stringify(Object.keys(P),null," "));var Z=ve(q,ne,D,$,H+"."+
|
|
|
115
115
|
`)&&n.flags==="s")}),fw}var hw,ED;function Ule(){if(ED)return hw;ED=1;var e=St(),t=Gt(),r=t.RegExp;return hw=e(function(){var n=r("(?<a>b)","g");return n.exec("b").groups.a!=="b"||"b".replace(n,"$<a>c")!=="bc"}),hw}var pw,_D;function fE(){if(_D)return pw;_D=1;var e=Ur(),t=yt(),r=Lo(),n=cL(),i=Hle(),o=tE(),a=df(),s=Xa().get,c=Wle(),d=Ule(),u=o("native-string-replace",String.prototype.replace),h=RegExp.prototype.exec,p=h,v=t("".charAt),y=t("".indexOf),m=t("".replace),g=t("".slice),w=(function(){var E=/a/,I=/b*/g;return e(h,E,"a"),e(h,I,"a"),E.lastIndex!==0||I.lastIndex!==0})(),x=i.BROKEN_CARET,_=/()??/.exec("")[1]!==void 0,S=w||_||x||c||d;return S&&(p=function(I){var N=this,T=s(N),M=r(I),z=T.raw,j,W,U,A,K,V,te;if(z)return z.lastIndex=N.lastIndex,j=e(p,z,M),N.lastIndex=z.lastIndex,j;var G=T.groups,re=x&&N.sticky,P=e(n,N),B=N.source,X=0,Q=M;if(re&&(P=m(P,"y",""),y(P,"g")===-1&&(P+="g"),Q=g(M,N.lastIndex),N.lastIndex>0&&(!N.multiline||N.multiline&&v(M,N.lastIndex-1)!==`
|
|
116
116
|
`)&&(B="(?: "+B+")",Q=" "+Q,X++),W=new RegExp("^(?:"+B+")",P)),_&&(W=new RegExp("^"+B+"$(?!\\s)",P)),w&&(U=N.lastIndex),A=e(h,re?W:N,Q),re?A?(A.input=g(A.input,X),A[0]=g(A[0],X),A.index=N.lastIndex,N.lastIndex+=A[0].length):N.lastIndex=0:w&&A&&(N.lastIndex=N.global?A.index+A[0].length:U),_&&A&&A.length>1&&e(u,A[0],W,function(){for(K=1;K<arguments.length-2;K++)arguments[K]===void 0&&(A[K]=void 0)}),A&&G)for(A.groups=V=a(null),K=0;K<G.length;K++)te=G[K],V[te[0]]=A[te[1]];return A}),pw=p,pw}var OD;function uL(){if(OD)return yD;OD=1;var e=no(),t=fE();return e({target:"RegExp",proto:!0,forced:/./.exec!==t},{exec:t}),yD}uL();var CD={},vw,ID;function dL(){if(ID)return vw;ID=1,uL();var e=Ur(),t=zo(),r=fE(),n=St(),i=Pr(),o=Bl(),a=i("species"),s=RegExp.prototype;return vw=function(c,d,u,h){var p=i(c),v=!n(function(){var w={};return w[p]=function(){return 7},""[c](w)!==7}),y=v&&!n(function(){var w=!1,x=/a/;return c==="split"&&(x={},x.constructor={},x.constructor[a]=function(){return x},x.flags="",x[p]=/./[p]),x.exec=function(){return w=!0,null},x[p](""),!w});if(!v||!y||u){var m=/./[p],g=d(p,""[c],function(w,x,_,S,E){var I=x.exec;return I===r||I===s.exec?v&&!E?{done:!0,value:e(m,x,_,S)}:{done:!0,value:e(w,_,x,S)}:{done:!1}});t(String.prototype,c,g[0]),t(s,p,g[1])}h&&o(s[p],"sham",!0)},vw}var gw,RD;function fL(){if(RD)return gw;RD=1;var e=Xz().charAt;return gw=function(t,r,n){return r+(n?e(t,r).length:1)},gw}var mw,ND;function Gle(){if(ND)return mw;ND=1;var e=Gt(),t=St(),r=e.RegExp,n=!t(function(){var i=!0;try{r(".","d")}catch{i=!1}var o={},a="",s=i?"dgimsy":"gimsy",c=function(p,v){Object.defineProperty(o,p,{get:function(){return a+=v,!0}})},d={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};i&&(d.hasIndices="d");for(var u in d)c(u,d[u]);var h=Object.getOwnPropertyDescriptor(r.prototype,"flags").get.call(o);return h!==s||a!==s});return mw={correct:n},mw}var bw,TD;function hL(){if(TD)return bw;TD=1;var e=Ur(),t=In(),r=of(),n=Gle(),i=cL(),o=RegExp.prototype;return bw=n.correct?function(a){return a.flags}:function(a){return!n.correct&&r(o,a)&&!t(a,"flags")?e(i,a):a.flags},bw}var yw,PD;function pL(){if(PD)return yw;PD=1;var e=Ur(),t=Rn(),r=er(),n=ro(),i=fE(),o=TypeError;return yw=function(a,s){var c=a.exec;if(r(c)){var d=e(c,a,s);return d!==null&&t(d),d}if(n(a)==="RegExp")return e(i,a,s);throw new o("RegExp#exec called on incompatible receiver")},yw}var MD;function Kle(){if(MD)return CD;MD=1;var e=Ur(),t=yt(),r=dL(),n=Rn(),i=dr(),o=aE(),a=Lo(),s=qo(),c=Ll(),d=fL(),u=hL(),h=pL(),p=t("".indexOf);return r("match",function(v,y,m){return[function(w){var x=s(this),_=i(w)?c(w,v):void 0;return _?e(_,w,x):new RegExp(w)[v](a(x))},function(g){var w=n(this),x=a(g),_=m(y,w,x);if(_.done)return _.value;var S=a(u(w));if(p(S,"g")===-1)return h(w,x);var E=p(S,"u")!==-1;w.lastIndex=0;for(var I=[],N=0,T;(T=h(w,x))!==null;){var M=a(T[0]);I[N]=M,M===""&&(w.lastIndex=d(x,o(w.lastIndex),E)),N++}return N===0?null:I}]}),CD}Kle();var kD={},xw,AD;function Yle(){if(AD)return xw;AD=1;var e=jz(),t=Ii();return xw=function(r,n,i){return i.get&&e(i.get,n,{getter:!0}),i.set&&e(i.set,n,{setter:!0}),t.f(r,n,i)},xw}var DD;function Xle(){if(DD)return kD;DD=1;var e=Wn(),t=iE().EXISTS,r=yt(),n=Yle(),i=Function.prototype,o=r(i.toString),a=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,s=r(a.exec),c="name";return e&&!t&&n(i,c,{configurable:!0,get:function(){try{return s(a,o(this))[1]}catch{return""}}}),kD}Xle();var jD={},ww,qD;function Zle(){if(qD)return ww;qD=1;var e=tf(),t=Function.prototype,r=t.apply,n=t.call;return ww=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(r):function(){return n.apply(r,arguments)}),ww}var Sw,zD;function Jle(){if(zD)return Sw;zD=1;var e=yt(),t=Ya(),r=Math.floor,n=e("".charAt),i=e("".replace),o=e("".slice),a=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,s=/\$([$&'`]|\d{1,2})/g;return Sw=function(c,d,u,h,p,v){var y=u+c.length,m=h.length,g=s;return p!==void 0&&(p=t(p),g=a),i(v,g,function(w,x){var _;switch(n(x,0)){case"$":return"$";case"&":return c;case"`":return o(d,0,u);case"'":return o(d,y);case"<":_=p[o(x,1,-1)];break;default:var S=+x;if(S===0)return w;if(S>m){var E=r(S/10);return E===0?w:E<=m?h[E-1]===void 0?n(x,1):h[E-1]+n(x,1):w}_=h[S-1]}return _===void 0?"":_})},Sw}var LD;function Qle(){if(LD)return jD;LD=1;var e=Zle(),t=Ur(),r=yt(),n=dL(),i=St(),o=Rn(),a=er(),s=dr(),c=lf(),d=aE(),u=Lo(),h=qo(),p=fL(),v=Ll(),y=Jle(),m=hL(),g=pL(),w=Pr(),x=w("replace"),_=Math.max,S=Math.min,E=r([].concat),I=r([].push),N=r("".indexOf),T=r("".slice),M=function(U){return U===void 0?U:String(U)},z=(function(){return"a".replace(/./,"$0")==="$0"})(),j=(function(){return/./[x]?/./[x]("a","$0")==="":!1})(),W=!i(function(){var U=/./;return U.exec=function(){var A=[];return A.groups={a:"7"},A},"".replace(U,"$<a>")!=="7"});return n("replace",function(U,A,K){var V=j?"$":"$0";return[function(G,re){var P=h(this),B=s(G)?v(G,x):void 0;return B?t(B,G,P,re):t(A,u(P),G,re)},function(te,G){var re=o(this),P=u(te);if(typeof G=="string"&&N(G,V)===-1&&N(G,"$<")===-1){var B=K(A,re,P,G);if(B.done)return B.value}var X=a(G);X||(G=u(G));var Q=u(m(re)),D=N(Q,"g")!==-1,$;D&&($=N(Q,"u")!==-1,re.lastIndex=0);for(var H=[],q;q=g(re,P),!(q===null||(I(H,q),!D));){var Y=u(q[0]);Y===""&&(re.lastIndex=p(P,d(re.lastIndex),$))}for(var ie="",ne=0,ve=0;ve<H.length;ve++){q=H[ve];for(var Z=u(q[0]),J=_(S(c(q.index),P.length),0),ae=[],he,ue=1;ue<q.length;ue++)I(ae,M(q[ue]));var de=q.groups;if(X){var le=E([Z],ae,J,P);de!==void 0&&I(le,de),he=u(e(G,void 0,le))}else he=y(Z,P,J,ae,de,G);J>=ne&&(ie+=T(P,ne,J)+he,ne=J+Z.length)}return ie+T(P,ne)}]},!W||!z||j),jD}Qle();function Wi(e){return!e||!e.ownerDocument||!e.ownerDocument.defaultView?window:e.ownerDocument.defaultView}function Nu(e){return!e||!e.ownerDocument?document:e.ownerDocument}var ma=null,BD=null;lL&&window.addEventListener("resize",function(){BD!==window.devicePixelRatio&&(BD=window.devicePixelRatio,ma=null)});function FD(e){if(ma===null){var t=Nu(e);if(typeof t>"u")return ma=0,ma;var r=t.body,n=t.createElement("div");n.classList.add("simplebar-hide-scrollbar"),r.appendChild(n);var i=n.getBoundingClientRect().right;r.removeChild(n),ma=i}return ma}var ud=(function(){function e(r,n){var i=this;this.onScroll=function(){var o=Wi(i.el);i.scrollXTicking||(o.requestAnimationFrame(i.scrollX),i.scrollXTicking=!0),i.scrollYTicking||(o.requestAnimationFrame(i.scrollY),i.scrollYTicking=!0)},this.scrollX=function(){i.axis.x.isOverflowing&&(i.showScrollbar("x"),i.positionScrollbar("x")),i.scrollXTicking=!1},this.scrollY=function(){i.axis.y.isOverflowing&&(i.showScrollbar("y"),i.positionScrollbar("y")),i.scrollYTicking=!1},this.onMouseEnter=function(){i.showScrollbar("x"),i.showScrollbar("y")},this.onMouseMove=function(o){i.mouseX=o.clientX,i.mouseY=o.clientY,(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseMoveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseMoveForAxis("y")},this.onMouseLeave=function(){i.onMouseMove.cancel(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&i.onMouseLeaveForAxis("x"),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&i.onMouseLeaveForAxis("y"),i.mouseX=-1,i.mouseY=-1},this.onWindowResize=function(){i.scrollbarWidth=i.getScrollbarWidth(),i.hideNativeScrollbar()},this.hideScrollbars=function(){i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.track.rect)||(i.axis.y.scrollbar.el.classList.remove(i.classNames.visible),i.axis.y.isVisible=!1),i.isWithinBounds(i.axis.x.track.rect)||(i.axis.x.scrollbar.el.classList.remove(i.classNames.visible),i.axis.x.isVisible=!1)},this.onPointerEvent=function(o){var a,s;i.axis.x.track.rect=i.axis.x.track.el.getBoundingClientRect(),i.axis.y.track.rect=i.axis.y.track.el.getBoundingClientRect(),(i.axis.x.isOverflowing||i.axis.x.forceVisible)&&(a=i.isWithinBounds(i.axis.x.track.rect)),(i.axis.y.isOverflowing||i.axis.y.forceVisible)&&(s=i.isWithinBounds(i.axis.y.track.rect)),(a||s)&&(o.preventDefault(),o.stopPropagation(),o.type==="mousedown"&&(a&&(i.axis.x.scrollbar.rect=i.axis.x.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.x.scrollbar.rect)?i.onDragStart(o,"x"):i.onTrackClick(o,"x")),s&&(i.axis.y.scrollbar.rect=i.axis.y.scrollbar.el.getBoundingClientRect(),i.isWithinBounds(i.axis.y.scrollbar.rect)?i.onDragStart(o,"y"):i.onTrackClick(o,"y"))))},this.drag=function(o){var a,s=i.axis[i.draggedAxis].track,c=s.rect[i.axis[i.draggedAxis].sizeAttr],d=i.axis[i.draggedAxis].scrollbar,u=i.contentWrapperEl[i.axis[i.draggedAxis].scrollSizeAttr],h=parseInt(i.elStyles[i.axis[i.draggedAxis].sizeAttr],10);o.preventDefault(),o.stopPropagation(),i.draggedAxis==="y"?a=o.pageY:a=o.pageX;var p=a-s.rect[i.axis[i.draggedAxis].offsetAttr]-i.axis[i.draggedAxis].dragOffset,v=p/(c-d.size),y=v*(u-h);i.draggedAxis==="x"&&(y=i.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?y-(c+d.size):y,y=i.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-y:y),i.contentWrapperEl[i.axis[i.draggedAxis].scrollOffsetAttr]=y},this.onEndDrag=function(o){var a=Nu(i.el),s=Wi(i.el);o.preventDefault(),o.stopPropagation(),i.el.classList.remove(i.classNames.dragging),a.removeEventListener("mousemove",i.drag,!0),a.removeEventListener("mouseup",i.onEndDrag,!0),i.removePreventClickId=s.setTimeout(function(){a.removeEventListener("click",i.preventClick,!0),a.removeEventListener("dblclick",i.preventClick,!0),i.removePreventClickId=null})},this.preventClick=function(o){o.preventDefault(),o.stopPropagation()},this.el=r,this.minScrollbarWidth=20,this.options=Object.assign({},e.defaultOptions,n),this.classNames=Object.assign({},e.defaultOptions.classNames,this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,!e.instances.has(this.el)&&(this.recalculate=QA(this.recalculate.bind(this),64),this.onMouseMove=QA(this.onMouseMove.bind(this),64),this.hideScrollbars=tD(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=tD(this.onWindowResize.bind(this),64,{leading:!0}),e.getRtlHelpers=vle(e.getRtlHelpers),this.init())}e.getRtlHelpers=function(){var n=document.createElement("div");n.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var i=n.firstElementChild;document.body.appendChild(i);var o=i.firstElementChild;i.scrollLeft=0;var a=e.getOffset(i),s=e.getOffset(o);i.scrollLeft=999;var c=e.getOffset(o);return{isRtlScrollingInverted:a.left!==s.left&&s.left-c.left!==0,isRtlScrollbarInverted:a.left!==s.left}},e.getOffset=function(n){var i=n.getBoundingClientRect(),o=Nu(n),a=Wi(n);return{top:i.top+(a.pageYOffset||o.documentElement.scrollTop),left:i.left+(a.pageXOffset||o.documentElement.scrollLeft)}};var t=e.prototype;return t.init=function(){e.instances.set(this.el,this),lL&&(this.initDOM(),this.setAccessibilityAttributes(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.initDOM=function(){var n=this;if(Array.prototype.filter.call(this.el.children,function(a){return a.classList.contains(n.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var i=document.createElement("div"),o=document.createElement("div");i.classList.add(this.classNames.track),o.classList.add(this.classNames.scrollbar),i.appendChild(o),this.axis.x.track.el=i.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=i.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},t.setAccessibilityAttributes=function(){var n=this.options.ariaLabel||"scrollable content";this.contentWrapperEl.setAttribute("tabindex","0"),this.contentWrapperEl.setAttribute("role","region"),this.contentWrapperEl.setAttribute("aria-label",n)},t.initListeners=function(){var n=this,i=Wi(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(c){n.el.addEventListener(c,n.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(c){n.el.addEventListener(c,n.onPointerEvent,{capture:!0,passive:!0})}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),i.addEventListener("resize",this.onWindowResize);var o=!1,a=null,s=i.ResizeObserver||jle;this.resizeObserver=new s(function(){!o||a!==null||(a=i.requestAnimationFrame(function(){n.recalculate(),a=null}))}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),i.requestAnimationFrame(function(){o=!0}),this.mutationObserver=new i.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},t.recalculate=function(){var n=Wi(this.el);this.elStyles=n.getComputedStyle(this.el),this.isRtl=this.elStyles.direction==="rtl";var i=this.heightAutoObserverEl.offsetHeight<=1,o=this.heightAutoObserverEl.offsetWidth<=1,a=this.contentEl.offsetWidth,s=this.contentWrapperEl.offsetWidth,c=this.elStyles.overflowX,d=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var u=this.contentEl.scrollHeight,h=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=i?"auto":"100%",this.placeholderEl.style.width=o?a+"px":"auto",this.placeholderEl.style.height=u+"px";var p=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=h>a,this.axis.y.isOverflowing=u>p,this.axis.x.isOverflowing=c==="hidden"?!1:this.axis.x.isOverflowing,this.axis.y.isOverflowing=d==="hidden"?!1:this.axis.y.isOverflowing,this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0,this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0,this.hideNativeScrollbar();var v=this.axis.x.isOverflowing?this.scrollbarWidth:0,y=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&h>s-y,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&u>p-v,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},t.getScrollbarSize=function(n){if(n===void 0&&(n="y"),!this.axis[n].isOverflowing)return 0;var i=this.contentEl[this.axis[n].scrollSizeAttr],o=this.axis[n].track.el[this.axis[n].offsetSizeAttr],a,s=o/i;return a=Math.max(~~(s*o),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(a=Math.min(a,this.options.scrollbarMaxSize)),a},t.positionScrollbar=function(n){if(n===void 0&&(n="y"),!!this.axis[n].isOverflowing){var i=this.contentWrapperEl[this.axis[n].scrollSizeAttr],o=this.axis[n].track.el[this.axis[n].offsetSizeAttr],a=parseInt(this.elStyles[this.axis[n].sizeAttr],10),s=this.axis[n].scrollbar,c=this.contentWrapperEl[this.axis[n].scrollOffsetAttr];c=n==="x"&&this.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-c:c;var d=c/(i-a),u=~~((o-s.size)*d);u=n==="x"&&this.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?u+(o-s.size):u,s.el.style.transform=n==="x"?"translate3d("+u+"px, 0, 0)":"translate3d(0, "+u+"px, 0)"}},t.toggleTrackVisibility=function(n){n===void 0&&(n="y");var i=this.axis[n].track.el,o=this.axis[n].scrollbar.el;this.axis[n].isOverflowing||this.axis[n].forceVisible?(i.style.visibility="visible",this.contentWrapperEl.style[this.axis[n].overflowAttr]="scroll"):(i.style.visibility="hidden",this.contentWrapperEl.style[this.axis[n].overflowAttr]="hidden"),this.axis[n].isOverflowing?o.style.display="block":o.style.display="none"},t.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},t.onMouseMoveForAxis=function(n){n===void 0&&(n="y"),this.axis[n].track.rect=this.axis[n].track.el.getBoundingClientRect(),this.axis[n].scrollbar.rect=this.axis[n].scrollbar.el.getBoundingClientRect();var i=this.isWithinBounds(this.axis[n].scrollbar.rect);i?this.axis[n].scrollbar.el.classList.add(this.classNames.hover):this.axis[n].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[n].track.rect)?(this.showScrollbar(n),this.axis[n].track.el.classList.add(this.classNames.hover)):this.axis[n].track.el.classList.remove(this.classNames.hover)},t.onMouseLeaveForAxis=function(n){n===void 0&&(n="y"),this.axis[n].track.el.classList.remove(this.classNames.hover),this.axis[n].scrollbar.el.classList.remove(this.classNames.hover)},t.showScrollbar=function(n){n===void 0&&(n="y");var i=this.axis[n].scrollbar.el;this.axis[n].isVisible||(i.classList.add(this.classNames.visible),this.axis[n].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},t.onDragStart=function(n,i){i===void 0&&(i="y");var o=Nu(this.el),a=Wi(this.el),s=this.axis[i].scrollbar,c=i==="y"?n.pageY:n.pageX;this.axis[i].dragOffset=c-s.rect[this.axis[i].offsetAttr],this.draggedAxis=i,this.el.classList.add(this.classNames.dragging),o.addEventListener("mousemove",this.drag,!0),o.addEventListener("mouseup",this.onEndDrag,!0),this.removePreventClickId===null?(o.addEventListener("click",this.preventClick,!0),o.addEventListener("dblclick",this.preventClick,!0)):(a.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.onTrackClick=function(n,i){var o=this;if(i===void 0&&(i="y"),!!this.options.clickOnTrack){var a=Wi(this.el);this.axis[i].scrollbar.rect=this.axis[i].scrollbar.el.getBoundingClientRect();var s=this.axis[i].scrollbar,c=s.rect[this.axis[i].offsetAttr],d=parseInt(this.elStyles[this.axis[i].sizeAttr],10),u=this.contentWrapperEl[this.axis[i].scrollOffsetAttr],h=i==="y"?this.mouseY-c:this.mouseX-c,p=h<0?-1:1,v=p===-1?u-d:u+d,y=function m(){if(p===-1){if(u>v){var g;u-=o.options.clickOnTrackSpeed,o.contentWrapperEl.scrollTo((g={},g[o.axis[i].offsetAttr]=u,g)),a.requestAnimationFrame(m)}}else if(u<v){var w;u+=o.options.clickOnTrackSpeed,o.contentWrapperEl.scrollTo((w={},w[o.axis[i].offsetAttr]=u,w)),a.requestAnimationFrame(m)}};y()}},t.getContentElement=function(){return this.contentEl},t.getScrollElement=function(){return this.contentWrapperEl},t.getScrollbarWidth=function(){try{return getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:FD(this.el)}catch{return FD(this.el)}},t.removeListeners=function(){var n=this,i=Wi(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(o){n.el.removeEventListener(o,n.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(o){n.el.removeEventListener(o,n.onPointerEvent,{capture:!0,passive:!0})}),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),i.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},t.unMount=function(){this.removeListeners(),e.instances.delete(this.el)},t.isWithinBounds=function(n){return this.mouseX>=n.left&&this.mouseX<=n.left+n.width&&this.mouseY>=n.top&&this.mouseY<=n.top+n.height},t.findChild=function(n,i){var o=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;return Array.prototype.filter.call(n.children,function(a){return o.call(a,i)})[0]},e})();ud.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3};ud.instances=new WeakMap;function $D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function du(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$D(Object(r),!0).forEach(function(n){ece(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$D(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ece(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dd(){return dd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dd.apply(this,arguments)}function tce(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function rce(e,t){if(e==null)return{};var r=tce(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var nce=["children","scrollableNodeProps","tag"],ice=function(t){var r=Array.prototype.reduce.call(t,function(n,i){var o=i.name.match(/data-simplebar-(.+)/);if(o){var a=o[1].replace(/\W+(.)/g,function(s,c){return c.toUpperCase()});switch(i.value){case"true":n[a]=!0;break;case"false":n[a]=!1;break;case void 0:n[a]=!0;break;default:n[a]=i.value}}return n},{});return r},hf=C.forwardRef(function(e,t){var r=e.children,n=e.scrollableNodeProps,i=n===void 0?{}:n,o=e.tag,a=o===void 0?"div":o,s=rce(e,nce),c=a,d,u=C.useRef(),h=C.useRef(),p=C.useRef(),v={},y={},m=[];return Object.keys(s).forEach(function(g){Object.prototype.hasOwnProperty.call(ud.defaultOptions,g)?v[g]=s[g]:g.match(/data-simplebar-(.+)/)&&g!=="data-simplebar-direction"?m.push({name:g,value:s[g]}):y[g]=s[g]}),m.length&&console.warn(`simplebar-react: this way of passing options is deprecated. Pass it like normal props instead:
|
|
117
117
|
'data-simplebar-auto-hide="false"' —> 'autoHide="false"'
|
|
118
|
-
`),C.useEffect(function(){return u=i.ref||u,h.current&&(d=new ud(h.current,du(du(du(du({},ice(m)),v),u&&{scrollableNode:u.current}),p.current&&{contentNode:p.current})),typeof t=="function"?t(d):t&&(t.current=d)),function(){d.unMount(),d=null,typeof t=="function"&&t(null)}},[]),C.createElement(c,dd({ref:h,"data-simplebar":!0},y),C.createElement("div",{className:"simplebar-wrapper"},C.createElement("div",{className:"simplebar-height-auto-observer-wrapper"},C.createElement("div",{className:"simplebar-height-auto-observer"})),C.createElement("div",{className:"simplebar-mask"},C.createElement("div",{className:"simplebar-offset"},typeof r=="function"?r({scrollableNodeRef:u,contentNodeRef:p}):C.createElement("div",dd({},i,{className:"simplebar-content-wrapper".concat(i.className?" ".concat(i.className):"")}),C.createElement("div",{className:"simplebar-content"},r)))),C.createElement("div",{className:"simplebar-placeholder"})),C.createElement("div",{className:"simplebar-track simplebar-horizontal"},C.createElement("div",{className:"simplebar-scrollbar"})),C.createElement("div",{className:"simplebar-track simplebar-vertical"},C.createElement("div",{className:"simplebar-scrollbar"})))});hf.displayName="SimpleBar";hf.propTypes={children:Fs.oneOfType([Fs.node,Fs.func]),scrollableNodeProps:Fs.object,tag:Fs.string};const vL=e=>{switch(e){case pe.EPermissionType.DATACLASS:return O.jsx(Pu,{className:"h-6 w-6"});case pe.EPermissionType.SINGLETON:return O.jsx(fj,{className:"h-6 w-6"});case pe.EPermissionType.DATASTORE:return O.jsx(lj,{className:"h-6 w-6"});case pe.EPermissionType.ATTRIBUTE:return O.jsx(hj,{className:"h-6 w-6"});case pe.EPermissionType.METHOD:return O.jsx(tj,{className:"h-6 w-6"});case pe.EPermissionType.SINGLETON_METHOD:return O.jsx(sj,{className:"h-6 w-6"});case pe.ESubPermissionType.ENTITY_SEL_METHOD:return O.jsx(aj,{className:"h-6 w-6"});case pe.ESubPermissionType.ENTITY_METHOD:return O.jsx(oj,{className:"h-6 w-6"});case pe.ESubPermissionType.DS_METHOD:return O.jsx(ij,{className:"h-6 w-6"});case pe.ESubPermissionType.DATACLASS_METHOD:return O.jsx(nj,{className:"h-6 w-6"});default:return O.jsx(Pu,{className:"h-6 w-6"})}},VD=({children:e})=>O.jsx("div",{className:"h-full w-full",children:O.jsx("div",{className:"flex h-full w-full flex-1 items-center justify-center",children:O.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-4 py-4 text-inactive-text",children:[O.jsx(on,{className:"h-10 w-10"}),O.jsx("div",{className:"text-center text-sm",children:e})]})})}),fa=({permissions:e,label:t,onToggle:r,onSelect:n,promoted:i,privileges:o,exists:a,optimisticChecked:s})=>{const c=e.find(u=>u.name===t);if(!c)return null;const d=s!==void 0?s:c.checked;return O.jsxs("div",{className:"relative mx-auto flex w-fit items-center",children:[O.jsx(ir,{value:d||c.from.length===0||t==="promote"?d:null,onChange:()=>r&&r(c),isInvalid:a===!1}),O.jsxs("div",{className:"absolute left-full translate-x-1/4 inset-y-0 flex cursor-pointer items-center gap-x-1",children:[t!=="promote"&&(c.checked&&(c.info||c.from.length>0)||!c.checked&&c.from.length>0)&&O.jsx(O.Fragment,{children:O.jsx(Lr,{container:Br(),delay:100,label:O.jsxs("div",{className:"max-w-xs h-fit flex flex-col gap-y-3 p-1.5 text-sm font-semibold",children:[c.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:c.from.map(u=>O.jsx("li",{className:"cursor-pointer list-disc font-bold hover:underline",onClick:()=>n(o[u].id),children:o[u].privilege}))})]})]}):null,c.info&&O.jsxs("div",{className:"flex items-start",children:[O.jsx(Ew,{className:"mr-2 mt-0.5 h-4 w-4 shrink-0"})," ",O.jsx("span",{className:"flex-1 min-w-0 wrap-break-word whitespace-normal text-left",children:c.info})]})]}),children:O.jsx(on,{className:"h-4 w-4 "})})}),(c.checked||c.from.length>0)&&["execute"].includes(t)&&!!(i!=null&&i.length)&&O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:O.jsxs("div",{className:"flex items-start text-s",children:[O.jsx(Ew,{className:"mr-2 mt-0.5 h-4 w-4 shrink-0"}),O.jsxs("p",{children:[O.jsx("span",{className:"mr-1",children:"Function is promoted with: "}),i==null?void 0:i.map(u=>O.jsx("li",{className:"cursor-pointer list-disc font-bold hover:underline",onClick:()=>n(o[u].id),children:o[u].privilege}))]})]})}),children:O.jsx(xV,{className:"h-3 w-3 "})})]})]})},oce=({privilegeId:e,privileges:t})=>{const r=Tr(),n=r.getCatalogMethods(),i=r.getDataclasses(),o=r.getSingletons(),[a,s]=C.useState([]),[c,d]=C.useState("");C.useEffect(()=>{d("")},[e]),C.useEffect(()=>{const p=pe.getInheritedResources(e,t).map(({resource:y,type:m,subType:g})=>({applyTo:y,type:m,subType:g})),v=US(c.toLowerCase(),n,Object.values(i),Object.values(o));s(v.filter(({applyTo:y,type:m,subType:g})=>!Xi.find(p,{applyTo:y,type:m,subType:g})))},[c,e,t,n,i,o]);const[u,h]=C.useState(!1);return O.jsx(Kh.Root,{className:"w-56",onInputChange:p=>d(p||""),onOpenChange:h,isOpen:u,isSearchable:!0,options:a,getOptionLabel:p=>p?p.applyTo:"",getOptionValue:p=>p?p.applyTo:"",value:null,clearSearchOnSelect:!0,closeMenuOnSelect:!1,onChange:p=>{if(!p)return;const v=pe.addPermission(e,p,t);r.actions.updatePrivileges(v),d("")},children:O.jsx(Kh.Group,{children:O.jsx(Kh.Field,{controlShouldRenderValue:!0,renderOption:({data:p})=>O.jsxs("div",{className:"flex items-center gap-x-2",children:[vL(p.type),O.jsx("span",{children:p.applyTo})]}),placeholder:"Create a permission",hideNoOptions:!0})})})};function ace(e){const t=["datastore","singleton","dataclass","attribute","dsMethod","dataclassMethod","entityMethod","entityselMethod","singletonMethod"],r=e.reduce((n,i)=>{const[o]=i.resource.split("."),a=n.find(s=>s.prefix===o.toLowerCase());return a?(a.resources.push(i),n):[...n,{prefix:o.toLowerCase(),type:i.type,resources:[i]}]},[]);return r.sort((n,i)=>n.prefix==="ds"?-1:i.prefix==="ds"||n.prefix>i.prefix?1:-1),r.map(n=>({...n,resources:n.resources.sort((i,o)=>{const a=t.indexOf(i.type),s=t.indexOf(o.type);return a!==s?a-s:i.resource.toLowerCase()>o.resource.toLowerCase()?1:-1})})).reduce((n,i)=>[...n,...i.resources],[])}const bo={datastore:["datastore"],dataclass:["dataclass"],singleton:["singleton"],functions:["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"],attribute:["attribute"]},HD=Object.values(bo).flat();function ha(e,t){return t.length>0&&t.every(r=>e.includes(r))}function sce(e,t){return t.some(r=>e.includes(r))}function lce(e,t){return Array.from(new Set([...e,...t]))}function cce(e,t){return e.filter(r=>!t.includes(r))}const uce=({selectedPrivilege:e,onSelect:t,showIncluded:r,privileges:n,rawPrivileges:i})=>{var ne,ve;const[o,a]=C.useState(null),[s,c]=C.useState(null),{styles:d,attributes:u}=Cd(o,s,{modifiers:[{name:"offset",options:{offset:[0,10]}}]}),h=Tr(),[p,v]=C.useState([]),[y,m]=C.useState([]),[g,w]=C.useState(""),[x,_]=C.useState(""),[S,E]=C.useState({}),I=i??n;C.useEffect(()=>{const Z=setTimeout(()=>m(p),0);return()=>clearTimeout(Z)},[p]),C.useEffect(()=>{E({})},[I]);const{id:N}=e,T=C.useMemo(()=>pe.getInheritedResources(N,I),[N,(ne=I[N])==null?void 0:ne.includes,(ve=I[N])==null?void 0:ve.resources]),M=C.useMemo(()=>pe.getPromotions(N,I),[I[N]]),z=Z=>{v([...Z])},j=Z=>{v(J=>ha(J,Z)?cce(J,Z):lce(J,Z))},W=Z=>{j(bo[Z])},U=ha(p,HD),A=p.length>0&&!U,K=ha(p,bo.functions),V=!K&&sce(p,bo.functions),te=()=>z(HD),G=()=>z([]),re=async Z=>{if(h.getHost()==="vscode"){const ae=pe.removePermission(e.id,Z,n);h.actions.updatePrivileges(ae);return}const{confirmed:J}=await h.actions.openModal({title:"Delete Privilege",type:pe.ModalType.CONFIRM,color:pe.ModalColor.DANGER,message:"Are you sure you want to remove this Privilege?",icon:"FdWarningDanger"});if(J){const ae=pe.removePermission(e.id,Z,n);h.actions.updatePrivileges(ae)}},P=async()=>{const{confirmed:Z}=await h.actions.openModal({title:"Reset Permissions",type:pe.ModalType.CONFIRM,color:pe.ModalColor.DANGER,message:"Are you sure you want to reset permissions for this Privilege?",icon:"FdWarningDanger"});if(Z){const J=pe.resetResources(e.id,n);h.actions.updatePrivileges(J)}},B=C.useMemo(()=>y.length>0?T.filter(Z=>y.includes(Z.type)):T,[T,y]),X=C.useMemo(()=>B.filter(({resource:Z})=>x?new RegExp(Xi.escapeRegExp(x),"i").test(Z):!0),[B,x]),Q=C.useMemo(()=>ace(X),[X]),D=C.useMemo(()=>Q.filter(Z=>{const J=Z.permissions.every(ae=>!ae.checked)&&Z.permissions.some(ae=>ae.from.length>0);return r||!J}),[Q,r]),$=(Z,J)=>{const ae=`${Z.resource}|${Z.type}|${J.name}`;E(he=>({...he,[ae]:!J.checked})),setTimeout(()=>{const he=pe.togglePermission(e.id,Z,J,n);h.actions.updatePrivileges(he)},0)},H=C.useMemo(()=>D.some(Z=>Z.exists===!1),[D]),q=async()=>{const{confirmed:Z}=await h.actions.openModal({title:"Delete Privilege",type:pe.ModalType.CONFIRM,color:pe.ModalColor.DANGER,message:"Are you sure you want to remove these permissions?",views:{tips:[{type:"warning",message:"This action will remove all permissions that don't exist in the catalog for all privileges"}]},icon:"FdWarningDanger"}),J=Object.entries(I).map(([ae,he])=>{const ue=he.resources.filter(de=>!de.exists);return{[ae]:ue.map(de=>({applyTo:de.resource,type:de.type}))}}).reduce((ae,he)=>({...ae,...he}),{});if(Z){const ae=pe.removeMultiplePermissions(J,n);h.actions.updatePrivileges(ae)}},Y=C.useRef(null),ie=cd({count:D.length,getScrollElement:()=>{var Z;return((Z=Y.current)==null?void 0:Z.getScrollElement())??null},estimateSize:()=>36,overscan:5});return C.useEffect(()=>{var Z,J;(J=(Z=Y.current)==null?void 0:Z.getScrollElement())==null||J.scrollTo({top:0})},[N]),O.jsxs(hf,{ref:Y,className:"z-20 h-full flex-1 overflow-auto p-3.75 pt-0",style:{maxHeight:"calc(100vh - 5.5rem - 85px - 20px)"},children:[O.jsxs("table",{className:"relative h-full w-full border-collapse",children:[O.jsx("thead",{className:"sticky top-0 z-20 bg-panel-1",children:O.jsxs("tr",{className:"border-b border-panel-border-subtle",children:[O.jsx("td",{className:"py-2",children:O.jsxs("div",{className:"flex items-center gap-x-2",children:[O.jsx(wt.Root,{className:"relative w-56",children:O.jsxs(wt.Group,{children:[O.jsx(wt.Icon,{children:O.jsx(dj,{})}),O.jsx(wt.Field,{type:"text",placeholder:"Search available permissions",value:g,onChange:Z=>{const J=Z.target.value;w(J),setTimeout(()=>_(J),0)}}),O.jsx(wn.Popover,{className:"flex items-center",children:({open:Z})=>O.jsxs(O.Fragment,{children:[O.jsx(wn.Popover.Button,{ref:a,children:O.jsx(wt.Icon,{isAction:!0,children:O.jsx(JD,{})})}),Z&&O.jsx(ef,{children:O.jsx(wn.Popover.Panel,{ref:c,style:d.popper,...u.popper,className:"z-50",static:!0,children:O.jsxs(br,{depth:3,borderType:"light",className:"rounded-md border px-4 py-2.5",children:[O.jsxs("label",{className:"mb-2 flex cursor-pointer items-center gap-2",children:[O.jsx(ir,{size:"sm",value:A?null:U,onChange:()=>U?G():te()}),O.jsx("h5",{className:"text-sm font-semibold",children:"Filter"})]}),O.jsxs("div",{className:"space-y-2 text-s",children:[O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:ha(p,bo.dataclass),onChange:()=>W("dataclass"),label:"Dataclass"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:ha(p,bo.singleton),onChange:()=>W("singleton"),label:"Singleton"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:V?null:K,onChange:()=>W("functions"),label:"Functions"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:ha(p,bo.attribute),onChange:()=>W("attribute"),label:"Attribute"})})]})]})})})]})})]})}),O.jsx(oce,{privilegeId:N,privileges:I}),O.jsx("div",{children:O.jsx(Lr,{label:`Resetting the privilege will remove all configured\r
|
|
119
|
-
ressources`,container:Br(),children:O.jsx(Jt,{color:"white",variant:"ghost",onClick:P,children:O.jsx(SV,{})})})}),O.jsx(Lr,{icon:O.jsx(wi,{}),label:"Delete all the non existing resources from privileges",container:Br(),children:O.jsx(Jt,{color:"white",variant:"ghost",onClick:q,disabled:!H,children:O.jsx(QD,{className:"h-4 w-4"})})})]})}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Read"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Create"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Update"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Delete"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Execute"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Promote"})]})}),D.length?O.jsxs("tbody",{children:[ie.getVirtualItems().length>0?O.jsx("tr",{style:{height:`${ie.getVirtualItems()[0].start}px`},children:O.jsx("td",{colSpan:7})}):null,ie.getVirtualItems().map(Z=>{const J=D[Z.index],ae=J.permissions.some(he=>he.from.length>0);return O.jsxs("tr",{className:an("group even:bg-white/5 hover:bg-input-bg",{"opacity-60":J.exists===!1}),children:[O.jsxs("td",{className:an("group flex items-center gap-3 py-2 text-xs group-hover:rounded-l group-hover:bg-input-bg ",J.exists===!1?"text-negative-text":""),children:[vL(J.type),J.resource,O.jsx(Lr,{label:"Remove Permission",container:Br(),children:O.jsx(Jt,{color:"white",variant:"ghost",disabled:ae,onClick:()=>{ae?pe.toastSubject.next({kind:"info",markdown:!0,message:"**Info:** Inherited permissions can't be removed",customIcon:on}):re({applyTo:J.resource,type:J.type})},className:"opacity-0 group-hover:opacity-100",children:O.jsx(ja,{className:"h-4 w-4 rotate-45 transform"})})})]}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg ",children:O.jsx(fa,{permissions:J.permissions,showIncluded:r,label:"read",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|read`]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg ",children:O.jsx(fa,{permissions:J.permissions,showIncluded:r,label:"create",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|create`]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg ",children:O.jsx(fa,{permissions:J.permissions,showIncluded:r,label:"update",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|update`]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:O.jsx(fa,{permissions:J.permissions,showIncluded:r,label:"drop",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|drop`]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:O.jsx(fa,{promoted:M[J.resource],permissions:J.permissions,showIncluded:r,label:"execute",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|execute`]})}),O.jsx("td",{className:"py-2 text-center group-hover:rounded-r group-hover:bg-input-bg",children:O.jsx(fa,{permissions:J.permissions,showIncluded:r,label:"promote",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|promote`]})})]},`${J.resource}-${Z.index}`)}),(()=>{const Z=ie.getVirtualItems();if(!Z.length)return null;const J=ie.getTotalSize()-Z[Z.length-1].end;return J>0?O.jsx("tr",{style:{height:`${J}px`},children:O.jsx("td",{colSpan:7})}):null})()]}):null]}),!Q.length&&x?O.jsx(VD,{children:"The Permission you're looking for can't be found "}):null,!Q.length&&!x?O.jsxs(VD,{children:["This Privilege has no Permissions configured yet ",O.jsx("br",{}),'Add a new permission by using the "Create a permission" input above']}):null]})},dce=({onCreate:e})=>{const t=Tr(),r=t.getPrivileges(),[n,i]=C.useState(null),[o,a]=C.useState(null),[s,c]=C.useState(""),[d,u]=C.useState(null),{styles:h,attributes:p}=Cd(n,o,{modifiers:[{name:"offset",options:{offset:[-10,10]}}],placement:"right-start"});C.useEffect(()=>{c(""),u(null)},[o]);const v=(y=()=>{})=>{u(null);try{const m=pe.createPrivilege(s,r),g=Object.values(m).find(w=>w.privilege===s);t.actions.updatePrivileges(m),g&&e(g),setTimeout(()=>{y()},0)}catch(m){u(m.message)}};return O.jsx(wn.Popover,{children:({open:y,close:m})=>O.jsxs(O.Fragment,{children:[O.jsx(wn.Popover.Button,{className:"rounded","data-cy":"New-priv-btn",as:"div",ref:i,children:O.jsx(Jt,{variant:"ghost",color:"white",children:O.jsx(ja,{className:"h-4 w-4"})})}),y&&O.jsx(ef,{children:O.jsx(wn.Popover.Panel,{ref:a,style:h.popper,...p.popper,"data-cy":"New-priv-pop-up",className:"z-50",static:!0,children:O.jsxs(br,{className:"min-w-[256px] border rounded px-4 py-2 text-xs shadow-md",depth:3,borderType:"light",children:[O.jsx("h5",{className:"mb-2 text-xs font-semibold",children:"Create New Privilege"}),O.jsx("div",{className:"mt-2",children:O.jsxs("label",{className:"flex items-center gap-x-4",children:[O.jsx("span",{children:"Name"}),O.jsx(wt.Root,{className:"w-full",color:d?"negative":"primary",children:O.jsxs(wt.Group,{children:[d&&O.jsx(wt.Message,{children:d}),O.jsx(wt.Field,{autoFocus:!0,value:s,onChange:g=>c(g.target.value),onKeyDown:g=>{g.key==="Enter"&&v()},type:"text"})]})})]})}),O.jsxs("div",{className:"mt-4 flex items-center justify-center gap-x-2",children:[O.jsx(Jt,{onClick:()=>v(m),children:"Create"}),O.jsx(Jt,{color:"white",variant:"outline",onClick:()=>m(),children:"Cancel"})]})]})})})]})})},fce=()=>{const e=Tr(),t=e.getCatalog(),r=e.getPrivileges(),[n,i]=C.useState(r);C.useEffect(()=>{const y=setTimeout(()=>i(r),0);return()=>clearTimeout(y)},[r]);const o=C.useMemo(()=>{if(t===null)return n;const y=sz(n,Object.values((t==null?void 0:t.dataClasses)??{}));return lz(y,t)},[n,t]),[a,s]=C.useState(null),[c,d]=C.useState(null),u=y=>{s(y),setTimeout(()=>d(y),0)},h=C.useMemo(()=>Object.keys(o),[o]);C.useEffect(()=>{if(a&&o[a.id]||!h.length)return;const y=o[h[0]];s(y),d(y)},[o]),C.useEffect(()=>{h.length<2&&v(!0)},[h.length]);const[p,v]=C.useState(!0);return O.jsxs("div",{className:"flex h-full min-h-0 min-w-0 flex-1",children:[O.jsxs(br,{depth:1,className:"flex h-full w-89 shrink-0 flex-col border-r",children:[O.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between px-3.5 py-2.5",children:[O.jsxs("div",{className:"flex items-center gap-x-1",children:[O.jsx("span",{children:O.jsx(pd,{className:"h-3.5 w-3.5"})}),O.jsx("span",{className:"text-[11px] font-semibold",children:"Privileges"})]}),O.jsx(dce,{onCreate:y=>{s(y),d(y)}})]}),O.jsx(lse,{privileges:o,selectedPrivilege:a,selectPrivilege:u})]}),a&&o[a.id]?O.jsxs(br,{depth:1,className:"privileges-container relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden border-l-[0.5px]",children:[O.jsxs("div",{className:"mb-1 flex min-h-0 min-w-0 flex-1 h-full w-full flex-col items-stretch overflow-auto",children:[(c??a).privilege!=="guest"?O.jsx(Yae,{privileges:o,selectedPrivilege:c??a,onSelect:y=>s(r[y]),setShowIncluded:v,showIncluded:p}):null,O.jsx(uce,{privileges:o,rawPrivileges:r,selectedPrivilege:c??a,onSelect:y=>s(r[y]),showIncluded:p})]}),O.jsx("div",{className:"mt-auto flex-shrink-0",children:O.jsx(hce,{privileges:o,selectedPrivilege:c??a,setSelectedPrivilege:s})})]}):O.jsx(U4,{tab:"Privilege"})]})},hce=({privileges:e,selectedPrivilege:t,setSelectedPrivilege:r})=>{const[n,i]=C.useState(!1);return O.jsx(pe.Panel,{path:pe.ROLES_TAB_PATH,isOpen:n,onOpen:()=>i(!0),onClose:()=>i(!1),children:O.jsx("div",{className:"flex h-full w-full min-h-0 px-3 pb-3",children:O.jsx(br,{depth:2,className:"h-full w-full overflow-hidden rounded",children:O.jsx(oae,{dict:e,data:pe.getGraphData(t.id,e),onSelect:o=>r(e[o])})})})})},pce=C.memo(({role:e})=>{var E;const t=Tr(),[r,n]=C.useState(e),[i,o]=C.useState(e.role),[a,s]=C.useState(null),c=t.getPrivileges(),d=((E=r.privileges)==null?void 0:E.filter(I=>c[I]&&c[I].privilege!=="guest").length)||0,u=t.getRoles(),{selectedRole:h,selectRole:p}=cS(),[v,y]=C.useState(!1),m=pe.useOutsideClick(()=>{v&&w()});pe.useDidMountEffect(()=>{i!==e.role&&o(e.role)},[e.role]),C.useEffect(()=>{e.role||y(!0)},[]),C.useEffect(()=>{n(e)},[e]);const g=()=>{s(null),y(!0)},w=()=>{s(null),e.role&&e.role===i&&y(!1);try{const I=pe.saveRole({...r,role:i},u);t.actions.updateRoles(I),y(!1)}catch(I){s(I.message)}},x=async I=>{if(I.stopPropagation(),t.getHost()==="vscode"){_();return}const{confirmed:N}=await t.actions.openModal({title:"Delete Role",type:pe.ModalType.CONFIRM,color:pe.ModalColor.DANGER,message:"Are you sure you want to remove this Role?",icon:"FdWarningDanger"});N&&_()},_=()=>{const I=pe.removeRole(r.id,u),N=Object.keys(I);if(h!==r.id){t.actions.updateRoles(I);return}if(N.length===0)p(null);else{const T=Object.keys(u),M=T.indexOf(r.id),z=Math.max(0,M-1),j=T[z];M===0?p(N[0]):I[j]?p(j):p(N[0])}t.actions.updateRoles(I)},S=(I=null)=>{if(I&&I.stopPropagation(),!e.role){_();return}y(!1),o(e.role)};return O.jsx(O.Fragment,{children:O.jsxs(br,{depth:4,borderType:h===r.id?"primary":h!==r.id?"light":"default",className:an("rounded border p-2"),role:"button","data-cy":"privilegeCard",onClick:()=>{p(r.id)},ref:m,children:[O.jsx("div",{className:"flex items-center justify-between",children:O.jsxs("div",{className:"flex flex-1 items-center",children:[O.jsx("span",{className:"mr-4",children:O.jsx(pd,{className:"h-6 w-6"})}),v?O.jsxs(wt.Root,{color:a?"negative":"primary",className:"flex-1 mr-2",children:[O.jsx(wt.Group,{className:"border-input-focus-border",children:O.jsx(wt.Field,{type:"text",value:i,onChange:({target:{value:I}})=>{o(I)},onKeyDown:I=>{I.key==="Enter"&&w(),I.key==="Escape"&&S()},placeholder:"role",autoComplete:"off",autoFocus:!0})}),a&&O.jsx(wt.Message,{children:a})]}):O.jsx("span",{className:"inline-block grow overflow-hidden truncate whitespace-nowrap text-xs font-bold",title:i,children:r.role}),O.jsx("div",{className:an("justify-between ml-auto flex w-fit items-center gap-x-2"),children:v?O.jsxs(O.Fragment,{children:[O.jsx(Jt,{color:"white",variant:"ghost",onClick:w,children:O.jsx(_V,{className:"h-4 w-4"})}),O.jsx(Jt,{color:"white",variant:"ghost",onClick:S,children:O.jsx(ej,{className:"h-4 w-4"})})]}):O.jsxs(O.Fragment,{children:[O.jsx(Jt,{color:"white",variant:"ghost",onClick:g,children:O.jsx(cj,{className:"h-4 w-4"})}),O.jsx(Jt,{color:"white",variant:"ghost",onClick:I=>x(I),children:O.jsx(pj,{className:"h-4 w-4"})})]})})]})}),O.jsxs("span",{className:an("ml-10.75 py-1 text-xs"),children:[d," Privilege",d>1?"s":""]})]})})}),gL=(e,t)=>e?t[e]:null,WD=(e,t,r)=>{const n=gL(e,r);return n?Object.values(r).reduce((i,o)=>o.id===e?n.privileges.includes(t)?{...i,[n.id]:{...n,privileges:n.privileges.filter(a=>a!==t)}}:{...i,[n.id]:{...n,privileges:[...n.privileges,t]}}:{...i,[o.id]:o},{}):r},vce=()=>{const e=Tr(),t=e.getPrivileges(),r=e.getRoles(),{selectedRole:n}=cS(),i=gL(n,r),o=(c,d)=>d&&d.privileges.includes(c.id),a=C.useMemo(()=>Object.values(t).filter(c=>o(c,i)&&c.privilege!=="guest"),[t,i]),s=C.useMemo(()=>Object.values(t).filter(c=>!o(c,i)&&c.privilege!=="guest"),[t,i]);return O.jsxs(br,{depth:1,className:"w-full border-b p-4 ",children:[O.jsx("div",{className:"mb-4 flex items-center gap-x-5",children:O.jsx("h4",{className:"text-[13px] font-semibold ",children:"Privileges"})}),O.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[O.jsx(vu,{"data-cy":"item=>Permisions",className:"italic opacity-90",children:"guest"}),a.map((c,d)=>O.jsxs(vu,{"data-cy":"item=>Permisions",color:"primary",onClick:()=>{const u=WD(i.id,c.id,r);e.actions.updateRoles(u)},children:[c.privilege,O.jsx(Tu.FdPlus,{className:"rotate-45 transform"})]},d)),s.map((c,d)=>O.jsxs(vu,{"data-cy":"item=>Permisions",color:"dark",onClick:()=>{const u=WD(i.id,c.id,r);e.actions.updateRoles(u)},children:[c.privilege,O.jsx(Tu.FdPlus,{})]},d))]})]})},fd=(e,t,r,n=!1)=>{const i=e.applyTo,o=e.type===pe.EPermissionType.DATACLASS?"ds":i.split(".")[0],a={...t,...r},s=()=>({value:!n,inherited:!1,from:[],explicitly:!1}),c={read:s(),create:s(),update:s(),drop:s(),execute:s(),promote:s()},d=h=>{h.forEach(p=>{a[p]&&(a[p].resources.forEach(v=>{if(v.resource===i||v.resource===o){const y=fd(e,t,{[p]:a[p]},n);Object.values(v.permissions).forEach(m=>{c[m.name].explicitly||(!c[m.name].from.includes(a[p].privilege)&&m.checked&&c[m.name].from.push(a[p].privilege),c[m.name].inherited=c[m.name].inherited||y[m.name].value||y[m.name].inherited)})}}),a[p].includes.length>0&&d(a[p].includes))})};if(Object.values(r).forEach(h=>{h.resources.forEach(p=>{p.resource===i&&Object.values(p.permissions).forEach(v=>{v.checked&&(c[v.name].explicitly=!0,n&&(c[v.name].value=!0))})}),(h.includes.length>0||h.privilege==="guest")&&d(h.includes)}),Object.values(t).forEach(h=>{h.resources.forEach(p=>{p.resource===i&&(h.privilege==="guest"?Object.values(p.permissions).forEach(v=>{v.checked&&(c[v.name].explicitly=!0,n&&(c[v.name].value=!0))}):Object.values(p.permissions).forEach(v=>{!c[v.name].explicitly&&v.checked&&(n?c[v.name].value=!0:c[v.name].value=!1)}))})}),(n?Object.entries(c).some(([h,p])=>h!=="promote"&&!p.value&&!p.explicitly):Object.entries(c).some(([h,p])=>h!=="promote"&&p.value&&!p.explicitly))&&![pe.EPermissionType.DATASTORE,pe.EPermissionType.SINGLETON].includes(e.type)){const h={applyTo:o,type:e.type===pe.EPermissionType.DATACLASS?pe.EPermissionType.DATASTORE:e.type===pe.EPermissionType.SINGLETON_METHOD?pe.EPermissionType.SINGLETON:pe.EPermissionType.DATACLASS},p=fd(h,t,r,n),v=y=>{let m=c[y].value;return n?!c[y].value&&!c[y].explicitly&&(m=p[y].value):c[y].value&&!c[y].explicitly&&(m=p[y].value),{value:m,inherited:c[y].inherited||p[y].inherited,from:c[y].from.length>0?c[y].from:p[y].from,explicitly:c[y].explicitly}};return{read:v("read"),create:v("create"),update:v("update"),drop:v("drop"),execute:v("execute"),promote:v("promote")}}return{read:c.read,create:c.create,update:c.update,drop:c.drop,execute:c.execute,promote:c.promote}},gce=({children:e})=>O.jsx("div",{className:"h-full w-full",children:O.jsx("div",{className:"flex h-full w-full flex-1 items-center justify-center",children:O.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-4 py-4 text-inactive-text",children:[O.jsx(on,{className:"absolute -right-full h-10 w-10 translate-x-1"}),O.jsx("div",{className:"text-center text-sm",children:e})]})})}),mce=e=>{switch(e){case"dataclass":return O.jsx(Pu,{className:"h-6 w-6"});case"singleton":return O.jsx(fj,{className:"h-6 w-6"});case"datastore":return O.jsx(lj,{className:"h-6 w-6"});case"attribute":return O.jsx(hj,{className:"h-6 w-6"});case"method":return O.jsx(tj,{className:"h-6 w-6"});case"singletonMethod":return O.jsx(sj,{className:"h-6 w-6"});case"entityselMethod":return O.jsx(aj,{className:"h-6 w-6"});case"entityMethod":return O.jsx(oj,{className:"h-6 w-6"});case"dsMethod":return O.jsx(ij,{className:"h-6 w-6"});case"dataclassMethod":return O.jsx(nj,{className:"h-6 w-6"});default:return O.jsx(Pu,{className:"h-6 w-6"})}},UD=({privileges:e,permission:t,hasChild:r,depth:n,isChild:i=!1,className:o,inSearch:a,toggleCollapse:s,collapsed:c,isRestrictedByDefault:d,toastMessageCallback:u,computedInherited:h})=>{const[p,v]=t.applyTo.split("."),y=C.useMemo(()=>h||fd(t,e.otherPrivs,e.rolePrivs,d),[h,e,t,d]);return O.jsxs("tr",{className:an("group even:bg-white/5 hover:bg-input-bg",o),children:[O.jsxs("td",{className:an("flex h-full w-full items-stretch gap-3 p-0 text-xs group-hover:rounded-l group-hover:bg-input-bg",{"px-1":a}),children:[Array(n).fill("").map((m,g)=>O.jsx("div",{className:an("ml-1.5 mr-1 w-[2px] bg-muted",{"mr-0.5":i})},g)),O.jsxs("div",{className:"flex items-center gap-3 py-2",children:[r&&O.jsx("button",{onClick:s,className:"w-3",children:c?O.jsx(uj,{className:"inline h-4 w-4"}):O.jsx(rj,{className:"inline h-4 w-4"})}),mce(t.type),a?t.applyTo:v||p]})]}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:[pe.EPermissionType.ATTRIBUTE,pe.EPermissionType.DATASTORE,pe.EPermissionType.DATACLASS].includes(t.type)&&O.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",onClick:u,children:[O.jsx(ir,{value:y.read.value||y.read.inherited,isDisabled:!0}),O.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!y.read.value&&y.read.inherited?O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:y.read.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:y.read.from.map((m,g)=>O.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},g))})]})]}):null}),children:O.jsx(on,{className:"h-4 w-4"})}):""})]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:[pe.EPermissionType.ATTRIBUTE,pe.EPermissionType.DATASTORE,pe.EPermissionType.DATACLASS].includes(t.type)&&O.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",onClick:u,children:[O.jsx(ir,{value:y.create.value||y.create.inherited,isDisabled:!0}),O.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!y.create.value&&y.create.inherited?O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:y.read.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:y.read.from.map((m,g)=>O.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},g))})]})]}):null}),children:O.jsx(on,{className:"h-4 w-4"})}):""})]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:[pe.EPermissionType.ATTRIBUTE,pe.EPermissionType.DATASTORE,pe.EPermissionType.DATACLASS].includes(t.type)&&O.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",onClick:u,children:[O.jsx(ir,{value:y.update.value||y.update.inherited,isDisabled:!0}),O.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!y.update.value&&y.update.inherited?O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:y.update.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:y.update.from.map((m,g)=>O.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},g))})]})]}):null}),children:O.jsx(on,{className:"h-4 w-4"})}):""})]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:[pe.EPermissionType.ATTRIBUTE,pe.EPermissionType.DATASTORE,pe.EPermissionType.DATACLASS].includes(t.type)&&O.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",onClick:u,children:[O.jsx(ir,{value:y.drop.value||y.drop.inherited,isDisabled:!0}),O.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!y.drop.value&&y.drop.inherited?O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:y.drop.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:y.drop.from.map((m,g)=>O.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},g))})]})]}):null}),children:O.jsx(on,{className:"h-4 w-4"})}):""})]})}),O.jsx("td",{className:"py-2 text-center group-hover:rounded-r group-hover:bg-input-bg",children:t.type!=="attribute"&&O.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",onClick:u,children:[O.jsx(ir,{value:y.execute.value||y.execute.inherited,isDisabled:!0}),O.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!y.execute.value&&y.execute.inherited?O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:y.execute.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:y.execute.from.map((m,g)=>O.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},g))})]})]}):null}),children:O.jsx(on,{className:"h-4 w-4"})}):""})]})})]})};function GD(e,t,r){const n=[],i=(a,s,c)=>n.push({id:a,permission:s,depth:c,hasChild:!1,isChild:!1}),o=(a,s,c,d,u,h)=>{n.push({id:a,permission:s,depth:c,hasChild:!0,isChild:d,toggleId:a,isCollapsed:u}),u||h()};for(const a of Object.values(e)){o("ds-group",{applyTo:a.applyTo,type:a.type},0,!1,t,()=>{for(const s of a.methods)i(`dsm-${s.applyTo}`,s,1);for(const s of a.dataClasses){const c=`dc-${s.applyTo}`;o(c,{applyTo:s.applyTo,type:s.type},1,!0,r[c]??!1,()=>{for(const d of s.attributes)i(`dca-${d.applyTo}`,d,2);for(const d of s.methods)i(`dcm-${d.applyTo}`,d,2)})}});for(const s of a.singletons){const c=`sing-${s.applyTo}`;o(c,{applyTo:s.applyTo,type:s.type},0,!0,r[c]??!1,()=>{for(const d of s.attributes)i(`singa-${d.applyTo}`,d,1);for(const d of s.methods)i(`singm-${d.applyTo}`,d,1)})}}return n}const KD=["datastore","singleton","dataclass","attribute","dsMethod","dataclassMethod","entityMethod","entityselMethod","singletonMethod"],yo={datastore:["datastore"],dataclass:["dataclass"],singleton:["singleton"],functions:["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"],attribute:["attribute"]},YD=Object.values(yo).flat();function pa(e,t){return t.length>0&&t.every(r=>e.includes(r))}function bce(e,t){return Array.from(new Set([...e,...t]))}function yce(e,t){return e.filter(r=>!t.includes(r))}const xce=({selectedRole:e})=>{const[t,r]=C.useState(null),[n,i]=C.useState(null),{styles:o,attributes:a}=Cd(t,n,{modifiers:[{name:"offset",options:{offset:[0,10]}}]}),s=Tr(),c=s.getRestrictedByDefault(),d=s.getPrivileges(),[u,h]=C.useState([]),[p,v]=C.useState([]),[y,m]=C.useState(""),[g,w]=C.useState("");C.useEffect(()=>{const J=setTimeout(()=>v(u),0);return()=>clearTimeout(J)},[u]);const x=s.getCatalogMethods(),_=s.getDataclasses(),S=s.getSingletons(),E=C.useMemo(()=>sae(x,Object.values(_),Object.values(S)),[x,_,S]),I=C.useMemo(()=>!p.length&&!g?[]:[...US(g,x,Object.values(_),Object.values(S))].filter(J=>p.length?p.includes(J.type):!0).sort((J,ae)=>{const he=KD.indexOf(J.type),ue=KD.indexOf(ae.type);return he!==ue?he-ue:J.applyTo.toLowerCase()>ae.applyTo.toLowerCase()?1:-1}),[g,p,x,_,S]),N=J=>h([...J]),T=J=>{h(ae=>pa(ae,J)?yce(ae,J):bce(ae,J))},M=J=>T(yo[J]),z=YD.every(J=>u.includes(J)),j=u.length>0&&!z,W=pa(u,yo.functions),U=()=>N(YD),A=()=>N([]),K=s.getRoles(),[V,te]=C.useState(K);C.useEffect(()=>{const J=setTimeout(()=>te(K),0);return()=>clearTimeout(J)},[K]);const G=C.useRef(null);C.useEffect(()=>{var J,ae;(ae=(J=G.current)==null?void 0:J.getScrollElement())==null||ae.scrollTo({top:0})},[e]);const re=cd({count:I.length,getScrollElement:()=>{var J;return((J=G.current)==null?void 0:J.getScrollElement())??null},estimateSize:()=>36,overscan:5,paddingEnd:40}),P=C.useMemo(()=>{const J=Object.values(d).find(le=>le.privilege==="guest"),ae=V[e],he=ae?Object.fromEntries(ae.privileges.map(le=>[le,d[le]]).filter(([,le])=>!!le)):{};if(c)return{rolePrivs:he,otherPrivs:J?{[J.id]:J}:{}};const ue=J?{[J.id]:{...J,active:!0}}:{},de=Object.fromEntries(Object.entries(d).filter(([le])=>le!==(J==null?void 0:J.id)&&!(ae!=null&&ae.privileges.includes(le))).map(([le,xe])=>[le,{...xe,active:!1}]));return{rolePrivs:he,otherPrivs:{...ue,...de}}},[d,V,e,c]),[B,X]=C.useState(!1),[Q,D]=C.useState({}),$=C.useMemo(()=>{const J=[];for(const ae of Object.values(E)){for(const he of ae.dataClasses)J.push(`dc-${he.applyTo}`);for(const he of ae.singletons)J.push(`sing-${he.applyTo}`)}return J},[E]),H=$.length>0&&$.every(J=>Q[J]===!0),q=C.useCallback(()=>{const J={};for(const ae of $)J[ae]=!0;D(J)},[$]),Y=C.useCallback(J=>{J==="ds-group"?X(ae=>!ae):D(ae=>({...ae,[J]:!ae[J]}))},[]),ie=C.useMemo(()=>{const J=new Map;for(const{permission:ae}of GD(E,!1,{}))J.set(`${ae.applyTo}|${ae.type}`,fd(ae,P.otherPrivs,P.rolePrivs,c));return J},[P,c,E]),ne=C.useMemo(()=>GD(E,B,Q),[E,B,Q]),ve=cd({count:ne.length,getScrollElement:()=>{var J;return((J=G.current)==null?void 0:J.getScrollElement())??null},estimateSize:()=>36,overscan:8,paddingEnd:15}),Z=C.useCallback(()=>{pe.toastSubject.next({kind:"info",markdown:!0,message:"**Info:** You can add or modify permissions only in the Privilege section.",customIcon:Ew})},[]);return O.jsxs(hf,{ref:G,className:"z-20 h-full flex-1 overflow-auto p-3.75 pt-0",style:{maxHeight:"calc(100vh - 5.5rem - 85px - 20px)"},children:[O.jsxs("table",{className:"relative h-full w-full border-collapse",children:[O.jsx("thead",{className:"sticky top-0 z-20 bg-panel-1",children:O.jsxs("tr",{className:"border-b border-grey-100",children:[O.jsx("td",{className:"py-2",children:O.jsxs("div",{className:"flex items-center gap-x-2",children:[O.jsx(Lr,{label:"Collapse All",position:"up",container:Br(),children:O.jsx(Jt,{color:"white",variant:"ghost",disabled:B&&H,onClick:()=>{H?(q(),X(!0)):q()},children:O.jsx(yV,{})})}),O.jsx(wt.Root,{className:"w-56",children:O.jsxs(wt.Group,{children:[O.jsx(wt.Icon,{children:O.jsx(dj,{})}),O.jsx(wt.Field,{type:"text",placeholder:"Search",value:y,onChange:J=>{const ae=J.target.value;m(ae),setTimeout(()=>w(ae),0)}}),O.jsx(wn.Popover,{className:"flex items-center",children:({open:J})=>O.jsxs(O.Fragment,{children:[O.jsx(wn.Popover.Button,{ref:r,children:O.jsx(wt.Icon,{isAction:!0,children:O.jsx(JD,{})})}),J&&O.jsx(ef,{children:O.jsx(wn.Popover.Panel,{ref:i,style:o.popper,...a.popper,className:"z-50",static:!0,children:O.jsxs(br,{depth:3,borderType:"light",className:"rounded-md border px-4 py-2.5 text-xs",children:[O.jsxs("label",{className:"mb-2 flex cursor-pointer items-center gap-2",children:[O.jsx(ir,{size:"sm",value:j?null:z,onChange:()=>z?A():U()}),O.jsx("h5",{className:"text-sm font-semibold",children:"Filter"})]}),O.jsxs("div",{className:"space-y-2 text-s",children:[O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:pa(u,yo.datastore),onChange:()=>M("datastore"),label:"Datastore"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:pa(u,yo.dataclass),onChange:()=>M("dataclass"),label:"Dataclass"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:pa(u,yo.singleton),onChange:()=>M("singleton"),label:"Singleton"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:W,onChange:()=>M("functions"),label:"Functions"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:pa(u,yo.attribute),onChange:()=>M("attribute"),label:"Attribute"})})]})]})})})]})})]})})]})}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"read"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Create"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Update"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Delete"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Execute"})]})}),O.jsx("tbody",{className:"relative",children:p.length||g?O.jsxs(O.Fragment,{children:[re.getVirtualItems().length>0?O.jsx("tr",{style:{height:`${re.getVirtualItems()[0].start}px`},children:O.jsx("td",{colSpan:6})}):null,re.getVirtualItems().map(J=>{const ae=I[J.index];return O.jsx(UD,{privileges:P,permission:ae,depth:0,inSearch:!0,isRestrictedByDefault:c,allPrivileges:d,toastMessageCallback:Z,computedInherited:ie.get(`${ae.applyTo}|${ae.type}`)},`${ae.type}-${J.index}`)}),(()=>{const J=re.getVirtualItems();if(!J.length)return null;const ae=re.getTotalSize()-J[J.length-1].end;return ae>0?O.jsx("tr",{style:{height:`${ae}px`},children:O.jsx("td",{colSpan:6})}):null})()]}):O.jsxs(O.Fragment,{children:[ve.getVirtualItems().length>0?O.jsx("tr",{style:{height:`${ve.getVirtualItems()[0].start}px`},children:O.jsx("td",{colSpan:6})}):null,ve.getVirtualItems().map(J=>{const ae=ne[J.index];return O.jsx(UD,{privileges:P,permission:ae.permission,depth:ae.depth,hasChild:ae.hasChild,isChild:ae.isChild,collapsed:ae.isCollapsed,toggleCollapse:ae.toggleId?()=>Y(ae.toggleId):void 0,isRestrictedByDefault:c,allPrivileges:d,toastMessageCallback:Z,computedInherited:ie.get(`${ae.permission.applyTo}|${ae.permission.type}`)},ae.id)}),(()=>{const J=ve.getVirtualItems();if(!J.length)return null;const ae=ve.getTotalSize()-J[J.length-1].end;return ae>0?O.jsx("tr",{style:{height:`${ae}px`},children:O.jsx("td",{colSpan:6})}):null})()]})})]}),(g||p.length)&&!I.length?O.jsx(gce,{children:"The Permission you're looking for can't be found "}):null]})},wce=()=>O.jsx("div",{className:"flex flex-1 items-center justify-center",children:O.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-grey-200 border-t-primary-dark"})}),Sce=()=>{const e=Tr(),t=e.getRoles(),[r,n]=C.useState(null),[i,o]=C.useState(null),[a,s]=C.useState(""),[c,d]=C.useState(null),{styles:u,attributes:h}=Cd(r,i,{modifiers:[{name:"offset",options:{offset:[-10,10]}}],placement:"right-start"});C.useEffect(()=>{s(""),d(null)},[i]);const p=()=>{if(!a)throw new Error("Please enter a valid name");if(Object.values(t).find(g=>g.role.toLowerCase()===a.toLowerCase()))throw new Error(`A role with the name ${a} already exists`);const y=yz.generate(),m=pe.createRole(y,a,t);e.actions.updateRoles(m)};return O.jsx(wn.Popover,{children:({open:v,close:y})=>{const m=()=>{d(null);try{pe.validateName(a),p(),y()}catch(g){d(g.message)}};return O.jsxs(O.Fragment,{children:[O.jsx(wn.Popover.Button,{className:"rounded","data-cy":"New-priv-btn",as:"div",ref:n,children:O.jsx(Jt,{variant:"ghost",color:"white",children:O.jsx(ja,{className:"h-4 w-4"})})}),v&&O.jsx(ef,{children:O.jsx(wn.Popover.Panel,{ref:o,style:u.popper,...h.popper,"data-cy":"New-priv-pop-up",className:"z-50",static:!0,children:O.jsxs(br,{className:"min-w-[256px] border rounded px-4 py-2 text-xs shadow-md",depth:3,borderType:"light",children:[O.jsx("h5",{className:"mb-2 text-xs font-semibold",children:"Create New Role"}),O.jsx("div",{className:"mt-2",children:O.jsxs("label",{className:"flex items-center gap-x-4",children:[O.jsx("span",{children:"Name"}),O.jsx(wt.Root,{color:c?"negative":"primary",className:"w-full",children:O.jsxs(wt.Group,{children:[c&&O.jsx(wt.Message,{children:c}),O.jsx(wt.Field,{autoFocus:!0,value:a,onChange:g=>s(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m()},type:"text"})]})})]})}),O.jsxs("div",{className:"mt-4 flex items-center justify-center gap-x-2",children:[O.jsx(Jt,{onClick:()=>{m()},children:"Create"}),O.jsx(Jt,{color:"white",variant:"outline",onClick:()=>y(),children:"Cancel"})]})]})})})]})}})},Ece=()=>{const e=Tr(),t=e.getRoles(),r=e.getPrivileges(),{selectedRole:n,deferredSelectedRole:i}=cS(),o=C.useMemo(()=>Object.values(t).sort((a,s)=>pe.localeCompare(a.role,s.role)),[t]);return O.jsxs("div",{className:"flex flex-1 h-full",children:[O.jsxs(br,{depth:1,className:"flex h-full w-89 flex-col border-r",children:[O.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3.5 py-2.5",children:[O.jsxs("div",{className:"flex items-center gap-x-1",children:[O.jsx("span",{children:O.jsx(pd,{className:"h-3.5 w-3.5"})}),O.jsx("span",{className:"text-[11px] font-semibold",children:"Roles"})]}),O.jsx(Sce,{})]}),O.jsx("div",{className:"flex-1 overflow-auto p-4 pb-10 pt-1",children:o.length>0?O.jsx("div",{className:"flex flex-col gap-4",children:o.map(a=>O.jsx(pce,{role:a,privileges:r},a.id))}):O.jsx("div",{className:"flex h-full items-center justify-center",children:O.jsx("div",{className:"flex flex-1 items-center justify-center text-inactive-text",children:O.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[O.jsx(on,{className:"h-10 w-10"}),O.jsx("div",{className:"font-semibold",children:"There are no roles"}),O.jsxs("div",{className:"flex items-center text-sm",children:["Create a new role by clicking on the"," ",O.jsx(ja,{className:"ml-2 inline h-4 w-4"})]})]})})})})]}),O.jsx(br,{depth:1,className:an("relative flex h-full w-full flex-1 flex-col items-stretch overflow-x-auto",{"border-l-[0.5px]":n}),children:O.jsx("div",{className:"flex h-full w-full select-none flex-col",children:n?O.jsxs(O.Fragment,{children:[O.jsx(vce,{}),i?O.jsx(xce,{selectedRole:i}):O.jsx(wce,{})]}):O.jsx(U4,{tab:"Role"})})})]})},mL=()=>{const e=Tr(),t=e.getQodly(),r=e.getSelectedTab(),n=e.getForceLogin(),i=e.getRestrictedByDefault(),{canUndo:o,canRedo:a}=e.getHistory(),s=C.useRef();return O.jsx("div",{className:"absolute inset-0 flex flex-1 overflow-hidden",children:O.jsx("div",{className:"relative flex flex-1 overflow-hidden","data-cy":"Roles&Privileges-editor-cy",ref:c=>s.current=c,children:O.jsxs("div",{className:"flex min-h-0 w-full flex-1 flex-col",children:[O.jsx($Y,{activeTab:r,forceLogin:n,restrictedByDefault:i,canUndo:o,canRedo:a,onUndo:e.actions.undo,onRedo:e.actions.redo,onTabChange:c=>{e.actions.toggleTab(c)},onForceLoginChange:c=>{e.actions.toggleForceLogin(c)},onRestrictedByDefaultChange:c=>{e.actions.toggleRestrictedByDefault(c)},qodly:t}),O.jsx("div",{className:r==="roles"?"flex flex-1 overflow-hidden":"hidden",children:O.jsx(VY,{children:O.jsx(Ece,{})})}),O.jsx("div",{className:r==="privileges"?"flex flex-1 overflow-hidden":"hidden",children:O.jsx(fce,{})})]})})})},_ce="object",Oce={forceLogin:{type:"boolean"},restrictedByDefault:{type:"boolean"},privileges:{type:"array",items:{$ref:"#/definitions/Privilege"}},roles:{type:"array",items:{$ref:"#/definitions/Role"}},permissions:{type:"object",properties:{allowed:{type:"array",items:{$ref:"#/definitions/Permission"}}}}},Cce={Privilege:{type:"object",properties:{id:{type:"string"},privilege:{type:"string"},includes:{type:"array",items:{type:"string"}}},required:["privilege"]},Role:{type:"object",properties:{id:{type:"string"},role:{type:"string"},privileges:{type:"array",items:{type:"string"}}},required:["role"]},PermissionEntry:{type:"array",items:{type:"string"}},Permission:{type:"object",properties:{applyTo:{type:"string"},type:{enum:["dataclass","method","attribute","datastore","singleton","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"]},subType:{enum:["dsMethod","dataclassMethod","entityMethod","entityselMethod"]},read:{$ref:"#/definitions/PermissionEntry"},create:{$ref:"#/definitions/PermissionEntry"},update:{$ref:"#/definitions/PermissionEntry"},drop:{$ref:"#/definitions/PermissionEntry"},execute:{$ref:"#/definitions/PermissionEntry"},promote:{$ref:"#/definitions/PermissionEntry"}},required:["applyTo","type"]}},Ice={type:_ce,properties:Oce,definitions:Cce},Rce=()=>{const{modals:e,closeModal:t,editModal:r}=Kae();return O.jsx(O.Fragment,{children:e.map((n,i)=>O.jsx(pe.Modal,{hasOverlay:i===0,...n,onClose:t,onEdit:r,container:Br()},n.id))})},bL=e=>{if(!e)return pe.rolesToAPI(pe.sanitizeRoles({}));try{return pe.rolesToAPI(pe.sanitizeRoles(JSON.parse(e)))}catch{return pe.rolesToAPI(pe.sanitizeRoles({}))}},Nce=({initialValue:e,onChange:t,...r})=>{const n=Tr(),i=n.getRolesFlags(),o=n.getRolesAndPrivileges(),a=C.useMemo(()=>bL(e),[e]),s=C.useRef(o),c=C.useRef(a),d=C.useRef(a);return C.useEffect(()=>{s.current=o},[o]),C.useEffect(()=>{Xi.isEqual(a,d.current)||(d.current=a,c.current=a,!Xi.isEqual(a,s.current)&&n.actions.setRolesContent({content:a,flags:{touched:!1}}))},[n,a]),pe.useDidMountEffect(()=>{if(!(!t||!i.touched)&&!Xi.isEqual(o,c.current))try{const u=JSON.stringify(o,null,2);t(u),c.current=o}catch(u){console.error("[Roles Editor Standalone] Error on value stringify:",u)}},[o,i.touched,t]),O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"relative h-screen z-10 overflow-hidden",children:O.jsx(mL,{...r})}),O.jsx(Rce,{})]})},Tce=e=>{const t=Gae();return O.jsx(dz,{adapter:t,children:O.jsx(pe.TipsProvider,{children:O.jsx(Nce,{...e})})})},Pce=({initialValue:e,catalog:t,history:r,...n})=>{const i=C.useMemo(()=>({...pe.sanitizeRoles(bL(e)),flags:{touched:!1}}),[e]);return O.jsx(Uae,{initialState:i,catalog:t,history:r,children:O.jsx(Tce,{initialValue:e,...n})})};exports.ROLES_EDITOR_SCOPE_CLASS=XD.ROLES_EDITOR_SCOPE_CLASS;exports.EditorStateAdapterProvider=dz;exports.Roles=mL;exports.Standalone=Pce;exports.jsonSchema=Ice;exports.useReduxAdapter=fae;
|
|
118
|
+
`),C.useEffect(function(){return u=i.ref||u,h.current&&(d=new ud(h.current,du(du(du(du({},ice(m)),v),u&&{scrollableNode:u.current}),p.current&&{contentNode:p.current})),typeof t=="function"?t(d):t&&(t.current=d)),function(){d.unMount(),d=null,typeof t=="function"&&t(null)}},[]),C.createElement(c,dd({ref:h,"data-simplebar":!0},y),C.createElement("div",{className:"simplebar-wrapper"},C.createElement("div",{className:"simplebar-height-auto-observer-wrapper"},C.createElement("div",{className:"simplebar-height-auto-observer"})),C.createElement("div",{className:"simplebar-mask"},C.createElement("div",{className:"simplebar-offset"},typeof r=="function"?r({scrollableNodeRef:u,contentNodeRef:p}):C.createElement("div",dd({},i,{className:"simplebar-content-wrapper".concat(i.className?" ".concat(i.className):"")}),C.createElement("div",{className:"simplebar-content"},r)))),C.createElement("div",{className:"simplebar-placeholder"})),C.createElement("div",{className:"simplebar-track simplebar-horizontal"},C.createElement("div",{className:"simplebar-scrollbar"})),C.createElement("div",{className:"simplebar-track simplebar-vertical"},C.createElement("div",{className:"simplebar-scrollbar"})))});hf.displayName="SimpleBar";hf.propTypes={children:Fs.oneOfType([Fs.node,Fs.func]),scrollableNodeProps:Fs.object,tag:Fs.string};const vL=e=>{switch(e){case pe.EPermissionType.DATACLASS:return O.jsx(Pu,{className:"h-6 w-6"});case pe.EPermissionType.SINGLETON:return O.jsx(fj,{className:"h-6 w-6"});case pe.EPermissionType.DATASTORE:return O.jsx(lj,{className:"h-6 w-6"});case pe.EPermissionType.ATTRIBUTE:return O.jsx(hj,{className:"h-6 w-6"});case pe.EPermissionType.METHOD:return O.jsx(tj,{className:"h-6 w-6"});case pe.EPermissionType.SINGLETON_METHOD:return O.jsx(sj,{className:"h-6 w-6"});case pe.ESubPermissionType.ENTITY_SEL_METHOD:return O.jsx(aj,{className:"h-6 w-6"});case pe.ESubPermissionType.ENTITY_METHOD:return O.jsx(oj,{className:"h-6 w-6"});case pe.ESubPermissionType.DS_METHOD:return O.jsx(ij,{className:"h-6 w-6"});case pe.ESubPermissionType.DATACLASS_METHOD:return O.jsx(nj,{className:"h-6 w-6"});default:return O.jsx(Pu,{className:"h-6 w-6"})}},VD=({children:e})=>O.jsx("div",{className:"h-full w-full",children:O.jsx("div",{className:"flex h-full w-full flex-1 items-center justify-center",children:O.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-4 py-4 text-inactive-text",children:[O.jsx(on,{className:"h-10 w-10"}),O.jsx("div",{className:"text-center text-sm",children:e})]})})}),fa=({permissions:e,label:t,onToggle:r,onSelect:n,promoted:i,privileges:o,exists:a,optimisticChecked:s})=>{const c=e.find(u=>u.name===t);if(!c)return null;const d=s!==void 0?s:c.checked;return O.jsxs("div",{className:"relative mx-auto flex w-fit items-center",children:[O.jsx(ir,{value:d||c.from.length===0||t==="promote"?d:null,onChange:()=>r&&r(c),isInvalid:a===!1}),O.jsxs("div",{className:"absolute left-full translate-x-1/4 inset-y-0 flex cursor-pointer items-center gap-x-1",children:[t!=="promote"&&(c.checked&&(c.info||c.from.length>0)||!c.checked&&c.from.length>0)&&O.jsx(O.Fragment,{children:O.jsx(Lr,{container:Br(),delay:100,label:O.jsxs("div",{className:"max-w-xs h-fit flex flex-col gap-y-3 p-1.5 text-sm font-semibold",children:[c.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:c.from.map(u=>{var h;return O.jsx("li",{className:"cursor-pointer list-disc font-bold hover:underline",onClick:()=>{var p;return n((p=o[u])==null?void 0:p.id)},children:(h=o[u])==null?void 0:h.privilege})})})]})]}):null,c.info&&O.jsxs("div",{className:"flex items-start",children:[O.jsx(Ew,{className:"mr-2 mt-0.5 h-4 w-4 shrink-0"})," ",O.jsx("span",{className:"flex-1 min-w-0 wrap-break-word whitespace-normal text-left",children:c.info})]})]}),children:O.jsx(on,{className:"h-4 w-4 "})})}),(c.checked||c.from.length>0)&&["execute"].includes(t)&&!!(i!=null&&i.length)&&O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:O.jsxs("div",{className:"flex items-start text-s",children:[O.jsx(Ew,{className:"mr-2 mt-0.5 h-4 w-4 shrink-0"}),O.jsxs("p",{children:[O.jsx("span",{className:"mr-1",children:"Function is promoted with: "}),i==null?void 0:i.map(u=>{var h;return O.jsx("li",{className:"cursor-pointer list-disc font-bold hover:underline",onClick:()=>{var p;return n((p=o[u])==null?void 0:p.id)},children:(h=o[u])==null?void 0:h.privilege})})]})]})}),children:O.jsx(xV,{className:"h-3 w-3 "})})]})]})},oce=({privilegeId:e,privileges:t})=>{const r=Tr(),n=r.getCatalogMethods(),i=r.getDataclasses(),o=r.getSingletons(),[a,s]=C.useState([]),[c,d]=C.useState("");C.useEffect(()=>{d("")},[e]),C.useEffect(()=>{const p=pe.getInheritedResources(e,t).map(({resource:y,type:m,subType:g})=>({applyTo:y,type:m,subType:g})),v=US(c.toLowerCase(),n,Object.values(i),Object.values(o));s(v.filter(({applyTo:y,type:m,subType:g})=>!Xi.find(p,{applyTo:y,type:m,subType:g})))},[c,e,t,n,i,o]);const[u,h]=C.useState(!1);return O.jsx(Kh.Root,{className:"w-56",onInputChange:p=>d(p||""),onOpenChange:h,isOpen:u,isSearchable:!0,options:a,getOptionLabel:p=>p?p.applyTo:"",getOptionValue:p=>p?p.applyTo:"",value:null,clearSearchOnSelect:!0,closeMenuOnSelect:!1,onChange:p=>{if(!p)return;const v=pe.addPermission(e,p,t);r.actions.updatePrivileges(v),d("")},children:O.jsx(Kh.Group,{children:O.jsx(Kh.Field,{controlShouldRenderValue:!0,renderOption:({data:p})=>O.jsxs("div",{className:"flex items-center gap-x-2",children:[vL(p.type),O.jsx("span",{children:p.applyTo})]}),placeholder:"Create a permission",hideNoOptions:!0})})})};function ace(e){const t=["datastore","singleton","dataclass","attribute","dsMethod","dataclassMethod","entityMethod","entityselMethod","singletonMethod"],r=e.reduce((n,i)=>{const[o]=i.resource.split("."),a=n.find(s=>s.prefix===o.toLowerCase());return a?(a.resources.push(i),n):[...n,{prefix:o.toLowerCase(),type:i.type,resources:[i]}]},[]);return r.sort((n,i)=>n.prefix==="ds"?-1:i.prefix==="ds"||n.prefix>i.prefix?1:-1),r.map(n=>({...n,resources:n.resources.sort((i,o)=>{const a=t.indexOf(i.type),s=t.indexOf(o.type);return a!==s?a-s:i.resource.toLowerCase()>o.resource.toLowerCase()?1:-1})})).reduce((n,i)=>[...n,...i.resources],[])}const bo={datastore:["datastore"],dataclass:["dataclass"],singleton:["singleton"],functions:["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"],attribute:["attribute"]},HD=Object.values(bo).flat();function ha(e,t){return t.length>0&&t.every(r=>e.includes(r))}function sce(e,t){return t.some(r=>e.includes(r))}function lce(e,t){return Array.from(new Set([...e,...t]))}function cce(e,t){return e.filter(r=>!t.includes(r))}const uce=({selectedPrivilege:e,onSelect:t,showIncluded:r,privileges:n,rawPrivileges:i})=>{var ne,ve;const[o,a]=C.useState(null),[s,c]=C.useState(null),{styles:d,attributes:u}=Cd(o,s,{modifiers:[{name:"offset",options:{offset:[0,10]}}]}),h=Tr(),[p,v]=C.useState([]),[y,m]=C.useState([]),[g,w]=C.useState(""),[x,_]=C.useState(""),[S,E]=C.useState({}),I=i??n;C.useEffect(()=>{const Z=setTimeout(()=>m(p),0);return()=>clearTimeout(Z)},[p]),C.useEffect(()=>{E({})},[I]);const{id:N}=e,T=C.useMemo(()=>pe.getInheritedResources(N,I),[N,(ne=I[N])==null?void 0:ne.includes,(ve=I[N])==null?void 0:ve.resources]),M=C.useMemo(()=>pe.getPromotions(N,I),[I[N]]),z=Z=>{v([...Z])},j=Z=>{v(J=>ha(J,Z)?cce(J,Z):lce(J,Z))},W=Z=>{j(bo[Z])},U=ha(p,HD),A=p.length>0&&!U,K=ha(p,bo.functions),V=!K&&sce(p,bo.functions),te=()=>z(HD),G=()=>z([]),re=async Z=>{if(h.getHost()==="vscode"){const ae=pe.removePermission(e.id,Z,n);h.actions.updatePrivileges(ae);return}const{confirmed:J}=await h.actions.openModal({title:"Delete Privilege",type:pe.ModalType.CONFIRM,color:pe.ModalColor.DANGER,message:"Are you sure you want to remove this Privilege?",icon:"FdWarningDanger"});if(J){const ae=pe.removePermission(e.id,Z,n);h.actions.updatePrivileges(ae)}},P=async()=>{const{confirmed:Z}=await h.actions.openModal({title:"Reset Permissions",type:pe.ModalType.CONFIRM,color:pe.ModalColor.DANGER,message:"Are you sure you want to reset permissions for this Privilege?",icon:"FdWarningDanger"});if(Z){const J=pe.resetResources(e.id,n);h.actions.updatePrivileges(J)}},B=C.useMemo(()=>y.length>0?T.filter(Z=>y.includes(Z.type)):T,[T,y]),X=C.useMemo(()=>B.filter(({resource:Z})=>x?new RegExp(Xi.escapeRegExp(x),"i").test(Z):!0),[B,x]),Q=C.useMemo(()=>ace(X),[X]),D=C.useMemo(()=>Q.filter(Z=>{const J=Z.permissions.every(ae=>!ae.checked)&&Z.permissions.some(ae=>ae.from.length>0);return r||!J}),[Q,r]),$=(Z,J)=>{const ae=`${Z.resource}|${Z.type}|${J.name}`;E(he=>({...he,[ae]:!J.checked})),setTimeout(()=>{const he=pe.togglePermission(e.id,Z,J,n);h.actions.updatePrivileges(he)},0)},H=C.useMemo(()=>D.some(Z=>Z.exists===!1),[D]),q=async()=>{const{confirmed:Z}=await h.actions.openModal({title:"Delete Privilege",type:pe.ModalType.CONFIRM,color:pe.ModalColor.DANGER,message:"Are you sure you want to remove these permissions?",views:{tips:[{type:"warning",message:"This action will remove all permissions that don't exist in the catalog for all privileges"}]},icon:"FdWarningDanger"}),J=Object.entries(I).map(([ae,he])=>{const ue=he.resources.filter(de=>!de.exists);return{[ae]:ue.map(de=>({applyTo:de.resource,type:de.type}))}}).reduce((ae,he)=>({...ae,...he}),{});if(Z){const ae=pe.removeMultiplePermissions(J,n);h.actions.updatePrivileges(ae)}},Y=C.useRef(null),ie=cd({count:D.length,getScrollElement:()=>{var Z;return((Z=Y.current)==null?void 0:Z.getScrollElement())??null},estimateSize:()=>36,overscan:5});return C.useEffect(()=>{var Z,J;(J=(Z=Y.current)==null?void 0:Z.getScrollElement())==null||J.scrollTo({top:0})},[N]),O.jsxs(hf,{ref:Y,className:"z-20 h-full flex-1 overflow-auto p-3.75 pt-0",style:{maxHeight:"calc(100vh - 5.5rem - 85px - 20px)"},children:[O.jsxs("table",{className:"relative h-full w-full border-collapse",children:[O.jsx("thead",{className:"sticky top-0 z-20 bg-panel-1",children:O.jsxs("tr",{className:"border-b border-panel-border-subtle",children:[O.jsx("td",{className:"py-2",children:O.jsxs("div",{className:"flex items-center gap-x-2",children:[O.jsx(wt.Root,{className:"relative w-56",children:O.jsxs(wt.Group,{children:[O.jsx(wt.Icon,{children:O.jsx(dj,{})}),O.jsx(wt.Field,{type:"text",placeholder:"Search available permissions",value:g,onChange:Z=>{const J=Z.target.value;w(J),setTimeout(()=>_(J),0)}}),O.jsx(wn.Popover,{className:"flex items-center",children:({open:Z})=>O.jsxs(O.Fragment,{children:[O.jsx(wn.Popover.Button,{ref:a,children:O.jsx(wt.Icon,{isAction:!0,children:O.jsx(JD,{})})}),Z&&O.jsx(ef,{children:O.jsx(wn.Popover.Panel,{ref:c,style:d.popper,...u.popper,className:"z-50",static:!0,children:O.jsxs(br,{depth:3,borderType:"light",className:"rounded-md border px-4 py-2.5",children:[O.jsxs("label",{className:"mb-2 flex cursor-pointer items-center gap-2",children:[O.jsx(ir,{size:"sm",value:A?null:U,onChange:()=>U?G():te()}),O.jsx("h5",{className:"text-sm font-semibold",children:"Filter"})]}),O.jsxs("div",{className:"space-y-2 text-s",children:[O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:ha(p,bo.dataclass),onChange:()=>W("dataclass"),label:"Dataclass"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:ha(p,bo.singleton),onChange:()=>W("singleton"),label:"Singleton"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:V?null:K,onChange:()=>W("functions"),label:"Functions"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:ha(p,bo.attribute),onChange:()=>W("attribute"),label:"Attribute"})})]})]})})})]})})]})}),O.jsx(oce,{privilegeId:N,privileges:I}),O.jsx("div",{children:O.jsx(Lr,{label:`Resetting the privilege will remove all configured\r
|
|
119
|
+
ressources`,container:Br(),children:O.jsx(Jt,{color:"white",variant:"ghost",onClick:P,children:O.jsx(SV,{})})})}),O.jsx(Lr,{icon:O.jsx(wi,{}),label:"Delete all the non existing resources from privileges",container:Br(),children:O.jsx(Jt,{color:"white",variant:"ghost",onClick:q,disabled:!H,children:O.jsx(QD,{className:"h-4 w-4"})})})]})}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Read"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Create"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Update"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Delete"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Execute"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Promote"})]})}),D.length?O.jsxs("tbody",{children:[ie.getVirtualItems().length>0?O.jsx("tr",{style:{height:`${ie.getVirtualItems()[0].start}px`},children:O.jsx("td",{colSpan:7})}):null,ie.getVirtualItems().map(Z=>{const J=D[Z.index],ae=J.permissions.some(he=>he.from.length>0);return O.jsxs("tr",{className:an("group even:bg-white/5 hover:bg-input-bg",{"opacity-60":J.exists===!1}),children:[O.jsxs("td",{className:an("group flex items-center gap-3 py-2 text-xs group-hover:rounded-l group-hover:bg-input-bg ",J.exists===!1?"text-negative-text":""),children:[vL(J.type),J.resource,O.jsx(Lr,{label:"Remove Permission",container:Br(),children:O.jsx(Jt,{color:"white",variant:"ghost",disabled:ae,onClick:()=>{ae?pe.toastSubject.next({kind:"info",markdown:!0,message:"**Info:** Inherited permissions can't be removed",customIcon:on}):re({applyTo:J.resource,type:J.type})},className:"opacity-0 group-hover:opacity-100",children:O.jsx(ja,{className:"h-4 w-4 rotate-45 transform"})})})]}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg ",children:O.jsx(fa,{permissions:J.permissions,showIncluded:r,label:"read",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|read`]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg ",children:O.jsx(fa,{permissions:J.permissions,showIncluded:r,label:"create",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|create`]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg ",children:O.jsx(fa,{permissions:J.permissions,showIncluded:r,label:"update",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|update`]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:O.jsx(fa,{permissions:J.permissions,showIncluded:r,label:"drop",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|drop`]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:O.jsx(fa,{promoted:M[J.resource],permissions:J.permissions,showIncluded:r,label:"execute",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|execute`]})}),O.jsx("td",{className:"py-2 text-center group-hover:rounded-r group-hover:bg-input-bg",children:O.jsx(fa,{permissions:J.permissions,showIncluded:r,label:"promote",onToggle:he=>$(J,he),onSelect:t,privileges:n,exists:J.exists,optimisticChecked:S[`${J.resource}|${J.type}|promote`]})})]},`${J.resource}-${Z.index}`)}),(()=>{const Z=ie.getVirtualItems();if(!Z.length)return null;const J=ie.getTotalSize()-Z[Z.length-1].end;return J>0?O.jsx("tr",{style:{height:`${J}px`},children:O.jsx("td",{colSpan:7})}):null})()]}):null]}),!Q.length&&x?O.jsx(VD,{children:"The Permission you're looking for can't be found "}):null,!Q.length&&!x?O.jsxs(VD,{children:["This Privilege has no Permissions configured yet ",O.jsx("br",{}),'Add a new permission by using the "Create a permission" input above']}):null]})},dce=({onCreate:e})=>{const t=Tr(),r=t.getPrivileges(),[n,i]=C.useState(null),[o,a]=C.useState(null),[s,c]=C.useState(""),[d,u]=C.useState(null),{styles:h,attributes:p}=Cd(n,o,{modifiers:[{name:"offset",options:{offset:[-10,10]}}],placement:"right-start"});C.useEffect(()=>{c(""),u(null)},[o]);const v=(y=()=>{})=>{u(null);try{const m=pe.createPrivilege(s,r),g=Object.values(m).find(w=>w.privilege===s);t.actions.updatePrivileges(m),g&&e(g),setTimeout(()=>{y()},0)}catch(m){u(m.message)}};return O.jsx(wn.Popover,{children:({open:y,close:m})=>O.jsxs(O.Fragment,{children:[O.jsx(wn.Popover.Button,{className:"rounded","data-cy":"New-priv-btn",as:"div",ref:i,children:O.jsx(Jt,{variant:"ghost",color:"white",children:O.jsx(ja,{className:"h-4 w-4"})})}),y&&O.jsx(ef,{children:O.jsx(wn.Popover.Panel,{ref:a,style:h.popper,...p.popper,"data-cy":"New-priv-pop-up",className:"z-50",static:!0,children:O.jsxs(br,{className:"min-w-[256px] border rounded px-4 py-2 text-xs shadow-md",depth:3,borderType:"light",children:[O.jsx("h5",{className:"mb-2 text-xs font-semibold",children:"Create New Privilege"}),O.jsx("div",{className:"mt-2",children:O.jsxs("label",{className:"flex items-center gap-x-4",children:[O.jsx("span",{children:"Name"}),O.jsx(wt.Root,{className:"w-full",color:d?"negative":"primary",children:O.jsxs(wt.Group,{children:[d&&O.jsx(wt.Message,{children:d}),O.jsx(wt.Field,{autoFocus:!0,value:s,onChange:g=>c(g.target.value),onKeyDown:g=>{g.key==="Enter"&&v()},type:"text"})]})})]})}),O.jsxs("div",{className:"mt-4 flex items-center justify-center gap-x-2",children:[O.jsx(Jt,{onClick:()=>v(m),children:"Create"}),O.jsx(Jt,{color:"white",variant:"outline",onClick:()=>m(),children:"Cancel"})]})]})})})]})})},fce=()=>{const e=Tr(),t=e.getCatalog(),r=e.getPrivileges(),[n,i]=C.useState(r);C.useEffect(()=>{const y=setTimeout(()=>i(r),0);return()=>clearTimeout(y)},[r]);const o=C.useMemo(()=>{if(t===null)return n;const y=sz(n,Object.values((t==null?void 0:t.dataClasses)??{}));return lz(y,t)},[n,t]),[a,s]=C.useState(null),[c,d]=C.useState(null),u=y=>{s(y),setTimeout(()=>d(y),0)},h=C.useMemo(()=>Object.keys(o),[o]);C.useEffect(()=>{if(a&&o[a.id]||!h.length)return;const y=o[h[0]];s(y),d(y)},[o]),C.useEffect(()=>{h.length<2&&v(!0)},[h.length]);const[p,v]=C.useState(!0);return O.jsxs("div",{className:"flex h-full min-h-0 min-w-0 flex-1",children:[O.jsxs(br,{depth:1,className:"flex h-full w-89 shrink-0 flex-col border-r",children:[O.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between px-3.5 py-2.5",children:[O.jsxs("div",{className:"flex items-center gap-x-1",children:[O.jsx("span",{children:O.jsx(pd,{className:"h-3.5 w-3.5"})}),O.jsx("span",{className:"text-[11px] font-semibold",children:"Privileges"})]}),O.jsx(dce,{onCreate:y=>{s(y),d(y)}})]}),O.jsx(lse,{privileges:o,selectedPrivilege:a,selectPrivilege:u})]}),a&&o[a.id]?O.jsxs(br,{depth:1,className:"privileges-container relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden border-l-[0.5px]",children:[O.jsxs("div",{className:"mb-1 flex min-h-0 min-w-0 flex-1 h-full w-full flex-col items-stretch overflow-auto",children:[(c??a).privilege!=="guest"?O.jsx(Yae,{privileges:o,selectedPrivilege:c??a,onSelect:y=>s(r[y]),setShowIncluded:v,showIncluded:p}):null,O.jsx(uce,{privileges:o,rawPrivileges:r,selectedPrivilege:c??a,onSelect:y=>s(r[y]),showIncluded:p})]}),O.jsx("div",{className:"mt-auto flex-shrink-0",children:O.jsx(hce,{privileges:o,selectedPrivilege:c??a,setSelectedPrivilege:s})})]}):O.jsx(U4,{tab:"Privilege"})]})},hce=({privileges:e,selectedPrivilege:t,setSelectedPrivilege:r})=>{const[n,i]=C.useState(!1);return O.jsx(pe.Panel,{path:pe.ROLES_TAB_PATH,isOpen:n,onOpen:()=>i(!0),onClose:()=>i(!1),children:O.jsx("div",{className:"flex h-full w-full min-h-0 px-3 pb-3",children:O.jsx(br,{depth:2,className:"h-full w-full overflow-hidden rounded",children:O.jsx(oae,{dict:e,data:pe.getGraphData(t.id,e),onSelect:o=>r(e[o])})})})})},pce=C.memo(({role:e})=>{var E;const t=Tr(),[r,n]=C.useState(e),[i,o]=C.useState(e.role),[a,s]=C.useState(null),c=t.getPrivileges(),d=((E=r.privileges)==null?void 0:E.filter(I=>c[I]&&c[I].privilege!=="guest").length)||0,u=t.getRoles(),{selectedRole:h,selectRole:p}=cS(),[v,y]=C.useState(!1),m=pe.useOutsideClick(()=>{v&&w()});pe.useDidMountEffect(()=>{i!==e.role&&o(e.role)},[e.role]),C.useEffect(()=>{e.role||y(!0)},[]),C.useEffect(()=>{n(e)},[e]);const g=()=>{s(null),y(!0)},w=()=>{s(null),e.role&&e.role===i&&y(!1);try{const I=pe.saveRole({...r,role:i},u);t.actions.updateRoles(I),y(!1)}catch(I){s(I.message)}},x=async I=>{if(I.stopPropagation(),t.getHost()==="vscode"){_();return}const{confirmed:N}=await t.actions.openModal({title:"Delete Role",type:pe.ModalType.CONFIRM,color:pe.ModalColor.DANGER,message:"Are you sure you want to remove this Role?",icon:"FdWarningDanger"});N&&_()},_=()=>{const I=pe.removeRole(r.id,u),N=Object.keys(I);if(h!==r.id){t.actions.updateRoles(I);return}if(N.length===0)p(null);else{const T=Object.keys(u),M=T.indexOf(r.id),z=Math.max(0,M-1),j=T[z];M===0?p(N[0]):I[j]?p(j):p(N[0])}t.actions.updateRoles(I)},S=(I=null)=>{if(I&&I.stopPropagation(),!e.role){_();return}y(!1),o(e.role)};return O.jsx(O.Fragment,{children:O.jsxs(br,{depth:4,borderType:h===r.id?"primary":h!==r.id?"light":"default",className:an("rounded border p-2"),role:"button","data-cy":"privilegeCard",onClick:()=>{p(r.id)},ref:m,children:[O.jsx("div",{className:"flex items-center justify-between",children:O.jsxs("div",{className:"flex flex-1 items-center",children:[O.jsx("span",{className:"mr-4",children:O.jsx(pd,{className:"h-6 w-6"})}),v?O.jsxs(wt.Root,{color:a?"negative":"primary",className:"flex-1 mr-2",children:[O.jsx(wt.Group,{className:"border-input-focus-border",children:O.jsx(wt.Field,{type:"text",value:i,onChange:({target:{value:I}})=>{o(I)},onKeyDown:I=>{I.key==="Enter"&&w(),I.key==="Escape"&&S()},placeholder:"role",autoComplete:"off",autoFocus:!0})}),a&&O.jsx(wt.Message,{children:a})]}):O.jsx("span",{className:"inline-block grow overflow-hidden truncate whitespace-nowrap text-xs font-bold",title:i,children:r.role}),O.jsx("div",{className:an("justify-between ml-auto flex w-fit items-center gap-x-2"),children:v?O.jsxs(O.Fragment,{children:[O.jsx(Jt,{color:"white",variant:"ghost",onClick:w,children:O.jsx(_V,{className:"h-4 w-4"})}),O.jsx(Jt,{color:"white",variant:"ghost",onClick:S,children:O.jsx(ej,{className:"h-4 w-4"})})]}):O.jsxs(O.Fragment,{children:[O.jsx(Jt,{color:"white",variant:"ghost",onClick:g,children:O.jsx(cj,{className:"h-4 w-4"})}),O.jsx(Jt,{color:"white",variant:"ghost",onClick:I=>x(I),children:O.jsx(pj,{className:"h-4 w-4"})})]})})]})}),O.jsxs("span",{className:an("ml-10.75 py-1 text-xs"),children:[d," Privilege",d>1?"s":""]})]})})}),gL=(e,t)=>e?t[e]:null,WD=(e,t,r)=>{const n=gL(e,r);return n?Object.values(r).reduce((i,o)=>o.id===e?n.privileges.includes(t)?{...i,[n.id]:{...n,privileges:n.privileges.filter(a=>a!==t)}}:{...i,[n.id]:{...n,privileges:[...n.privileges,t]}}:{...i,[o.id]:o},{}):r},vce=()=>{const e=Tr(),t=e.getPrivileges(),r=e.getRoles(),{selectedRole:n}=cS(),i=gL(n,r),o=(c,d)=>d&&d.privileges.includes(c.id),a=C.useMemo(()=>Object.values(t).filter(c=>o(c,i)&&c.privilege!=="guest"),[t,i]),s=C.useMemo(()=>Object.values(t).filter(c=>!o(c,i)&&c.privilege!=="guest"),[t,i]);return O.jsxs(br,{depth:1,className:"w-full border-b p-4 ",children:[O.jsx("div",{className:"mb-4 flex items-center gap-x-5",children:O.jsx("h4",{className:"text-[13px] font-semibold ",children:"Privileges"})}),O.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[O.jsx(vu,{"data-cy":"item=>Permisions",className:"italic opacity-90",children:"guest"}),a.map((c,d)=>O.jsxs(vu,{"data-cy":"item=>Permisions",color:"primary",onClick:()=>{const u=WD(i.id,c.id,r);e.actions.updateRoles(u)},children:[c.privilege,O.jsx(Tu.FdPlus,{className:"rotate-45 transform"})]},d)),s.map((c,d)=>O.jsxs(vu,{"data-cy":"item=>Permisions",color:"dark",onClick:()=>{const u=WD(i.id,c.id,r);e.actions.updateRoles(u)},children:[c.privilege,O.jsx(Tu.FdPlus,{})]},d))]})]})},fd=(e,t,r,n=!1)=>{const i=e.applyTo,o=e.type===pe.EPermissionType.DATACLASS?"ds":i.split(".")[0],a={...t,...r},s=()=>({value:!n,inherited:!1,from:[],explicitly:!1}),c={read:s(),create:s(),update:s(),drop:s(),execute:s(),promote:s()},d=h=>{h.forEach(p=>{a[p]&&(a[p].resources.forEach(v=>{if(v.resource===i||v.resource===o){const y=fd(e,t,{[p]:a[p]},n);Object.values(v.permissions).forEach(m=>{c[m.name].explicitly||(!c[m.name].from.includes(a[p].privilege)&&m.checked&&c[m.name].from.push(a[p].privilege),c[m.name].inherited=c[m.name].inherited||y[m.name].value||y[m.name].inherited)})}}),a[p].includes.length>0&&d(a[p].includes))})};if(Object.values(r).forEach(h=>{h.resources.forEach(p=>{p.resource===i&&Object.values(p.permissions).forEach(v=>{v.checked&&(c[v.name].explicitly=!0,n&&(c[v.name].value=!0))})}),(h.includes.length>0||h.privilege==="guest")&&d(h.includes)}),Object.values(t).forEach(h=>{h.resources.forEach(p=>{p.resource===i&&(h.privilege==="guest"?Object.values(p.permissions).forEach(v=>{v.checked&&(c[v.name].explicitly=!0,n&&(c[v.name].value=!0))}):Object.values(p.permissions).forEach(v=>{!c[v.name].explicitly&&v.checked&&(n?c[v.name].value=!0:c[v.name].value=!1)}))})}),(n?Object.entries(c).some(([h,p])=>h!=="promote"&&!p.value&&!p.explicitly):Object.entries(c).some(([h,p])=>h!=="promote"&&p.value&&!p.explicitly))&&![pe.EPermissionType.DATASTORE,pe.EPermissionType.SINGLETON].includes(e.type)){const h={applyTo:o,type:e.type===pe.EPermissionType.DATACLASS?pe.EPermissionType.DATASTORE:e.type===pe.EPermissionType.SINGLETON_METHOD?pe.EPermissionType.SINGLETON:pe.EPermissionType.DATACLASS},p=fd(h,t,r,n),v=y=>{let m=c[y].value;return n?!c[y].value&&!c[y].explicitly&&(m=p[y].value):c[y].value&&!c[y].explicitly&&(m=p[y].value),{value:m,inherited:c[y].inherited||p[y].inherited,from:c[y].from.length>0?c[y].from:p[y].from,explicitly:c[y].explicitly}};return{read:v("read"),create:v("create"),update:v("update"),drop:v("drop"),execute:v("execute"),promote:v("promote")}}return{read:c.read,create:c.create,update:c.update,drop:c.drop,execute:c.execute,promote:c.promote}},gce=({children:e})=>O.jsx("div",{className:"h-full w-full",children:O.jsx("div",{className:"flex h-full w-full flex-1 items-center justify-center",children:O.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-4 py-4 text-inactive-text",children:[O.jsx(on,{className:"absolute -right-full h-10 w-10 translate-x-1"}),O.jsx("div",{className:"text-center text-sm",children:e})]})})}),mce=e=>{switch(e){case"dataclass":return O.jsx(Pu,{className:"h-6 w-6"});case"singleton":return O.jsx(fj,{className:"h-6 w-6"});case"datastore":return O.jsx(lj,{className:"h-6 w-6"});case"attribute":return O.jsx(hj,{className:"h-6 w-6"});case"method":return O.jsx(tj,{className:"h-6 w-6"});case"singletonMethod":return O.jsx(sj,{className:"h-6 w-6"});case"entityselMethod":return O.jsx(aj,{className:"h-6 w-6"});case"entityMethod":return O.jsx(oj,{className:"h-6 w-6"});case"dsMethod":return O.jsx(ij,{className:"h-6 w-6"});case"dataclassMethod":return O.jsx(nj,{className:"h-6 w-6"});default:return O.jsx(Pu,{className:"h-6 w-6"})}},UD=({privileges:e,permission:t,hasChild:r,depth:n,isChild:i=!1,className:o,inSearch:a,toggleCollapse:s,collapsed:c,isRestrictedByDefault:d,toastMessageCallback:u,computedInherited:h})=>{const[p,v]=t.applyTo.split("."),y=C.useMemo(()=>h||fd(t,e.otherPrivs,e.rolePrivs,d),[h,e,t,d]);return O.jsxs("tr",{className:an("group even:bg-white/5 hover:bg-input-bg",o),children:[O.jsxs("td",{className:an("flex h-full w-full items-stretch gap-3 p-0 text-xs group-hover:rounded-l group-hover:bg-input-bg",{"px-1":a}),children:[Array(n).fill("").map((m,g)=>O.jsx("div",{className:an("ml-1.5 mr-1 w-[2px] bg-muted",{"mr-0.5":i})},g)),O.jsxs("div",{className:"flex items-center gap-3 py-2",children:[r&&O.jsx("button",{onClick:s,className:"w-3",children:c?O.jsx(uj,{className:"inline h-4 w-4"}):O.jsx(rj,{className:"inline h-4 w-4"})}),mce(t.type),a?t.applyTo:v||p]})]}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:[pe.EPermissionType.ATTRIBUTE,pe.EPermissionType.DATASTORE,pe.EPermissionType.DATACLASS].includes(t.type)&&O.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",onClick:u,children:[O.jsx(ir,{value:y.read.value||y.read.inherited,isDisabled:!0}),O.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!y.read.value&&y.read.inherited?O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:y.read.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:y.read.from.map((m,g)=>O.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},g))})]})]}):null}),children:O.jsx(on,{className:"h-4 w-4"})}):""})]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:[pe.EPermissionType.ATTRIBUTE,pe.EPermissionType.DATASTORE,pe.EPermissionType.DATACLASS].includes(t.type)&&O.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",onClick:u,children:[O.jsx(ir,{value:y.create.value||y.create.inherited,isDisabled:!0}),O.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!y.create.value&&y.create.inherited?O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:y.read.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:y.read.from.map((m,g)=>O.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},g))})]})]}):null}),children:O.jsx(on,{className:"h-4 w-4"})}):""})]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:[pe.EPermissionType.ATTRIBUTE,pe.EPermissionType.DATASTORE,pe.EPermissionType.DATACLASS].includes(t.type)&&O.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",onClick:u,children:[O.jsx(ir,{value:y.update.value||y.update.inherited,isDisabled:!0}),O.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!y.update.value&&y.update.inherited?O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:y.update.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:y.update.from.map((m,g)=>O.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},g))})]})]}):null}),children:O.jsx(on,{className:"h-4 w-4"})}):""})]})}),O.jsx("td",{className:"py-2 text-center group-hover:bg-input-bg",children:[pe.EPermissionType.ATTRIBUTE,pe.EPermissionType.DATASTORE,pe.EPermissionType.DATACLASS].includes(t.type)&&O.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",onClick:u,children:[O.jsx(ir,{value:y.drop.value||y.drop.inherited,isDisabled:!0}),O.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!y.drop.value&&y.drop.inherited?O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:y.drop.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:y.drop.from.map((m,g)=>O.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},g))})]})]}):null}),children:O.jsx(on,{className:"h-4 w-4"})}):""})]})}),O.jsx("td",{className:"py-2 text-center group-hover:rounded-r group-hover:bg-input-bg",children:t.type!=="attribute"&&O.jsxs("div",{className:"relative mx-auto flex w-fit items-center justify-center gap-x-1",onClick:u,children:[O.jsx(ir,{value:y.execute.value||y.execute.inherited,isDisabled:!0}),O.jsx("div",{className:"absolute left-full top-1/2 flex -translate-y-1/2 translate-x-1/2 cursor-pointer items-center",children:!y.execute.value&&y.execute.inherited?O.jsx(Lr,{container:Br(),delay:100,label:O.jsx("div",{className:"space-y-1 p-1",children:y.execute.from.length?O.jsxs("div",{className:"flex items-start",children:[O.jsx(wi,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0"}),O.jsxs("p",{className:"flex flex-col gap-y-2",children:[O.jsx("span",{className:"mr-1",children:"Permission inherited from:"}),O.jsx("ul",{children:y.execute.from.map((m,g)=>O.jsx("li",{className:"cursor-pointer list-disc font-bold",children:m},g))})]})]}):null}),children:O.jsx(on,{className:"h-4 w-4"})}):""})]})})]})};function GD(e,t,r){const n=[],i=(a,s,c)=>n.push({id:a,permission:s,depth:c,hasChild:!1,isChild:!1}),o=(a,s,c,d,u,h)=>{n.push({id:a,permission:s,depth:c,hasChild:!0,isChild:d,toggleId:a,isCollapsed:u}),u||h()};for(const a of Object.values(e)){o("ds-group",{applyTo:a.applyTo,type:a.type},0,!1,t,()=>{for(const s of a.methods)i(`dsm-${s.applyTo}`,s,1);for(const s of a.dataClasses){const c=`dc-${s.applyTo}`;o(c,{applyTo:s.applyTo,type:s.type},1,!0,r[c]??!1,()=>{for(const d of s.attributes)i(`dca-${d.applyTo}`,d,2);for(const d of s.methods)i(`dcm-${d.applyTo}`,d,2)})}});for(const s of a.singletons){const c=`sing-${s.applyTo}`;o(c,{applyTo:s.applyTo,type:s.type},0,!0,r[c]??!1,()=>{for(const d of s.attributes)i(`singa-${d.applyTo}`,d,1);for(const d of s.methods)i(`singm-${d.applyTo}`,d,1)})}}return n}const KD=["datastore","singleton","dataclass","attribute","dsMethod","dataclassMethod","entityMethod","entityselMethod","singletonMethod"],yo={datastore:["datastore"],dataclass:["dataclass"],singleton:["singleton"],functions:["method","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"],attribute:["attribute"]},YD=Object.values(yo).flat();function pa(e,t){return t.length>0&&t.every(r=>e.includes(r))}function bce(e,t){return Array.from(new Set([...e,...t]))}function yce(e,t){return e.filter(r=>!t.includes(r))}const xce=({selectedRole:e})=>{const[t,r]=C.useState(null),[n,i]=C.useState(null),{styles:o,attributes:a}=Cd(t,n,{modifiers:[{name:"offset",options:{offset:[0,10]}}]}),s=Tr(),c=s.getRestrictedByDefault(),d=s.getPrivileges(),[u,h]=C.useState([]),[p,v]=C.useState([]),[y,m]=C.useState(""),[g,w]=C.useState("");C.useEffect(()=>{const J=setTimeout(()=>v(u),0);return()=>clearTimeout(J)},[u]);const x=s.getCatalogMethods(),_=s.getDataclasses(),S=s.getSingletons(),E=C.useMemo(()=>sae(x,Object.values(_),Object.values(S)),[x,_,S]),I=C.useMemo(()=>!p.length&&!g?[]:[...US(g,x,Object.values(_),Object.values(S))].filter(J=>p.length?p.includes(J.type):!0).sort((J,ae)=>{const he=KD.indexOf(J.type),ue=KD.indexOf(ae.type);return he!==ue?he-ue:J.applyTo.toLowerCase()>ae.applyTo.toLowerCase()?1:-1}),[g,p,x,_,S]),N=J=>h([...J]),T=J=>{h(ae=>pa(ae,J)?yce(ae,J):bce(ae,J))},M=J=>T(yo[J]),z=YD.every(J=>u.includes(J)),j=u.length>0&&!z,W=pa(u,yo.functions),U=()=>N(YD),A=()=>N([]),K=s.getRoles(),[V,te]=C.useState(K);C.useEffect(()=>{const J=setTimeout(()=>te(K),0);return()=>clearTimeout(J)},[K]);const G=C.useRef(null);C.useEffect(()=>{var J,ae;(ae=(J=G.current)==null?void 0:J.getScrollElement())==null||ae.scrollTo({top:0})},[e]);const re=cd({count:I.length,getScrollElement:()=>{var J;return((J=G.current)==null?void 0:J.getScrollElement())??null},estimateSize:()=>36,overscan:5,paddingEnd:40}),P=C.useMemo(()=>{const J=Object.values(d).find(le=>le.privilege==="guest"),ae=V[e],he=ae?Object.fromEntries(ae.privileges.map(le=>[le,d[le]]).filter(([,le])=>!!le)):{};if(c)return{rolePrivs:he,otherPrivs:J?{[J.id]:J}:{}};const ue=J?{[J.id]:{...J,active:!0}}:{},de=Object.fromEntries(Object.entries(d).filter(([le])=>le!==(J==null?void 0:J.id)&&!(ae!=null&&ae.privileges.includes(le))).map(([le,xe])=>[le,{...xe,active:!1}]));return{rolePrivs:he,otherPrivs:{...ue,...de}}},[d,V,e,c]),[B,X]=C.useState(!1),[Q,D]=C.useState({}),$=C.useMemo(()=>{const J=[];for(const ae of Object.values(E)){for(const he of ae.dataClasses)J.push(`dc-${he.applyTo}`);for(const he of ae.singletons)J.push(`sing-${he.applyTo}`)}return J},[E]),H=$.length>0&&$.every(J=>Q[J]===!0),q=C.useCallback(()=>{const J={};for(const ae of $)J[ae]=!0;D(J)},[$]),Y=C.useCallback(J=>{J==="ds-group"?X(ae=>!ae):D(ae=>({...ae,[J]:!ae[J]}))},[]),ie=C.useMemo(()=>{const J=new Map;for(const{permission:ae}of GD(E,!1,{}))J.set(`${ae.applyTo}|${ae.type}`,fd(ae,P.otherPrivs,P.rolePrivs,c));return J},[P,c,E]),ne=C.useMemo(()=>GD(E,B,Q),[E,B,Q]),ve=cd({count:ne.length,getScrollElement:()=>{var J;return((J=G.current)==null?void 0:J.getScrollElement())??null},estimateSize:()=>36,overscan:8,paddingEnd:15}),Z=C.useCallback(()=>{pe.toastSubject.next({kind:"info",markdown:!0,message:"**Info:** You can add or modify permissions only in the Privilege section.",customIcon:Ew})},[]);return O.jsxs(hf,{ref:G,className:"z-20 h-full flex-1 overflow-auto p-3.75 pt-0",style:{maxHeight:"calc(100vh - 5.5rem - 85px - 20px)"},children:[O.jsxs("table",{className:"relative h-full w-full border-collapse",children:[O.jsx("thead",{className:"sticky top-0 z-20 bg-panel-1",children:O.jsxs("tr",{className:"border-b border-grey-100",children:[O.jsx("td",{className:"py-2",children:O.jsxs("div",{className:"flex items-center gap-x-2",children:[O.jsx(Lr,{label:"Collapse All",position:"up",container:Br(),children:O.jsx(Jt,{color:"white",variant:"ghost",disabled:B&&H,onClick:()=>{H?(q(),X(!0)):q()},children:O.jsx(yV,{})})}),O.jsx(wt.Root,{className:"w-56",children:O.jsxs(wt.Group,{children:[O.jsx(wt.Icon,{children:O.jsx(dj,{})}),O.jsx(wt.Field,{type:"text",placeholder:"Search",value:y,onChange:J=>{const ae=J.target.value;m(ae),setTimeout(()=>w(ae),0)}}),O.jsx(wn.Popover,{className:"flex items-center",children:({open:J})=>O.jsxs(O.Fragment,{children:[O.jsx(wn.Popover.Button,{ref:r,children:O.jsx(wt.Icon,{isAction:!0,children:O.jsx(JD,{})})}),J&&O.jsx(ef,{children:O.jsx(wn.Popover.Panel,{ref:i,style:o.popper,...a.popper,className:"z-50",static:!0,children:O.jsxs(br,{depth:3,borderType:"light",className:"rounded-md border px-4 py-2.5 text-xs",children:[O.jsxs("label",{className:"mb-2 flex cursor-pointer items-center gap-2",children:[O.jsx(ir,{size:"sm",value:j?null:z,onChange:()=>z?A():U()}),O.jsx("h5",{className:"text-sm font-semibold",children:"Filter"})]}),O.jsxs("div",{className:"space-y-2 text-s",children:[O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:pa(u,yo.datastore),onChange:()=>M("datastore"),label:"Datastore"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:pa(u,yo.dataclass),onChange:()=>M("dataclass"),label:"Dataclass"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:pa(u,yo.singleton),onChange:()=>M("singleton"),label:"Singleton"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:W,onChange:()=>M("functions"),label:"Functions"})}),O.jsx("div",{className:"flex items-center",children:O.jsx(ir,{size:"sm",value:pa(u,yo.attribute),onChange:()=>M("attribute"),label:"Attribute"})})]})]})})})]})})]})})]})}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"read"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Create"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Update"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Delete"}),O.jsx("td",{className:"px-4 py-2 text-center text-[12px]",children:"Execute"})]})}),O.jsx("tbody",{className:"relative",children:p.length||g?O.jsxs(O.Fragment,{children:[re.getVirtualItems().length>0?O.jsx("tr",{style:{height:`${re.getVirtualItems()[0].start}px`},children:O.jsx("td",{colSpan:6})}):null,re.getVirtualItems().map(J=>{const ae=I[J.index];return O.jsx(UD,{privileges:P,permission:ae,depth:0,inSearch:!0,isRestrictedByDefault:c,allPrivileges:d,toastMessageCallback:Z,computedInherited:ie.get(`${ae.applyTo}|${ae.type}`)},`${ae.type}-${J.index}`)}),(()=>{const J=re.getVirtualItems();if(!J.length)return null;const ae=re.getTotalSize()-J[J.length-1].end;return ae>0?O.jsx("tr",{style:{height:`${ae}px`},children:O.jsx("td",{colSpan:6})}):null})()]}):O.jsxs(O.Fragment,{children:[ve.getVirtualItems().length>0?O.jsx("tr",{style:{height:`${ve.getVirtualItems()[0].start}px`},children:O.jsx("td",{colSpan:6})}):null,ve.getVirtualItems().map(J=>{const ae=ne[J.index];return O.jsx(UD,{privileges:P,permission:ae.permission,depth:ae.depth,hasChild:ae.hasChild,isChild:ae.isChild,collapsed:ae.isCollapsed,toggleCollapse:ae.toggleId?()=>Y(ae.toggleId):void 0,isRestrictedByDefault:c,allPrivileges:d,toastMessageCallback:Z,computedInherited:ie.get(`${ae.permission.applyTo}|${ae.permission.type}`)},ae.id)}),(()=>{const J=ve.getVirtualItems();if(!J.length)return null;const ae=ve.getTotalSize()-J[J.length-1].end;return ae>0?O.jsx("tr",{style:{height:`${ae}px`},children:O.jsx("td",{colSpan:6})}):null})()]})})]}),(g||p.length)&&!I.length?O.jsx(gce,{children:"The Permission you're looking for can't be found "}):null]})},wce=()=>O.jsx("div",{className:"flex flex-1 items-center justify-center",children:O.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-grey-200 border-t-primary-dark"})}),Sce=()=>{const e=Tr(),t=e.getRoles(),[r,n]=C.useState(null),[i,o]=C.useState(null),[a,s]=C.useState(""),[c,d]=C.useState(null),{styles:u,attributes:h}=Cd(r,i,{modifiers:[{name:"offset",options:{offset:[-10,10]}}],placement:"right-start"});C.useEffect(()=>{s(""),d(null)},[i]);const p=()=>{if(!a)throw new Error("Please enter a valid name");if(Object.values(t).find(g=>g.role.toLowerCase()===a.toLowerCase()))throw new Error(`A role with the name ${a} already exists`);const y=yz.generate(),m=pe.createRole(y,a,t);e.actions.updateRoles(m)};return O.jsx(wn.Popover,{children:({open:v,close:y})=>{const m=()=>{d(null);try{pe.validateName(a),p(),y()}catch(g){d(g.message)}};return O.jsxs(O.Fragment,{children:[O.jsx(wn.Popover.Button,{className:"rounded","data-cy":"New-priv-btn",as:"div",ref:n,children:O.jsx(Jt,{variant:"ghost",color:"white",children:O.jsx(ja,{className:"h-4 w-4"})})}),v&&O.jsx(ef,{children:O.jsx(wn.Popover.Panel,{ref:o,style:u.popper,...h.popper,"data-cy":"New-priv-pop-up",className:"z-50",static:!0,children:O.jsxs(br,{className:"min-w-[256px] border rounded px-4 py-2 text-xs shadow-md",depth:3,borderType:"light",children:[O.jsx("h5",{className:"mb-2 text-xs font-semibold",children:"Create New Role"}),O.jsx("div",{className:"mt-2",children:O.jsxs("label",{className:"flex items-center gap-x-4",children:[O.jsx("span",{children:"Name"}),O.jsx(wt.Root,{color:c?"negative":"primary",className:"w-full",children:O.jsxs(wt.Group,{children:[c&&O.jsx(wt.Message,{children:c}),O.jsx(wt.Field,{autoFocus:!0,value:a,onChange:g=>s(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m()},type:"text"})]})})]})}),O.jsxs("div",{className:"mt-4 flex items-center justify-center gap-x-2",children:[O.jsx(Jt,{onClick:()=>{m()},children:"Create"}),O.jsx(Jt,{color:"white",variant:"outline",onClick:()=>y(),children:"Cancel"})]})]})})})]})}})},Ece=()=>{const e=Tr(),t=e.getRoles(),r=e.getPrivileges(),{selectedRole:n,deferredSelectedRole:i}=cS(),o=C.useMemo(()=>Object.values(t).sort((a,s)=>pe.localeCompare(a.role,s.role)),[t]);return O.jsxs("div",{className:"flex flex-1 h-full",children:[O.jsxs(br,{depth:1,className:"flex h-full w-89 flex-col border-r",children:[O.jsxs("div",{className:"flex shrink-0 items-center justify-between px-3.5 py-2.5",children:[O.jsxs("div",{className:"flex items-center gap-x-1",children:[O.jsx("span",{children:O.jsx(pd,{className:"h-3.5 w-3.5"})}),O.jsx("span",{className:"text-[11px] font-semibold",children:"Roles"})]}),O.jsx(Sce,{})]}),O.jsx("div",{className:"flex-1 overflow-auto p-4 pb-10 pt-1",children:o.length>0?O.jsx("div",{className:"flex flex-col gap-4",children:o.map(a=>O.jsx(pce,{role:a,privileges:r},a.id))}):O.jsx("div",{className:"flex h-full items-center justify-center",children:O.jsx("div",{className:"flex flex-1 items-center justify-center text-inactive-text",children:O.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-4",children:[O.jsx(on,{className:"h-10 w-10"}),O.jsx("div",{className:"font-semibold",children:"There are no roles"}),O.jsxs("div",{className:"flex items-center text-sm",children:["Create a new role by clicking on the"," ",O.jsx(ja,{className:"ml-2 inline h-4 w-4"})]})]})})})})]}),O.jsx(br,{depth:1,className:an("relative flex h-full w-full flex-1 flex-col items-stretch overflow-x-auto",{"border-l-[0.5px]":n}),children:O.jsx("div",{className:"flex h-full w-full select-none flex-col",children:n?O.jsxs(O.Fragment,{children:[O.jsx(vce,{}),i?O.jsx(xce,{selectedRole:i}):O.jsx(wce,{})]}):O.jsx(U4,{tab:"Role"})})})]})},mL=()=>{const e=Tr(),t=e.getQodly(),r=e.getSelectedTab(),n=e.getForceLogin(),i=e.getRestrictedByDefault(),{canUndo:o,canRedo:a}=e.getHistory(),s=C.useRef();return O.jsx("div",{className:"absolute inset-0 flex flex-1 overflow-hidden",children:O.jsx("div",{className:"relative flex flex-1 overflow-hidden","data-cy":"Roles&Privileges-editor-cy",ref:c=>s.current=c,children:O.jsxs("div",{className:"flex min-h-0 w-full flex-1 flex-col",children:[O.jsx($Y,{activeTab:r,forceLogin:n,restrictedByDefault:i,canUndo:o,canRedo:a,onUndo:e.actions.undo,onRedo:e.actions.redo,onTabChange:c=>{e.actions.toggleTab(c)},onForceLoginChange:c=>{e.actions.toggleForceLogin(c)},onRestrictedByDefaultChange:c=>{e.actions.toggleRestrictedByDefault(c)},qodly:t}),O.jsx("div",{className:r==="roles"?"flex flex-1 overflow-hidden":"hidden",children:O.jsx(VY,{children:O.jsx(Ece,{})})}),O.jsx("div",{className:r==="privileges"?"flex flex-1 overflow-hidden":"hidden",children:O.jsx(fce,{})})]})})})},_ce="object",Oce={forceLogin:{type:"boolean"},restrictedByDefault:{type:"boolean"},privileges:{type:"array",items:{$ref:"#/definitions/Privilege"}},roles:{type:"array",items:{$ref:"#/definitions/Role"}},permissions:{type:"object",properties:{allowed:{type:"array",items:{$ref:"#/definitions/Permission"}}}}},Cce={Privilege:{type:"object",properties:{id:{type:"string"},privilege:{type:"string"},includes:{type:"array",items:{type:"string"}}},required:["privilege"]},Role:{type:"object",properties:{id:{type:"string"},role:{type:"string"},privileges:{type:"array",items:{type:"string"}}},required:["role"]},PermissionEntry:{type:"array",items:{type:"string"}},Permission:{type:"object",properties:{applyTo:{type:"string"},type:{enum:["dataclass","method","attribute","datastore","singleton","singletonMethod","dsMethod","dataclassMethod","entityMethod","entityselMethod"]},subType:{enum:["dsMethod","dataclassMethod","entityMethod","entityselMethod"]},read:{$ref:"#/definitions/PermissionEntry"},create:{$ref:"#/definitions/PermissionEntry"},update:{$ref:"#/definitions/PermissionEntry"},drop:{$ref:"#/definitions/PermissionEntry"},execute:{$ref:"#/definitions/PermissionEntry"},promote:{$ref:"#/definitions/PermissionEntry"}},required:["applyTo","type"]}},Ice={type:_ce,properties:Oce,definitions:Cce},Rce=()=>{const{modals:e,closeModal:t,editModal:r}=Kae();return O.jsx(O.Fragment,{children:e.map((n,i)=>O.jsx(pe.Modal,{hasOverlay:i===0,...n,onClose:t,onEdit:r,container:Br()},n.id))})},bL=e=>{if(!e)return pe.rolesToAPI(pe.sanitizeRoles({}));try{return pe.rolesToAPI(pe.sanitizeRoles(JSON.parse(e)))}catch{return pe.rolesToAPI(pe.sanitizeRoles({}))}},Nce=({initialValue:e,onChange:t,...r})=>{const n=Tr(),i=n.getRolesFlags(),o=n.getRolesAndPrivileges(),a=C.useMemo(()=>bL(e),[e]),s=C.useRef(o),c=C.useRef(a),d=C.useRef(a);return C.useEffect(()=>{s.current=o},[o]),C.useEffect(()=>{Xi.isEqual(a,d.current)||(d.current=a,c.current=a,!Xi.isEqual(a,s.current)&&n.actions.setRolesContent({content:a,flags:{touched:!1}}))},[n,a]),pe.useDidMountEffect(()=>{if(!(!t||!i.touched)&&!Xi.isEqual(o,c.current))try{const u=JSON.stringify(o,null,2);t(u),c.current=o}catch(u){console.error("[Roles Editor Standalone] Error on value stringify:",u)}},[o,i.touched,t]),O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"relative h-screen z-10 overflow-hidden",children:O.jsx(mL,{...r})}),O.jsx(Rce,{})]})},Tce=e=>{const t=Gae();return O.jsx(dz,{adapter:t,children:O.jsx(pe.TipsProvider,{children:O.jsx(Nce,{...e})})})},Pce=({initialValue:e,catalog:t,history:r,activeTab:n,onTabChange:i,...o})=>{const a=C.useMemo(()=>({...pe.sanitizeRoles(bL(e)),flags:{touched:!1}}),[e]);return O.jsx(Uae,{initialState:a,catalog:t,history:r,selectedTab:n,onTabChange:i,children:O.jsx(Tce,{initialValue:e,...o})})};exports.ROLES_EDITOR_SCOPE_CLASS=XD.ROLES_EDITOR_SCOPE_CLASS;exports.EditorStateAdapterProvider=dz;exports.Roles=mL;exports.Standalone=Pce;exports.jsonSchema=Ice;exports.useReduxAdapter=fae;
|
|
120
120
|
//# sourceMappingURL=index.cjs.js.map
|