diff --git a/docs/public/editor/assets/index-Cjhj5q0g.js b/docs/public/editor/assets/index-BwqHJ3f2.js similarity index 99% rename from docs/public/editor/assets/index-Cjhj5q0g.js rename to docs/public/editor/assets/index-BwqHJ3f2.js index 3ede95dce..d2d3d82fd 100644 --- a/docs/public/editor/assets/index-Cjhj5q0g.js +++ b/docs/public/editor/assets/index-BwqHJ3f2.js @@ -703,7 +703,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } `]))),Yq=function(t,n){var o=t.isFocused,r=t.size,i=t.theme,s=i.colors,a=i.spacing.baseUnit;return _e({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},n?{}:{color:o?s.neutral60:s.neutral20,padding:a*2})},G2=function(t){var n=t.delay,o=t.offset;return ve("span",{css:A5({animation:"".concat(qq," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:o?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Xq=function(t){var n=t.innerProps,o=t.isRtl,r=t.size,i=r===void 0?4:r,s=ms(t,Fq);return ve("div",we({},qt(_e(_e({},s),{},{innerProps:n,isRtl:o,size:i}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),ve(G2,{delay:0,offset:o}),ve(G2,{delay:160,offset:!0}),ve(G2,{delay:320,offset:!o}))},Jq=function(t,n){var o=t.isDisabled,r=t.isFocused,i=t.theme,s=i.colors,a=i.borderRadius,l=i.spacing;return _e({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:o?s.neutral5:s.neutral0,borderColor:o?s.neutral10:r?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:r?s.primary:s.neutral30}})},Zq=function(t){var n=t.children,o=t.isDisabled,r=t.isFocused,i=t.innerRef,s=t.innerProps,a=t.menuIsOpen;return ve("div",we({ref:i},qt(t,"control",{control:!0,"control--is-disabled":o,"control--is-focused":r,"control--menu-is-open":a}),s,{"aria-disabled":o||void 0}),n)},Kq=Zq,Qq=["data"],eY=function(t,n){var o=t.theme.spacing;return n?{}:{paddingBottom:o.baseUnit*2,paddingTop:o.baseUnit*2}},tY=function(t){var n=t.children,o=t.cx,r=t.getStyles,i=t.getClassNames,s=t.Heading,a=t.headingProps,l=t.innerProps,c=t.label,d=t.theme,f=t.selectProps;return ve("div",we({},qt(t,"group",{group:!0}),l),ve(s,we({},a,{selectProps:f,theme:d,getStyles:r,getClassNames:i,cx:o}),c),ve("div",null,n))},nY=function(t,n){var o=t.theme,r=o.colors,i=o.spacing;return _e({label:"group",cursor:"default",display:"block"},n?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:i.baseUnit*3,paddingRight:i.baseUnit*3,textTransform:"uppercase"})},oY=function(t){var n=Ek(t);n.data;var o=ms(n,Qq);return ve("div",we({},qt(t,"groupHeading",{"group-heading":!0}),o))},rY=tY,iY=["innerRef","isDisabled","isHidden","inputClassName"],sY=function(t,n){var o=t.isDisabled,r=t.value,i=t.theme,s=i.spacing,a=i.colors;return _e(_e({visibility:o?"hidden":"visible",transform:r?"translateZ(0)":""},aY),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},Ak={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},aY={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":_e({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Ak)},lY=function(t){return _e({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Ak)},cY=function(t){var n=t.cx,o=t.value,r=Ek(t),i=r.innerRef,s=r.isDisabled,a=r.isHidden,l=r.inputClassName,c=ms(r,iY);return ve("div",we({},qt(t,"input",{"input-container":!0}),{"data-value":o||""}),ve("input",we({className:n({input:!0},l),ref:i,style:lY(a),disabled:s},c)))},uY=cY,dY=function(t,n){var o=t.theme,r=o.spacing,i=o.borderRadius,s=o.colors;return _e({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:i/2,margin:r.baseUnit/2})},fY=function(t,n){var o=t.theme,r=o.borderRadius,i=o.colors,s=t.cropWithEllipsis;return _e({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:r/2,color:i.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},pY=function(t,n){var o=t.theme,r=o.spacing,i=o.borderRadius,s=o.colors,a=t.isFocused;return _e({alignItems:"center",display:"flex"},n?{}:{borderRadius:i/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},Ok=function(t){var n=t.children,o=t.innerProps;return ve("div",o,n)},hY=Ok,mY=Ok;function gY(e){var t=e.children,n=e.innerProps;return ve("div",we({role:"button"},n),t||ve(O5,{size:14}))}var yY=function(t){var n=t.children,o=t.components,r=t.data,i=t.innerProps,s=t.isDisabled,a=t.removeProps,l=t.selectProps,c=o.Container,d=o.Label,f=o.Remove;return ve(c,{data:r,innerProps:_e(_e({},qt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),i),selectProps:l},ve(d,{data:r,innerProps:_e({},qt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),ve(f,{data:r,innerProps:_e(_e({},qt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),selectProps:l}))},vY=yY,bY=function(t,n){var o=t.isDisabled,r=t.isFocused,i=t.isSelected,s=t.theme,a=s.spacing,l=s.colors;return _e({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:i?l.primary:r?l.primary25:"transparent",color:o?l.neutral20:i?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:o?void 0:i?l.primary:l.primary50}})},_Y=function(t){var n=t.children,o=t.isDisabled,r=t.isFocused,i=t.isSelected,s=t.innerRef,a=t.innerProps;return ve("div",we({},qt(t,"option",{option:!0,"option--is-disabled":o,"option--is-focused":r,"option--is-selected":i}),{ref:s,"aria-disabled":o},a),n)},wY=_Y,xY=function(t,n){var o=t.theme,r=o.spacing,i=o.colors;return _e({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:i.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},SY=function(t){var n=t.children,o=t.innerProps;return ve("div",we({},qt(t,"placeholder",{placeholder:!0}),o),n)},EY=SY,CY=function(t,n){var o=t.isDisabled,r=t.theme,i=r.spacing,s=r.colors;return _e({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:o?s.neutral40:s.neutral80,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},TY=function(t){var n=t.children,o=t.isDisabled,r=t.innerProps;return ve("div",we({},qt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":o}),r),n)},kY=TY,gd={ClearIndicator:jq,Control:Kq,DropdownIndicator:Vq,DownChevron:Rk,CrossIcon:O5,Group:rY,GroupHeading:oY,IndicatorsContainer:Pq,IndicatorSeparator:Gq,Input:uY,LoadingIndicator:Xq,Menu:Sq,MenuList:Cq,MenuPortal:Rq,LoadingMessage:Iq,NoOptionsMessage:Lq,MultiValue:vY,MultiValueContainer:hY,MultiValueLabel:mY,MultiValueRemove:gY,Option:wY,Placeholder:EY,SelectContainer:Aq,SingleValue:kY,ValueContainer:Dq},LY=function(t){return _e(_e({},gd),t.components)},Q7=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function IY(e,t){return!!(e===t||Q7(e)&&Q7(t))}function NY(e,t){if(e.length!==t.length)return!1;for(var n=0;n1?"s":""," ").concat(i.join(","),", selected.");case"select-option":return s?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(t){var n=t.context,o=t.focused,r=t.options,i=t.label,s=i===void 0?"":i,a=t.selectValue,l=t.isDisabled,c=t.isSelected,d=t.isAppleDevice,f=function(g,b){return g&&g.length?"".concat(g.indexOf(b)+1," of ").concat(g.length):""};if(n==="value"&&a)return"value ".concat(s," focused, ").concat(f(a,o),".");if(n==="menu"&&d){var m=l?" disabled":"",h="".concat(c?" selected":"").concat(m);return"".concat(s).concat(h,", ").concat(f(r,o),".")}return""},onFilter:function(t){var n=t.inputValue,o=t.resultsMessage;return"".concat(o).concat(n?" for search term "+n:"",".")}},DY=function(t){var n=t.ariaSelection,o=t.focusedOption,r=t.focusedValue,i=t.focusableOptions,s=t.isFocused,a=t.selectValue,l=t.selectProps,c=t.id,d=t.isAppleDevice,f=l.ariaLiveMessages,m=l.getOptionLabel,h=l.inputValue,p=l.isMulti,g=l.isOptionDisabled,b=l.isSearchable,y=l.menuIsOpen,v=l.options,_=l.screenReaderStatus,w=l.tabSelectsValue,S=l.isLoading,x=l["aria-label"],E=l["aria-live"],T=u.useMemo(function(){return _e(_e({},OY),f||{})},[f]),N=u.useMemo(function(){var M="";if(n&&T.onChange){var A=n.option,$=n.options,z=n.removedValue,L=n.removedValues,D=n.value,F=function(j){return Array.isArray(j)?null:j},V=z||A||F(D),G=V?m(V):"",U=$||L||void 0,W=U?U.map(m):[],H=_e({isDisabled:V&&g(V,a),label:G,labels:W},n);M=T.onChange(H)}return M},[n,T,g,a,m]),I=u.useMemo(function(){var M="",A=o||r,$=!!(o&&a&&a.includes(o));if(A&&T.onFocus){var z={focused:A,label:m(A),isDisabled:g(A,a),isSelected:$,options:i,context:A===o?"menu":"value",selectValue:a,isAppleDevice:d};M=T.onFocus(z)}return M},[o,r,m,g,T,i,a,d]),R=u.useMemo(function(){var M="";if(y&&v.length&&!S&&T.onFilter){var A=_({count:i.length});M=T.onFilter({inputValue:h,resultsMessage:A})}return M},[i,h,y,T,v,_,S]),O=n?.action==="initial-input-focus",B=u.useMemo(function(){var M="";if(T.guidance){var A=r?"value":y?"menu":"input";M=T.guidance({"aria-label":x,context:A,isDisabled:o&&g(o,a),isMulti:p,isSearchable:b,tabSelectsValue:w,isInitialFocus:O})}return M},[x,o,r,p,g,b,y,T,a,w,O]),C=ve(u.Fragment,null,ve("span",{id:"aria-selection"},N),ve("span",{id:"aria-focused"},I),ve("span",{id:"aria-results"},R),ve("span",{id:"aria-guidance"},B));return ve(u.Fragment,null,ve(e_,{id:c},O&&C),ve(e_,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!O&&C))},zY=DY,Ly=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],PY=new RegExp("["+Ly.map(function(e){return e.letters}).join("")+"]","g"),Dk={};for(var q2=0;q2-1}},$Y=["innerRef"];function HY(e){var t=e.innerRef,n=ms(e,$Y),o=mq(n,"onExited","in","enter","exit","appear");return ve("input",we({ref:t},o,{css:A5({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var VY=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function UY(e){var t=e.isEnabled,n=e.onBottomArrive,o=e.onBottomLeave,r=e.onTopArrive,i=e.onTopLeave,s=u.useRef(!1),a=u.useRef(!1),l=u.useRef(0),c=u.useRef(null),d=u.useCallback(function(b,y){if(c.current!==null){var v=c.current,_=v.scrollTop,w=v.scrollHeight,S=v.clientHeight,x=c.current,E=y>0,T=w-S-_,N=!1;T>y&&s.current&&(o&&o(b),s.current=!1),E&&a.current&&(i&&i(b),a.current=!1),E&&y>T?(n&&!s.current&&n(b),x.scrollTop=w,N=!0,s.current=!0):!E&&-y>_&&(r&&!a.current&&r(b),x.scrollTop=0,N=!0,a.current=!0),N&&VY(b)}},[n,o,r,i]),f=u.useCallback(function(b){d(b,b.deltaY)},[d]),m=u.useCallback(function(b){l.current=b.changedTouches[0].clientY},[]),h=u.useCallback(function(b){var y=l.current-b.changedTouches[0].clientY;d(b,y)},[d]),p=u.useCallback(function(b){if(b){var y=fq?{passive:!1}:!1;b.addEventListener("wheel",f,y),b.addEventListener("touchstart",m,y),b.addEventListener("touchmove",h,y)}},[h,m,f]),g=u.useCallback(function(b){b&&(b.removeEventListener("wheel",f,!1),b.removeEventListener("touchstart",m,!1),b.removeEventListener("touchmove",h,!1))},[h,m,f]);return u.useEffect(function(){if(t){var b=c.current;return p(b),function(){g(b)}}},[t,p,g]),function(b){c.current=b}}var n_=["boxSizing","height","overflow","paddingRight","position"],o_={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function r_(e){e.preventDefault()}function i_(e){e.stopPropagation()}function s_(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function a_(){return"ontouchstart"in window||navigator.maxTouchPoints}var l_=!!(typeof window<"u"&&window.document&&window.document.createElement),bu=0,Rl={capture:!1,passive:!1};function jY(e){var t=e.isEnabled,n=e.accountForScrollbars,o=n===void 0?!0:n,r=u.useRef({}),i=u.useRef(null),s=u.useCallback(function(l){if(l_){var c=document.body,d=c&&c.style;if(o&&n_.forEach(function(p){var g=d&&d[p];r.current[p]=g}),o&&bu<1){var f=parseInt(r.current.paddingRight,10)||0,m=document.body?document.body.clientWidth:0,h=window.innerWidth-m+f||0;Object.keys(o_).forEach(function(p){var g=o_[p];d&&(d[p]=g)}),d&&(d.paddingRight="".concat(h,"px"))}c&&a_()&&(c.addEventListener("touchmove",r_,Rl),l&&(l.addEventListener("touchstart",s_,Rl),l.addEventListener("touchmove",i_,Rl))),bu+=1}},[o]),a=u.useCallback(function(l){if(l_){var c=document.body,d=c&&c.style;bu=Math.max(bu-1,0),o&&bu<1&&n_.forEach(function(f){var m=r.current[f];d&&(d[f]=m)}),c&&a_()&&(c.removeEventListener("touchmove",r_,Rl),l&&(l.removeEventListener("touchstart",s_,Rl),l.removeEventListener("touchmove",i_,Rl)))}},[o]);return u.useEffect(function(){if(t){var l=i.current;return s(l),function(){a(l)}}},[t,s,a]),function(l){i.current=l}}var WY=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},GY={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function qY(e){var t=e.children,n=e.lockEnabled,o=e.captureEnabled,r=o===void 0?!0:o,i=e.onBottomArrive,s=e.onBottomLeave,a=e.onTopArrive,l=e.onTopLeave,c=UY({isEnabled:r,onBottomArrive:i,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),d=jY({isEnabled:n}),f=function(h){c(h),d(h)};return ve(u.Fragment,null,n&&ve("div",{onClick:WY,css:GY}),t(f))}var YY={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},XY=function(t){var n=t.name,o=t.onFocus;return ve("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:o,css:YY,value:"",onChange:function(){}})},JY=XY;function D5(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function ZY(){return D5(/^iPhone/i)}function Bk(){return D5(/^Mac/i)}function KY(){return D5(/^iPad/i)||Bk()&&navigator.maxTouchPoints>1}function QY(){return ZY()||KY()}function eX(){return Bk()||QY()}var tX=function(t){return t.label},nX=function(t){return t.label},oX=function(t){return t.value},rX=function(t){return!!t.isDisabled},iX={clearIndicator:Uq,container:Mq,control:Jq,dropdownIndicator:Hq,group:eY,groupHeading:nY,indicatorsContainer:zq,indicatorSeparator:Wq,input:sY,loadingIndicator:Yq,loadingMessage:kq,menu:_q,menuList:Eq,menuPortal:Nq,multiValue:dY,multiValueLabel:fY,multiValueRemove:pY,noOptionsMessage:Tq,option:bY,placeholder:xY,singleValue:CY,valueContainer:Oq},sX={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},aX=4,Fk=4,lX=38,cX=Fk*2,uX={baseUnit:Fk,controlHeight:lX,menuGutter:cX},J2={borderRadius:aX,colors:sX,spacing:uX},dX={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Z7(),captureMenuScroll:!Z7(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Pk(),formatGroupLabel:tX,getOptionLabel:nX,getOptionValue:oX,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:rX,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!uq(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function c_(e,t,n,o){var r=Vk(e,t,n),i=Uk(e,t,n),s=Hk(e,t),a=Gp(e,t);return{type:"option",data:t,isDisabled:r,isSelected:i,label:s,value:a,index:o}}function k0(e,t){return e.options.map(function(n,o){if("options"in n){var r=n.options.map(function(s,a){return c_(e,s,t,a)}).filter(function(s){return d_(e,s)});return r.length>0?{type:"group",data:n,options:r,index:o}:void 0}var i=c_(e,n,t,o);return d_(e,i)?i:void 0}).filter(pq)}function $k(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,C5(n.options.map(function(o){return o.data}))):t.push(n.data),t},[])}function u_(e,t){return e.reduce(function(n,o){return o.type==="group"?n.push.apply(n,C5(o.options.map(function(r){return{data:r.data,id:"".concat(t,"-").concat(o.index,"-").concat(r.index)}}))):n.push({data:o.data,id:"".concat(t,"-").concat(o.index)}),n},[])}function fX(e,t){return $k(k0(e,t))}function d_(e,t){var n=e.inputValue,o=n===void 0?"":n,r=t.data,i=t.isSelected,s=t.label,a=t.value;return(!Wk(e)||!i)&&jk(e,{label:s,value:a,data:r},o)}function pX(e,t){var n=e.focusedValue,o=e.selectValue,r=o.indexOf(n);if(r>-1){var i=t.indexOf(n);if(i>-1)return n;if(r-1?n:t[0]}var Z2=function(t,n){var o,r=(o=t.find(function(i){return i.data===n}))===null||o===void 0?void 0:o.id;return r||null},Hk=function(t,n){return t.getOptionLabel(n)},Gp=function(t,n){return t.getOptionValue(n)};function Vk(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Uk(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var o=Gp(e,t);return n.some(function(r){return Gp(e,r)===o})}function jk(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Wk=function(t){var n=t.hideSelectedOptions,o=t.isMulti;return n===void 0?o:n},mX=1,Gk=function(e){qW(n,e);var t=JW(n);function n(o){var r;if(WW(this,n),r=t.call(this,o),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=eX(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,c){var d=r.props,f=d.onChange,m=d.name;c.name=m,r.ariaOnChange(l,c),f(l,c)},r.setValue=function(l,c,d){var f=r.props,m=f.closeMenuOnSelect,h=f.isMulti,p=f.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:p}),m&&(r.setState({inputIsHiddenAfterUpdate:!h}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:c,option:d})},r.selectOption=function(l){var c=r.props,d=c.blurInputOnSelect,f=c.isMulti,m=c.name,h=r.state.selectValue,p=f&&r.isOptionSelected(l,h),g=r.isOptionDisabled(l,h);if(p){var b=r.getOptionValue(l);r.setValue(h.filter(function(y){return r.getOptionValue(y)!==b}),"deselect-option",l)}else if(!g)f?r.setValue([].concat(C5(h),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:m});return}d&&r.blurInput()},r.removeValue=function(l){var c=r.props.isMulti,d=r.state.selectValue,f=r.getOptionValue(l),m=d.filter(function(p){return r.getOptionValue(p)!==f}),h=Lf(c,m,m[0]||null);r.onChange(h,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(Lf(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,c=r.state.selectValue,d=c[c.length-1],f=c.slice(0,c.length-1),m=Lf(l,f,f[0]||null);r.onChange(m,{action:"pop-value",removedValue:d})},r.getFocusedOptionId=function(l){return Z2(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return u_(k0(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,c=new Array(l),d=0;dh||m>h}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var c=r.props.inputValue,d=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(d,{action:"input-change",prevInputValue:c}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var c=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:c}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var c=r.getFocusableOptions(),d=c.indexOf(l);r.setState({focusedOption:l,focusedOptionId:d>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return Wk(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var c=r.props,d=c.isMulti,f=c.backspaceRemovesValue,m=c.escapeClearsValue,h=c.inputValue,p=c.isClearable,g=c.isDisabled,b=c.menuIsOpen,y=c.onKeyDown,v=c.tabSelectsValue,_=c.openMenuOnFocus,w=r.state,S=w.focusedOption,x=w.focusedValue,E=w.selectValue;if(!g&&!(typeof y=="function"&&(y(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!d||h)return;r.focusValue("previous");break;case"ArrowRight":if(!d||h)return;r.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(x)r.removeValue(x);else{if(!f)return;d?r.popValue():p&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!b||!v||!S||_&&r.isOptionSelected(S,E))return;r.selectOption(S);break;case"Enter":if(l.keyCode===229)break;if(b){if(!S||r.isComposing)return;r.selectOption(S);break}return;case"Escape":b?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:h}),r.onMenuClose()):p&&m&&r.clearValue();break;case" ":if(h)return;if(!b){r.openMenu("first");break}if(!S)return;r.selectOption(S);break;case"ArrowUp":b?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":b?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!b)return;r.focusOption("pageup");break;case"PageDown":if(!b)return;r.focusOption("pagedown");break;case"Home":if(!b)return;r.focusOption("first");break;case"End":if(!b)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++mX),r.state.selectValue=X7(o.value),o.menuIsOpen&&r.state.selectValue.length){var i=r.getFocusableOptionsWithIds(),s=r.buildFocusableOptions(),a=s.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=i,r.state.focusedOption=s[a],r.state.focusedOptionId=Z2(i,s[a])}return r}return GW(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&J7(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var i=this.props,s=i.isDisabled,a=i.menuIsOpen,l=this.state.isFocused;(l&&!s&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&s&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(J7(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,i){this.props.onInputChange(r,i)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var i=this,s=this.state,a=s.selectValue,l=s.isFocused,c=this.buildFocusableOptions(),d=r==="first"?0:c.length-1;if(!this.props.isMulti){var f=c.indexOf(a[0]);f>-1&&(d=f)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[d],focusedOptionId:this.getFocusedOptionId(c[d])},function(){return i.onMenuOpen()})}},{key:"focusValue",value:function(r){var i=this.state,s=i.selectValue,a=i.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var c=s.length-1,d=-1;if(s.length){switch(r){case"previous":l===0?d=0:l===-1?d=c:d=l-1;break;case"next":l>-1&&l0&&arguments[0]!==void 0?arguments[0]:"first",i=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,c=a.indexOf(s);s||(c=-1),r==="up"?l=c>0?c-1:a.length-1:r==="down"?l=(c+1)%a.length:r==="pageup"?(l=c-i,l<0&&(l=0)):r==="pagedown"?(l=c+i,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(J2):_e(_e({},J2),this.props.theme):J2}},{key:"getCommonProps",value:function(){var r=this.clearValue,i=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,c=this.selectOption,d=this.setValue,f=this.props,m=f.isMulti,h=f.isRtl,p=f.options,g=this.hasValue();return{clearValue:r,cx:i,getStyles:s,getClassNames:a,getValue:l,hasValue:g,isMulti:m,isRtl:h,options:p,selectOption:c,selectProps:f,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,i=r.isClearable,s=r.isMulti;return i===void 0?s:i}},{key:"isOptionDisabled",value:function(r,i){return Vk(this.props,r,i)}},{key:"isOptionSelected",value:function(r,i){return Uk(this.props,r,i)}},{key:"filterOption",value:function(r,i){return jk(this.props,r,i)}},{key:"formatOptionLabel",value:function(r,i){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:i,inputValue:s,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,i=r.isDisabled,s=r.isSearchable,a=r.inputId,l=r.inputValue,c=r.tabIndex,d=r.form,f=r.menuIsOpen,m=r.required,h=this.getComponents(),p=h.Input,g=this.state,b=g.inputIsHidden,y=g.ariaSelection,v=this.commonProps,_=a||this.getElementId("input"),w=_e(_e(_e({"aria-autocomplete":"list","aria-expanded":f,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":m,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?y?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?u.createElement(p,we({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:_,innerRef:this.getInputRef,isDisabled:i,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:d,type:"text",value:l},w)):u.createElement(HY,we({id:_,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:jp,onFocus:this.onInputFocus,disabled:i,tabIndex:c,inputMode:"none",form:d,value:""},w))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,i=this.getComponents(),s=i.MultiValue,a=i.MultiValueContainer,l=i.MultiValueLabel,c=i.MultiValueRemove,d=i.SingleValue,f=i.Placeholder,m=this.commonProps,h=this.props,p=h.controlShouldRenderValue,g=h.isDisabled,b=h.isMulti,y=h.inputValue,v=h.placeholder,_=this.state,w=_.selectValue,S=_.focusedValue,x=_.isFocused;if(!this.hasValue()||!p)return y?null:u.createElement(f,we({},m,{key:"placeholder",isDisabled:g,isFocused:x,innerProps:{id:this.getElementId("placeholder")}}),v);if(b)return w.map(function(T,N){var I=T===S,R="".concat(r.getOptionLabel(T),"-").concat(r.getOptionValue(T));return u.createElement(s,we({},m,{components:{Container:a,Label:l,Remove:c},isFocused:I,isDisabled:g,key:R,index:N,removeProps:{onClick:function(){return r.removeValue(T)},onTouchEnd:function(){return r.removeValue(T)},onMouseDown:function(B){B.preventDefault()}},data:T}),r.formatOptionLabel(T,"value"))});if(y)return null;var E=w[0];return u.createElement(d,we({},m,{data:E,isDisabled:g}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),i=r.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,d=this.state.isFocused;if(!this.isClearable()||!i||l||!this.hasValue()||c)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return u.createElement(i,we({},s,{innerProps:f,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),i=r.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,d=this.state.isFocused;if(!i||!c)return null;var f={"aria-hidden":"true"};return u.createElement(i,we({},s,{innerProps:f,isDisabled:l,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),i=r.DropdownIndicator,s=r.IndicatorSeparator;if(!i||!s)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return u.createElement(s,we({},a,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),i=r.DropdownIndicator;if(!i)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return u.createElement(i,we({},s,{innerProps:c,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,i=this.getComponents(),s=i.Group,a=i.GroupHeading,l=i.Menu,c=i.MenuList,d=i.MenuPortal,f=i.LoadingMessage,m=i.NoOptionsMessage,h=i.Option,p=this.commonProps,g=this.state.focusedOption,b=this.props,y=b.captureMenuScroll,v=b.inputValue,_=b.isLoading,w=b.loadingMessage,S=b.minMenuHeight,x=b.maxMenuHeight,E=b.menuIsOpen,T=b.menuPlacement,N=b.menuPosition,I=b.menuPortalTarget,R=b.menuShouldBlockScroll,O=b.menuShouldScrollIntoView,B=b.noOptionsMessage,C=b.onMenuScrollToTop,M=b.onMenuScrollToBottom;if(!E)return null;var A=function(G,U){var W=G.type,H=G.data,q=G.isDisabled,j=G.isSelected,X=G.label,J=G.value,K=g===H,Y=q?void 0:function(){return r.onOptionHover(H)},Z=q?void 0:function(){return r.selectOption(H)},oe="".concat(r.getElementId("option"),"-").concat(U),ce={id:oe,onClick:Z,onMouseMove:Y,onMouseOver:Y,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:j};return u.createElement(h,we({},p,{innerProps:ce,data:H,isDisabled:q,isSelected:j,key:oe,label:X,type:W,value:J,isFocused:K,innerRef:K?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(G.data,"menu"))},$;if(this.hasOptions())$=this.getCategorizedOptions().map(function(V){if(V.type==="group"){var G=V.data,U=V.options,W=V.index,H="".concat(r.getElementId("group"),"-").concat(W),q="".concat(H,"-heading");return u.createElement(s,we({},p,{key:H,data:G,options:U,Heading:a,headingProps:{id:q,data:V.data},label:r.formatGroupLabel(V.data)}),V.options.map(function(j){return A(j,"".concat(W,"-").concat(j.index))}))}else if(V.type==="option")return A(V,"".concat(V.index))});else if(_){var z=w({inputValue:v});if(z===null)return null;$=u.createElement(f,p,z)}else{var L=B({inputValue:v});if(L===null)return null;$=u.createElement(m,p,L)}var D={minMenuHeight:S,maxMenuHeight:x,menuPlacement:T,menuPosition:N,menuShouldScrollIntoView:O},F=u.createElement(wq,we({},p,D),function(V){var G=V.ref,U=V.placerProps,W=U.placement,H=U.maxHeight;return u.createElement(l,we({},p,D,{innerRef:G,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:_,placement:W}),u.createElement(qY,{captureEnabled:y,onTopArrive:C,onBottomArrive:M,lockEnabled:R},function(q){return u.createElement(c,we({},p,{innerRef:function(X){r.getMenuListRef(X),q(X)},innerProps:{role:"listbox","aria-multiselectable":p.isMulti,id:r.getElementId("listbox")},isLoading:_,maxHeight:H,focusedOption:g}),$)}))});return I||N==="fixed"?u.createElement(d,we({},p,{appendTo:I,controlElement:this.controlRef,menuPlacement:T,menuPosition:N}),F):F}},{key:"renderFormField",value:function(){var r=this,i=this.props,s=i.delimiter,a=i.isDisabled,l=i.isMulti,c=i.name,d=i.required,f=this.state.selectValue;if(d&&!this.hasValue()&&!a)return u.createElement(JY,{name:c,onFocus:this.onValueInputFocus});if(!(!c||a))if(l)if(s){var m=f.map(function(g){return r.getOptionValue(g)}).join(s);return u.createElement("input",{name:c,type:"hidden",value:m})}else{var h=f.length>0?f.map(function(g,b){return u.createElement("input",{key:"i-".concat(b),name:c,type:"hidden",value:r.getOptionValue(g)})}):u.createElement("input",{name:c,type:"hidden",value:""});return u.createElement("div",null,h)}else{var p=f[0]?this.getOptionValue(f[0]):"";return u.createElement("input",{name:c,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,i=this.state,s=i.ariaSelection,a=i.focusedOption,l=i.focusedValue,c=i.isFocused,d=i.selectValue,f=this.getFocusableOptions();return u.createElement(zY,we({},r,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:c,selectValue:d,focusableOptions:f,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),i=r.Control,s=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,c=this.props,d=c.className,f=c.id,m=c.isDisabled,h=c.menuIsOpen,p=this.state.isFocused,g=this.commonProps=this.getCommonProps();return u.createElement(a,we({},g,{className:d,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:m,isFocused:p}),this.renderLiveRegion(),u.createElement(i,we({},g,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:m,isFocused:p,menuIsOpen:h}),u.createElement(l,we({},g,{isDisabled:m}),this.renderPlaceholderOrValue(),this.renderInput()),u.createElement(s,we({},g,{isDisabled:m}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,i){var s=i.prevProps,a=i.clearFocusValueOnUpdate,l=i.inputIsHiddenAfterUpdate,c=i.ariaSelection,d=i.isFocused,f=i.prevWasFocused,m=i.instancePrefix,h=r.options,p=r.value,g=r.menuIsOpen,b=r.inputValue,y=r.isMulti,v=X7(p),_={};if(s&&(p!==s.value||h!==s.options||g!==s.menuIsOpen||b!==s.inputValue)){var w=g?fX(r,v):[],S=g?u_(k0(r,v),"".concat(m,"-option")):[],x=a?pX(i,v):null,E=hX(i,w),T=Z2(S,E);_={selectValue:v,focusedOption:E,focusedOptionId:T,focusableOptionsWithIds:S,focusedValue:x,clearFocusValueOnUpdate:!1}}var N=l!=null&&r!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},I=c,R=d&&f;return d&&!R&&(I={value:Lf(y,v,v[0]||null),options:v,action:"initial-input-focus"},R=!f),c?.action==="initial-input-focus"&&(I=null),_e(_e(_e({},_),N),{},{prevProps:r,ariaSelection:I,prevWasFocused:R})}}]),n}(u.Component);Gk.defaultProps=dX;var gX=u.forwardRef(function(e,t){var n=jW(e);return u.createElement(Gk,we({ref:t},n))}),yX=gX;const vX="_dropdown_1p8r5_1",bX="_searchable-dropdown_1p8r5_15",_X="_dropdown-group_1p8r5_28",wX="_dropdown-group-name_1p8r5_39",xX="_dropdown-group-arrow_1p8r5_45",SX="_dropdown-option_1p8r5_50",EX="_dropdown-option-group_1p8r5_54",CX="_dropdown-option-icon_1p8r5_58",TX="_dropdown-option-label_1p8r5_65",kX="_dropdown-option-label-name_1p8r5_69",LX="_dropdown-option-label-description_1p8r5_73",IX="_dropdown-option-group-arrow_1p8r5_79",NX="_expand-menu_1p8r5_130",RX="_menu-list-blur-underlay_1p8r5_139",MX="_menu-list_1p8r5_139",Kn={dropdown:vX,"searchable-dropdown":"_searchable-dropdown_1p8r5_15",searchableDropdown:bX,"dropdown-group":"_dropdown-group_1p8r5_28",dropdownGroup:_X,"dropdown-group-name":"_dropdown-group-name_1p8r5_39",dropdownGroupName:wX,"dropdown-group-arrow":"_dropdown-group-arrow_1p8r5_45",dropdownGroupArrow:xX,"dropdown-option":"_dropdown-option_1p8r5_50",dropdownOption:SX,"dropdown-option-group":"_dropdown-option-group_1p8r5_54",dropdownOptionGroup:EX,"dropdown-option-icon":"_dropdown-option-icon_1p8r5_58",dropdownOptionIcon:CX,"dropdown-option-label":"_dropdown-option-label_1p8r5_65",dropdownOptionLabel:TX,"dropdown-option-label-name":"_dropdown-option-label-name_1p8r5_69",dropdownOptionLabelName:kX,"dropdown-option-label-description":"_dropdown-option-label-description_1p8r5_73",dropdownOptionLabelDescription:LX,"dropdown-option-group-arrow":"_dropdown-option-group-arrow_1p8r5_79",dropdownOptionGroupArrow:IX,"expand-menu":"_expand-menu_1p8r5_130",expandMenu:NX,"menu-list-blur-underlay":"_menu-list-blur-underlay_1p8r5_139",menuListBlurUnderlay:RX,"menu-list":"_menu-list_1p8r5_139",menuList:MX},AX=Pk(),ru=({containerClass:e,expand:t,label:n,labelAttrs:o,labelClass:r,open:i,options:s,readonly:a,searchable:l,submit:c,tooltip:d,value:f})=>{const[m,h]=u.useState(!1),[p,g]=u.useState(),b=u.useRef(null),y=u.useMemo(()=>ln(Kn.dropdown,[l,Kn.searchableDropdown],[t,Kn.expandMenu]),[t,l]),v=u.useCallback(()=>b.current?.inputRef?.value??"",[]),_=u.useCallback(()=>b.current?.state.focusedOption??void 0,[]),w=u.useCallback(L=>{b.current!=null&&(b.current.state.focusedOption=L)},[]),S=u.useCallback(()=>{const L=b.current?.focusedOptionRef,D=Nz(b.current?.menuListRef?.parentElement);if(!D||!L)return;const F=L.getBoundingClientRect().top,V=F+L.getBoundingClientRect().height,G=D.getBoundingClientRect().top,U=G+D.getBoundingClientRect().height;FU&&(D.scrollTop+=V-U)},[]),x=u.useCallback(()=>{h(!0),f!=null&&(w(f),setTimeout(S,0))},[S,w,f]),E=u.useCallback(()=>{h(!1),g(void 0)},[]),T=u.useCallback((L,D)=>{p!==void 0&&D.action==="input-change"&&g(void 0),!m&&L.length>0&&x()},[p,m,x]),N=u.useCallback(L=>{const D=()=>m?E():x(),F={...L.innerProps,onMouseDown:D};return gd.SelectContainer({...L,innerProps:F})},[E,m,x]),I=u.useCallback(L=>{const D={...L.innerProps};return gd.ValueContainer({...L,innerProps:D})},[]),R=u.useCallback(()=>p&&k.jsxs("div",{className:Kn.dropdownGroup,onClick:()=>g(void 0),children:[k.jsx("span",{className:Kn.dropdownGroupArrow,children:eW}),k.jsx("span",{className:Kn.dropdownGroupName,children:p})]}),[p]),O=u.useCallback(L=>k.jsxs(gd.Menu,{...L,children:[R(),L.children]}),[R]),B=u.useCallback(()=>({SelectContainer:N,ValueContainer:I,DropdownIndicator:()=>Kh,Menu:O,MenuList:OX}),[N,O,I]),C=u.useCallback(L=>{c(L??void 0),E()},[E,c]),M=u.useCallback(L=>{L.key==="ArrowRight"&&b.current?.focusedOptionRef?.click(),L.key==="ArrowLeft"&&p!==void 0&&g(void 0),!m&&(L.key==="Enter"||L.key==="ArrowUp"||L.key==="ArrowDown")&&x(),f!==void 0&&v().length===0&&L.key==="Backspace"&&C(void 0),m&&L.key==="Tab"&&(_()!==f?C(_()):E())},[E,p,_,v,m,x,C,f]),A=u.useCallback(L=>{L?.value?.startsWith("to:")?g(L.value.substring(3)):C(L)},[C]),$=u.useCallback((L,D)=>{const F=L.label??L.value;if(D.context==="value")return f!==void 0?F:"";const V=L.value.startsWith("to:"),G=`${Kn.dropdownOption} ${V?Kn.dropdownOptionGroup:""}`;return k.jsxs("div",{className:G,children:[L.icon&&k.jsx("div",{className:Kn.dropdownOptionIcon,children:L.icon}),k.jsxs("div",{className:Kn.dropdownOptionLabel,children:[k.jsx("div",{className:Kn.dropdownOptionLabelName,children:F}),L.description&&k.jsx("div",{className:Kn.dropdownOptionLabelDescription,children:L.description})]}),V&&k.jsx("div",{className:Kn.dropdownOptionGroupArrow,children:tW})]})},[f]),z=u.useCallback((L,D)=>D?.length>0?AX({...L,label:`${L.label} ${L.data.description}`},D):L.data.group===p,[p]);return u.useEffect(()=>{!i||!b.current||(b.current.focus(),x())},[i,x]),k.jsx(xl,{value:f,submit:c,label:n,readonly:a,labelAttrs:o,labelClass:r,containerClass:e,tooltip:m?void 0:d,children:k.jsx(yX,{ref:b,options:s,value:f,className:y,classNamePrefix:"react-select",components:B(),formatOptionLabel:$,filterOption:z,isSearchable:l??!1,menuIsOpen:m,onBlur:E,onChange:A,onInputChange:T,onKeyDown:M,openMenuOnClick:!1,openMenuOnFocus:!1,tabSelectsValue:!1,captureMenuScroll:!1,tabIndex:-1})})},OX=({children:e,innerRef:t,...n})=>{const[o,r]=u.useState(null);return u.useEffect(()=>{t(o)},[t,o]),k.jsx(Qc,{show:!0,className:Kn.menuListBlurUnderlay,children:k.jsx(Kc,{container:o,className:Kn.menuList,children:k.jsx(gd.MenuList,{...n,innerRef:r,children:e})})})},Iy=e=>e.options===void 0?k.jsx(ti,{...e}):k.jsx(ru,{...e,value:Jh(e.value,e.options),submit:t=>e.submit(Zh(t)),options:e.options,searchable:e.searchable}),qk=({eol:e,label:t,submit:n,tooltip:o,value:r,containerClass:i,labelClass:s,labelAttrs:a,readonly:l})=>{const c=u.useCallback(m=>e?m.replace(e,` -`):m,[e]),d=u.useCallback(m=>e?m.replace(/\r?\n|\r/g,e):m,[e]),f=u.useCallback(m=>{n(m?d(m):void 0)},[d,n]);return k.jsx(ti,{submit:f,format:jr.Multiline,value:r?c(r):void 0,tooltip:o,containerClass:i,labelClass:s,labelAttrs:a,readonly:l,label:t})},DX="_list_1pldn_1",zX="_list-header_1pldn_5 _labeled-container_iqlml_46",PX="_list-collapse_1pldn_13",BX="_list-label_1pldn_20 _label_iqlml_46",FX="_list-label-with-tooltip_1pldn_25 _label-with-tooltip_iqlml_63",$X="_list-size_1pldn_29",HX="_list-items_1pldn_34",VX="_list-item_1pldn_34",UX="_list-item-selected_1pldn_49 _list-item_1pldn_34",jX="_list-item-drag-handle_1pldn_58",WX="_list-item-label_1pldn_69",GX="_list-item-editor_1pldn_74",qX="_list-empty-item_1pldn_82",YX="_list-add-remove-panel_1pldn_88",XX="_list-add-remove-button_1pldn_101",Un={list:DX,"list-header":"_list-header_1pldn_5 _labeled-container_iqlml_46",listHeader:zX,"list-collapse":"_list-collapse_1pldn_13",listCollapse:PX,"list-label":"_list-label_1pldn_20 _label_iqlml_46",listLabel:BX,"list-label-with-tooltip":"_list-label-with-tooltip_1pldn_25 _label-with-tooltip_iqlml_63",listLabelWithTooltip:FX,"list-size":"_list-size_1pldn_29",listSize:$X,"list-items":"_list-items_1pldn_34",listItems:HX,"list-item":"_list-item_1pldn_34",listItem:VX,"list-item-selected":"_list-item-selected_1pldn_49 _list-item_1pldn_34",listItemSelected:UX,"list-item-drag-handle":"_list-item-drag-handle_1pldn_58",listItemDragHandle:jX,"list-item-label":"_list-item-label_1pldn_69",listItemLabel:WX,"list-item-editor":"_list-item-editor_1pldn_74",listItemEditor:GX,"list-empty-item":"_list-empty-item_1pldn_82",listEmptyItem:qX,"list-add-remove-panel":"_list-add-remove-panel_1pldn_88",listAddRemovePanel:YX,"list-add-remove-button":"_list-add-remove-button_1pldn_101",listAddRemoveButton:XX},JX=e=>{const t=e.selected?Un.listItemSelected:Un.listItem,n=mv(e.index);return k.jsxs("span",{className:t,onClick:e.handleSelected,...n.node,children:[k.jsx("span",{...cn("Reorder Element"),...n.handle,className:Un.listItemDragHandle,tabIndex:0,children:mW}),k.jsxs("span",{className:Un.listItemLabel,children:["Element ",e.index]}),k.jsx("span",{className:Un.listItemEditor,children:e.editor})]})};function z5({createDefault:e,headerClass:t,label:n,labelAttrs:o,labelClass:r,renderItem:i,submit:s,tooltip:a,values:l}){const[c,d]=u.useState(void 0),[f,m]=u.useState(!l||l.length===0),h=u.useCallback(E=>{if(E===void 0||E<0){s(void 0);return}if(E>100&&(E=100),E===l?.length)return;const T=new Array(E);for(let N=0;Nm(!f),[f]),g=u.useCallback(()=>{const E=f?_5:Kh;return k.jsxs("div",{className:`${Un.listHeader} ${t??""}`,children:[k.jsx("span",{className:Un.listCollapse,onClick:p,children:E}),k.jsx("span",{className:`${Un.listLabel} ${a?Un.listLabelWithTooltip:""} ${r??""}`,...cn(a,{doc:!0}),onClick:p,...o,children:n}),k.jsx(fl,{containerClass:Un.listSize,tooltip:"List Size",value:l?.length??0,submit:h})]})},[f,t,n,o,r,h,p,a,l?.length]),b=u.useCallback((E,T)=>{T===void 0&&(T=e());const N=new Array(l?.length??0);for(let I=0;I{const N=i(E,I=>b(T,I));return k.jsx(JX,{index:T,selected:c===T,handleSelected:()=>d(T),editor:N},T)},[b,i,c]),v=u.useCallback(()=>s([...l??[],e()]),[e,s,l]),_=u.useCallback(()=>{if(!l||l.length===0)return;const E=c??l.length-1;c===E&&d(void 0),s(l.filter((T,N)=>N!==E))},[c,s,l]),w=u.useCallback((E,T)=>{s(Rz(l,E,T))},[s,l]),S=u.useCallback(()=>{if(f)return null;const E=l==null||l.length===0?k.jsx("span",{className:Un.listEmptyItem,children:"List is empty"}):k.jsx(Tv,{handleSort:w,bound:Lc.Ancestor,children:l.map(y)});return k.jsx("div",{className:Un.listItems,children:E})},[f,w,y,l]),x=u.useCallback(()=>{if(!f)return k.jsxs("div",{className:Un.listAddRemovePanel,children:[k.jsx("span",{className:Un.listAddRemoveButton,onMouseDown:v,...cn("Add Element"),children:nk}),k.jsx("span",{className:Un.listAddRemoveButton,onMouseDown:_,...cn("Remove Element"),children:_W})]})},[v,f,_]);return u.useLayoutEffect(()=>m(!l||l.length===0),[l]),k.jsxs("div",{className:Un.list,children:[g(),S(),x()]})}function Yk(e){return k.jsx(xl,{...e,children:k.jsxs("span",{className:rt.named,children:[k.jsx("span",{className:rt.namedName,children:t()}),k.jsx("span",{className:rt.namedValue,children:n()})]})});function t(){return e.nameOptions===void 0?k.jsx(ti,{submit:o,value:e.value.name}):k.jsx(ru,{value:Jh(e.value.name,e.nameOptions),submit:i=>o(Zh(i)),options:e.nameOptions,searchable:!0})}function n(){const i=e.value.value??e.createDefault();return e.renderNamed(i,r)}function o(i){e.submit({name:i,value:e.value.value})}function r(i){e.submit({name:e.value.name,value:i})}}function ZX({className:e,createDefault:t,nameOptions:n,renderNamed:o,label:r,values:i,submit:s,tooltip:a,labelAttrs:l}){const c=u.useCallback(()=>({name:void 0,value:t()}),[t]),d=u.useCallback((f,m)=>k.jsx(Yk,{createDefault:t,value:f,submit:m,renderNamed:o,nameOptions:n}),[t,n,o]);return k.jsx(z5,{createDefault:c,renderItem:d,headerClass:e,label:r,values:i,submit:s,tooltip:a,labelAttrs:l})}const mm="\uFEFF",Xk=({containerClass:e,multiline:t,submit:n,value:o,readonly:r,labelAttrs:i,labelClass:s,tooltip:a,label:l})=>{const c=Ia(de.InsertExpression),d=Ia(de.ExitBeforeExpression),f=Ia(de.ExitAfterExpression),m=Ia(de.InsertTextId),h=Ia(de.ExitBeforeTextId),p=Ia(de.ExitAfterTextId),g={className:`${rt.value} ${rt.textEditor} ${rt.mixed}`},b=u.useCallback((w,S)=>ZT(w)?[w.text,k.jsx("span",{className:rt.textId,spellCheck:!1,children:w.id},S)]:JT(w)?k.jsx("span",{className:rt.expression,spellCheck:!1,children:w.body},S):w,[]),y=u.useMemo(()=>k.jsx(k.Fragment,{children:o.map(b)}),[b,o]),v=u.useCallback(w=>{const S=Array();let x;for(let E=w.childNodes.length-1;E>=0;E--){const T=w.childNodes[E],N=T.textContent?.replace(mm,""),I=T?.className;!N||N.length===0||(I===rt.textId?x=N:I===rt.expression?S.push({body:N}):x!==void 0?(S.push({text:N,id:x}),x=void 0):S.push(N))}n(S.reverse())},[n]),_=u.useCallback(w=>f_(w,c,rt.expression)||p_(w,d,f,rt.expression)||f_(w,m,rt.textId)||p_(w,h,p,rt.textId),[f,p,d,h,c,m]);return k.jsx(xl,{value:o,submit:n,readonly:r,labelAttrs:i,labelClass:s,tooltip:a,label:l,containerClass:`${e} ${t?rt.multiline:""}`,children:k.jsx(YT,{content:y,submit:v,onKeyDown:_,spanProps:g})})};function KX(e){const t=document.createElement("span");return t.className=e,t.spellcheck=!1,t.textContent=mm,t}function Jk(e){const t=e.target,n=window.getSelection(),o=n?.focusNode,r=o.textContent;if(!(!t||!n||!o||!r))return{selection:n,container:t,node:o,text:r}}function P5(e){return e?.nodeType===Node.TEXT_NODE&&e.parentElement?.className?.includes(rt.mixed)}function QX(e){return e.text.at(e.selection.focusOffset-1)==="\\"}function eJ(e,t){return e?.nodeType===Node.TEXT_NODE&&e.parentElement?.className?.includes(t)}function f_(e,t,n){if(e.key!==t)return!1;const o=Jk(e);if(!o||!P5(o.node)||QX(o))return!1;const r=KX(n);return o.container.insertBefore(r,o.node.splitText(o.selection.focusOffset)),o.selection.setBaseAndExtent(r,0,r,1),e.preventDefault(),!0}function K2(e,t){const n=t.node.parentElement?.nextSibling??null;if(P5(n)&&n.textContent.length>0)t.selection.setPosition(n,1);else{const o=document.createTextNode(mm);t.container.insertBefore(o,n??null),t.selection.setBaseAndExtent(o,0,o,1)}return e.preventDefault(),!0}function Q2(e,t){const n=t.node.parentElement?.previousSibling??null;if(P5(n)&&n.textContent.length>0)t.selection.setPosition(n,n.textContent.length);else{const o=document.createTextNode(mm);t.container.insertBefore(o,t.node.parentNode),t.selection.setBaseAndExtent(o,0,o,1)}return e.preventDefault(),!0}function p_(e,t,n,o){const r=e.key==="ArrowLeft",i=e.key==="ArrowRight",s=e.key===t,a=e.key===n;if(!r&&!i&&!s&&!a)return!1;const l=Jk(e);return!l||!eJ(l.node,o)?!1:a?K2(e,l):s?Q2(e,l):l.text.length===0?i?K2(e,l):Q2(e,l):i&&l.selection.focusOffset>=l.text.length?K2(e,l):r&&l.selection.focusOffset<=1?Q2(e,l):!1}function gm(){return(gm=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}function Ny(e){var t=u.useRef(e),n=u.useRef(function(o){t.current&&t.current(o)});return t.current=e,n.current}var Dc=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:b.buttons>0)&&r.current?i(h_(r.current,b,a.current)):g(!1)},p=function(){return g(!1)};function g(b){var y=l.current,v=Ry(r.current),_=b?v.addEventListener:v.removeEventListener;_(y?"touchmove":"mousemove",h),_(y?"touchend":"mouseup",p)}return[function(b){var y=b.nativeEvent,v=r.current;if(v&&(m_(y),!function(w,S){return S&&!yd(w)}(y,l.current)&&v)){if(yd(y)){l.current=!0;var _=y.changedTouches||[];_.length&&(a.current=_[0].identifier)}v.focus(),i(h_(v,y,a.current)),g(!0)}},function(b){var y=b.which||b.keyCode;y<37||y>40||(b.preventDefault(),s({left:y===39?.05:y===37?-.05:0,top:y===40?.05:y===38?-.05:0}))},g]},[s,i]),d=c[0],f=c[1],m=c[2];return u.useEffect(function(){return m},[m]),P.createElement("div",gm({},o,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:r,onKeyDown:f,tabIndex:0,role:"slider"}))}),ym=function(e){return e.filter(Boolean).join(" ")},F5=function(e){var t=e.color,n=e.left,o=e.top,r=o===void 0?.5:o,i=ym(["react-colorful__pointer",e.className]);return P.createElement("div",{className:i,style:{top:100*r+"%",left:100*n+"%"}},P.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},bn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},tJ=function(e){return iJ(My(e))},My=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?bn(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?bn(parseInt(e.substring(6,8),16)/255,2):1}},nJ=function(e){return rJ(oJ(e))},Kk=function(e){var t=e.s,n=e.v,o=e.a,r=(200-t)*n/100;return{h:bn(e.h),s:bn(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:bn(r/2),a:bn(o,2)}},Ay=function(e){var t=Kk(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},eg=function(e){var t=Kk(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},oJ=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var i=Math.floor(t),s=o*(1-n),a=o*(1-(t-i)*n),l=o*(1-(1-t+i)*n),c=i%6;return{r:bn(255*[o,a,s,s,l,o][c]),g:bn(255*[l,o,o,a,s,s][c]),b:bn(255*[s,s,l,o,o,a][c]),a:bn(r,2)}},If=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},rJ=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,i=r<1?If(bn(255*r)):"";return"#"+If(t)+If(n)+If(o)+i},iJ=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,i=Math.max(t,n,o),s=i-Math.min(t,n,o),a=s?i===t?(n-o)/s:i===n?2+(o-t)/s:4+(t-n)/s:0;return{h:bn(60*(a<0?a+6:a)),s:bn(i?s/i*100:0),v:bn(i/255*100),a:r}},sJ=P.memo(function(e){var t=e.hue,n=e.onChange,o=ym(["react-colorful__hue",e.className]);return P.createElement("div",{className:o},P.createElement(B5,{onMove:function(r){n({h:360*r.left})},onKey:function(r){n({h:Dc(t+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":bn(t),"aria-valuemax":"360","aria-valuemin":"0"},P.createElement(F5,{className:"react-colorful__hue-pointer",left:t/360,color:Ay({h:t,s:100,v:100,a:1})})))}),aJ=P.memo(function(e){var t=e.hsva,n=e.onChange,o={backgroundColor:Ay({h:t.h,s:100,v:100,a:1})};return P.createElement("div",{className:"react-colorful__saturation",style:o},P.createElement(B5,{onMove:function(r){n({s:100*r.left,v:100-100*r.top})},onKey:function(r){n({s:Dc(t.s+100*r.left,0,100),v:Dc(t.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+bn(t.s)+"%, Brightness "+bn(t.v)+"%"},P.createElement(F5,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Ay(t)})))}),Qk=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},lJ=function(e,t){return e.toLowerCase()===t.toLowerCase()||Qk(My(e),My(t))};function cJ(e,t,n){var o=Ny(n),r=u.useState(function(){return e.toHsva(t)}),i=r[0],s=r[1],a=u.useRef({color:t,hsva:i});u.useEffect(function(){if(!e.equal(t,a.current.color)){var c=e.toHsva(t);a.current={hsva:c,color:t},s(c)}},[t,e]),u.useEffect(function(){var c;Qk(i,a.current.hsva)||e.equal(c=e.fromHsva(i),a.current.color)||(a.current={hsva:i,color:c},o(c))},[i,e,o]);var l=u.useCallback(function(c){s(function(d){return Object.assign({},d,c)})},[]);return[i,l]}var uJ=typeof window<"u"?u.useLayoutEffect:u.useEffect,dJ=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},g_=new Map,fJ=function(e){uJ(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!g_.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,g_.set(t,n);var o=dJ();o&&n.setAttribute("nonce",o),t.head.appendChild(n)}},[])},pJ=function(e){var t=e.className,n=e.hsva,o=e.onChange,r={backgroundImage:"linear-gradient(90deg, "+eg(Object.assign({},n,{a:0}))+", "+eg(Object.assign({},n,{a:1}))+")"},i=ym(["react-colorful__alpha",t]),s=bn(100*n.a);return P.createElement("div",{className:i},P.createElement("div",{className:"react-colorful__alpha-gradient",style:r}),P.createElement(B5,{onMove:function(a){o({a:a.left})},onKey:function(a){o({a:Dc(n.a+a.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},P.createElement(F5,{className:"react-colorful__alpha-pointer",left:n.a,color:eg(n)})))},hJ=function(e){var t=e.className,n=e.colorModel,o=e.color,r=o===void 0?n.defaultColor:o,i=e.onChange,s=Zk(e,["className","colorModel","color","onChange"]),a=u.useRef(null);fJ(a);var l=cJ(n,r,i),c=l[0],d=l[1],f=ym(["react-colorful",t]);return P.createElement("div",gm({},s,{ref:a,className:f}),P.createElement(aJ,{hsva:c,onChange:d}),P.createElement(sJ,{hue:c.h,onChange:d}),P.createElement(pJ,{hsva:c,onChange:d,className:"react-colorful__last-control"}))},mJ={defaultColor:"0001",toHsva:tJ,fromHsva:nJ,equal:lJ},gJ=function(e){return P.createElement(hJ,gm({},e,{colorModel:mJ}))};const yJ="_color_1dubz_1",vJ="_fields_1dubz_5",bJ="_hex-field-container_1dubz_9",_J="_hex-field_1dubz_9",wJ="_color-field_1dubz_18",xJ="_color-field-open_1dubz_29 _color-field_1dubz_18",SJ="_color-field-rgb_1dubz_38",EJ="_color-field-alpha_1dubz_42",CJ="_color-field-alpha-fill_1dubz_47",TJ="_color-picker_1dubz_52",si={color:yJ,fields:vJ,"hex-field-container":"_hex-field-container_1dubz_9",hexFieldContainer:bJ,"hex-field":"_hex-field_1dubz_9",hexField:_J,"color-field":"_color-field_1dubz_18",colorField:wJ,"color-field-open":"_color-field-open_1dubz_29 _color-field_1dubz_18",colorFieldOpen:xJ,"color-field-rgb":"_color-field-rgb_1dubz_38",colorFieldRgb:SJ,"color-field-alpha":"_color-field-alpha_1dubz_42",colorFieldAlpha:EJ,"color-field-alpha-fill":"_color-field-alpha-fill_1dubz_47",colorFieldAlphaFill:CJ,"color-picker":"_color-picker_1dubz_52",colorPicker:TJ},eL=e=>{const[t,n]=u.useState(y_(e.value)),[o,r]=u.useState(),[i,s]=LJ(t),a=u.useRef(null),l=u.useRef(null),c=u.useCallback(()=>{(t!==void 0||e.value!==void 0)&&e.submit(t),r(!1)},[t,e]),d=u.useCallback(()=>k.jsx(ti,{submit:e.submit,value:t,containerClass:si.hexFieldContainer,fieldClass:si.hexField,disableSpellCheck:!0}),[t,e.submit]),f=u.useCallback(()=>{const g=o?si.colorFieldOpen:si.colorField;return k.jsxs("div",{className:g,...cn("Pick Color"),onClick:()=>o?c():r(!0),ref:a,tabIndex:-1,children:[k.jsx("div",{className:si.colorFieldRgb,style:{background:i}}),k.jsx("div",{className:si.colorFieldAlpha,children:k.jsx("div",{className:si.colorFieldAlphaFill,style:{width:s}})})]})},[s,o,i,c]),m=u.useCallback(()=>k.jsx(xl,{...e,children:k.jsxs("div",{className:si.fields,children:[d(),f()]})}),[e,f,d]),h=u.useCallback(g=>{!l.current?.contains(g.relatedTarget)&&!a.current?.contains(g.relatedTarget)&&c()},[c]),p=u.useCallback(()=>o&&k.jsx("div",{className:si.colorPicker,ref:l,onBlur:h,tabIndex:-1,children:k.jsx(gJ,{color:t??"#ffffff",onChange:n})}),[t,h,o]);return u.useEffect(()=>n(y_(e.value)),[e.value]),u.useEffect(()=>void(o&&l.current?.focus()),[o]),iu([o&&[de.Submit,c],o&&[de.Cancel,c]],[o,t]),k.jsxs("div",{className:si.color,children:[m(),p()]})};function y_(e){if(e!=null)return e.startsWith("#")?e.length<7?"#ffffff":e:kJ(e)}function kJ(e){return e=e.toLowerCase(),e==="black"?"#000000":e==="white"?"#ffffff":e==="red"?"#ff0000":e==="green"?"#00ff00":e==="blue"?"#0000ff":e==="cyan"||e==="aqua"?"#00ffff":e==="darkblue"?"#00008b":e==="lightblue"?"#add8e6":e==="purple"?"#a020f0":e==="yellow"?"#ffff00":e==="fuchsia"||e==="magenta"?"#ff00ff":e==="silver"?"#c0c0c0":e==="grey"?"#808080":e==="orange"?"#ffa500":e==="brown"?"#964b00":e==="maroon"?"#800000":e==="olive"?"#808000":e==="navy"?"#000080":e==="teal"?"#008080":"#ffffff"}function LJ(e){if(e==null)return["#ffffff","100%"];const t=e.substring(0,7),n=e.length<9?"100%":`${IJ(e.substring(7,9))}`;return[t,n]}function IJ(e){return`${parseInt(e,16)/255*100}%`}const NJ=({components:e,containerClass:t,label:n,labelAttrs:o,labelClass:r,readonly:i,submit:s,tooltip:a,value:l})=>{const c=u.useCallback((f,m)=>{const h=[...l??[]];h[f]=m,h.some(p=>p!==void 0)?s(h):s(void 0)},[l,s]),d=u.useCallback((f,m)=>k.jsx(fl,{containerClass:rt.vectorComponent,labelClass:rt.vectorComponentLabel,label:f,submit:h=>c(m,h),value:l?.at(m)},f),[c,l]);return k.jsx(xl,{value:l,submit:s,label:n,tooltip:a,labelClass:r,labelAttrs:o,readonly:i,containerClass:t,children:k.jsx("span",{className:rt.vector,children:e.map(d)})})};var ei=(e=>(e[e.Primary=0]="Primary",e[e.Minimal=1]="Minimal",e))(ei||{});const RJ="_button_xapm2_1",MJ="_label_xapm2_31",AJ="_icon_xapm2_37",OJ="_primary_xapm2_41",DJ="_minimal_xapm2_53",_u={button:RJ,label:MJ,icon:AJ,primary:OJ,minimal:DJ},yn=({handler:e,label:t,icon:n,tooltip:o,className:r,style:i,focus:s,onDown:a})=>{r=u.useMemo(()=>ln(_u.button,r,i===ei.Primary&&_u.primary,i===ei.Minimal&&_u.minimal),[r,i]);const l=u.useRef(null),c=u.useCallback(f=>{e?.(),f.preventDefault(),f.stopPropagation()},[e]),d=u.useCallback(f=>{Oy(f,de.Submit)&&(e?.(),f.preventDefault(),f.stopPropagation())},[e]);return u.useEffect(()=>{s&&l.current?.focus()},[s]),k.jsxs("span",{ref:l,className:r,onClick:a?void 0:c,onMouseDown:a?c:void 0,onKeyDown:d,...cn(o),tabIndex:0,children:[n&&k.jsx("span",{className:_u.icon,children:n}),t&&k.jsx("span",{className:_u.label,children:t})]})},zJ="_search-field_1j83z_1",PJ="_field_1j83z_5",BJ="_search-icon_1j83z_11",FJ="_clear-button_1j83z_23",$J="_match_1j83z_30",Wu={"search-field":"_search-field_1j83z_1",searchField:zJ,field:PJ,"search-icon":"_search-icon_1j83z_11",searchIcon:BJ,"clear-button":"_clear-button_1j83z_23",clearButton:FJ,match:$J},HJ=({handleInput:e,className:t})=>{const[n,o]=u.useState(!0),r=u.useCallback(()=>{o(!0),e("")},[e]),i=u.useCallback(()=>!n&&k.jsx(yn,{handler:r,icon:PW,style:ei.Minimal,className:Wu.clearButton,tooltip:"Clear Search"}),[r,n]),s=u.useCallback(a=>{a.length===0&&!n?o(!0):a.length>0&&n&&o(!1),e(a)},[n,e]);return k.jsxs("div",{className:`${Wu.searchField} ${t??""}`,children:[k.jsx("span",{className:Wu.searchIcon,children:bW}),i(),k.jsx(ti,{submit:a=>{},value:"",onInput:s,fieldClass:Wu.field,tooltip:"Search in Settings",clear:n,disableSpellCheck:!0})]})},VJ=e=>k.jsx("span",{className:Wu.match,children:e.text}),UJ="_settings-editor_1xqhl_1",jJ="_header_1xqhl_6",WJ="_content_1xqhl_13",GJ="_type-list_1xqhl_18",qJ="_scope-separator_1xqhl_23",YJ="_scope-separator-empty_1xqhl_32",XJ="_type-list-item_1xqhl_36",JJ="_type-list-item-selected_1xqhl_40 _type-list-item_1xqhl_36",ZJ="_type-view_1xqhl_46",KJ="_view-header_1xqhl_53",QJ="_view-content_1xqhl_60",eZ="_view-group_1xqhl_64",tZ="_view-property_1xqhl_70",nZ="_view-property-label-modified_1xqhl_74",jn={"settings-editor":"_settings-editor_1xqhl_1",settingsEditor:UJ,header:jJ,content:WJ,"type-list":"_type-list_1xqhl_18",typeList:GJ,"scope-separator":"_scope-separator_1xqhl_23",scopeSeparator:qJ,"scope-separator-empty":"_scope-separator-empty_1xqhl_32",scopeSeparatorEmpty:YJ,"type-list-item":"_type-list-item_1xqhl_36",typeListItem:XJ,"type-list-item-selected":"_type-list-item-selected_1xqhl_40 _type-list-item_1xqhl_36",typeListItemSelected:JJ,"type-view":"_type-view_1xqhl_46",typeView:ZJ,"view-header":"_view-header_1xqhl_53",viewHeader:KJ,"view-content":"_view-content_1xqhl_60",viewContent:QJ,"view-group":"_view-group_1xqhl_64",viewGroup:eZ,"view-property":"_view-property_1xqhl_70",viewProperty:tZ,"view-property-label-modified":"_view-property-label-modified_1xqhl_74",viewPropertyLabelModified:nZ},oZ=({categories:e,handleSelect:t,selectedCategory:n})=>{const o=(g,b)=>g.filter(y=>y.id.startsWith(Cr.ConfigurationScope[b])).sort((y,v)=>y.label==="General"||y.label[...r,...i],[r,i]),a=u.useMemo(()=>ln(jn.scopeSeparator,r.length===0&&jn.scopeSeparatorEmpty),[r.length]),l=u.useMemo(()=>ln(jn.scopeSeparator,i.length===0&&jn.scopeSeparatorEmpty),[i.length]),c=u.useCallback(g=>{t(g)},[t]),d=u.useCallback(()=>n===void 0?-1:s.findIndex(g=>g.id===n),[s,n]),f=u.useCallback(()=>{if(s.length===0)return;const g=d()+1;s.length<=g?t(s[0].id):t(s[g].id)},[s,d,t]),m=u.useCallback(()=>{if(s.length===0)return;const g=d()-1;g<0?t(s[s.length-1].id):t(s[g].id)},[s,d,t]),h=u.useCallback(g=>{g.key==="ArrowDown"&&f(),g.key==="ArrowUp"&&m()},[f,m]),p=u.useCallback((g,b)=>{const v=g===n?jn.typeListItemSelected:jn.typeListItem;return k.jsx("div",{className:v,onMouseDown:()=>c(g),onKeyDown:h,tabIndex:-1,children:b},g)},[h,c,n]);return k.jsxs(Kc,{className:jn.typeList,children:[k.jsx("div",{className:a,...cn(rZ),children:"Project"}),k.jsx("div",{children:r.map(g=>p(g.id,g.label))}),k.jsx("div",{className:l,...cn(iZ),children:"User"}),k.jsx("div",{children:i.map(g=>p(g.id,g.label))})]})},rZ="Project settings are saved inside project directory and shared across collaborators.",iZ="User settings are saved outside project directory and not shared across collaborators.",tL=new Array;function sZ(e){tL.push(e)}function nL(e){return tL.find(t=>t.canRender(e))}const aZ=({handleReset:e,label:t,modified:n,search:o})=>{const r=n?jn.viewPropertyLabelModified:void 0,i=N1(e!==void 0&&n&&{label:"Reset to Default",icon:S5,onClick:e}),s=u.useCallback(()=>{if(o.length===0)return t;const a=t.toLowerCase().indexOf(o);return a<0?t:[k.jsx("span",{children:t.substring(0,a)},0),k.jsx(VJ,{text:t.substring(a,a+o.length)},1),k.jsx("span",{children:t.substring(a+o.length)},2)]},[t,o]);return k.jsx("span",{className:r,onContextMenu:i,children:s()})},lZ=({label:e,options:t,submit:n,tooltip:o,valueType:r,values:i})=>{const s=u.useCallback((c,d)=>{if(r===re.ValueType.Boolean)return k.jsx(E5,{value:c,submit:d});if(r===re.ValueType.Integer)return k.jsx(fl,{value:c,submit:d,integer:!0});if(r===re.ValueType.Decimal)return k.jsx(fl,{value:c,submit:d});if(r===re.ValueType.String&&t===void 0)return k.jsx(ti,{value:c,submit:d});if(r===re.ValueType.String&&t!==void 0)return k.jsx(ru,{value:Jh(c),submit:f=>d(Zh(f)),options:XT(t),searchable:!0});throw Error("Failed to render array property item: unknown value type.")},[t,r]),a=u.useCallback(c=>{n(c===void 0?void 0:[...c])},[n]),l=u.useCallback(()=>{if(t!==void 0)return t.at(0);if(r===re.ValueType.Boolean)return!1;if(r===re.ValueType.Integer||r===re.ValueType.Decimal)return 0;if(r===re.ValueType.String)return"";throw Error("Failed to create default for array property: unknown value type.")},[t,r]);return k.jsx(z5,{values:i,label:e,tooltip:o,createDefault:l,renderItem:s,submit:a})},v_=({color:e,containerType:t,handleReset:n,label:o,modified:r,options:i,search:s,submit:a,tooltip:l,value:c,valueType:d})=>{const f=(l??"")+(r?" (modified)":""),m=u.useMemo(()=>k.jsx(aZ,{label:o,search:s,handleReset:n,modified:r}),[n,o,r,s]),h=u.useCallback(()=>t===re.ContainerType.Array?k.jsx(lZ,{values:c,submit:a,valueType:d,label:m,tooltip:f,options:i}):d===re.ValueType.Boolean?k.jsx(E5,{value:c,submit:a,label:m,tooltip:f}):d===re.ValueType.Integer?k.jsx(fl,{value:c,submit:a,label:m,tooltip:f,integer:!0}):d===re.ValueType.Decimal?k.jsx(fl,{value:c,submit:a,label:m,tooltip:f}):d===re.ValueType.String&&e?k.jsx(eL,{value:c,submit:a,label:m,tooltip:f}):d===re.ValueType.String&&i===void 0?k.jsx(ti,{value:c,submit:a,label:m,tooltip:f,disableSpellCheck:!0}):d===re.ValueType.String&&i!==void 0?k.jsx(ru,{value:Jh(c,void 0,!0),submit:p=>a(Zh(p)),label:m,tooltip:f,options:XT(i,!0),searchable:!0}):k.jsx(k.Fragment,{children:"Unknown property value type."}),[e,t,m,i,a,f,c,d]);return k.jsx("div",{className:jn.viewProperty,children:h()})},cZ=({search:e,view:t})=>{const[n,o]=u.useState([]);u.useLayoutEffect(()=>{t&&o(t.properties.map(re.viewProperty))},[t]);const r=u.useCallback(m=>m.reduce((h,p)=>{const g=p.group??"";return h.has(g)?h.get(g).push(p):h.set(g,[p]),h},new Map),[]),i=u.useCallback(m=>k.jsx("div",{className:jn.viewGroup,children:m},m),[]),s=u.useCallback(m=>{const h=new Array;for(const[p,g]of r(n))h.push(p.length>0?i(p):null,...g.map(m));return h},[r,i,n]),a=u.useCallback(m=>{re.reset(m),re.saveModified()},[]),l=u.useCallback((m,h)=>{re.edit(m,h),re.saveModified()},[]),c=u.useCallback((m,h)=>{m===void 0?a(h):l(h,JSON.stringify(m))},[a,l]),d=u.useCallback(m=>u.createElement(v_,{...m,ref:void 0,key:m.ref.propertyId,value:m.valueJson===void 0?void 0:JSON.parse(m.valueJson),tooltip:m.summary,handleReset:()=>a(m.ref),submit:h=>c(h,m.ref),search:e}),[c,a,e]),f=u.useMemo(()=>t?nL(t.id)?.render({props:n,submitProperty:l,resetProperty:a,renderGroup:i,renderViews:s,renderProperty:m=>u.createElement(v_,{...m,key:m.key,search:e,handleReset:m.reset})})??s(d):null,[i,d,s,a,e,l,t,n]);return k.jsxs(Kc,{className:jn.typeView,children:[k.jsx("div",{className:jn.viewHeader,children:t?.label}),k.jsx("div",{className:jn.viewContent,children:f})]})},uZ=u.memo(()=>{const[e,t]=u.useState([]),[n,o]=u.useState([]),[r,i]=u.useState(),[s,a]=u.useState("");u.useEffect(()=>{const p=re.viewCategories();t(p),o(p),i(p.at(0))},[]);const l=u.useCallback(p=>{p.length===0?i(void 0):(r===void 0||!p.some(g=>g.id===r.id))&&i(p[0])},[r]),c=u.useCallback((p,g)=>(p=p.toLowerCase().trim(),g.filter(b=>b.label.toLowerCase().includes(p)||b.properties.some(y=>to(y.propertyId).toLowerCase().includes(p)||nL(b.id)?.filter(b,p)))),[]),d=u.useCallback((p,g)=>{const b=p.length===0?g:c(p,g);o(b),l(b)},[l,c]),f=u.useCallback(p=>{t(g=>{const b=re.viewCategories();return r&&i(b.find(y=>y.id===r.id)),d(s,b),b})},[d,s,r]),m=u.useCallback(p=>{p=p.toLowerCase().trim(),a(p),d(p,e)},[e,d]),h=u.useCallback(p=>{i(e.find(g=>g.id===p))},[e]);return Nr(re.onChanged,f,[r,s]),k.jsxs("div",{className:jn.settingsEditor,children:[k.jsx("div",{className:jn.header,children:k.jsx(HJ,{handleInput:m})}),k.jsxs("div",{className:jn.content,children:[k.jsx(oZ,{categories:n,handleSelect:h,selectedCategory:r?.id}),k.jsx(cZ,{view:r,search:s})]})]})}),dZ={canRender:e=>e==="SettingsEditor",renderContent:e=>u.createElement(uZ),renderIcon:e=>ik},fZ="_hotkey_7x4aj_1",pZ="_help_7x4aj_5",oL={hotkey:fZ,help:pZ},hZ=({renderProperty:e,renderViews:t,resetProperty:n,submitProperty:o})=>{const r=({modified:i,ref:s,summary:a,valueJson:l})=>e({key:s.propertyId,label:s.propertyId,value:l==null?void 0:JSON.parse(l),submit:c=>o(s,c==null?void 0:JSON.stringify(c.trim())),reset:()=>n(s),valueType:re.ValueType.String,containerType:re.ContainerType.Single,tooltip:a,modified:i});return k.jsxs(k.Fragment,{children:[k.jsx("a",{href:"https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values",className:oL.help,target:"_blank",...cn("Supported values for hotkeys."),children:"Key codes"}),t(r)]})},rL=new Ye,o1="Keymap",mZ={id:o1,scope:Cr.ConfigurationScope.User,properties:e5.map(gZ)},b_=new Map(e5.map(e=>[e.id,e.keys]));function Ia(e){return MC(o1,e)}function gZ(e){return{id:e.id,label:e.id,valueType:re.ValueType.String,containerType:re.ContainerType.Single,defaultValueJson:JSON.stringify(e.keys),group:e.group,summary:e.summary}}function yZ(e){if(e===o1)for(const[t,n]of b_){const o=re.getValueJson({settingsId:o1,propertyId:t}),r=o==null?void 0:JSON.parse(o);r!==n&&(b_.set(t,r),rL.broadcast(t,r))}}re.onChanged.subscribe(yZ);c$(mZ);sZ({canRender:e=>e==`User/${o1}`,render:hZ,filter:(e,t)=>e.properties.some(n=>to(n.propertyId).toLowerCase().includes(t))});const vZ=e=>{const t=Ia(e.id);return k.jsx("span",{className:ln(oL.hotkey,e.class),children:t})},qp=new Array,$5=new Map(e5.map(e=>[e.id,sL(e.keys)]));function bZ(e){qp.splice(0,0,e)}function _Z(e){const t=qp.findIndex(n=>n.key===e);if(t<0)throw Error(`Failed to unregister '${e}' hotkey: not registered.`);qp.splice(t,1)}function Oy(e,t){return aL(e,$5.get(t))}function iu(e,t){u.useEffect(()=>{for(const n of e)Dy(n)&&bZ(iL(n));return()=>{for(const n of e)Dy(n)&&_Z(n[0])}},[e,...t??[]])}function vm(...e){return t=>{for(const n of e)if(Dy(n)&&lL(t,iL(n)))break}}function Dy(e){return e!=null&&typeof e!="boolean"}function iL(e){return{key:e[0],handle:e[1],options:e[2]}}function sL(e){if(e===void 0)return;const t=e.split("+").map(o=>o.trim());let n=t[t.length-1].toLowerCase();return n==="space"&&(n=" "),{key:n,shift:t.some(o=>o.toLowerCase()==="shift"),ctrl:t.some(o=>o.toLowerCase()==="ctrl"),alt:t.some(o=>o.toLowerCase()==="alt"),label:e}}function aL(e,t){return t===void 0?!1:t.key===e.key.toLowerCase()&&t.shift===e.shiftKey&&t.ctrl===(e.ctrlKey||e.metaKey)&&t.alt===e.altKey}function lL(e,t){return t==null||e.repeat||!aL(e,$5.get(t.key))||(t.handle(e),mH(),e.preventDefault(),t.options?.bubbles)?!1:(e.stopPropagation(),!0)}function wZ(e){for(const t of qp)if(lL(e,t))break}function xZ(e,t){$5.set(e,sL(t))}addEventListener("keydown",wZ);rL.subscribe(xZ);const cL=({hotkey:e,icon:t,label:n,tooltip:o})=>k.jsxs("span",{className:Ur.itemContainer,...cn(o),children:[k.jsx("span",{className:Ur.itemIcon,children:t}),k.jsx("span",{className:Ur.itemLabel,children:n}),k.jsx("span",{className:Ur.itemHotkey,children:e!==void 0?k.jsx(vZ,{id:e}):null})]}),at=({className:e,disableFocus:t,disabled:n,hotkey:o,icon:r,label:i,onClick:s,tooltip:a})=>{const l=n??!1,c=t?{tabIndex:void 0}:{},d=u.useCallback(f=>{s!=null&&(f.syntheticEvent.stopPropagation(),s())},[s]);return k.jsx(rH,{onClick:d,disabled:l,className:e,...c,children:k.jsx(cL,{label:i,icon:r,hotkey:o,tooltip:a})})},SZ=()=>{const[e,t]=u.useState(),[n,o]=WC(),r=u.useRef(null),i=u.useCallback(()=>!open||!e||e.items.length===0?null:k.jsx(Qc,{show:!0,className:Ur.itemsContainer,children:e.items.map((c,d)=>k.jsx(at,{...c,disableFocus:!0},d))}),[e]),s=u.useCallback(c=>{t(c),o(!0)},[o]),a=u.useCallback(()=>{t(void 0),o(!1)},[o]),l=u.useCallback(c=>{r.current?.contains(c.target)||a()},[a]);return Nr(JC,s,[]),Nr(ZC,a,[]),u.useEffect(()=>(addEventListener("mousedown",l,{capture:!0}),()=>removeEventListener("mousedown",l,{capture:!0}))),e===void 0?null:k.jsx(VC,{...n,ref:r,anchorPoint:e.point,captureFocus:!1,direction:"right",onClose:a,children:i()})},EZ=({children:e,disabled:t,icon:n,label:o})=>{const r=t??!1,i=k.jsx(cL,{label:o,icon:n}),s=u.useMemo(()=>e&&k.jsx(Qc,{show:!0,className:Ur.itemsContainer,children:e}),[e]);return k.jsx(nH,{label:i,disabled:r,children:s})},M1=()=>k.jsx(iH,{}),CZ="_modal_xk5tk_1",TZ="_modal-hidden_xk5tk_13",kZ="_window_xk5tk_17",LZ="_fade-in_xk5tk_1",IZ="_title_xk5tk_31",NZ="_progress-info_xk5tk_37",RZ="_progress-bar_xk5tk_43",MZ="_progress-bar-fill_xk5tk_51",AZ="_progress-bar-gradient_xk5tk_1",OZ="_confirmation-content_xk5tk_67",DZ="_confirmation-buttons_xk5tk_71",zZ="_confirmation-button-confirm_xk5tk_75",PZ="_confirmation-button-deny_xk5tk_81",Gr={modal:CZ,"modal-hidden":"_modal-hidden_xk5tk_13",modalHidden:TZ,window:kZ,"fade-in":"_fade-in_xk5tk_1",fadeIn:LZ,title:IZ,"progress-info":"_progress-info_xk5tk_37",progressInfo:NZ,"progress-bar":"_progress-bar_xk5tk_43",progressBar:RZ,"progress-bar-fill":"_progress-bar-fill_xk5tk_51",progressBarFill:MZ,"progress-bar-gradient":"_progress-bar-gradient_xk5tk_1",progressBarGradient:AZ,"confirmation-content":"_confirmation-content_xk5tk_67",confirmationContent:OZ,"confirmation-buttons":"_confirmation-buttons_xk5tk_71",confirmationButtons:DZ,"confirmation-button-confirm":"_confirmation-button-confirm_xk5tk_75",confirmationButtonConfirm:zZ,"confirmation-button-deny":"_confirmation-button-deny_xk5tk_81",confirmationButtonDeny:PZ},BZ=e=>k.jsxs(k.Fragment,{children:[k.jsx("div",{className:Gr.progressInfo,children:e.info}),k.jsx(FZ,{ratio:e.progress})]}),FZ=e=>{const t=`${e.ratio*100}%`;return k.jsx("div",{className:Gr.progressBar,children:k.jsx("div",{className:Gr.progressBarFill,style:{width:t}})})},$Z=({content:e,deniable:t,onConfirm:n,onDeny:o})=>{const[r,i]=u.useState(!0),s=u.useCallback(async c=>{r&&(i(!1),c!=null&&await c(),U5(),i(!0))},[r]),a=u.useCallback(()=>k.jsx(yn,{handler:()=>s(n),style:ei.Primary,className:Gr.confirmationButtonConfirm,label:"OK"}),[n,s]),l=u.useCallback(()=>t&&k.jsx(yn,{handler:()=>s(o),className:Gr.confirmationButtonDeny,label:"Cancel"}),[t,o,s]);return iu([[de.Submit,c=>s(n)],[de.Cancel,c=>s(o)]],[n,o]),k.jsxs(k.Fragment,{children:[k.jsx("div",{className:Gr.confirmationContent,children:e}),k.jsxs("div",{className:Gr.confirmationButtons,children:[a(),l()]})]})},H5=new Ye;function V5(e){H5.broadcast(e)}function U5(){H5.broadcast(void 0)}function HZ(e){V5({title:e.title,content:k.jsx(BZ,{...e})})}function VZ(e){V5({title:e.title,focus:!0,content:k.jsx($Z,{...e})})}tl.onProgressChanged.subscribe(HZ);tl.onProgressCleared.subscribe(U5);const UZ=()=>{const e=so(H5),t=u.useCallback(()=>e&&k.jsxs("div",{className:Gr.window,children:[k.jsx("div",{className:Gr.title,children:e?.title}),k.jsx(OE,{pull:e.focus,children:e.content})]}),[e]);return k.jsx(Qc,{className:ln(Gr.modal,[!e,Gr.modalHidden]),show:e!=null,blurAmount:5,brightness:.65,saturation:1,transition:qv.Base,children:t()})},jZ="_login-window_1msvh_1",WZ="_window_1msvh_12",GZ="_title_1msvh_20",qZ="_info_1msvh_26",YZ="_button_1msvh_31",Es={"login-window":"_login-window_1msvh_1",loginWindow:jZ,window:WZ,title:GZ,info:qZ,button:YZ},XZ=({children:e})=>{const t=MO(),n=t?Ws.getLastUser():void 0,o=so(Ws.onUserAuthorized)??!1,r=u.useCallback(()=>k.jsx(yn,{handler:Ws.authorizeUser,style:n==null?ei.Primary:void 0,className:Es.button,icon:w5,label:"Select Directory"}),[n]),i=u.useCallback(()=>n&&k.jsx(yn,{handler:Ws.authorizeLastUser,style:ei.Primary,className:Es.button,icon:x5,label:n}),[n]),s=u.useCallback(()=>k.jsxs(k.Fragment,{children:[k.jsx("div",{className:Es.title,children:n==null?"First-Time Setup":"Welcome Back"}),k.jsx("div",{className:Es.info,children:n==null?"Please specify directory to store user data, such as custom layouts and preferences.":"Select existing or pick another directory to store user data, such as custom layouts and preferences."}),i(),r()]}),[n,i,r]),a=u.useCallback(()=>k.jsxs(k.Fragment,{children:[k.jsx("div",{className:Es.title,children:"Browser Not Supported"}),k.jsxs("div",{className:Es.info,children:["Naninovel Editor is not compatible with this web browser. We recommend using ",k.jsx("a",{href:"https://www.google.com/chrome",target:"_blank",children:"Google Chrome"}),"."]})]}),[]);return u.useEffect(()=>{!o&&n&&JZ()},[o,n]),o?k.jsx(k.Fragment,{children:e}):t&&k.jsx("div",{className:Es.loginWindow,children:k.jsx("div",{className:Es.window,children:pB()?s():a()})})};let tg=!1;async function JZ(){if(!tg){tg=!0;try{await Ws.authorizeLastUser()}finally{tg=!1}}}function ZZ(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:o,onRegistered:r,onRegisteredSW:i,onRegisterError:s}=e;let a,l,c;const d=async(m=!0)=>{await l,await c?.()};async function f(){if("serviceWorker"in navigator){if(a=await oh(()=>import("./workbox-window.prod.es5-D5gOYdM7.js"),[]).then(({Workbox:m})=>new m("/editor/sw.js",{scope:"/editor/",type:"classic"})).catch(m=>{s?.(m)}),!a)return;c=async()=>{await a?.messageSkipWaiting()};{let m=!1;const h=()=>{m=!0,a?.addEventListener("controlling",p=>{p.isUpdate&&window.location.reload()}),n?.()};a.addEventListener("installed",p=>{typeof p.isUpdate>"u"?typeof p.isExternal<"u"?p.isExternal?h():!m&&o?.():p.isExternal?window.location.reload():!m&&o?.():p.isUpdate||o?.()}),a.addEventListener("waiting",h),a.addEventListener("externalwaiting",h)}a.register({immediate:t}).then(m=>{i?i("/editor/sw.js",m):r?.(m)}).catch(m=>{s?.(m)})}}return l=f(),d}function KZ(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:o,onRegistered:r,onRegisteredSW:i,onRegisterError:s}=e,[a,l]=u.useState(!1),[c,d]=u.useState(!1),[f]=u.useState(()=>ZZ({immediate:t,onOfflineReady(){d(!0),o?.()},onNeedRefresh(){l(!0),n?.()},onRegistered:r,onRegisteredSW:i,onRegisterError:s}));return{needRefresh:[a,l],offlineReady:[c,d],updateServiceWorker:f}}const QZ="_control-panel_1lgal_1",eK="_left_1lgal_29",tK="_right_1lgal_30",nK="_button_1lgal_48",oK="_button-open_1lgal_56",rK="_button-disabled_1lgal_60",iK="_enlarged-svg_1lgal_64",sK="_editor-menu_1lgal_70",aK="_bridging_1lgal_74",lK="_metadata_1lgal_84",cK="_project-title-field_1lgal_101",uK="_undo_1lgal_132",dK="_undo-list_1lgal_136",fK="_undo-item_1lgal_140",pK="_undo-item-undone_1lgal_144",hK="_undo-icon-add_1lgal_149",mK="_undo-icon-modify_1lgal_153",gK="_undo-icon-delete_1lgal_157",yK="_save_1lgal_161",vK="_layout_1lgal_165",bK="_layout-name_1lgal_169",_K="_layout-icon_1lgal_173",wK="_layout-delete-button_1lgal_177",xK="_about-window_1lgal_181",SK="_about-window-logo_1lgal_186",EK="_about-window-version_1lgal_192",CK="_about-window-update_1lgal_199",TK="_about-window-title_1lgal_206",kK="_about-window-info_1lgal_211",LK="_about-window-button-group_1lgal_217",IK="_about-window-button_1lgal_217",xe={"control-panel":"_control-panel_1lgal_1",controlPanel:QZ,left:eK,right:tK,button:nK,"button-open":"_button-open_1lgal_56",buttonOpen:oK,"button-disabled":"_button-disabled_1lgal_60",buttonDisabled:rK,"enlarged-svg":"_enlarged-svg_1lgal_64",enlargedSvg:iK,"editor-menu":"_editor-menu_1lgal_70",editorMenu:sK,bridging:aK,metadata:lK,"project-title-field":"_project-title-field_1lgal_101",projectTitleField:cK,undo:uK,"undo-list":"_undo-list_1lgal_136",undoList:dK,"undo-item":"_undo-item_1lgal_140",undoItem:fK,"undo-item-undone":"_undo-item-undone_1lgal_144",undoItemUndone:pK,"undo-icon-add":"_undo-icon-add_1lgal_149",undoIconAdd:hK,"undo-icon-modify":"_undo-icon-modify_1lgal_153",undoIconModify:mK,"undo-icon-delete":"_undo-icon-delete_1lgal_157",undoIconDelete:gK,save:yK,layout:vK,"layout-name":"_layout-name_1lgal_169",layoutName:bK,"layout-icon":"_layout-icon_1lgal_173",layoutIcon:_K,"layout-delete-button":"_layout-delete-button_1lgal_177",layoutDeleteButton:wK,"about-window":"_about-window_1lgal_181",aboutWindow:xK,"about-window-logo":"_about-window-logo_1lgal_186",aboutWindowLogo:SK,"about-window-version":"_about-window-version_1lgal_192",aboutWindowVersion:EK,"about-window-update":"_about-window-update_1lgal_199",aboutWindowUpdate:CK,"about-window-title":"_about-window-title_1lgal_206",aboutWindowTitle:TK,"about-window-info":"_about-window-info_1lgal_211",aboutWindowInfo:kK,"about-window-button-group":"_about-window-button-group_1lgal_217",aboutWindowButtonGroup:LK,"about-window-button":"_about-window-button_1lgal_217",aboutWindowButton:IK},__="1.20",NK="2024-07-16",RK=()=>{const e=so(Ae.onRecentProjectsChanged),{needRefresh:[t]}=KZ({onRegisteredSW:(r,i)=>{console.log(`Service Worker at: ${r}`)}});iu([[de.CreateProject,()=>{}],[de.OpenProject,Ae.openProject],[de.OpenSettings,re.openEditor]],[]);const n=u.useCallback(()=>{const r=!e||e.length==0,i=e?.map(s=>k.jsx(at,{label:s.title,onClick:()=>Ae.openRecentProject(s.id)},s.id))??[];return k.jsx(EZ,{label:"Open Recent",icon:CW,disabled:r,children:i})},[e]),o=u.useCallback(async()=>{V5({title:"About Naninovel",content:k.jsxs("div",{className:xe.aboutWindow,children:[k.jsx("div",{className:xe.aboutWindowLogo,children:wW}),k.jsxs("div",{className:xe.aboutWindowVersion,children:["v",__," build ",NK]}),t&&k.jsx("div",{className:xe.aboutWindowUpdate,children:"(new version available; restart to update)"}),k.jsx("div",{className:xe.aboutWindowTitle,children:"Release Notes"}),k.jsx("div",{className:xe.aboutWindowInfo,children:"For the list of changes associated with this release, see the notes on GitHub."}),k.jsx(yn,{handler:()=>Nl(`https://github.com/naninovel/docs/releases/tag/v${__}`),className:xe.aboutWindowButton,label:"Release Notes"}),k.jsx("div",{className:xe.aboutWindowTitle,children:"Online Resources"}),k.jsx("div",{className:xe.aboutWindowInfo,children:"Please read getting started and command guides. Contact support if you have any issues or questions."}),k.jsxs("div",{className:xe.aboutWindowButtonGroup,children:[k.jsx(yn,{handler:()=>Nl("https://naninovel.com/guide/getting-started"),className:xe.aboutWindowButton,label:"Guide"}),k.jsx(yn,{handler:()=>Nl("https://naninovel.com/api"),className:xe.aboutWindowButton,label:"Commands"}),k.jsx(yn,{handler:()=>Nl("https://forum.naninovel.com"),className:xe.aboutWindowButton,label:"Forum"}),k.jsx(yn,{handler:()=>Nl("https://discord.gg/BfkNqem"),className:xe.aboutWindowButton,label:"Discord"}),k.jsx(yn,{handler:()=>Nl("https://naninovel.com/support"),className:xe.aboutWindowButton,label:"Support"})]}),k.jsx("div",{className:xe.aboutWindowTitle}),k.jsx(yn,{handler:U5,className:xe.aboutWindowButton,style:ei.Primary,label:"Close"})]})})},[t]);return k.jsx("span",{className:xe.editorMenu,children:k.jsxs(hs,{icon:nW,buttonClass:xe.button,openButtonClass:xe.buttonOpen,tooltip:"Editor Menu",children:[k.jsx(at,{label:"New Project",icon:hW,hotkey:de.CreateProject,disabled:!0}),k.jsx(at,{label:"Open...",icon:w5,hotkey:de.OpenProject,onClick:Ae.openProject}),n(),k.jsx(M1,{}),k.jsx(at,{label:"Settings",icon:ik,hotkey:de.OpenSettings,onClick:re.openEditor}),k.jsx(at,{label:"About",icon:yW,onClick:o}),k.jsx(at,{label:"Log Out",icon:TW,onClick:Ws.logout})]})})},MK=()=>{const e=so(Ae.onBridgingChanged),[t,n]=u.useState(),o=e!==void 0,r=o?`Connected to ${e}`:"Bridging connection not established",i=u.useCallback(async()=>{n(void 0),n(await Ae.findServers())},[]),s=u.useCallback(()=>{const c=o?$7:SW,d=o?xe.enlargedSvg:void 0;return k.jsx("span",{className:d,children:c})},[o]),a=u.useCallback(()=>{if(t===void 0)return k.jsx(at,{label:"Looking for servers...",disabled:!0});if(t.length===0)return k.jsx(at,{label:"No servers found.",disabled:!0});return t.map(c);function c(d){return k.jsx(at,{label:d.name,icon:$7,tooltip:`Port: ${d.port}`,onClick:()=>Ae.connect(d.port)},d.port)}},[t]),l=u.useCallback(()=>o&&k.jsxs(k.Fragment,{children:[k.jsx(M1,{}),k.jsx(at,{label:"Disconnect",icon:xW,onClick:Ae.disconnect})]}),[o]);return k.jsx("span",{className:xe.bridging,children:k.jsxs(hs,{icon:s(),buttonClass:xe.button,tooltip:r,handleOpen:i,children:[a(),l()]})})},AK=()=>{const e=so(Ae.onMetadataChanged,!1)??!1,t=Ae.hasCachedMetadata(),n=RS(),o=u.useMemo(()=>e?"Project metadata is synced":"Project metadata not available",[e]),r=u.useMemo(()=>e?dW:uW,[e]),i=u.useCallback(()=>e&&k.jsx(at,{label:"Reset Metadata",icon:S5,onClick:Ae.applyDefaultMetadata}),[e]),s=u.useCallback(()=>Ae.deleteCachedMetadata().then(n),[n]),a=u.useCallback(()=>t&&k.jsx(at,{label:"Delete Cached",icon:Ri,onClick:s}),[t,s]);return k.jsx("span",{className:xe.metadata,children:k.jsxs(hs,{icon:r,buttonClass:xe.button,handleOpen:n,openButtonClass:xe.buttonOpen,disabledButtonClass:xe.buttonDisabled,tooltip:o,disabled:!e&&!t,children:[i(),a()]})})},OK=()=>{const e=so(Ae.onProjectTitleChanged);return e?k.jsx(ti,{tooltip:"Rename Project",submit:t=>Ae.renameProject(t??""),value:e,containerClass:xe.projectTitle,fieldClass:xe.projectTitleField}):k.jsx(k.Fragment,{})},DK=({maxLength:e})=>{const t=Ae.getUndoLength(),[n,o]=u.useState({firstIndex:0,lastIndex:0});Nr(Ae.onUndoChanged,RS());const r=u.useCallback(c=>t-c-1,[t]),i=u.useCallback(c=>{const d=r(c),f=Ae.viewUndo(d),m=zK(f.assetUri,f.context),h=ln(xe.undoItem,[f.undone,xe.undoItemUndone]);return k.jsx(at,{icon:m,label:to(f.summary),onClick:p,className:h,tooltip:f.assetUri});function p(){f.undone?Ae.redoAt(d):Ae.undoAt(d)}},[r]),s=u.useCallback(()=>{let c=0;for(let d=n.firstIndex;d<=n.lastIndex;d++){const f=Ae.viewUndo(r(d)).summary.length;f>c&&(c=f)}return c},[n,r]);if(t===0)return null;const a=`${Math.min(e,t)*2.3}rem`,l=`${s()*.7+3}rem`;return k.jsx("div",{className:xe.undoList,style:{minWidth:l,height:a},children:k.jsx(AE,{totalCount:t,renderItem:i,handleRangeChanged:o})})};function zK(e,t){const n=b5(e.split(".").pop()),o=ln([t===Cr.UndoContext.Add,xe.undoIconAdd],[t===Cr.UndoContext.Modify,xe.undoIconModify],[t===Cr.UndoContext.Delete,xe.undoIconDelete]);return k.jsx("span",{className:o,children:n})}const PK=()=>{const e=kn(hn.UndoListLength),t=Ae.getUndoLength(),[n,o]=u.useState(!1),[r,i]=u.useState(!1);return Nr(Ae.onUndoChanged,()=>{o(Ae.canUndo()),i(Ae.canRedo())}),iu([n&&[de.Undo,Ae.undo],r&&[de.Redo,Ae.redo]],[n,r]),k.jsx("span",{className:xe.undo,children:k.jsxs(hs,{icon:iW,buttonClass:xe.button,tooltip:"Undo History",align:eu.End,disabled:t===0,children:[k.jsx(at,{label:"Undo Last",icon:S5,hotkey:de.Undo,disabled:!n,onClick:Ae.undo}),k.jsx(at,{label:"Redo Last",icon:LW,hotkey:de.Redo,disabled:!r,onClick:Ae.redo}),e>0&&k.jsxs(k.Fragment,{children:[k.jsx(M1,{}),k.jsx(DK,{maxLength:e})]})]})})},BK=()=>{const e=so(ft.onSelectedLayoutChanged)??"",t=so(ft.onAvailableLayoutsChanged)??[],n=u.useCallback(()=>k.jsxs(k.Fragment,{children:[k.jsx("span",{className:xe.layoutName,children:e}),k.jsx("span",{className:xe.layoutIcon,children:MW})]}),[e]),o=u.useCallback(s=>s.deletable?k.jsxs(k.Fragment,{children:[s.name,k.jsx(yn,{handler:()=>ft.deleteLayout(s.name),className:xe.layoutDeleteButton,style:ei.Minimal,tooltip:"Delete Layout",icon:Ri})]}):s.name,[]),r=u.useCallback(s=>k.jsx(at,{label:o(s),onClick:()=>ft.applyLayout(s.name)},s.name),[o]),i=u.useCallback(async()=>{const s="New Layout";let a=s;VZ({title:"Save Layout",content:k.jsx(ti,{label:"Layout Name",submit:l=>a=l??s,value:a}),deniable:!0,onConfirm:()=>ft.saveCurrentLayout(a.length===0?s:a)})},[]);return k.jsx("span",{className:xe.layout,children:k.jsxs(hs,{icon:n(),buttonClass:xe.button,align:eu.End,tooltip:"Layout",children:[k.jsx(at,{label:"Save Current As...",icon:QT,onClick:i}),k.jsx(M1,{}),t.map(r)]})})},FK=()=>{const e=so(Ae.onDirtyChanged,[])??[];iu([[de.SaveAll,Ae.saveAllDirty]]);const t=u.useMemo(()=>k.jsx("span",{className:xe.enlargedSvg,children:pW}),[]),n=u.useCallback(o=>{const r=b5(o.assetUri.split(".").pop());return k.jsx(at,{label:o.assetUri,icon:r,onClick:()=>Ae.saveDirty(o.assetId)},o.assetId)},[]);return k.jsx("span",{className:xe.save,children:k.jsxs(hs,{icon:t,buttonClass:xe.button,tooltip:"Modified Assets",align:eu.End,disabled:e.length===0,children:[k.jsx(at,{label:"Save All",icon:QT,hotkey:de.SaveAll,onClick:Ae.saveAllDirty}),k.jsx(M1,{}),e.map(n)]})})},$K=()=>k.jsxs("div",{className:xe.controlPanel,children:[k.jsxs("span",{className:xe.left,children:[k.jsx(RK,{}),k.jsx(MK,{}),k.jsx(AK,{}),k.jsx(OK,{})]}),k.jsxs("span",{className:xe.right,children:[k.jsx(PK,{}),k.jsx(FK,{}),k.jsx(BK,{})]})]});var kr={},bm={},ni={},Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.Orientation=void 0;class es{static flip(t){return t===es.HORZ?es.VERT:es.HORZ}constructor(t){this._name=t}getName(){return this._name}toString(){return this._name}}Sn.Orientation=es;es.HORZ=new es("horz");es.VERT=new es("vert");var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.Rect=void 0;const HK=Sn;class tc{static empty(){return new tc(0,0,0,0)}constructor(t,n,o,r){this.x=t,this.y=n,this.width=o,this.height=r}static fromElement(t){let{x:n,y:o,width:r,height:i}=t.getBoundingClientRect();return new tc(n,o,r,i)}clone(){return new tc(this.x,this.y,this.width,this.height)}equals(t){return this.x===t?.x&&this.y===t?.y&&this.width===t?.width&&this.height===t?.height}getBottom(){return this.y+this.height}getRight(){return this.x+this.width}getCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}positionElement(t,n){this.styleWithPosition(t.style,n)}styleWithPosition(t,n="absolute"){return t.left=this.x+"px",t.top=this.y+"px",t.width=Math.max(0,this.width)+"px",t.height=Math.max(0,this.height)+"px",t.position=n,t}contains(t,n){return this.x<=t&&t<=this.getRight()&&this.y<=n&&n<=this.getBottom()}removeInsets(t){return new tc(this.x+t.left,this.y+t.top,Math.max(0,this.width-t.left-t.right),Math.max(0,this.height-t.top-t.bottom))}centerInRect(t){this.x=(t.width-this.width)/2,this.y=(t.height-this.height)/2}_getSize(t){let n=this.width;return t===HK.Orientation.VERT&&(n=this.height),n}toString(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"}}Jn.Rect=tc;Object.defineProperty(ni,"__esModule",{value:!0});ni.DockLocation=void 0;const A1=Sn,gr=Jn;class Ze{static getByName(t){return Ze.values[t]}static getLocation(t,n,o){if(n=(n-t.x)/t.width,o=(o-t.y)/t.height,n>=.25&&n<.75&&o>=.25&&o<.75)return Ze.CENTER;const r=o>=n,i=o>=1-n;return r?i?Ze.BOTTOM:Ze.LEFT:i?Ze.RIGHT:Ze.TOP}constructor(t,n,o){this._name=t,this._orientation=n,this._indexPlus=o,Ze.values[this._name]=this}getName(){return this._name}getOrientation(){return this._orientation}getDockRect(t){return this===Ze.TOP?new gr.Rect(t.x,t.y,t.width,t.height/2):this===Ze.BOTTOM?new gr.Rect(t.x,t.getBottom()-t.height/2,t.width,t.height/2):this===Ze.LEFT?new gr.Rect(t.x,t.y,t.width/2,t.height):this===Ze.RIGHT?new gr.Rect(t.getRight()-t.width/2,t.y,t.width/2,t.height):t.clone()}split(t,n){if(this===Ze.TOP){const o=new gr.Rect(t.x,t.y,t.width,n),r=new gr.Rect(t.x,t.y+n,t.width,t.height-n);return{start:o,end:r}}else if(this===Ze.LEFT){const o=new gr.Rect(t.x,t.y,n,t.height),r=new gr.Rect(t.x+n,t.y,t.width-n,t.height);return{start:o,end:r}}if(this===Ze.RIGHT){const o=new gr.Rect(t.getRight()-n,t.y,n,t.height),r=new gr.Rect(t.x,t.y,t.width-n,t.height);return{start:o,end:r}}else{const o=new gr.Rect(t.x,t.getBottom()-n,t.width,n),r=new gr.Rect(t.x,t.y,t.width,t.height-n);return{start:o,end:r}}}reflect(){return this===Ze.TOP?Ze.BOTTOM:this===Ze.LEFT?Ze.RIGHT:this===Ze.RIGHT?Ze.LEFT:Ze.TOP}toString(){return"(DockLocation: name="+this._name+", orientation="+this._orientation+")"}}ni.DockLocation=Ze;Ze.values={};Ze.TOP=new Ze("top",A1.Orientation.VERT,0);Ze.BOTTOM=new Ze("bottom",A1.Orientation.VERT,1);Ze.LEFT=new Ze("left",A1.Orientation.HORZ,0);Ze.RIGHT=new Ze("right",A1.Orientation.HORZ,1);Ze.CENTER=new Ze("center",A1.Orientation.VERT,0);var Sl={};Object.defineProperty(Sl,"__esModule",{value:!0});Sl.DragDrop=void 0;const VK=Jn,UK=!!(typeof window<"u"&&window.document&&window.document.createElement);class zy{constructor(){this._manualGlassManagement=!1,this._startX=0,this._startY=0,this._dragDepth=0,this._glassShowing=!1,this._dragging=!1,this._active=!1,UK&&(this._glass=document.createElement("div"),this._glass.style.zIndex="998",this._glass.style.backgroundColor="transparent",this._glass.style.outline="none"),this._defaultGlassCursor="default",this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onKeyPress=this._onKeyPress.bind(this),this._onDragCancel=this._onDragCancel.bind(this),this._onDragEnter=this._onDragEnter.bind(this),this._onDragLeave=this._onDragLeave.bind(this),this.resizeGlass=this.resizeGlass.bind(this),this._lastClick=0,this._clickX=0,this._clickY=0}addGlass(t){var n;this._glassShowing?this._manualGlassManagement=!0:(this._document||(this._document=window.document),this._rootElement||(this._rootElement=this._document.body),this.resizeGlass(),(n=this._document.defaultView)===null||n===void 0||n.addEventListener("resize",this.resizeGlass),this._document.body.appendChild(this._glass),this._glass.tabIndex=-1,this._glass.focus(),this._glass.addEventListener("keydown",this._onKeyPress),this._glass.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._glass.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._glass.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._glassShowing=!0,this._fDragCancel=t,this._manualGlassManagement=!1)}resizeGlass(){VK.Rect.fromElement(this._rootElement).positionElement(this._glass,"fixed")}hideGlass(){var t;this._glassShowing&&(this._document.body.removeChild(this._glass),(t=this._document.defaultView)===null||t===void 0||t.removeEventListener("resize",this.resizeGlass),this._glassShowing=!1,this._document=void 0,this._rootElement=void 0,this.setGlassCursorOverride(void 0))}_updateGlassCursor(){var t;this._glass.style.cursor=(t=this._glassCursorOverride)!==null&&t!==void 0?t:this._defaultGlassCursor}_setDefaultGlassCursor(t){this._defaultGlassCursor=t,this._updateGlassCursor()}setGlassCursorOverride(t){this._glassCursorOverride=t,this._updateGlassCursor()}startDrag(t,n,o,r,i,s,a,l,c){if(t&&this._lastEvent&&this._lastEvent.type.startsWith("touch")&&t.type.startsWith("mouse")&&t.timeStamp-this._lastEvent.timeStamp<500||this._dragging)return;this._lastEvent=t,l?this._document=l:this._document=window.document,c?this._rootElement=c:this._rootElement=this._document.body;const d=this._getLocationEvent(t);this.addGlass(i),t?(this._startX=d.clientX,this._startY=d.clientY,(!window.matchMedia||window.matchMedia("(pointer: fine)").matches)&&this._setDefaultGlassCursor(getComputedStyle(t.target).cursor),this._stopPropagation(t),this._preventDefault(t)):(this._startX=0,this._startY=0,this._setDefaultGlassCursor("default")),this._dragging=!1,this._fDragStart=n,this._fDragMove=o,this._fDragEnd=r,this._fDragCancel=i,this._fClick=s,this._fDblClick=a,this._active=!0,t?.type==="dragenter"?(this._dragDepth=1,this._rootElement.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._rootElement.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._rootElement.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._document.addEventListener("dragend",this._onDragCancel,{passive:!1}),this._document.addEventListener("drop",this._onMouseUp,{passive:!1})):(this._document.addEventListener("mouseup",this._onMouseUp,{passive:!1}),this._document.addEventListener("mousemove",this._onMouseMove,{passive:!1}),this._document.addEventListener("touchend",this._onMouseUp,{passive:!1}),this._document.addEventListener("touchmove",this._onMouseMove,{passive:!1}))}isDragging(){return this._dragging}isActive(){return this._active}toString(){return"(DragDrop: startX="+this._startX+", startY="+this._startY+", dragging="+this._dragging+")"}_onKeyPress(t){t.code==="Escape"&&this._onDragCancel()}_onDragCancel(){this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this.hideGlass(),this._fDragCancel!==void 0&&this._fDragCancel(this._dragging),this._dragging=!1,this._active=!1}_getLocationEvent(t){let n=t;return t&&t.touches&&(n=t.touches[0]),n}_getLocationEventEnd(t){let n=t;return t.changedTouches&&(n=t.changedTouches[0]),n}_stopPropagation(t){t.stopPropagation&&t.stopPropagation()}_preventDefault(t){return t.preventDefault&&t.cancelable&&t.preventDefault(),t}_onMouseMove(t){this._lastEvent=t;const n=this._getLocationEvent(t);return this._stopPropagation(t),this._preventDefault(t),!this._dragging&&(Math.abs(this._startX-n.clientX)>5||Math.abs(this._startY-n.clientY)>5)&&(this._dragging=!0,this._fDragStart&&(this._setDefaultGlassCursor("move"),this._dragging=this._fDragStart({clientX:this._startX,clientY:this._startY}))),this._dragging&&this._fDragMove&&this._fDragMove(n),!1}_onMouseUp(t){this._lastEvent=t;const n=this._getLocationEventEnd(t);if(this._stopPropagation(t),this._preventDefault(t),this._active=!1,this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this._manualGlassManagement||this.hideGlass(),this._dragging)this._dragging=!1,this._fDragEnd&&this._fDragEnd(t);else if(this._fDragCancel&&this._fDragCancel(this._dragging),Math.abs(this._startX-n.clientX)<=5&&Math.abs(this._startY-n.clientY)<=5){let o=!1;const r=new Date().getTime();Math.abs(this._clickX-n.clientX)<=5&&Math.abs(this._clickY-n.clientY)<=5&&r-this._lastClick<500&&this._fDblClick&&(this._fDblClick(t),o=!0),!o&&this._fClick&&this._fClick(t),this._lastClick=r,this._clickX=n.clientX,this._clickY=n.clientY}return!1}_onDragEnter(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth++,!1}_onDragLeave(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth--,this._dragDepth<=0&&this._onDragCancel(),!1}}Sl.DragDrop=zy;zy.instance=new zy;var hr={},O1={};Object.defineProperty(O1,"__esModule",{value:!0});O1.Action=void 0;class jK{constructor(t,n){this.type=t,this.data=n}}O1.Action=jK;Object.defineProperty(hr,"__esModule",{value:!0});hr.Actions=void 0;const vo=O1;class ut{static addNode(t,n,o,r,i){return new vo.Action(ut.ADD_NODE,{json:t,toNode:n,location:o.getName(),index:r,select:i})}static moveNode(t,n,o,r,i){return new vo.Action(ut.MOVE_NODE,{fromNode:t,toNode:n,location:o.getName(),index:r,select:i})}static deleteTab(t){return new vo.Action(ut.DELETE_TAB,{node:t})}static deleteTabset(t){return new vo.Action(ut.DELETE_TABSET,{node:t})}static renameTab(t,n){return new vo.Action(ut.RENAME_TAB,{node:t,text:n})}static selectTab(t){return new vo.Action(ut.SELECT_TAB,{tabNode:t})}static setActiveTabset(t){return new vo.Action(ut.SET_ACTIVE_TABSET,{tabsetNode:t})}static adjustSplit(t){const n=t.node1Id,o=t.node2Id;return new vo.Action(ut.ADJUST_SPLIT,{node1:n,weight1:t.weight1,pixelWidth1:t.pixelWidth1,node2:o,weight2:t.weight2,pixelWidth2:t.pixelWidth2})}static adjustBorderSplit(t,n){return new vo.Action(ut.ADJUST_BORDER_SPLIT,{node:t,pos:n})}static maximizeToggle(t){return new vo.Action(ut.MAXIMIZE_TOGGLE,{node:t})}static updateModelAttributes(t){return new vo.Action(ut.UPDATE_MODEL_ATTRIBUTES,{json:t})}static updateNodeAttributes(t,n){return new vo.Action(ut.UPDATE_NODE_ATTRIBUTES,{node:t,json:n})}static floatTab(t){return new vo.Action(ut.FLOAT_TAB,{node:t})}static unFloatTab(t){return new vo.Action(ut.UNFLOAT_TAB,{node:t})}}hr.Actions=ut;ut.ADD_NODE="FlexLayout_AddNode";ut.MOVE_NODE="FlexLayout_MoveNode";ut.DELETE_TAB="FlexLayout_DeleteTab";ut.DELETE_TABSET="FlexLayout_DeleteTabset";ut.RENAME_TAB="FlexLayout_RenameTab";ut.SELECT_TAB="FlexLayout_SelectTab";ut.SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset";ut.ADJUST_SPLIT="FlexLayout_AdjustSplit";ut.ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit";ut.MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle";ut.UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes";ut.UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes";ut.FLOAT_TAB="FlexLayout_FloatTab";ut.UNFLOAT_TAB="FlexLayout_UnFloatTab";var wu={},gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.Attribute=void 0;class _m{constructor(t,n,o,r){this.name=t,this.modelName=n,this.defaultValue=o,this.alwaysWriteJson=r,this.required=!1,this.fixed=!1,this.type="any"}setType(t){return this.type=t,this}setRequired(){return this.required=!0,this}setFixed(){return this.fixed=!0,this}}gs.Attribute=_m;_m.NUMBER="number";_m.STRING="string";_m.BOOLEAN="boolean";var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.AttributeDefinitions=void 0;const WK=gs;class GK{constructor(){this.attributes=[],this.nameToAttribute={}}addWithAll(t,n,o,r){const i=new WK.Attribute(t,n,o,r);return this.attributes.push(i),this.nameToAttribute[t]=i,i}addInherited(t,n){return this.addWithAll(t,n,void 0,!1)}add(t,n,o){return this.addWithAll(t,void 0,n,o)}getAttributes(){return this.attributes}getModelName(t){const n=this.nameToAttribute[t];if(n!==void 0)return n.modelName}toJson(t,n){for(const o of this.attributes){const r=n[o.name];(o.alwaysWriteJson||r!==o.defaultValue)&&(t[o.name]=r)}}fromJson(t,n){for(const o of this.attributes){const r=t[o.name];r===void 0?n[o.name]=o.defaultValue:n[o.name]=r}}update(t,n){for(const o of this.attributes)if(t.hasOwnProperty(o.name)){const r=t[o.name];r===void 0?delete n[o.name]:n[o.name]=r}}setDefaults(t){for(const n of this.attributes)t[n.name]=n.defaultValue}toTypescriptInterface(t,n){const o=[],r=this.attributes.sort((i,s)=>i.name.localeCompare(s.name));o.push("export interface I"+t+"Attributes {");for(let i=0;i0?" // "+h:""))}}return o.push("}"),o.join(` +`):m,[e]),d=u.useCallback(m=>e?m.replace(/\r?\n|\r/g,e):m,[e]),f=u.useCallback(m=>{n(m?d(m):void 0)},[d,n]);return k.jsx(ti,{submit:f,format:jr.Multiline,value:r?c(r):void 0,tooltip:o,containerClass:i,labelClass:s,labelAttrs:a,readonly:l,label:t})},DX="_list_1pldn_1",zX="_list-header_1pldn_5 _labeled-container_iqlml_46",PX="_list-collapse_1pldn_13",BX="_list-label_1pldn_20 _label_iqlml_46",FX="_list-label-with-tooltip_1pldn_25 _label-with-tooltip_iqlml_63",$X="_list-size_1pldn_29",HX="_list-items_1pldn_34",VX="_list-item_1pldn_34",UX="_list-item-selected_1pldn_49 _list-item_1pldn_34",jX="_list-item-drag-handle_1pldn_58",WX="_list-item-label_1pldn_69",GX="_list-item-editor_1pldn_74",qX="_list-empty-item_1pldn_82",YX="_list-add-remove-panel_1pldn_88",XX="_list-add-remove-button_1pldn_101",Un={list:DX,"list-header":"_list-header_1pldn_5 _labeled-container_iqlml_46",listHeader:zX,"list-collapse":"_list-collapse_1pldn_13",listCollapse:PX,"list-label":"_list-label_1pldn_20 _label_iqlml_46",listLabel:BX,"list-label-with-tooltip":"_list-label-with-tooltip_1pldn_25 _label-with-tooltip_iqlml_63",listLabelWithTooltip:FX,"list-size":"_list-size_1pldn_29",listSize:$X,"list-items":"_list-items_1pldn_34",listItems:HX,"list-item":"_list-item_1pldn_34",listItem:VX,"list-item-selected":"_list-item-selected_1pldn_49 _list-item_1pldn_34",listItemSelected:UX,"list-item-drag-handle":"_list-item-drag-handle_1pldn_58",listItemDragHandle:jX,"list-item-label":"_list-item-label_1pldn_69",listItemLabel:WX,"list-item-editor":"_list-item-editor_1pldn_74",listItemEditor:GX,"list-empty-item":"_list-empty-item_1pldn_82",listEmptyItem:qX,"list-add-remove-panel":"_list-add-remove-panel_1pldn_88",listAddRemovePanel:YX,"list-add-remove-button":"_list-add-remove-button_1pldn_101",listAddRemoveButton:XX},JX=e=>{const t=e.selected?Un.listItemSelected:Un.listItem,n=mv(e.index);return k.jsxs("span",{className:t,onClick:e.handleSelected,...n.node,children:[k.jsx("span",{...cn("Reorder Element"),...n.handle,className:Un.listItemDragHandle,tabIndex:0,children:mW}),k.jsxs("span",{className:Un.listItemLabel,children:["Element ",e.index]}),k.jsx("span",{className:Un.listItemEditor,children:e.editor})]})};function z5({createDefault:e,headerClass:t,label:n,labelAttrs:o,labelClass:r,renderItem:i,submit:s,tooltip:a,values:l}){const[c,d]=u.useState(void 0),[f,m]=u.useState(!l||l.length===0),h=u.useCallback(E=>{if(E===void 0||E<0){s(void 0);return}if(E>100&&(E=100),E===l?.length)return;const T=new Array(E);for(let N=0;Nm(!f),[f]),g=u.useCallback(()=>{const E=f?_5:Kh;return k.jsxs("div",{className:`${Un.listHeader} ${t??""}`,children:[k.jsx("span",{className:Un.listCollapse,onClick:p,children:E}),k.jsx("span",{className:`${Un.listLabel} ${a?Un.listLabelWithTooltip:""} ${r??""}`,...cn(a,{doc:!0}),onClick:p,...o,children:n}),k.jsx(fl,{containerClass:Un.listSize,tooltip:"List Size",value:l?.length??0,submit:h})]})},[f,t,n,o,r,h,p,a,l?.length]),b=u.useCallback((E,T)=>{T===void 0&&(T=e());const N=new Array(l?.length??0);for(let I=0;I{const N=i(E,I=>b(T,I));return k.jsx(JX,{index:T,selected:c===T,handleSelected:()=>d(T),editor:N},T)},[b,i,c]),v=u.useCallback(()=>s([...l??[],e()]),[e,s,l]),_=u.useCallback(()=>{if(!l||l.length===0)return;const E=c??l.length-1;c===E&&d(void 0),s(l.filter((T,N)=>N!==E))},[c,s,l]),w=u.useCallback((E,T)=>{s(Rz(l,E,T))},[s,l]),S=u.useCallback(()=>{if(f)return null;const E=l==null||l.length===0?k.jsx("span",{className:Un.listEmptyItem,children:"List is empty"}):k.jsx(Tv,{handleSort:w,bound:Lc.Ancestor,children:l.map(y)});return k.jsx("div",{className:Un.listItems,children:E})},[f,w,y,l]),x=u.useCallback(()=>{if(!f)return k.jsxs("div",{className:Un.listAddRemovePanel,children:[k.jsx("span",{className:Un.listAddRemoveButton,onMouseDown:v,...cn("Add Element"),children:nk}),k.jsx("span",{className:Un.listAddRemoveButton,onMouseDown:_,...cn("Remove Element"),children:_W})]})},[v,f,_]);return u.useLayoutEffect(()=>m(!l||l.length===0),[l]),k.jsxs("div",{className:Un.list,children:[g(),S(),x()]})}function Yk(e){return k.jsx(xl,{...e,children:k.jsxs("span",{className:rt.named,children:[k.jsx("span",{className:rt.namedName,children:t()}),k.jsx("span",{className:rt.namedValue,children:n()})]})});function t(){return e.nameOptions===void 0?k.jsx(ti,{submit:o,value:e.value.name}):k.jsx(ru,{value:Jh(e.value.name,e.nameOptions),submit:i=>o(Zh(i)),options:e.nameOptions,searchable:!0})}function n(){const i=e.value.value??e.createDefault();return e.renderNamed(i,r)}function o(i){e.submit({name:i,value:e.value.value})}function r(i){e.submit({name:e.value.name,value:i})}}function ZX({className:e,createDefault:t,nameOptions:n,renderNamed:o,label:r,values:i,submit:s,tooltip:a,labelAttrs:l}){const c=u.useCallback(()=>({name:void 0,value:t()}),[t]),d=u.useCallback((f,m)=>k.jsx(Yk,{createDefault:t,value:f,submit:m,renderNamed:o,nameOptions:n}),[t,n,o]);return k.jsx(z5,{createDefault:c,renderItem:d,headerClass:e,label:r,values:i,submit:s,tooltip:a,labelAttrs:l})}const mm="\uFEFF",Xk=({containerClass:e,multiline:t,submit:n,value:o,readonly:r,labelAttrs:i,labelClass:s,tooltip:a,label:l})=>{const c=Ia(de.InsertExpression),d=Ia(de.ExitBeforeExpression),f=Ia(de.ExitAfterExpression),m=Ia(de.InsertTextId),h=Ia(de.ExitBeforeTextId),p=Ia(de.ExitAfterTextId),g={className:`${rt.value} ${rt.textEditor} ${rt.mixed}`},b=u.useCallback((w,S)=>ZT(w)?[w.text,k.jsx("span",{className:rt.textId,spellCheck:!1,children:w.id},S)]:JT(w)?k.jsx("span",{className:rt.expression,spellCheck:!1,children:w.body},S):w,[]),y=u.useMemo(()=>k.jsx(k.Fragment,{children:o.map(b)}),[b,o]),v=u.useCallback(w=>{const S=Array();let x;for(let E=w.childNodes.length-1;E>=0;E--){const T=w.childNodes[E],N=T.textContent?.replace(mm,""),I=T?.className;!N||N.length===0||(I===rt.textId?x=N:I===rt.expression?S.push({body:N}):x!==void 0?(S.push({text:N,id:x}),x=void 0):S.push(N))}n(S.reverse())},[n]),_=u.useCallback(w=>f_(w,c,rt.expression)||p_(w,d,f,rt.expression)||f_(w,m,rt.textId)||p_(w,h,p,rt.textId),[f,p,d,h,c,m]);return k.jsx(xl,{value:o,submit:n,readonly:r,labelAttrs:i,labelClass:s,tooltip:a,label:l,containerClass:`${e} ${t?rt.multiline:""}`,children:k.jsx(YT,{content:y,submit:v,onKeyDown:_,spanProps:g})})};function KX(e){const t=document.createElement("span");return t.className=e,t.spellcheck=!1,t.textContent=mm,t}function Jk(e){const t=e.target,n=window.getSelection(),o=n?.focusNode,r=o.textContent;if(!(!t||!n||!o||!r))return{selection:n,container:t,node:o,text:r}}function P5(e){return e?.nodeType===Node.TEXT_NODE&&e.parentElement?.className?.includes(rt.mixed)}function QX(e){return e.text.at(e.selection.focusOffset-1)==="\\"}function eJ(e,t){return e?.nodeType===Node.TEXT_NODE&&e.parentElement?.className?.includes(t)}function f_(e,t,n){if(e.key!==t)return!1;const o=Jk(e);if(!o||!P5(o.node)||QX(o))return!1;const r=KX(n);return o.container.insertBefore(r,o.node.splitText(o.selection.focusOffset)),o.selection.setBaseAndExtent(r,0,r,1),e.preventDefault(),!0}function K2(e,t){const n=t.node.parentElement?.nextSibling??null;if(P5(n)&&n.textContent.length>0)t.selection.setPosition(n,1);else{const o=document.createTextNode(mm);t.container.insertBefore(o,n??null),t.selection.setBaseAndExtent(o,0,o,1)}return e.preventDefault(),!0}function Q2(e,t){const n=t.node.parentElement?.previousSibling??null;if(P5(n)&&n.textContent.length>0)t.selection.setPosition(n,n.textContent.length);else{const o=document.createTextNode(mm);t.container.insertBefore(o,t.node.parentNode),t.selection.setBaseAndExtent(o,0,o,1)}return e.preventDefault(),!0}function p_(e,t,n,o){const r=e.key==="ArrowLeft",i=e.key==="ArrowRight",s=e.key===t,a=e.key===n;if(!r&&!i&&!s&&!a)return!1;const l=Jk(e);return!l||!eJ(l.node,o)?!1:a?K2(e,l):s?Q2(e,l):l.text.length===0?i?K2(e,l):Q2(e,l):i&&l.selection.focusOffset>=l.text.length?K2(e,l):r&&l.selection.focusOffset<=1?Q2(e,l):!1}function gm(){return(gm=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}function Ny(e){var t=u.useRef(e),n=u.useRef(function(o){t.current&&t.current(o)});return t.current=e,n.current}var Dc=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:b.buttons>0)&&r.current?i(h_(r.current,b,a.current)):g(!1)},p=function(){return g(!1)};function g(b){var y=l.current,v=Ry(r.current),_=b?v.addEventListener:v.removeEventListener;_(y?"touchmove":"mousemove",h),_(y?"touchend":"mouseup",p)}return[function(b){var y=b.nativeEvent,v=r.current;if(v&&(m_(y),!function(w,S){return S&&!yd(w)}(y,l.current)&&v)){if(yd(y)){l.current=!0;var _=y.changedTouches||[];_.length&&(a.current=_[0].identifier)}v.focus(),i(h_(v,y,a.current)),g(!0)}},function(b){var y=b.which||b.keyCode;y<37||y>40||(b.preventDefault(),s({left:y===39?.05:y===37?-.05:0,top:y===40?.05:y===38?-.05:0}))},g]},[s,i]),d=c[0],f=c[1],m=c[2];return u.useEffect(function(){return m},[m]),P.createElement("div",gm({},o,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:r,onKeyDown:f,tabIndex:0,role:"slider"}))}),ym=function(e){return e.filter(Boolean).join(" ")},F5=function(e){var t=e.color,n=e.left,o=e.top,r=o===void 0?.5:o,i=ym(["react-colorful__pointer",e.className]);return P.createElement("div",{className:i,style:{top:100*r+"%",left:100*n+"%"}},P.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},bn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},tJ=function(e){return iJ(My(e))},My=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?bn(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?bn(parseInt(e.substring(6,8),16)/255,2):1}},nJ=function(e){return rJ(oJ(e))},Kk=function(e){var t=e.s,n=e.v,o=e.a,r=(200-t)*n/100;return{h:bn(e.h),s:bn(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:bn(r/2),a:bn(o,2)}},Ay=function(e){var t=Kk(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},eg=function(e){var t=Kk(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},oJ=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var i=Math.floor(t),s=o*(1-n),a=o*(1-(t-i)*n),l=o*(1-(1-t+i)*n),c=i%6;return{r:bn(255*[o,a,s,s,l,o][c]),g:bn(255*[l,o,o,a,s,s][c]),b:bn(255*[s,s,l,o,o,a][c]),a:bn(r,2)}},If=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},rJ=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,i=r<1?If(bn(255*r)):"";return"#"+If(t)+If(n)+If(o)+i},iJ=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,i=Math.max(t,n,o),s=i-Math.min(t,n,o),a=s?i===t?(n-o)/s:i===n?2+(o-t)/s:4+(t-n)/s:0;return{h:bn(60*(a<0?a+6:a)),s:bn(i?s/i*100:0),v:bn(i/255*100),a:r}},sJ=P.memo(function(e){var t=e.hue,n=e.onChange,o=ym(["react-colorful__hue",e.className]);return P.createElement("div",{className:o},P.createElement(B5,{onMove:function(r){n({h:360*r.left})},onKey:function(r){n({h:Dc(t+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":bn(t),"aria-valuemax":"360","aria-valuemin":"0"},P.createElement(F5,{className:"react-colorful__hue-pointer",left:t/360,color:Ay({h:t,s:100,v:100,a:1})})))}),aJ=P.memo(function(e){var t=e.hsva,n=e.onChange,o={backgroundColor:Ay({h:t.h,s:100,v:100,a:1})};return P.createElement("div",{className:"react-colorful__saturation",style:o},P.createElement(B5,{onMove:function(r){n({s:100*r.left,v:100-100*r.top})},onKey:function(r){n({s:Dc(t.s+100*r.left,0,100),v:Dc(t.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+bn(t.s)+"%, Brightness "+bn(t.v)+"%"},P.createElement(F5,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Ay(t)})))}),Qk=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},lJ=function(e,t){return e.toLowerCase()===t.toLowerCase()||Qk(My(e),My(t))};function cJ(e,t,n){var o=Ny(n),r=u.useState(function(){return e.toHsva(t)}),i=r[0],s=r[1],a=u.useRef({color:t,hsva:i});u.useEffect(function(){if(!e.equal(t,a.current.color)){var c=e.toHsva(t);a.current={hsva:c,color:t},s(c)}},[t,e]),u.useEffect(function(){var c;Qk(i,a.current.hsva)||e.equal(c=e.fromHsva(i),a.current.color)||(a.current={hsva:i,color:c},o(c))},[i,e,o]);var l=u.useCallback(function(c){s(function(d){return Object.assign({},d,c)})},[]);return[i,l]}var uJ=typeof window<"u"?u.useLayoutEffect:u.useEffect,dJ=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},g_=new Map,fJ=function(e){uJ(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!g_.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,g_.set(t,n);var o=dJ();o&&n.setAttribute("nonce",o),t.head.appendChild(n)}},[])},pJ=function(e){var t=e.className,n=e.hsva,o=e.onChange,r={backgroundImage:"linear-gradient(90deg, "+eg(Object.assign({},n,{a:0}))+", "+eg(Object.assign({},n,{a:1}))+")"},i=ym(["react-colorful__alpha",t]),s=bn(100*n.a);return P.createElement("div",{className:i},P.createElement("div",{className:"react-colorful__alpha-gradient",style:r}),P.createElement(B5,{onMove:function(a){o({a:a.left})},onKey:function(a){o({a:Dc(n.a+a.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},P.createElement(F5,{className:"react-colorful__alpha-pointer",left:n.a,color:eg(n)})))},hJ=function(e){var t=e.className,n=e.colorModel,o=e.color,r=o===void 0?n.defaultColor:o,i=e.onChange,s=Zk(e,["className","colorModel","color","onChange"]),a=u.useRef(null);fJ(a);var l=cJ(n,r,i),c=l[0],d=l[1],f=ym(["react-colorful",t]);return P.createElement("div",gm({},s,{ref:a,className:f}),P.createElement(aJ,{hsva:c,onChange:d}),P.createElement(sJ,{hue:c.h,onChange:d}),P.createElement(pJ,{hsva:c,onChange:d,className:"react-colorful__last-control"}))},mJ={defaultColor:"0001",toHsva:tJ,fromHsva:nJ,equal:lJ},gJ=function(e){return P.createElement(hJ,gm({},e,{colorModel:mJ}))};const yJ="_color_1dubz_1",vJ="_fields_1dubz_5",bJ="_hex-field-container_1dubz_9",_J="_hex-field_1dubz_9",wJ="_color-field_1dubz_18",xJ="_color-field-open_1dubz_29 _color-field_1dubz_18",SJ="_color-field-rgb_1dubz_38",EJ="_color-field-alpha_1dubz_42",CJ="_color-field-alpha-fill_1dubz_47",TJ="_color-picker_1dubz_52",si={color:yJ,fields:vJ,"hex-field-container":"_hex-field-container_1dubz_9",hexFieldContainer:bJ,"hex-field":"_hex-field_1dubz_9",hexField:_J,"color-field":"_color-field_1dubz_18",colorField:wJ,"color-field-open":"_color-field-open_1dubz_29 _color-field_1dubz_18",colorFieldOpen:xJ,"color-field-rgb":"_color-field-rgb_1dubz_38",colorFieldRgb:SJ,"color-field-alpha":"_color-field-alpha_1dubz_42",colorFieldAlpha:EJ,"color-field-alpha-fill":"_color-field-alpha-fill_1dubz_47",colorFieldAlphaFill:CJ,"color-picker":"_color-picker_1dubz_52",colorPicker:TJ},eL=e=>{const[t,n]=u.useState(y_(e.value)),[o,r]=u.useState(),[i,s]=LJ(t),a=u.useRef(null),l=u.useRef(null),c=u.useCallback(()=>{(t!==void 0||e.value!==void 0)&&e.submit(t),r(!1)},[t,e]),d=u.useCallback(()=>k.jsx(ti,{submit:e.submit,value:t,containerClass:si.hexFieldContainer,fieldClass:si.hexField,disableSpellCheck:!0}),[t,e.submit]),f=u.useCallback(()=>{const g=o?si.colorFieldOpen:si.colorField;return k.jsxs("div",{className:g,...cn("Pick Color"),onClick:()=>o?c():r(!0),ref:a,tabIndex:-1,children:[k.jsx("div",{className:si.colorFieldRgb,style:{background:i}}),k.jsx("div",{className:si.colorFieldAlpha,children:k.jsx("div",{className:si.colorFieldAlphaFill,style:{width:s}})})]})},[s,o,i,c]),m=u.useCallback(()=>k.jsx(xl,{...e,children:k.jsxs("div",{className:si.fields,children:[d(),f()]})}),[e,f,d]),h=u.useCallback(g=>{!l.current?.contains(g.relatedTarget)&&!a.current?.contains(g.relatedTarget)&&c()},[c]),p=u.useCallback(()=>o&&k.jsx("div",{className:si.colorPicker,ref:l,onBlur:h,tabIndex:-1,children:k.jsx(gJ,{color:t??"#ffffff",onChange:n})}),[t,h,o]);return u.useEffect(()=>n(y_(e.value)),[e.value]),u.useEffect(()=>void(o&&l.current?.focus()),[o]),iu([o&&[de.Submit,c],o&&[de.Cancel,c]],[o,t]),k.jsxs("div",{className:si.color,children:[m(),p()]})};function y_(e){if(e!=null)return e.startsWith("#")?e.length<7?"#ffffff":e:kJ(e)}function kJ(e){return e=e.toLowerCase(),e==="black"?"#000000":e==="white"?"#ffffff":e==="red"?"#ff0000":e==="green"?"#00ff00":e==="blue"?"#0000ff":e==="cyan"||e==="aqua"?"#00ffff":e==="darkblue"?"#00008b":e==="lightblue"?"#add8e6":e==="purple"?"#a020f0":e==="yellow"?"#ffff00":e==="fuchsia"||e==="magenta"?"#ff00ff":e==="silver"?"#c0c0c0":e==="grey"?"#808080":e==="orange"?"#ffa500":e==="brown"?"#964b00":e==="maroon"?"#800000":e==="olive"?"#808000":e==="navy"?"#000080":e==="teal"?"#008080":"#ffffff"}function LJ(e){if(e==null)return["#ffffff","100%"];const t=e.substring(0,7),n=e.length<9?"100%":`${IJ(e.substring(7,9))}`;return[t,n]}function IJ(e){return`${parseInt(e,16)/255*100}%`}const NJ=({components:e,containerClass:t,label:n,labelAttrs:o,labelClass:r,readonly:i,submit:s,tooltip:a,value:l})=>{const c=u.useCallback((f,m)=>{const h=[...l??[]];h[f]=m,h.some(p=>p!==void 0)?s(h):s(void 0)},[l,s]),d=u.useCallback((f,m)=>k.jsx(fl,{containerClass:rt.vectorComponent,labelClass:rt.vectorComponentLabel,label:f,submit:h=>c(m,h),value:l?.at(m)},f),[c,l]);return k.jsx(xl,{value:l,submit:s,label:n,tooltip:a,labelClass:r,labelAttrs:o,readonly:i,containerClass:t,children:k.jsx("span",{className:rt.vector,children:e.map(d)})})};var ei=(e=>(e[e.Primary=0]="Primary",e[e.Minimal=1]="Minimal",e))(ei||{});const RJ="_button_xapm2_1",MJ="_label_xapm2_31",AJ="_icon_xapm2_37",OJ="_primary_xapm2_41",DJ="_minimal_xapm2_53",_u={button:RJ,label:MJ,icon:AJ,primary:OJ,minimal:DJ},yn=({handler:e,label:t,icon:n,tooltip:o,className:r,style:i,focus:s,onDown:a})=>{r=u.useMemo(()=>ln(_u.button,r,i===ei.Primary&&_u.primary,i===ei.Minimal&&_u.minimal),[r,i]);const l=u.useRef(null),c=u.useCallback(f=>{e?.(),f.preventDefault(),f.stopPropagation()},[e]),d=u.useCallback(f=>{Oy(f,de.Submit)&&(e?.(),f.preventDefault(),f.stopPropagation())},[e]);return u.useEffect(()=>{s&&l.current?.focus()},[s]),k.jsxs("span",{ref:l,className:r,onClick:a?void 0:c,onMouseDown:a?c:void 0,onKeyDown:d,...cn(o),tabIndex:0,children:[n&&k.jsx("span",{className:_u.icon,children:n}),t&&k.jsx("span",{className:_u.label,children:t})]})},zJ="_search-field_1j83z_1",PJ="_field_1j83z_5",BJ="_search-icon_1j83z_11",FJ="_clear-button_1j83z_23",$J="_match_1j83z_30",Wu={"search-field":"_search-field_1j83z_1",searchField:zJ,field:PJ,"search-icon":"_search-icon_1j83z_11",searchIcon:BJ,"clear-button":"_clear-button_1j83z_23",clearButton:FJ,match:$J},HJ=({handleInput:e,className:t})=>{const[n,o]=u.useState(!0),r=u.useCallback(()=>{o(!0),e("")},[e]),i=u.useCallback(()=>!n&&k.jsx(yn,{handler:r,icon:PW,style:ei.Minimal,className:Wu.clearButton,tooltip:"Clear Search"}),[r,n]),s=u.useCallback(a=>{a.length===0&&!n?o(!0):a.length>0&&n&&o(!1),e(a)},[n,e]);return k.jsxs("div",{className:`${Wu.searchField} ${t??""}`,children:[k.jsx("span",{className:Wu.searchIcon,children:bW}),i(),k.jsx(ti,{submit:a=>{},value:"",onInput:s,fieldClass:Wu.field,tooltip:"Search in Settings",clear:n,disableSpellCheck:!0})]})},VJ=e=>k.jsx("span",{className:Wu.match,children:e.text}),UJ="_settings-editor_1xqhl_1",jJ="_header_1xqhl_6",WJ="_content_1xqhl_13",GJ="_type-list_1xqhl_18",qJ="_scope-separator_1xqhl_23",YJ="_scope-separator-empty_1xqhl_32",XJ="_type-list-item_1xqhl_36",JJ="_type-list-item-selected_1xqhl_40 _type-list-item_1xqhl_36",ZJ="_type-view_1xqhl_46",KJ="_view-header_1xqhl_53",QJ="_view-content_1xqhl_60",eZ="_view-group_1xqhl_64",tZ="_view-property_1xqhl_70",nZ="_view-property-label-modified_1xqhl_74",jn={"settings-editor":"_settings-editor_1xqhl_1",settingsEditor:UJ,header:jJ,content:WJ,"type-list":"_type-list_1xqhl_18",typeList:GJ,"scope-separator":"_scope-separator_1xqhl_23",scopeSeparator:qJ,"scope-separator-empty":"_scope-separator-empty_1xqhl_32",scopeSeparatorEmpty:YJ,"type-list-item":"_type-list-item_1xqhl_36",typeListItem:XJ,"type-list-item-selected":"_type-list-item-selected_1xqhl_40 _type-list-item_1xqhl_36",typeListItemSelected:JJ,"type-view":"_type-view_1xqhl_46",typeView:ZJ,"view-header":"_view-header_1xqhl_53",viewHeader:KJ,"view-content":"_view-content_1xqhl_60",viewContent:QJ,"view-group":"_view-group_1xqhl_64",viewGroup:eZ,"view-property":"_view-property_1xqhl_70",viewProperty:tZ,"view-property-label-modified":"_view-property-label-modified_1xqhl_74",viewPropertyLabelModified:nZ},oZ=({categories:e,handleSelect:t,selectedCategory:n})=>{const o=(g,b)=>g.filter(y=>y.id.startsWith(Cr.ConfigurationScope[b])).sort((y,v)=>y.label==="General"||y.label[...r,...i],[r,i]),a=u.useMemo(()=>ln(jn.scopeSeparator,r.length===0&&jn.scopeSeparatorEmpty),[r.length]),l=u.useMemo(()=>ln(jn.scopeSeparator,i.length===0&&jn.scopeSeparatorEmpty),[i.length]),c=u.useCallback(g=>{t(g)},[t]),d=u.useCallback(()=>n===void 0?-1:s.findIndex(g=>g.id===n),[s,n]),f=u.useCallback(()=>{if(s.length===0)return;const g=d()+1;s.length<=g?t(s[0].id):t(s[g].id)},[s,d,t]),m=u.useCallback(()=>{if(s.length===0)return;const g=d()-1;g<0?t(s[s.length-1].id):t(s[g].id)},[s,d,t]),h=u.useCallback(g=>{g.key==="ArrowDown"&&f(),g.key==="ArrowUp"&&m()},[f,m]),p=u.useCallback((g,b)=>{const v=g===n?jn.typeListItemSelected:jn.typeListItem;return k.jsx("div",{className:v,onMouseDown:()=>c(g),onKeyDown:h,tabIndex:-1,children:b},g)},[h,c,n]);return k.jsxs(Kc,{className:jn.typeList,children:[k.jsx("div",{className:a,...cn(rZ),children:"Project"}),k.jsx("div",{children:r.map(g=>p(g.id,g.label))}),k.jsx("div",{className:l,...cn(iZ),children:"User"}),k.jsx("div",{children:i.map(g=>p(g.id,g.label))})]})},rZ="Project settings are saved inside project directory and shared across collaborators.",iZ="User settings are saved outside project directory and not shared across collaborators.",tL=new Array;function sZ(e){tL.push(e)}function nL(e){return tL.find(t=>t.canRender(e))}const aZ=({handleReset:e,label:t,modified:n,search:o})=>{const r=n?jn.viewPropertyLabelModified:void 0,i=N1(e!==void 0&&n&&{label:"Reset to Default",icon:S5,onClick:e}),s=u.useCallback(()=>{if(o.length===0)return t;const a=t.toLowerCase().indexOf(o);return a<0?t:[k.jsx("span",{children:t.substring(0,a)},0),k.jsx(VJ,{text:t.substring(a,a+o.length)},1),k.jsx("span",{children:t.substring(a+o.length)},2)]},[t,o]);return k.jsx("span",{className:r,onContextMenu:i,children:s()})},lZ=({label:e,options:t,submit:n,tooltip:o,valueType:r,values:i})=>{const s=u.useCallback((c,d)=>{if(r===re.ValueType.Boolean)return k.jsx(E5,{value:c,submit:d});if(r===re.ValueType.Integer)return k.jsx(fl,{value:c,submit:d,integer:!0});if(r===re.ValueType.Decimal)return k.jsx(fl,{value:c,submit:d});if(r===re.ValueType.String&&t===void 0)return k.jsx(ti,{value:c,submit:d});if(r===re.ValueType.String&&t!==void 0)return k.jsx(ru,{value:Jh(c),submit:f=>d(Zh(f)),options:XT(t),searchable:!0});throw Error("Failed to render array property item: unknown value type.")},[t,r]),a=u.useCallback(c=>{n(c===void 0?void 0:[...c])},[n]),l=u.useCallback(()=>{if(t!==void 0)return t.at(0);if(r===re.ValueType.Boolean)return!1;if(r===re.ValueType.Integer||r===re.ValueType.Decimal)return 0;if(r===re.ValueType.String)return"";throw Error("Failed to create default for array property: unknown value type.")},[t,r]);return k.jsx(z5,{values:i,label:e,tooltip:o,createDefault:l,renderItem:s,submit:a})},v_=({color:e,containerType:t,handleReset:n,label:o,modified:r,options:i,search:s,submit:a,tooltip:l,value:c,valueType:d})=>{const f=(l??"")+(r?" (modified)":""),m=u.useMemo(()=>k.jsx(aZ,{label:o,search:s,handleReset:n,modified:r}),[n,o,r,s]),h=u.useCallback(()=>t===re.ContainerType.Array?k.jsx(lZ,{values:c,submit:a,valueType:d,label:m,tooltip:f,options:i}):d===re.ValueType.Boolean?k.jsx(E5,{value:c,submit:a,label:m,tooltip:f}):d===re.ValueType.Integer?k.jsx(fl,{value:c,submit:a,label:m,tooltip:f,integer:!0}):d===re.ValueType.Decimal?k.jsx(fl,{value:c,submit:a,label:m,tooltip:f}):d===re.ValueType.String&&e?k.jsx(eL,{value:c,submit:a,label:m,tooltip:f}):d===re.ValueType.String&&i===void 0?k.jsx(ti,{value:c,submit:a,label:m,tooltip:f,disableSpellCheck:!0}):d===re.ValueType.String&&i!==void 0?k.jsx(ru,{value:Jh(c,void 0,!0),submit:p=>a(Zh(p)),label:m,tooltip:f,options:XT(i,!0),searchable:!0}):k.jsx(k.Fragment,{children:"Unknown property value type."}),[e,t,m,i,a,f,c,d]);return k.jsx("div",{className:jn.viewProperty,children:h()})},cZ=({search:e,view:t})=>{const[n,o]=u.useState([]);u.useLayoutEffect(()=>{t&&o(t.properties.map(re.viewProperty))},[t]);const r=u.useCallback(m=>m.reduce((h,p)=>{const g=p.group??"";return h.has(g)?h.get(g).push(p):h.set(g,[p]),h},new Map),[]),i=u.useCallback(m=>k.jsx("div",{className:jn.viewGroup,children:m},m),[]),s=u.useCallback(m=>{const h=new Array;for(const[p,g]of r(n))h.push(p.length>0?i(p):null,...g.map(m));return h},[r,i,n]),a=u.useCallback(m=>{re.reset(m),re.saveModified()},[]),l=u.useCallback((m,h)=>{re.edit(m,h),re.saveModified()},[]),c=u.useCallback((m,h)=>{m===void 0?a(h):l(h,JSON.stringify(m))},[a,l]),d=u.useCallback(m=>u.createElement(v_,{...m,ref:void 0,key:m.ref.propertyId,value:m.valueJson===void 0?void 0:JSON.parse(m.valueJson),tooltip:m.summary,handleReset:()=>a(m.ref),submit:h=>c(h,m.ref),search:e}),[c,a,e]),f=u.useMemo(()=>t?nL(t.id)?.render({props:n,submitProperty:l,resetProperty:a,renderGroup:i,renderViews:s,renderProperty:m=>u.createElement(v_,{...m,key:m.key,search:e,handleReset:m.reset})})??s(d):null,[i,d,s,a,e,l,t,n]);return k.jsxs(Kc,{className:jn.typeView,children:[k.jsx("div",{className:jn.viewHeader,children:t?.label}),k.jsx("div",{className:jn.viewContent,children:f})]})},uZ=u.memo(()=>{const[e,t]=u.useState([]),[n,o]=u.useState([]),[r,i]=u.useState(),[s,a]=u.useState("");u.useEffect(()=>{const p=re.viewCategories();t(p),o(p),i(p.at(0))},[]);const l=u.useCallback(p=>{p.length===0?i(void 0):(r===void 0||!p.some(g=>g.id===r.id))&&i(p[0])},[r]),c=u.useCallback((p,g)=>(p=p.toLowerCase().trim(),g.filter(b=>b.label.toLowerCase().includes(p)||b.properties.some(y=>to(y.propertyId).toLowerCase().includes(p)||nL(b.id)?.filter(b,p)))),[]),d=u.useCallback((p,g)=>{const b=p.length===0?g:c(p,g);o(b),l(b)},[l,c]),f=u.useCallback(p=>{t(g=>{const b=re.viewCategories();return r&&i(b.find(y=>y.id===r.id)),d(s,b),b})},[d,s,r]),m=u.useCallback(p=>{p=p.toLowerCase().trim(),a(p),d(p,e)},[e,d]),h=u.useCallback(p=>{i(e.find(g=>g.id===p))},[e]);return Nr(re.onChanged,f,[r,s]),k.jsxs("div",{className:jn.settingsEditor,children:[k.jsx("div",{className:jn.header,children:k.jsx(HJ,{handleInput:m})}),k.jsxs("div",{className:jn.content,children:[k.jsx(oZ,{categories:n,handleSelect:h,selectedCategory:r?.id}),k.jsx(cZ,{view:r,search:s})]})]})}),dZ={canRender:e=>e==="SettingsEditor",renderContent:e=>u.createElement(uZ),renderIcon:e=>ik},fZ="_hotkey_7x4aj_1",pZ="_help_7x4aj_5",oL={hotkey:fZ,help:pZ},hZ=({renderProperty:e,renderViews:t,resetProperty:n,submitProperty:o})=>{const r=({modified:i,ref:s,summary:a,valueJson:l})=>e({key:s.propertyId,label:s.propertyId,value:l==null?void 0:JSON.parse(l),submit:c=>o(s,c==null?void 0:JSON.stringify(c.trim())),reset:()=>n(s),valueType:re.ValueType.String,containerType:re.ContainerType.Single,tooltip:a,modified:i});return k.jsxs(k.Fragment,{children:[k.jsx("a",{href:"https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values",className:oL.help,target:"_blank",...cn("Supported values for hotkeys."),children:"Key codes"}),t(r)]})},rL=new Ye,o1="Keymap",mZ={id:o1,scope:Cr.ConfigurationScope.User,properties:e5.map(gZ)},b_=new Map(e5.map(e=>[e.id,e.keys]));function Ia(e){return MC(o1,e)}function gZ(e){return{id:e.id,label:e.id,valueType:re.ValueType.String,containerType:re.ContainerType.Single,defaultValueJson:JSON.stringify(e.keys),group:e.group,summary:e.summary}}function yZ(e){if(e===o1)for(const[t,n]of b_){const o=re.getValueJson({settingsId:o1,propertyId:t}),r=o==null?void 0:JSON.parse(o);r!==n&&(b_.set(t,r),rL.broadcast(t,r))}}re.onChanged.subscribe(yZ);c$(mZ);sZ({canRender:e=>e==`User/${o1}`,render:hZ,filter:(e,t)=>e.properties.some(n=>to(n.propertyId).toLowerCase().includes(t))});const vZ=e=>{const t=Ia(e.id);return k.jsx("span",{className:ln(oL.hotkey,e.class),children:t})},qp=new Array,$5=new Map(e5.map(e=>[e.id,sL(e.keys)]));function bZ(e){qp.splice(0,0,e)}function _Z(e){const t=qp.findIndex(n=>n.key===e);if(t<0)throw Error(`Failed to unregister '${e}' hotkey: not registered.`);qp.splice(t,1)}function Oy(e,t){return aL(e,$5.get(t))}function iu(e,t){u.useEffect(()=>{for(const n of e)Dy(n)&&bZ(iL(n));return()=>{for(const n of e)Dy(n)&&_Z(n[0])}},[e,...t??[]])}function vm(...e){return t=>{for(const n of e)if(Dy(n)&&lL(t,iL(n)))break}}function Dy(e){return e!=null&&typeof e!="boolean"}function iL(e){return{key:e[0],handle:e[1],options:e[2]}}function sL(e){if(e===void 0)return;const t=e.split("+").map(o=>o.trim());let n=t[t.length-1].toLowerCase();return n==="space"&&(n=" "),{key:n,shift:t.some(o=>o.toLowerCase()==="shift"),ctrl:t.some(o=>o.toLowerCase()==="ctrl"),alt:t.some(o=>o.toLowerCase()==="alt"),label:e}}function aL(e,t){return t===void 0?!1:t.key===e.key.toLowerCase()&&t.shift===e.shiftKey&&t.ctrl===(e.ctrlKey||e.metaKey)&&t.alt===e.altKey}function lL(e,t){return t==null||e.repeat||!aL(e,$5.get(t.key))||(t.handle(e),mH(),e.preventDefault(),t.options?.bubbles)?!1:(e.stopPropagation(),!0)}function wZ(e){for(const t of qp)if(lL(e,t))break}function xZ(e,t){$5.set(e,sL(t))}addEventListener("keydown",wZ);rL.subscribe(xZ);const cL=({hotkey:e,icon:t,label:n,tooltip:o})=>k.jsxs("span",{className:Ur.itemContainer,...cn(o),children:[k.jsx("span",{className:Ur.itemIcon,children:t}),k.jsx("span",{className:Ur.itemLabel,children:n}),k.jsx("span",{className:Ur.itemHotkey,children:e!==void 0?k.jsx(vZ,{id:e}):null})]}),at=({className:e,disableFocus:t,disabled:n,hotkey:o,icon:r,label:i,onClick:s,tooltip:a})=>{const l=n??!1,c=t?{tabIndex:void 0}:{},d=u.useCallback(f=>{s!=null&&(f.syntheticEvent.stopPropagation(),s())},[s]);return k.jsx(rH,{onClick:d,disabled:l,className:e,...c,children:k.jsx(cL,{label:i,icon:r,hotkey:o,tooltip:a})})},SZ=()=>{const[e,t]=u.useState(),[n,o]=WC(),r=u.useRef(null),i=u.useCallback(()=>!open||!e||e.items.length===0?null:k.jsx(Qc,{show:!0,className:Ur.itemsContainer,children:e.items.map((c,d)=>k.jsx(at,{...c,disableFocus:!0},d))}),[e]),s=u.useCallback(c=>{t(c),o(!0)},[o]),a=u.useCallback(()=>{t(void 0),o(!1)},[o]),l=u.useCallback(c=>{r.current?.contains(c.target)||a()},[a]);return Nr(JC,s,[]),Nr(ZC,a,[]),u.useEffect(()=>(addEventListener("mousedown",l,{capture:!0}),()=>removeEventListener("mousedown",l,{capture:!0}))),e===void 0?null:k.jsx(VC,{...n,ref:r,anchorPoint:e.point,captureFocus:!1,direction:"right",onClose:a,children:i()})},EZ=({children:e,disabled:t,icon:n,label:o})=>{const r=t??!1,i=k.jsx(cL,{label:o,icon:n}),s=u.useMemo(()=>e&&k.jsx(Qc,{show:!0,className:Ur.itemsContainer,children:e}),[e]);return k.jsx(nH,{label:i,disabled:r,children:s})},M1=()=>k.jsx(iH,{}),CZ="_modal_xk5tk_1",TZ="_modal-hidden_xk5tk_13",kZ="_window_xk5tk_17",LZ="_fade-in_xk5tk_1",IZ="_title_xk5tk_31",NZ="_progress-info_xk5tk_37",RZ="_progress-bar_xk5tk_43",MZ="_progress-bar-fill_xk5tk_51",AZ="_progress-bar-gradient_xk5tk_1",OZ="_confirmation-content_xk5tk_67",DZ="_confirmation-buttons_xk5tk_71",zZ="_confirmation-button-confirm_xk5tk_75",PZ="_confirmation-button-deny_xk5tk_81",Gr={modal:CZ,"modal-hidden":"_modal-hidden_xk5tk_13",modalHidden:TZ,window:kZ,"fade-in":"_fade-in_xk5tk_1",fadeIn:LZ,title:IZ,"progress-info":"_progress-info_xk5tk_37",progressInfo:NZ,"progress-bar":"_progress-bar_xk5tk_43",progressBar:RZ,"progress-bar-fill":"_progress-bar-fill_xk5tk_51",progressBarFill:MZ,"progress-bar-gradient":"_progress-bar-gradient_xk5tk_1",progressBarGradient:AZ,"confirmation-content":"_confirmation-content_xk5tk_67",confirmationContent:OZ,"confirmation-buttons":"_confirmation-buttons_xk5tk_71",confirmationButtons:DZ,"confirmation-button-confirm":"_confirmation-button-confirm_xk5tk_75",confirmationButtonConfirm:zZ,"confirmation-button-deny":"_confirmation-button-deny_xk5tk_81",confirmationButtonDeny:PZ},BZ=e=>k.jsxs(k.Fragment,{children:[k.jsx("div",{className:Gr.progressInfo,children:e.info}),k.jsx(FZ,{ratio:e.progress})]}),FZ=e=>{const t=`${e.ratio*100}%`;return k.jsx("div",{className:Gr.progressBar,children:k.jsx("div",{className:Gr.progressBarFill,style:{width:t}})})},$Z=({content:e,deniable:t,onConfirm:n,onDeny:o})=>{const[r,i]=u.useState(!0),s=u.useCallback(async c=>{r&&(i(!1),c!=null&&await c(),U5(),i(!0))},[r]),a=u.useCallback(()=>k.jsx(yn,{handler:()=>s(n),style:ei.Primary,className:Gr.confirmationButtonConfirm,label:"OK"}),[n,s]),l=u.useCallback(()=>t&&k.jsx(yn,{handler:()=>s(o),className:Gr.confirmationButtonDeny,label:"Cancel"}),[t,o,s]);return iu([[de.Submit,c=>s(n)],[de.Cancel,c=>s(o)]],[n,o]),k.jsxs(k.Fragment,{children:[k.jsx("div",{className:Gr.confirmationContent,children:e}),k.jsxs("div",{className:Gr.confirmationButtons,children:[a(),l()]})]})},H5=new Ye;function V5(e){H5.broadcast(e)}function U5(){H5.broadcast(void 0)}function HZ(e){V5({title:e.title,content:k.jsx(BZ,{...e})})}function VZ(e){V5({title:e.title,focus:!0,content:k.jsx($Z,{...e})})}tl.onProgressChanged.subscribe(HZ);tl.onProgressCleared.subscribe(U5);const UZ=()=>{const e=so(H5),t=u.useCallback(()=>e&&k.jsxs("div",{className:Gr.window,children:[k.jsx("div",{className:Gr.title,children:e?.title}),k.jsx(OE,{pull:e.focus,children:e.content})]}),[e]);return k.jsx(Qc,{className:ln(Gr.modal,[!e,Gr.modalHidden]),show:e!=null,blurAmount:5,brightness:.65,saturation:1,transition:qv.Base,children:t()})},jZ="_login-window_1msvh_1",WZ="_window_1msvh_12",GZ="_title_1msvh_20",qZ="_info_1msvh_26",YZ="_button_1msvh_31",Es={"login-window":"_login-window_1msvh_1",loginWindow:jZ,window:WZ,title:GZ,info:qZ,button:YZ},XZ=({children:e})=>{const t=MO(),n=t?Ws.getLastUser():void 0,o=so(Ws.onUserAuthorized)??!1,r=u.useCallback(()=>k.jsx(yn,{handler:Ws.authorizeUser,style:n==null?ei.Primary:void 0,className:Es.button,icon:w5,label:"Select Directory"}),[n]),i=u.useCallback(()=>n&&k.jsx(yn,{handler:Ws.authorizeLastUser,style:ei.Primary,className:Es.button,icon:x5,label:n}),[n]),s=u.useCallback(()=>k.jsxs(k.Fragment,{children:[k.jsx("div",{className:Es.title,children:n==null?"First-Time Setup":"Welcome Back"}),k.jsx("div",{className:Es.info,children:n==null?"Please specify directory to store user data, such as custom layouts and preferences.":"Select existing or pick another directory to store user data, such as custom layouts and preferences."}),i(),r()]}),[n,i,r]),a=u.useCallback(()=>k.jsxs(k.Fragment,{children:[k.jsx("div",{className:Es.title,children:"Browser Not Supported"}),k.jsxs("div",{className:Es.info,children:["Naninovel Editor is not compatible with this web browser. We recommend using ",k.jsx("a",{href:"https://www.google.com/chrome",target:"_blank",children:"Google Chrome"}),"."]})]}),[]);return u.useEffect(()=>{!o&&n&&JZ()},[o,n]),o?k.jsx(k.Fragment,{children:e}):t&&k.jsx("div",{className:Es.loginWindow,children:k.jsx("div",{className:Es.window,children:pB()?s():a()})})};let tg=!1;async function JZ(){if(!tg){tg=!0;try{await Ws.authorizeLastUser()}finally{tg=!1}}}function ZZ(e={}){const{immediate:t=!1,onNeedRefresh:n,onOfflineReady:o,onRegistered:r,onRegisteredSW:i,onRegisterError:s}=e;let a,l,c;const d=async(m=!0)=>{await l,await c?.()};async function f(){if("serviceWorker"in navigator){if(a=await oh(()=>import("./workbox-window.prod.es5-D5gOYdM7.js"),[]).then(({Workbox:m})=>new m("/editor/sw.js",{scope:"/editor/",type:"classic"})).catch(m=>{s?.(m)}),!a)return;c=async()=>{await a?.messageSkipWaiting()};{let m=!1;const h=()=>{m=!0,a?.addEventListener("controlling",p=>{p.isUpdate&&window.location.reload()}),n?.()};a.addEventListener("installed",p=>{typeof p.isUpdate>"u"?typeof p.isExternal<"u"?p.isExternal?h():!m&&o?.():p.isExternal?window.location.reload():!m&&o?.():p.isUpdate||o?.()}),a.addEventListener("waiting",h),a.addEventListener("externalwaiting",h)}a.register({immediate:t}).then(m=>{i?i("/editor/sw.js",m):r?.(m)}).catch(m=>{s?.(m)})}}return l=f(),d}function KZ(e={}){const{immediate:t=!0,onNeedRefresh:n,onOfflineReady:o,onRegistered:r,onRegisteredSW:i,onRegisterError:s}=e,[a,l]=u.useState(!1),[c,d]=u.useState(!1),[f]=u.useState(()=>ZZ({immediate:t,onOfflineReady(){d(!0),o?.()},onNeedRefresh(){l(!0),n?.()},onRegistered:r,onRegisteredSW:i,onRegisterError:s}));return{needRefresh:[a,l],offlineReady:[c,d],updateServiceWorker:f}}const QZ="_control-panel_1lgal_1",eK="_left_1lgal_29",tK="_right_1lgal_30",nK="_button_1lgal_48",oK="_button-open_1lgal_56",rK="_button-disabled_1lgal_60",iK="_enlarged-svg_1lgal_64",sK="_editor-menu_1lgal_70",aK="_bridging_1lgal_74",lK="_metadata_1lgal_84",cK="_project-title-field_1lgal_101",uK="_undo_1lgal_132",dK="_undo-list_1lgal_136",fK="_undo-item_1lgal_140",pK="_undo-item-undone_1lgal_144",hK="_undo-icon-add_1lgal_149",mK="_undo-icon-modify_1lgal_153",gK="_undo-icon-delete_1lgal_157",yK="_save_1lgal_161",vK="_layout_1lgal_165",bK="_layout-name_1lgal_169",_K="_layout-icon_1lgal_173",wK="_layout-delete-button_1lgal_177",xK="_about-window_1lgal_181",SK="_about-window-logo_1lgal_186",EK="_about-window-version_1lgal_192",CK="_about-window-update_1lgal_199",TK="_about-window-title_1lgal_206",kK="_about-window-info_1lgal_211",LK="_about-window-button-group_1lgal_217",IK="_about-window-button_1lgal_217",xe={"control-panel":"_control-panel_1lgal_1",controlPanel:QZ,left:eK,right:tK,button:nK,"button-open":"_button-open_1lgal_56",buttonOpen:oK,"button-disabled":"_button-disabled_1lgal_60",buttonDisabled:rK,"enlarged-svg":"_enlarged-svg_1lgal_64",enlargedSvg:iK,"editor-menu":"_editor-menu_1lgal_70",editorMenu:sK,bridging:aK,metadata:lK,"project-title-field":"_project-title-field_1lgal_101",projectTitleField:cK,undo:uK,"undo-list":"_undo-list_1lgal_136",undoList:dK,"undo-item":"_undo-item_1lgal_140",undoItem:fK,"undo-item-undone":"_undo-item-undone_1lgal_144",undoItemUndone:pK,"undo-icon-add":"_undo-icon-add_1lgal_149",undoIconAdd:hK,"undo-icon-modify":"_undo-icon-modify_1lgal_153",undoIconModify:mK,"undo-icon-delete":"_undo-icon-delete_1lgal_157",undoIconDelete:gK,save:yK,layout:vK,"layout-name":"_layout-name_1lgal_169",layoutName:bK,"layout-icon":"_layout-icon_1lgal_173",layoutIcon:_K,"layout-delete-button":"_layout-delete-button_1lgal_177",layoutDeleteButton:wK,"about-window":"_about-window_1lgal_181",aboutWindow:xK,"about-window-logo":"_about-window-logo_1lgal_186",aboutWindowLogo:SK,"about-window-version":"_about-window-version_1lgal_192",aboutWindowVersion:EK,"about-window-update":"_about-window-update_1lgal_199",aboutWindowUpdate:CK,"about-window-title":"_about-window-title_1lgal_206",aboutWindowTitle:TK,"about-window-info":"_about-window-info_1lgal_211",aboutWindowInfo:kK,"about-window-button-group":"_about-window-button-group_1lgal_217",aboutWindowButtonGroup:LK,"about-window-button":"_about-window-button_1lgal_217",aboutWindowButton:IK},__="1.20",NK="2024-07-16",RK=()=>{const e=so(Ae.onRecentProjectsChanged),{needRefresh:[t]}=KZ();iu([[de.CreateProject,()=>{}],[de.OpenProject,Ae.openProject],[de.OpenSettings,re.openEditor]],[]);const n=u.useCallback(()=>{const r=!e||e.length==0,i=e?.map(s=>k.jsx(at,{label:s.title,onClick:()=>Ae.openRecentProject(s.id)},s.id))??[];return k.jsx(EZ,{label:"Open Recent",icon:CW,disabled:r,children:i})},[e]),o=u.useCallback(async()=>{V5({title:"About Naninovel",content:k.jsxs("div",{className:xe.aboutWindow,children:[k.jsx("div",{className:xe.aboutWindowLogo,children:wW}),k.jsxs("div",{className:xe.aboutWindowVersion,children:["v",__," build ",NK]}),t&&k.jsx("div",{className:xe.aboutWindowUpdate,children:"(new version available; restart to update)"}),k.jsx("div",{className:xe.aboutWindowTitle,children:"Release Notes"}),k.jsx("div",{className:xe.aboutWindowInfo,children:"For the list of changes associated with this release, see the notes on GitHub."}),k.jsx(yn,{handler:()=>Nl(`https://github.com/naninovel/docs/releases/tag/v${__}`),className:xe.aboutWindowButton,label:"Release Notes"}),k.jsx("div",{className:xe.aboutWindowTitle,children:"Online Resources"}),k.jsx("div",{className:xe.aboutWindowInfo,children:"Please read getting started and command guides. Contact support if you have any issues or questions."}),k.jsxs("div",{className:xe.aboutWindowButtonGroup,children:[k.jsx(yn,{handler:()=>Nl("https://naninovel.com/guide/getting-started"),className:xe.aboutWindowButton,label:"Guide"}),k.jsx(yn,{handler:()=>Nl("https://naninovel.com/api"),className:xe.aboutWindowButton,label:"Commands"}),k.jsx(yn,{handler:()=>Nl("https://forum.naninovel.com"),className:xe.aboutWindowButton,label:"Forum"}),k.jsx(yn,{handler:()=>Nl("https://discord.gg/BfkNqem"),className:xe.aboutWindowButton,label:"Discord"}),k.jsx(yn,{handler:()=>Nl("https://naninovel.com/support"),className:xe.aboutWindowButton,label:"Support"})]}),k.jsx("div",{className:xe.aboutWindowTitle}),k.jsx(yn,{handler:U5,className:xe.aboutWindowButton,style:ei.Primary,label:"Close"})]})})},[t]);return k.jsx("span",{className:xe.editorMenu,children:k.jsxs(hs,{icon:nW,buttonClass:xe.button,openButtonClass:xe.buttonOpen,tooltip:"Editor Menu",children:[k.jsx(at,{label:"New Project",icon:hW,hotkey:de.CreateProject,disabled:!0}),k.jsx(at,{label:"Open...",icon:w5,hotkey:de.OpenProject,onClick:Ae.openProject}),n(),k.jsx(M1,{}),k.jsx(at,{label:"Settings",icon:ik,hotkey:de.OpenSettings,onClick:re.openEditor}),k.jsx(at,{label:"About",icon:yW,onClick:o}),k.jsx(at,{label:"Log Out",icon:TW,onClick:Ws.logout})]})})},MK=()=>{const e=so(Ae.onBridgingChanged),[t,n]=u.useState(),o=e!==void 0,r=o?`Connected to ${e}`:"Bridging connection not established",i=u.useCallback(async()=>{n(void 0),n(await Ae.findServers())},[]),s=u.useCallback(()=>{const c=o?$7:SW,d=o?xe.enlargedSvg:void 0;return k.jsx("span",{className:d,children:c})},[o]),a=u.useCallback(()=>{if(t===void 0)return k.jsx(at,{label:"Looking for servers...",disabled:!0});if(t.length===0)return k.jsx(at,{label:"No servers found.",disabled:!0});return t.map(c);function c(d){return k.jsx(at,{label:d.name,icon:$7,tooltip:`Port: ${d.port}`,onClick:()=>Ae.connect(d.port)},d.port)}},[t]),l=u.useCallback(()=>o&&k.jsxs(k.Fragment,{children:[k.jsx(M1,{}),k.jsx(at,{label:"Disconnect",icon:xW,onClick:Ae.disconnect})]}),[o]);return k.jsx("span",{className:xe.bridging,children:k.jsxs(hs,{icon:s(),buttonClass:xe.button,tooltip:r,handleOpen:i,children:[a(),l()]})})},AK=()=>{const e=so(Ae.onMetadataChanged,!1)??!1,t=Ae.hasCachedMetadata(),n=RS(),o=u.useMemo(()=>e?"Project metadata is synced":"Project metadata not available",[e]),r=u.useMemo(()=>e?dW:uW,[e]),i=u.useCallback(()=>e&&k.jsx(at,{label:"Reset Metadata",icon:S5,onClick:Ae.applyDefaultMetadata}),[e]),s=u.useCallback(()=>Ae.deleteCachedMetadata().then(n),[n]),a=u.useCallback(()=>t&&k.jsx(at,{label:"Delete Cached",icon:Ri,onClick:s}),[t,s]);return k.jsx("span",{className:xe.metadata,children:k.jsxs(hs,{icon:r,buttonClass:xe.button,handleOpen:n,openButtonClass:xe.buttonOpen,disabledButtonClass:xe.buttonDisabled,tooltip:o,disabled:!e&&!t,children:[i(),a()]})})},OK=()=>{const e=so(Ae.onProjectTitleChanged);return e?k.jsx(ti,{tooltip:"Rename Project",submit:t=>Ae.renameProject(t??""),value:e,containerClass:xe.projectTitle,fieldClass:xe.projectTitleField}):k.jsx(k.Fragment,{})},DK=({maxLength:e})=>{const t=Ae.getUndoLength(),[n,o]=u.useState({firstIndex:0,lastIndex:0});Nr(Ae.onUndoChanged,RS());const r=u.useCallback(c=>t-c-1,[t]),i=u.useCallback(c=>{const d=r(c),f=Ae.viewUndo(d),m=zK(f.assetUri,f.context),h=ln(xe.undoItem,[f.undone,xe.undoItemUndone]);return k.jsx(at,{icon:m,label:to(f.summary),onClick:p,className:h,tooltip:f.assetUri});function p(){f.undone?Ae.redoAt(d):Ae.undoAt(d)}},[r]),s=u.useCallback(()=>{let c=0;for(let d=n.firstIndex;d<=n.lastIndex;d++){const f=Ae.viewUndo(r(d)).summary.length;f>c&&(c=f)}return c},[n,r]);if(t===0)return null;const a=`${Math.min(e,t)*2.3}rem`,l=`${s()*.7+3}rem`;return k.jsx("div",{className:xe.undoList,style:{minWidth:l,height:a},children:k.jsx(AE,{totalCount:t,renderItem:i,handleRangeChanged:o})})};function zK(e,t){const n=b5(e.split(".").pop()),o=ln([t===Cr.UndoContext.Add,xe.undoIconAdd],[t===Cr.UndoContext.Modify,xe.undoIconModify],[t===Cr.UndoContext.Delete,xe.undoIconDelete]);return k.jsx("span",{className:o,children:n})}const PK=()=>{const e=kn(hn.UndoListLength),t=Ae.getUndoLength(),[n,o]=u.useState(!1),[r,i]=u.useState(!1);return Nr(Ae.onUndoChanged,()=>{o(Ae.canUndo()),i(Ae.canRedo())}),iu([n&&[de.Undo,Ae.undo],r&&[de.Redo,Ae.redo]],[n,r]),k.jsx("span",{className:xe.undo,children:k.jsxs(hs,{icon:iW,buttonClass:xe.button,tooltip:"Undo History",align:eu.End,disabled:t===0,children:[k.jsx(at,{label:"Undo Last",icon:S5,hotkey:de.Undo,disabled:!n,onClick:Ae.undo}),k.jsx(at,{label:"Redo Last",icon:LW,hotkey:de.Redo,disabled:!r,onClick:Ae.redo}),e>0&&k.jsxs(k.Fragment,{children:[k.jsx(M1,{}),k.jsx(DK,{maxLength:e})]})]})})},BK=()=>{const e=so(ft.onSelectedLayoutChanged)??"",t=so(ft.onAvailableLayoutsChanged)??[],n=u.useCallback(()=>k.jsxs(k.Fragment,{children:[k.jsx("span",{className:xe.layoutName,children:e}),k.jsx("span",{className:xe.layoutIcon,children:MW})]}),[e]),o=u.useCallback(s=>s.deletable?k.jsxs(k.Fragment,{children:[s.name,k.jsx(yn,{handler:()=>ft.deleteLayout(s.name),className:xe.layoutDeleteButton,style:ei.Minimal,tooltip:"Delete Layout",icon:Ri})]}):s.name,[]),r=u.useCallback(s=>k.jsx(at,{label:o(s),onClick:()=>ft.applyLayout(s.name)},s.name),[o]),i=u.useCallback(async()=>{const s="New Layout";let a=s;VZ({title:"Save Layout",content:k.jsx(ti,{label:"Layout Name",submit:l=>a=l??s,value:a}),deniable:!0,onConfirm:()=>ft.saveCurrentLayout(a.length===0?s:a)})},[]);return k.jsx("span",{className:xe.layout,children:k.jsxs(hs,{icon:n(),buttonClass:xe.button,align:eu.End,tooltip:"Layout",children:[k.jsx(at,{label:"Save Current As...",icon:QT,onClick:i}),k.jsx(M1,{}),t.map(r)]})})},FK=()=>{const e=so(Ae.onDirtyChanged,[])??[];iu([[de.SaveAll,Ae.saveAllDirty]]);const t=u.useMemo(()=>k.jsx("span",{className:xe.enlargedSvg,children:pW}),[]),n=u.useCallback(o=>{const r=b5(o.assetUri.split(".").pop());return k.jsx(at,{label:o.assetUri,icon:r,onClick:()=>Ae.saveDirty(o.assetId)},o.assetId)},[]);return k.jsx("span",{className:xe.save,children:k.jsxs(hs,{icon:t,buttonClass:xe.button,tooltip:"Modified Assets",align:eu.End,disabled:e.length===0,children:[k.jsx(at,{label:"Save All",icon:QT,hotkey:de.SaveAll,onClick:Ae.saveAllDirty}),k.jsx(M1,{}),e.map(n)]})})},$K=()=>k.jsxs("div",{className:xe.controlPanel,children:[k.jsxs("span",{className:xe.left,children:[k.jsx(RK,{}),k.jsx(MK,{}),k.jsx(AK,{}),k.jsx(OK,{})]}),k.jsxs("span",{className:xe.right,children:[k.jsx(PK,{}),k.jsx(FK,{}),k.jsx(BK,{})]})]});var kr={},bm={},ni={},Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.Orientation=void 0;class es{static flip(t){return t===es.HORZ?es.VERT:es.HORZ}constructor(t){this._name=t}getName(){return this._name}toString(){return this._name}}Sn.Orientation=es;es.HORZ=new es("horz");es.VERT=new es("vert");var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.Rect=void 0;const HK=Sn;class tc{static empty(){return new tc(0,0,0,0)}constructor(t,n,o,r){this.x=t,this.y=n,this.width=o,this.height=r}static fromElement(t){let{x:n,y:o,width:r,height:i}=t.getBoundingClientRect();return new tc(n,o,r,i)}clone(){return new tc(this.x,this.y,this.width,this.height)}equals(t){return this.x===t?.x&&this.y===t?.y&&this.width===t?.width&&this.height===t?.height}getBottom(){return this.y+this.height}getRight(){return this.x+this.width}getCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}positionElement(t,n){this.styleWithPosition(t.style,n)}styleWithPosition(t,n="absolute"){return t.left=this.x+"px",t.top=this.y+"px",t.width=Math.max(0,this.width)+"px",t.height=Math.max(0,this.height)+"px",t.position=n,t}contains(t,n){return this.x<=t&&t<=this.getRight()&&this.y<=n&&n<=this.getBottom()}removeInsets(t){return new tc(this.x+t.left,this.y+t.top,Math.max(0,this.width-t.left-t.right),Math.max(0,this.height-t.top-t.bottom))}centerInRect(t){this.x=(t.width-this.width)/2,this.y=(t.height-this.height)/2}_getSize(t){let n=this.width;return t===HK.Orientation.VERT&&(n=this.height),n}toString(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"}}Jn.Rect=tc;Object.defineProperty(ni,"__esModule",{value:!0});ni.DockLocation=void 0;const A1=Sn,gr=Jn;class Ze{static getByName(t){return Ze.values[t]}static getLocation(t,n,o){if(n=(n-t.x)/t.width,o=(o-t.y)/t.height,n>=.25&&n<.75&&o>=.25&&o<.75)return Ze.CENTER;const r=o>=n,i=o>=1-n;return r?i?Ze.BOTTOM:Ze.LEFT:i?Ze.RIGHT:Ze.TOP}constructor(t,n,o){this._name=t,this._orientation=n,this._indexPlus=o,Ze.values[this._name]=this}getName(){return this._name}getOrientation(){return this._orientation}getDockRect(t){return this===Ze.TOP?new gr.Rect(t.x,t.y,t.width,t.height/2):this===Ze.BOTTOM?new gr.Rect(t.x,t.getBottom()-t.height/2,t.width,t.height/2):this===Ze.LEFT?new gr.Rect(t.x,t.y,t.width/2,t.height):this===Ze.RIGHT?new gr.Rect(t.getRight()-t.width/2,t.y,t.width/2,t.height):t.clone()}split(t,n){if(this===Ze.TOP){const o=new gr.Rect(t.x,t.y,t.width,n),r=new gr.Rect(t.x,t.y+n,t.width,t.height-n);return{start:o,end:r}}else if(this===Ze.LEFT){const o=new gr.Rect(t.x,t.y,n,t.height),r=new gr.Rect(t.x+n,t.y,t.width-n,t.height);return{start:o,end:r}}if(this===Ze.RIGHT){const o=new gr.Rect(t.getRight()-n,t.y,n,t.height),r=new gr.Rect(t.x,t.y,t.width-n,t.height);return{start:o,end:r}}else{const o=new gr.Rect(t.x,t.getBottom()-n,t.width,n),r=new gr.Rect(t.x,t.y,t.width,t.height-n);return{start:o,end:r}}}reflect(){return this===Ze.TOP?Ze.BOTTOM:this===Ze.LEFT?Ze.RIGHT:this===Ze.RIGHT?Ze.LEFT:Ze.TOP}toString(){return"(DockLocation: name="+this._name+", orientation="+this._orientation+")"}}ni.DockLocation=Ze;Ze.values={};Ze.TOP=new Ze("top",A1.Orientation.VERT,0);Ze.BOTTOM=new Ze("bottom",A1.Orientation.VERT,1);Ze.LEFT=new Ze("left",A1.Orientation.HORZ,0);Ze.RIGHT=new Ze("right",A1.Orientation.HORZ,1);Ze.CENTER=new Ze("center",A1.Orientation.VERT,0);var Sl={};Object.defineProperty(Sl,"__esModule",{value:!0});Sl.DragDrop=void 0;const VK=Jn,UK=!!(typeof window<"u"&&window.document&&window.document.createElement);class zy{constructor(){this._manualGlassManagement=!1,this._startX=0,this._startY=0,this._dragDepth=0,this._glassShowing=!1,this._dragging=!1,this._active=!1,UK&&(this._glass=document.createElement("div"),this._glass.style.zIndex="998",this._glass.style.backgroundColor="transparent",this._glass.style.outline="none"),this._defaultGlassCursor="default",this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onKeyPress=this._onKeyPress.bind(this),this._onDragCancel=this._onDragCancel.bind(this),this._onDragEnter=this._onDragEnter.bind(this),this._onDragLeave=this._onDragLeave.bind(this),this.resizeGlass=this.resizeGlass.bind(this),this._lastClick=0,this._clickX=0,this._clickY=0}addGlass(t){var n;this._glassShowing?this._manualGlassManagement=!0:(this._document||(this._document=window.document),this._rootElement||(this._rootElement=this._document.body),this.resizeGlass(),(n=this._document.defaultView)===null||n===void 0||n.addEventListener("resize",this.resizeGlass),this._document.body.appendChild(this._glass),this._glass.tabIndex=-1,this._glass.focus(),this._glass.addEventListener("keydown",this._onKeyPress),this._glass.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._glass.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._glass.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._glassShowing=!0,this._fDragCancel=t,this._manualGlassManagement=!1)}resizeGlass(){VK.Rect.fromElement(this._rootElement).positionElement(this._glass,"fixed")}hideGlass(){var t;this._glassShowing&&(this._document.body.removeChild(this._glass),(t=this._document.defaultView)===null||t===void 0||t.removeEventListener("resize",this.resizeGlass),this._glassShowing=!1,this._document=void 0,this._rootElement=void 0,this.setGlassCursorOverride(void 0))}_updateGlassCursor(){var t;this._glass.style.cursor=(t=this._glassCursorOverride)!==null&&t!==void 0?t:this._defaultGlassCursor}_setDefaultGlassCursor(t){this._defaultGlassCursor=t,this._updateGlassCursor()}setGlassCursorOverride(t){this._glassCursorOverride=t,this._updateGlassCursor()}startDrag(t,n,o,r,i,s,a,l,c){if(t&&this._lastEvent&&this._lastEvent.type.startsWith("touch")&&t.type.startsWith("mouse")&&t.timeStamp-this._lastEvent.timeStamp<500||this._dragging)return;this._lastEvent=t,l?this._document=l:this._document=window.document,c?this._rootElement=c:this._rootElement=this._document.body;const d=this._getLocationEvent(t);this.addGlass(i),t?(this._startX=d.clientX,this._startY=d.clientY,(!window.matchMedia||window.matchMedia("(pointer: fine)").matches)&&this._setDefaultGlassCursor(getComputedStyle(t.target).cursor),this._stopPropagation(t),this._preventDefault(t)):(this._startX=0,this._startY=0,this._setDefaultGlassCursor("default")),this._dragging=!1,this._fDragStart=n,this._fDragMove=o,this._fDragEnd=r,this._fDragCancel=i,this._fClick=s,this._fDblClick=a,this._active=!0,t?.type==="dragenter"?(this._dragDepth=1,this._rootElement.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._rootElement.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._rootElement.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._document.addEventListener("dragend",this._onDragCancel,{passive:!1}),this._document.addEventListener("drop",this._onMouseUp,{passive:!1})):(this._document.addEventListener("mouseup",this._onMouseUp,{passive:!1}),this._document.addEventListener("mousemove",this._onMouseMove,{passive:!1}),this._document.addEventListener("touchend",this._onMouseUp,{passive:!1}),this._document.addEventListener("touchmove",this._onMouseMove,{passive:!1}))}isDragging(){return this._dragging}isActive(){return this._active}toString(){return"(DragDrop: startX="+this._startX+", startY="+this._startY+", dragging="+this._dragging+")"}_onKeyPress(t){t.code==="Escape"&&this._onDragCancel()}_onDragCancel(){this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this.hideGlass(),this._fDragCancel!==void 0&&this._fDragCancel(this._dragging),this._dragging=!1,this._active=!1}_getLocationEvent(t){let n=t;return t&&t.touches&&(n=t.touches[0]),n}_getLocationEventEnd(t){let n=t;return t.changedTouches&&(n=t.changedTouches[0]),n}_stopPropagation(t){t.stopPropagation&&t.stopPropagation()}_preventDefault(t){return t.preventDefault&&t.cancelable&&t.preventDefault(),t}_onMouseMove(t){this._lastEvent=t;const n=this._getLocationEvent(t);return this._stopPropagation(t),this._preventDefault(t),!this._dragging&&(Math.abs(this._startX-n.clientX)>5||Math.abs(this._startY-n.clientY)>5)&&(this._dragging=!0,this._fDragStart&&(this._setDefaultGlassCursor("move"),this._dragging=this._fDragStart({clientX:this._startX,clientY:this._startY}))),this._dragging&&this._fDragMove&&this._fDragMove(n),!1}_onMouseUp(t){this._lastEvent=t;const n=this._getLocationEventEnd(t);if(this._stopPropagation(t),this._preventDefault(t),this._active=!1,this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this._manualGlassManagement||this.hideGlass(),this._dragging)this._dragging=!1,this._fDragEnd&&this._fDragEnd(t);else if(this._fDragCancel&&this._fDragCancel(this._dragging),Math.abs(this._startX-n.clientX)<=5&&Math.abs(this._startY-n.clientY)<=5){let o=!1;const r=new Date().getTime();Math.abs(this._clickX-n.clientX)<=5&&Math.abs(this._clickY-n.clientY)<=5&&r-this._lastClick<500&&this._fDblClick&&(this._fDblClick(t),o=!0),!o&&this._fClick&&this._fClick(t),this._lastClick=r,this._clickX=n.clientX,this._clickY=n.clientY}return!1}_onDragEnter(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth++,!1}_onDragLeave(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth--,this._dragDepth<=0&&this._onDragCancel(),!1}}Sl.DragDrop=zy;zy.instance=new zy;var hr={},O1={};Object.defineProperty(O1,"__esModule",{value:!0});O1.Action=void 0;class jK{constructor(t,n){this.type=t,this.data=n}}O1.Action=jK;Object.defineProperty(hr,"__esModule",{value:!0});hr.Actions=void 0;const vo=O1;class ut{static addNode(t,n,o,r,i){return new vo.Action(ut.ADD_NODE,{json:t,toNode:n,location:o.getName(),index:r,select:i})}static moveNode(t,n,o,r,i){return new vo.Action(ut.MOVE_NODE,{fromNode:t,toNode:n,location:o.getName(),index:r,select:i})}static deleteTab(t){return new vo.Action(ut.DELETE_TAB,{node:t})}static deleteTabset(t){return new vo.Action(ut.DELETE_TABSET,{node:t})}static renameTab(t,n){return new vo.Action(ut.RENAME_TAB,{node:t,text:n})}static selectTab(t){return new vo.Action(ut.SELECT_TAB,{tabNode:t})}static setActiveTabset(t){return new vo.Action(ut.SET_ACTIVE_TABSET,{tabsetNode:t})}static adjustSplit(t){const n=t.node1Id,o=t.node2Id;return new vo.Action(ut.ADJUST_SPLIT,{node1:n,weight1:t.weight1,pixelWidth1:t.pixelWidth1,node2:o,weight2:t.weight2,pixelWidth2:t.pixelWidth2})}static adjustBorderSplit(t,n){return new vo.Action(ut.ADJUST_BORDER_SPLIT,{node:t,pos:n})}static maximizeToggle(t){return new vo.Action(ut.MAXIMIZE_TOGGLE,{node:t})}static updateModelAttributes(t){return new vo.Action(ut.UPDATE_MODEL_ATTRIBUTES,{json:t})}static updateNodeAttributes(t,n){return new vo.Action(ut.UPDATE_NODE_ATTRIBUTES,{node:t,json:n})}static floatTab(t){return new vo.Action(ut.FLOAT_TAB,{node:t})}static unFloatTab(t){return new vo.Action(ut.UNFLOAT_TAB,{node:t})}}hr.Actions=ut;ut.ADD_NODE="FlexLayout_AddNode";ut.MOVE_NODE="FlexLayout_MoveNode";ut.DELETE_TAB="FlexLayout_DeleteTab";ut.DELETE_TABSET="FlexLayout_DeleteTabset";ut.RENAME_TAB="FlexLayout_RenameTab";ut.SELECT_TAB="FlexLayout_SelectTab";ut.SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset";ut.ADJUST_SPLIT="FlexLayout_AdjustSplit";ut.ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit";ut.MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle";ut.UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes";ut.UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes";ut.FLOAT_TAB="FlexLayout_FloatTab";ut.UNFLOAT_TAB="FlexLayout_UnFloatTab";var wu={},gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.Attribute=void 0;class _m{constructor(t,n,o,r){this.name=t,this.modelName=n,this.defaultValue=o,this.alwaysWriteJson=r,this.required=!1,this.fixed=!1,this.type="any"}setType(t){return this.type=t,this}setRequired(){return this.required=!0,this}setFixed(){return this.fixed=!0,this}}gs.Attribute=_m;_m.NUMBER="number";_m.STRING="string";_m.BOOLEAN="boolean";var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.AttributeDefinitions=void 0;const WK=gs;class GK{constructor(){this.attributes=[],this.nameToAttribute={}}addWithAll(t,n,o,r){const i=new WK.Attribute(t,n,o,r);return this.attributes.push(i),this.nameToAttribute[t]=i,i}addInherited(t,n){return this.addWithAll(t,n,void 0,!1)}add(t,n,o){return this.addWithAll(t,void 0,n,o)}getAttributes(){return this.attributes}getModelName(t){const n=this.nameToAttribute[t];if(n!==void 0)return n.modelName}toJson(t,n){for(const o of this.attributes){const r=n[o.name];(o.alwaysWriteJson||r!==o.defaultValue)&&(t[o.name]=r)}}fromJson(t,n){for(const o of this.attributes){const r=t[o.name];r===void 0?n[o.name]=o.defaultValue:n[o.name]=r}}update(t,n){for(const o of this.attributes)if(t.hasOwnProperty(o.name)){const r=t[o.name];r===void 0?delete n[o.name]:n[o.name]=r}}setDefaults(t){for(const n of this.attributes)t[n.name]=n.defaultValue}toTypescriptInterface(t,n){const o=[],r=this.attributes.sort((i,s)=>i.name.localeCompare(s.name));o.push("export interface I"+t+"Attributes {");for(let i=0;i0?" // "+h:""))}}return o.push("}"),o.join(` `)}}ys.AttributeDefinitions=GK;var El={};Object.defineProperty(El,"__esModule",{value:!0});El.DropInfo=void 0;class qK{constructor(t,n,o,r,i){this.node=t,this.rect=n,this.location=o,this.index=r,this.className=i}}El.DropInfo=qK;var En={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CLASSES=void 0,function(t){t.FLEXLAYOUT__BORDER="flexlayout__border",t.FLEXLAYOUT__BORDER_="flexlayout__border_",t.FLEXLAYOUT__BORDER_BUTTON="flexlayout__border_button",t.FLEXLAYOUT__BORDER_BUTTON_="flexlayout__border_button_",t.FLEXLAYOUT__BORDER_BUTTON_CONTENT="flexlayout__border_button_content",t.FLEXLAYOUT__BORDER_BUTTON_LEADING="flexlayout__border_button_leading",t.FLEXLAYOUT__BORDER_BUTTON_TRAILING="flexlayout__border_button_trailing",t.FLEXLAYOUT__BORDER_BUTTON__SELECTED="flexlayout__border_button--selected",t.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED="flexlayout__border_button--unselected",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW="flexlayout__border_toolbar_button_overflow",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_="flexlayout__border_toolbar_button_overflow_",t.FLEXLAYOUT__BORDER_INNER="flexlayout__border_inner",t.FLEXLAYOUT__BORDER_INNER_="flexlayout__border_inner_",t.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER="flexlayout__border_inner_tab_container",t.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_="flexlayout__border_inner_tab_container_",t.FLEXLAYOUT__BORDER_TAB_DIVIDER="flexlayout__border_tab_divider",t.FLEXLAYOUT__BORDER_SIZER="flexlayout__border_sizer",t.FLEXLAYOUT__BORDER_TOOLBAR="flexlayout__border_toolbar",t.FLEXLAYOUT__BORDER_TOOLBAR_="flexlayout__border_toolbar_",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON="flexlayout__border_toolbar_button",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT="flexlayout__border_toolbar_button-float",t.FLEXLAYOUT__DRAG_RECT="flexlayout__drag_rect",t.FLEXLAYOUT__EDGE_RECT="flexlayout__edge_rect",t.FLEXLAYOUT__EDGE_RECT_TOP="flexlayout__edge_rect_top",t.FLEXLAYOUT__EDGE_RECT_LEFT="flexlayout__edge_rect_left",t.FLEXLAYOUT__EDGE_RECT_BOTTOM="flexlayout__edge_rect_bottom",t.FLEXLAYOUT__EDGE_RECT_RIGHT="flexlayout__edge_rect_right",t.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER="flexlayout__error_boundary_container",t.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT="flexlayout__error_boundary_content",t.FLEXLAYOUT__FLOATING_WINDOW_CONTENT="flexlayout__floating_window_content",t.FLEXLAYOUT__FLOATING_WINDOW_TAB="flexlayout__floating_window_tab",t.FLEXLAYOUT__LAYOUT="flexlayout__layout",t.FLEXLAYOUT__OUTLINE_RECT="flexlayout__outline_rect",t.FLEXLAYOUT__OUTLINE_RECT_EDGE="flexlayout__outline_rect_edge",t.FLEXLAYOUT__SPLITTER="flexlayout__splitter",t.FLEXLAYOUT__SPLITTER_EXTRA="flexlayout__splitter_extra",t.FLEXLAYOUT__SPLITTER_="flexlayout__splitter_",t.FLEXLAYOUT__SPLITTER_BORDER="flexlayout__splitter_border",t.FLEXLAYOUT__SPLITTER_DRAG="flexlayout__splitter_drag",t.FLEXLAYOUT__TAB="flexlayout__tab",t.FLEXLAYOUT__TABSET="flexlayout__tabset",t.FLEXLAYOUT__TABSET_HEADER="flexlayout__tabset_header",t.FLEXLAYOUT__TABSET_HEADER_SIZER="flexlayout__tabset_header_sizer",t.FLEXLAYOUT__TABSET_HEADER_CONTENT="flexlayout__tabset_header_content",t.FLEXLAYOUT__TABSET_MAXIMIZED="flexlayout__tabset-maximized",t.FLEXLAYOUT__TABSET_SELECTED="flexlayout__tabset-selected",t.FLEXLAYOUT__TABSET_SIZER="flexlayout__tabset_sizer",t.FLEXLAYOUT__TABSET_TAB_DIVIDER="flexlayout__tabset_tab_divider",t.FLEXLAYOUT__TABSET_CONTENT="flexlayout__tabset_content",t.FLEXLAYOUT__TABSET_TABBAR_INNER="flexlayout__tabset_tabbar_inner",t.FLEXLAYOUT__TABSET_TABBAR_INNER_="flexlayout__tabset_tabbar_inner_",t.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER="flexlayout__tabset_tabbar_inner_tab_container",t.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_="flexlayout__tabset_tabbar_inner_tab_container_",t.FLEXLAYOUT__TABSET_TABBAR_OUTER="flexlayout__tabset_tabbar_outer",t.FLEXLAYOUT__TABSET_TABBAR_OUTER_="flexlayout__tabset_tabbar_outer_",t.FLEXLAYOUT__TAB_BORDER="flexlayout__tab_border",t.FLEXLAYOUT__TAB_BORDER_="flexlayout__tab_border_",t.FLEXLAYOUT__TAB_BUTTON="flexlayout__tab_button",t.FLEXLAYOUT__TAB_BUTTON_STRETCH="flexlayout__tab_button_stretch",t.FLEXLAYOUT__TAB_BUTTON_CONTENT="flexlayout__tab_button_content",t.FLEXLAYOUT__TAB_BUTTON_LEADING="flexlayout__tab_button_leading",t.FLEXLAYOUT__TAB_BUTTON_OVERFLOW="flexlayout__tab_button_overflow",t.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT="flexlayout__tab_button_overflow_count",t.FLEXLAYOUT__TAB_BUTTON_TEXTBOX="flexlayout__tab_button_textbox",t.FLEXLAYOUT__TAB_BUTTON_TRAILING="flexlayout__tab_button_trailing",t.FLEXLAYOUT__TAB_BUTTON_STAMP="flexlayout__tab_button_stamp",t.FLEXLAYOUT__TAB_FLOATING="flexlayout__tab_floating",t.FLEXLAYOUT__TAB_FLOATING_INNER="flexlayout__tab_floating_inner",t.FLEXLAYOUT__TAB_TOOLBAR="flexlayout__tab_toolbar",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON="flexlayout__tab_toolbar_button",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_="flexlayout__tab_toolbar_button-",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT="flexlayout__tab_toolbar_button-float",t.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER="flexlayout__tab_toolbar_sticky_buttons_container",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE="flexlayout__tab_toolbar_button-close",t.FLEXLAYOUT__POPUP_MENU_CONTAINER="flexlayout__popup_menu_container",t.FLEXLAYOUT__POPUP_MENU_ITEM="flexlayout__popup_menu_item",t.FLEXLAYOUT__POPUP_MENU="flexlayout__popup_menu"}(e.CLASSES||(e.CLASSES={}))})(En);var vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.Node=void 0;const ng=ni,og=Sn,YK=Jn;let XK=class{constructor(t){this._dirty=!1,this._tempSize=0,this._model=t,this._attributes={},this._children=[],this._fixed=!1,this._rect=YK.Rect.empty(),this._visible=!1,this._listeners={}}getId(){let t=this._attributes.id;return t!==void 0||(t=this._model._nextUniqueId(),this._setId(t)),t}getModel(){return this._model}getType(){return this._attributes.type}getParent(){return this._parent}getChildren(){return this._children}getRect(){return this._rect}isVisible(){return this._visible}getOrientation(){return this._parent===void 0?this._model.isRootOrientationVertical()?og.Orientation.VERT:og.Orientation.HORZ:og.Orientation.flip(this._parent.getOrientation())}setEventListener(t,n){this._listeners[t]=n}removeEventListener(t){delete this._listeners[t]}_setId(t){this._attributes.id=t}_fireEvent(t,n){this._listeners[t]!==void 0&&this._listeners[t](n)}_getAttr(t){let n=this._attributes[t];if(n===void 0){const o=this._getAttributeDefinitions().getModelName(t);o!==void 0&&(n=this._model._getAttribute(o))}return n}_forEachNode(t,n){t(this,n),n++;for(const o of this._children)o._forEachNode(t,n)}_setVisible(t){t!==this._visible&&(this._fireEvent("visibility",{visible:t}),this._visible=t)}_getDrawChildren(){return this._children}_setParent(t){this._parent=t}_setRect(t){this._rect=t}_setWeight(t){this._attributes.weight=t}_setSelected(t){this._attributes.selected=t}_isFixed(){return this._fixed}_layout(t,n){this._rect=t}_findDropTargetNode(t,n,o){let r;if(this._rect.contains(n,o)){if(this._model.getMaximizedTabset()!==void 0)r=this._model.getMaximizedTabset().canDrop(t,n,o);else if(r=this.canDrop(t,n,o),r===void 0&&this._children.length!==0){for(const i of this._children)if(r=i._findDropTargetNode(t,n,o),r!==void 0)break}}return r}canDrop(t,n,o){}_canDockInto(t,n){if(n!=null){if(n.location===ng.DockLocation.CENTER&&n.node.isEnableDrop()===!1||n.location===ng.DockLocation.CENTER&&t.getType()==="tabset"&&t.getName()!==void 0||n.location!==ng.DockLocation.CENTER&&n.node.isEnableDivide()===!1)return!1;if(this._model._getOnAllowDrop())return this._model._getOnAllowDrop()(t,n)}return!0}_removeChild(t){const n=this._children.indexOf(t);return n!==-1&&this._children.splice(n,1),this._dirty=!0,n}_addChild(t,n){return n!=null?this._children.splice(n,0,t):(this._children.push(t),n=this._children.length-1),t._parent=this,this._dirty=!0,n}_removeAll(){this._children=[],this._dirty=!0}_styleWithPosition(t){return t==null&&(t={}),this._rect.styleWithPosition(t)}_getTempSize(){return this._tempSize}_setTempSize(t){this._tempSize=t}isEnableDivide(){return!0}_toAttributeString(){return JSON.stringify(this._attributes,void 0," ")}};vs.Node=XK;var Cl={};Object.defineProperty(Cl,"__esModule",{value:!0});Cl.SplitterNode=void 0;const JK=ys,rg=Sn,ZK=vs;class wm extends ZK.Node{constructor(t){super(t),this._fixed=!0,this._attributes.type=wm.TYPE,t._addNode(this)}getWidth(){return this._model.getSplitterSize()}getMinWidth(){return this.getOrientation()===rg.Orientation.VERT?this._model.getSplitterSize():0}getHeight(){return this._model.getSplitterSize()}getMinHeight(){return this.getOrientation()===rg.Orientation.HORZ?this._model.getSplitterSize():0}getMinSize(t){return t===rg.Orientation.HORZ?this.getMinWidth():this.getMinHeight()}getWeight(){return 0}_setWeight(t){}_getPrefSize(t){return this._model.getSplitterSize()}_updateAttrs(t){}_getAttributeDefinitions(){return new JK.AttributeDefinitions}toJson(){}}Cl.SplitterNode=wm;wm.TYPE="splitter";var wa={};Object.defineProperty(wa,"__esModule",{value:!0});wa.TabNode=void 0;const pn=gs,KK=ys,QK=vs;class vr extends QK.Node{static _fromJson(t,n,o=!0){return new vr(n,t,o)}static _createAttributeDefinitions(){const t=new KK.AttributeDefinitions;return t.add("type",vr.TYPE,!0).setType(pn.Attribute.STRING),t.add("id",void 0).setType(pn.Attribute.STRING),t.add("name","[Unnamed Tab]").setType(pn.Attribute.STRING),t.add("altName",void 0).setType(pn.Attribute.STRING),t.add("helpText",void 0).setType(pn.Attribute.STRING),t.add("component",void 0).setType(pn.Attribute.STRING),t.add("config",void 0).setType("any"),t.add("floating",!1).setType(pn.Attribute.BOOLEAN),t.add("tabsetClassName",void 0).setType(pn.Attribute.STRING),t.addInherited("enableClose","tabEnableClose").setType(pn.Attribute.BOOLEAN),t.addInherited("closeType","tabCloseType").setType("ICloseType"),t.addInherited("enableDrag","tabEnableDrag").setType(pn.Attribute.BOOLEAN),t.addInherited("enableRename","tabEnableRename").setType(pn.Attribute.BOOLEAN),t.addInherited("className","tabClassName").setType(pn.Attribute.STRING),t.addInherited("contentClassName","tabContentClassName").setType(pn.Attribute.STRING),t.addInherited("icon","tabIcon").setType(pn.Attribute.STRING),t.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(pn.Attribute.BOOLEAN),t.addInherited("enableFloat","tabEnableFloat").setType(pn.Attribute.BOOLEAN),t.addInherited("borderWidth","tabBorderWidth").setType(pn.Attribute.NUMBER),t.addInherited("borderHeight","tabBorderHeight").setType(pn.Attribute.NUMBER),t}constructor(t,n,o=!0){super(t),this._extra={},vr._attributeDefinitions.fromJson(n,this._attributes),o===!0&&t._addNode(this)}getWindow(){return this._window}getTabRect(){return this._tabRect}_setTabRect(t){this._tabRect=t}_setRenderedName(t){this._renderedName=t}_getNameForOverflowMenu(){const t=this._getAttr("altName");return t!==void 0?t:this._renderedName}getName(){return this._getAttr("name")}getHelpText(){return this._getAttr("helpText")}getComponent(){return this._getAttr("component")}getConfig(){return this._attributes.config}getExtraData(){return this._extra}isFloating(){return this._getAttr("floating")}getIcon(){return this._getAttr("icon")}isEnableClose(){return this._getAttr("enableClose")}getCloseType(){return this._getAttr("closeType")}isEnableFloat(){return this._getAttr("enableFloat")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableRename(){return this._getAttr("enableRename")}getClassName(){return this._getAttr("className")}getContentClassName(){return this._getAttr("contentClassName")}getTabSetClassName(){return this._getAttr("tabsetClassName")}isEnableRenderOnDemand(){return this._getAttr("enableRenderOnDemand")}_setName(t){this._attributes.name=t,this._window&&this._window.document&&(this._window.document.title=t)}_setFloating(t){this._attributes.floating=t}_layout(t,n){t.equals(this._rect)||this._fireEvent("resize",{rect:t}),this._rect=t}_delete(){this._parent._remove(this),this._fireEvent("close",{})}toJson(){const t={};return vr._attributeDefinitions.toJson(t,this._attributes),t}_updateAttrs(t){vr._attributeDefinitions.update(t,this._attributes)}_getAttributeDefinitions(){return vr._attributeDefinitions}_setWindow(t){this._window=t}_setBorderWidth(t){this._attributes.borderWidth=t}_setBorderHeight(t){this._attributes.borderHeight=t}static getAttributeDefinitions(){return vr._attributeDefinitions}}wa.TabNode=vr;vr.TYPE="tab";vr._attributeDefinitions=vr._createAttributeDefinitions();var Or={},xu={},Su={},w_;function j5(){if(w_)return Su;w_=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.RowNode=void 0;const e=gs,t=ys,n=ni,o=El,r=Sn,i=Jn,s=En,a=bs(),l=vs,c=Cl,d=xa();let f=class Vn extends l.Node{static _fromJson(h,p){const g=new Vn(p,h);if(h.children!=null)for(const b of h.children)if(b.type===d.TabSetNode.TYPE){const y=d.TabSetNode._fromJson(b,p);g._addChild(y)}else{const y=Vn._fromJson(b,p);g._addChild(y)}return g}static _createAttributeDefinitions(){const h=new t.AttributeDefinitions;return h.add("type",Vn.TYPE,!0).setType(e.Attribute.STRING).setFixed(),h.add("id",void 0).setType(e.Attribute.STRING),h.add("weight",100).setType(e.Attribute.NUMBER),h.add("width",void 0).setType(e.Attribute.NUMBER),h.add("height",void 0).setType(e.Attribute.NUMBER),h}constructor(h,p){super(h),this._dirty=!0,this._drawChildren=[],this._minHeight=0,this._minWidth=0,Vn._attributeDefinitions.fromJson(p,this._attributes),h._addNode(this)}getWeight(){return this._attributes.weight}getWidth(){return this._getAttr("width")}getHeight(){return this._getAttr("height")}_setWeight(h){this._attributes.weight=h}_layout(h,p){super._layout(h,p);const g=this._rect._getSize(this.getOrientation());let b=0,y=0,v=0,_=0;const w=this._getDrawChildren();for(const I of w){const R=I._getPrefSize(this.getOrientation());I._isFixed()?R!==void 0&&(y+=R):R===void 0?b+=I.getWeight():(v+=R,_+=I.getWeight())}let S=!1,x=g-y-v;x<0&&(x=g-y,S=!0,b+=_);let E=0,T=0;for(const I of w){const R=I._getPrefSize(this.getOrientation());if(I._isFixed())R!==void 0&&I._setTempSize(R);else if(R==null||S){if(b===0)I._setTempSize(0);else{const O=I.getMinSize(this.getOrientation()),B=Math.floor(x*(I.getWeight()/b));I._setTempSize(Math.max(O,B))}T+=I._getTempSize()}else I._setTempSize(R);E+=I._getTempSize()}if(T>0){for(;Eg;){let I=!1;for(const R of w)if(!(R instanceof c.SplitterNode)){const O=R.getMinSize(this.getOrientation());R._getTempSize()>O&&E>g&&(R._setTempSize(R._getTempSize()-1),E--,I=!0)}if(!I)break}for(;E>g;){let I=!1;for(const R of w)R instanceof c.SplitterNode||R._getTempSize()>0&&E>g&&(R._setTempSize(R._getTempSize()-1),E--,I=!0);if(!I)break}}let N=0;for(const I of w)this.getOrientation()===r.Orientation.HORZ?I._layout(new i.Rect(this._rect.x+N,this._rect.y,I._getTempSize(),this._rect.height),p):I._layout(new i.Rect(this._rect.x,this._rect.y+N,this._rect.width,I._getTempSize()),p),N+=I._getTempSize();return!0}_getSplitterBounds(h,p=!1){const g=[0,0],b=this._getDrawChildren(),y=b.indexOf(h),v=b[y-1],_=b[y+1];if(this.getOrientation()===r.Orientation.HORZ){const w=p?v.getMinWidth():0,S=p?_.getMinWidth():0;g[0]=v.getRect().x+w,g[1]=_.getRect().getRight()-h.getWidth()-S}else{const w=p?v.getMinHeight():0,S=p?_.getMinHeight():0;g[0]=v.getRect().y+w,g[1]=_.getRect().getBottom()-h.getHeight()-S}return g}_calculateSplit(h,p){let g;const b=this._getDrawChildren(),y=b.indexOf(h),v=this._getSplitterBounds(h),_=b[y-1].getWeight()+b[y+1].getWeight(),w=Math.max(0,p-v[0]),S=Math.max(0,v[1]-p);if(w+S>0){const x=w*_/(w+S),E=S*_/(w+S);g={node1Id:b[y-1].getId(),weight1:x,pixelWidth1:w,node2Id:b[y+1].getId(),weight2:E,pixelWidth2:S}}return g}_getDrawChildren(){if(this._dirty){this._drawChildren=[];for(let h=0;h_/2-S&&b<_/2+S){const E=n.DockLocation.LEFT,T=E.getDockRect(this._rect);T.width=T.width/2,x=new o.DropInfo(this,T,E,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(p>this._rect.getRight()-w&&b>_/2-S&&b<_/2+S){const E=n.DockLocation.RIGHT,T=E.getDockRect(this._rect);T.width=T.width/2,T.x+=T.width,x=new o.DropInfo(this,T,E,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(gv/2-S&&ythis._rect.getBottom()-w&&y>v/2-S&&yS+x.getWeight(),0);_===0&&(_=100),v._setWeight(_/3);const w=!this._model.isRootOrientationVertical();if(w&&b===n.DockLocation.LEFT||!w&&b===n.DockLocation.TOP)this._addChild(v,0);else if(w&&b===n.DockLocation.RIGHT||!w&&b===n.DockLocation.BOTTOM)this._addChild(v);else if(w&&b===n.DockLocation.TOP||!w&&b===n.DockLocation.LEFT){const S=new Vn(this._model,{}),x=new Vn(this._model,{});x._setWeight(75),v._setWeight(25);for(const E of this._children)x._addChild(E);this._removeAll(),S._addChild(v),S._addChild(x),this._addChild(S)}else if(w&&b===n.DockLocation.BOTTOM||!w&&b===n.DockLocation.RIGHT){const S=new Vn(this._model,{}),x=new Vn(this._model,{});x._setWeight(75),v._setWeight(25);for(const E of this._children)x._addChild(E);this._removeAll(),S._addChild(x),S._addChild(v),this._addChild(S)}this._model._setActiveTabset(v),this._model._tidy()}toJson(){const h={};Vn._attributeDefinitions.toJson(h,this._attributes),h.children=[];for(const p of this._children)h.children.push(p.toJson());return h}isEnableDrop(){return!0}_getPrefSize(h){let p=this.getWidth();return h===r.Orientation.VERT&&(p=this.getHeight()),p}_getAttributeDefinitions(){return Vn._attributeDefinitions}_updateAttrs(h){Vn._attributeDefinitions.update(h,this._attributes)}static getAttributeDefinitions(){return Vn._attributeDefinitions}};return Su.RowNode=f,f.TYPE="row",f._attributeDefinitions=f._createAttributeDefinitions(),Su}var x_;function xa(){if(x_)return xu;x_=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.TabSetNode=void 0;const e=gs,t=ys,n=ni,o=El,r=Sn,i=Jn,s=En,a=bs(),l=vs,c=j5(),d=wa,f=W5();let m=class Hi extends l.Node{static _fromJson(p,g){const b=new Hi(g,p);if(p.children!=null)for(const y of p.children){const v=d.TabNode._fromJson(y,g);b._addChild(v)}return b._children.length===0&&b._setSelected(-1),p.maximized&&p.maximized===!0&&g._setMaximizedTabset(b),p.active&&p.active===!0&&g._setActiveTabset(b),b}static _createAttributeDefinitions(){const p=new t.AttributeDefinitions;return p.add("type",Hi.TYPE,!0).setType(e.Attribute.STRING).setFixed(),p.add("id",void 0).setType(e.Attribute.STRING),p.add("weight",100).setType(e.Attribute.NUMBER),p.add("width",void 0).setType(e.Attribute.NUMBER),p.add("height",void 0).setType(e.Attribute.NUMBER),p.add("selected",0).setType(e.Attribute.NUMBER),p.add("name",void 0).setType(e.Attribute.STRING),p.add("config",void 0).setType("any"),p.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty"),p.addInherited("enableDrop","tabSetEnableDrop"),p.addInherited("enableDrag","tabSetEnableDrag"),p.addInherited("enableDivide","tabSetEnableDivide"),p.addInherited("enableMaximize","tabSetEnableMaximize"),p.addInherited("enableClose","tabSetEnableClose"),p.addInherited("enableSingleTabStretch","tabSetEnableSingleTabStretch"),p.addInherited("classNameTabStrip","tabSetClassNameTabStrip"),p.addInherited("classNameHeader","tabSetClassNameHeader"),p.addInherited("enableTabStrip","tabSetEnableTabStrip"),p.addInherited("borderInsets","tabSetBorderInsets"),p.addInherited("marginInsets","tabSetMarginInsets"),p.addInherited("minWidth","tabSetMinWidth"),p.addInherited("minHeight","tabSetMinHeight"),p.addInherited("headerHeight","tabSetHeaderHeight"),p.addInherited("tabStripHeight","tabSetTabStripHeight"),p.addInherited("tabLocation","tabSetTabLocation"),p.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(e.Attribute.BOOLEAN),p}constructor(p,g){super(p),Hi._attributeDefinitions.fromJson(g,this._attributes),p._addNode(this),this._calculatedTabBarHeight=0,this._calculatedHeaderBarHeight=0}getName(){return this._getAttr("name")}getSelected(){const p=this._attributes.selected;return p!==void 0?p:-1}getSelectedNode(){const p=this.getSelected();if(p!==-1)return this._children[p]}getWeight(){return this._getAttr("weight")}getWidth(){return this._getAttr("width")}getMinWidth(){return this._getAttr("minWidth")}getHeight(){return this._getAttr("height")}getMinHeight(){return this._getAttr("minHeight")}getMinSize(p){return p===r.Orientation.HORZ?this.getMinWidth():this.getMinHeight()}getConfig(){return this._attributes.config}isMaximized(){return this._model.getMaximizedTabset()===this}isActive(){return this._model.getActiveTabset()===this}isEnableDeleteWhenEmpty(){return this._getAttr("enableDeleteWhenEmpty")}isEnableDrop(){return this._getAttr("enableDrop")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableDivide(){return this._getAttr("enableDivide")}isEnableMaximize(){return this._getAttr("enableMaximize")}isEnableClose(){return this._getAttr("enableClose")}isEnableSingleTabStretch(){return this._getAttr("enableSingleTabStretch")}canMaximize(){return this.isEnableMaximize()?this.getModel().getMaximizedTabset()===this?!0:!(this.getParent()===this.getModel().getRoot()&&this.getModel().getRoot().getChildren().length===1):!1}isEnableTabStrip(){return this._getAttr("enableTabStrip")}isAutoSelectTab(){return this._getAttr("autoSelectTab")}getClassNameTabStrip(){return this._getAttr("classNameTabStrip")}getClassNameHeader(){return this._getAttr("classNameHeader")}calculateHeaderBarHeight(p){const g=this._getAttr("headerHeight");g!==0?this._calculatedHeaderBarHeight=g:this._calculatedHeaderBarHeight=p.headerBarSize}calculateTabBarHeight(p){const g=this._getAttr("tabStripHeight");g!==0?this._calculatedTabBarHeight=g:this._calculatedTabBarHeight=p.tabBarSize}getHeaderHeight(){return this._calculatedHeaderBarHeight}getTabStripHeight(){return this._calculatedTabBarHeight}getTabLocation(){return this._getAttr("tabLocation")}_setWeight(p){this._attributes.weight=p}_setSelected(p){this._attributes.selected=p}canDrop(p,g,b){let y;if(p===this){const v=n.DockLocation.CENTER,_=this._tabHeaderRect;y=new o.DropInfo(this,_,v,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this._contentRect.contains(g,b)){let v=n.DockLocation.CENTER;this._model.getMaximizedTabset()===void 0&&(v=n.DockLocation.getLocation(this._contentRect,g,b));const _=v.getDockRect(this._rect);y=new o.DropInfo(this,_,v,-1,s.CLASSES.FLEXLAYOUT__OUTLINE_RECT)}else if(this._tabHeaderRect!=null&&this._tabHeaderRect.contains(g,b)){let v,_,w;if(this._children.length===0)v=this._tabHeaderRect.clone(),_=v.y+3,w=v.height-4,v.width=2;else{let S=this._children[0];v=S.getTabRect(),_=v.y,w=v.height;let x=this._tabHeaderRect.x,E=0;for(let T=0;T=x&&g0&&b--,v===n.DockLocation.CENTER){let S=b;if(S===-1&&(S=this._children.length),p.getType()===d.TabNode.TYPE)this._addChild(p,S),(y||y!==!1&&this.isAutoSelectTab())&&this._setSelected(S);else{for(let x=0;x0&&this._setSelected(0)}this._model._setActiveTabset(this)}else{let S;if(p instanceof d.TabNode){const T=this._model._getOnCreateTabSet();S=new Hi(this._model,T?T(p):{}),S._addChild(p),_=S}else S=p;const x=this._parent,E=x.getChildren().indexOf(this);if(x.getOrientation()===v._orientation)S._setWeight(this.getWeight()/2),this._setWeight(this.getWeight()/2),x._addChild(S,E+v._indexPlus);else{const T=new c.RowNode(this._model,{});T._setWeight(this.getWeight()),T._addChild(this),this._setWeight(50),S._setWeight(50),T._addChild(S,v._indexPlus),x._removeChild(this),x._addChild(T,E)}this._model._setActiveTabset(S)}this._model._tidy()}toJson(){const p={};return Hi._attributeDefinitions.toJson(p,this._attributes),p.children=this._children.map(g=>g.toJson()),this.isActive()&&(p.active=!0),this.isMaximized()&&(p.maximized=!0),p}_updateAttrs(p){Hi._attributeDefinitions.update(p,this._attributes)}_getAttributeDefinitions(){return Hi._attributeDefinitions}_getPrefSize(p){let g=this.getWidth();return p===r.Orientation.VERT&&(g=this.getHeight()),g}static getAttributeDefinitions(){return Hi._attributeDefinitions}};return xu.TabSetNode=m,m.TYPE="tabset",m._attributeDefinitions=m._createAttributeDefinitions(),xu}var S_;function W5(){if(S_)return Or;S_=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.randomUUID=Or.adjustSelectedIndex=Or.adjustSelectedIndexAfterDock=Or.adjustSelectedIndexAfterFloat=void 0;const e=xa(),t=bs();function n(s){const a=s.getParent();if(a!==null)if(a instanceof e.TabSetNode){let l=!1,c=0;const d=a.getChildren();for(let f=0;f0?a>=s.getChildren().length&&s._setSelected(s.getChildren().length-1):al||s._setSelected(-1))}}Or.adjustSelectedIndex=r;function i(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,s=>(s^crypto.getRandomValues(new Uint8Array(1))[0]&15>>s/4).toString(16))}return Or.randomUUID=i,Or}var E_;function bs(){if(E_)return wu;E_=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.BorderNode=void 0;const e=gs,t=ys,n=ni,o=El,r=Sn,i=Jn,s=En,a=vs,l=Cl,c=wa,d=W5();let f=class Vi extends a.Node{static _fromJson(h,p){const g=n.DockLocation.getByName(h.location),b=new Vi(g,h,p);return h.children&&(b._children=h.children.map(y=>{const v=c.TabNode._fromJson(y,p);return v._setParent(b),v})),b}static _createAttributeDefinitions(){const h=new t.AttributeDefinitions;return h.add("type",Vi.TYPE,!0).setType(e.Attribute.STRING).setFixed(),h.add("selected",-1).setType(e.Attribute.NUMBER),h.add("show",!0).setType(e.Attribute.BOOLEAN),h.add("config",void 0).setType("any"),h.addInherited("barSize","borderBarSize").setType(e.Attribute.NUMBER),h.addInherited("enableDrop","borderEnableDrop").setType(e.Attribute.BOOLEAN),h.addInherited("className","borderClassName").setType(e.Attribute.STRING),h.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(e.Attribute.BOOLEAN),h.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(e.Attribute.BOOLEAN),h.addInherited("size","borderSize").setType(e.Attribute.NUMBER),h.addInherited("minSize","borderMinSize").setType(e.Attribute.NUMBER),h.addInherited("enableAutoHide","borderEnableAutoHide").setType(e.Attribute.BOOLEAN),h}constructor(h,p,g){super(g),this._adjustedSize=0,this._calculatedBorderBarSize=0,this._location=h,this._drawChildren=[],this._attributes.id=`border_${h.getName()}`,Vi._attributeDefinitions.fromJson(p,this._attributes),g._addNode(this)}getLocation(){return this._location}getTabHeaderRect(){return this._tabHeaderRect}getRect(){return this._tabHeaderRect}getContentRect(){return this._contentRect}isEnableDrop(){return this._getAttr("enableDrop")}isAutoSelectTab(h){return h==null&&(h=this.getSelected()!==-1),h?this._getAttr("autoSelectTabWhenOpen"):this._getAttr("autoSelectTabWhenClosed")}getClassName(){return this._getAttr("className")}calcBorderBarSize(h){const p=this._getAttr("barSize");p!==0?this._calculatedBorderBarSize=p:this._calculatedBorderBarSize=h.borderBarSize}getBorderBarSize(){return this._calculatedBorderBarSize}getSize(){const h=this._getAttr("size"),p=this.getSelected();if(p===-1)return h;{const g=this._children[p],b=this._location._orientation===r.Orientation.HORZ?g._getAttr("borderWidth"):g._getAttr("borderHeight");return b===-1?h:b}}getMinSize(){return this._getAttr("minSize")}getSelected(){return this._attributes.selected}getSelectedNode(){if(this.getSelected()!==-1)return this._children[this.getSelected()]}getOrientation(){return this._location.getOrientation()}getConfig(){return this._attributes.config}isMaximized(){return!1}isShowing(){return this._attributes.show?!(this._model._getShowHiddenBorder()!==this._location&&this.isAutoHide()&&this._children.length===0):!1}isAutoHide(){return this._getAttr("enableAutoHide")}_setSelected(h){this._attributes.selected=h}_setSize(h){const p=this.getSelected();if(p===-1)this._attributes.size=h;else{const g=this._children[p];(this._location._orientation===r.Orientation.HORZ?g._getAttr("borderWidth"):g._getAttr("borderHeight"))===-1?this._attributes.size=h:this._location._orientation===r.Orientation.HORZ?g._setBorderWidth(h):g._setBorderHeight(h)}}_updateAttrs(h){Vi._attributeDefinitions.update(h,this._attributes)}_getDrawChildren(){return this._drawChildren}_setAdjustedSize(h){this._adjustedSize=h}_getAdjustedSize(){return this._adjustedSize}_layoutBorderOuter(h,p){this.calcBorderBarSize(p);const g=this._location.split(h,this.getBorderBarSize());return this._tabHeaderRect=g.start,g.end}_layoutBorderInner(h,p){this._drawChildren=[];const g=this._location,b=g.split(h,this._adjustedSize+this._model.getSplitterSize()),y=g.reflect().split(b.start,this._model.getSplitterSize());this._contentRect=y.end;for(let v=0;v0){let v=this._children[0],_=v.getTabRect();const w=_.y,S=_.height;let x=this._tabHeaderRect.x,E=0;for(let T=0;T=x&&p0){let v=this._children[0],_=v.getTabRect();const w=_.x,S=_.width;let x=this._tabHeaderRect.y,E=0;for(let T=0;T=x&&g0&&g--;let _=g;_===-1&&(_=this._children.length),h.getType()===c.TabNode.TYPE&&this._addChild(h,_),(b||b!==!1&&this.isAutoSelectTab())&&this._setSelected(_),this._model._tidy()}toJson(){const h={};return Vi._attributeDefinitions.toJson(h,this._attributes),h.location=this._location.getName(),h.children=this._children.map(p=>p.toJson()),h}_getSplitterBounds(h,p=!1){const g=[0,0],b=p?this.getMinSize():0,y=this._model._getOuterInnerRects().outer,v=this._model._getOuterInnerRects().inner,_=this._model.getRoot();return this._location===n.DockLocation.TOP?(g[0]=y.y+b,g[1]=Math.max(g[0],v.getBottom()-h.getHeight()-_.getMinHeight())):this._location===n.DockLocation.LEFT?(g[0]=y.x+b,g[1]=Math.max(g[0],v.getRight()-h.getWidth()-_.getMinWidth())):this._location===n.DockLocation.BOTTOM?(g[1]=y.getBottom()-h.getHeight()-b,g[0]=Math.min(g[1],v.y+_.getMinHeight())):this._location===n.DockLocation.RIGHT&&(g[1]=y.getRight()-h.getWidth()-b,g[0]=Math.min(g[1],v.x+_.getMinWidth())),g}_calculateSplit(h,p){const g=this._getSplitterBounds(h);return this._location===n.DockLocation.BOTTOM||this._location===n.DockLocation.RIGHT?Math.max(0,g[1]-p):Math.max(0,p-g[0])}_getAttributeDefinitions(){return Vi._attributeDefinitions}static getAttributeDefinitions(){return Vi._attributeDefinitions}};return wu.BorderNode=f,f.TYPE="border",f._attributeDefinitions=f._createAttributeDefinitions(),wu}var xm={},Sm={},_s={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.I18nLabel=void 0,function(t){t.Close_Tab="Close",t.Close_Tabset="Close tabset",t.Move_Tab="Move: ",t.Move_Tabset="Move tabset",t.Maximize="Maximize tabset",t.Restore="Restore tabset",t.Float_Tab="Show selected tab in floating window",t.Overflow_Menu_Tooltip="Hidden tabs",t.Floating_Window_Message="This panel is shown in a floating window",t.Floating_Window_Show_Window="Show window",t.Floating_Window_Dock_Window="Dock window",t.Error_rendering_component="Error rendering component"}(e.I18nLabel||(e.I18nLabel={}))})(_s);var Em={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ICloseType=void 0,function(t){t[t.Visible=1]="Visible",t[t.Always=2]="Always",t[t.Selected=3]="Selected"}(e.ICloseType||(e.ICloseType={}))})(Em);var Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});Oo.isAuxMouseEvent=Oo.hideElement=Oo.getRenderStateEx=void 0;const C_=u;function eQ(e,t,n,o,r){let i=n?n(t):void 0,s=t.getName(),a=t.getName();r===void 0&&(r=0);function l(f){return f.titleContent!==void 0}if(o!==void 0){const f=o(t);f!==void 0&&(typeof f=="string"?(s=f,a=f):l(f)?(s=f.titleContent,a=f.name):s=f)}i===void 0&&t.getIcon()!==void 0&&(r!==0?i=C_.createElement("img",{style:{width:"1em",height:"1em",transform:"rotate("+r+"deg)"},src:t.getIcon(),alt:"leadingContent"}):i=C_.createElement("img",{style:{width:"1em",height:"1em"},src:t.getIcon(),alt:"leadingContent"}));const d={leading:i,content:s,name:a,buttons:[]};return e.customizeTab(t,d),t._setRenderedName(d.name),d}Oo.getRenderStateEx=eQ;function tQ(e,t){t?e.visibility="hidden":e.display="none"}Oo.hideElement=tQ;function nQ(e){let t=!1;return e.nativeEvent instanceof MouseEvent&&(e.nativeEvent.button!==0||e.ctrlKey||e.altKey||e.metaKey||e.shiftKey)&&(t=!0),t}Oo.isAuxMouseEvent=nQ;Object.defineProperty(Sm,"__esModule",{value:!0});Sm.BorderButton=void 0;const Cs=u,oQ=_s,ig=hr,rQ=Jn,T_=Em,Ts=En,sg=Oo,iQ=e=>{const{layout:t,node:n,selected:o,border:r,iconFactory:i,titleFactory:s,icons:a,path:l}=e,c=Cs.useRef(null),d=Cs.useRef(null),f=O=>{!(0,sg.isAuxMouseEvent)(O)&&!t.getEditingTab()&&t.dragStart(O,void 0,n,n.isEnableDrag(),p,g)},m=O=>{(0,sg.isAuxMouseEvent)(O)&&t.auxMouseClick(n,O)},h=O=>{t.showContextMenu(n,O)},p=()=>{t.doAction(ig.Actions.selectTab(n.getId()))},g=O=>{},b=()=>{const O=n.getCloseType();return!!(o||O===T_.ICloseType.Always||O===T_.ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)},y=O=>{b()?t.doAction(ig.Actions.deleteTab(n.getId())):p()},v=O=>{O.stopPropagation()};Cs.useLayoutEffect(()=>{_(),t.getEditingTab()===n&&d.current.select()});const _=()=>{var O;const B=t.getDomRect(),C=(O=c.current)===null||O===void 0?void 0:O.getBoundingClientRect();C&&B&&n._setTabRect(new rQ.Rect(C.left-B.left,C.top-B.top,C.width,C.height))},w=O=>{O.stopPropagation()},S=O=>{O.code==="Escape"?t.setEditingTab(void 0):O.code==="Enter"&&(t.setEditingTab(void 0),t.doAction(ig.Actions.renameTab(n.getId(),O.target.value)))},x=t.getClassName;let E=x(Ts.CLASSES.FLEXLAYOUT__BORDER_BUTTON)+" "+x(Ts.CLASSES.FLEXLAYOUT__BORDER_BUTTON_+r);o?E+=" "+x(Ts.CLASSES.FLEXLAYOUT__BORDER_BUTTON__SELECTED):E+=" "+x(Ts.CLASSES.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),n.getClassName()!==void 0&&(E+=" "+n.getClassName());let T=0;n.getModel().isEnableRotateBorderIcons()===!1&&(r==="left"?T=90:r==="right"&&(T=-90));const N=(0,sg.getRenderStateEx)(t,n,i,s,T);let I=N.content?Cs.createElement("div",{className:x(Ts.CLASSES.FLEXLAYOUT__BORDER_BUTTON_CONTENT)},N.content):null;const R=N.leading?Cs.createElement("div",{className:x(Ts.CLASSES.FLEXLAYOUT__BORDER_BUTTON_LEADING)},N.leading):null;if(t.getEditingTab()===n&&(I=Cs.createElement("input",{ref:d,className:x(Ts.CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":l+"/textbox",type:"text",autoFocus:!0,defaultValue:n.getName(),onKeyDown:S,onMouseDown:w,onTouchStart:w})),n.isEnableClose()){const O=t.i18nName(oQ.I18nLabel.Close_Tab);N.buttons.push(Cs.createElement("div",{key:"close","data-layout-path":l+"/button/close",title:O,className:x(Ts.CLASSES.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onMouseDown:v,onClick:y,onTouchStart:v},typeof a.close=="function"?a.close(n):a.close))}return Cs.createElement("div",{ref:c,"data-layout-path":l,className:E,onMouseDown:f,onClick:m,onAuxClick:m,onContextMenu:h,onTouchStart:f,title:n.getHelpText()},R,I,N.buttons)};Sm.BorderButton=iQ;var D1={},z1={};Object.defineProperty(z1,"__esModule",{value:!0});z1.TabButtonStamp=void 0;const Nf=u,ag=En,sQ=Oo,aQ=e=>{const{layout:t,node:n,iconFactory:o,titleFactory:r}=e,i=Nf.useRef(null),s=t.getClassName;let a=s(ag.CLASSES.FLEXLAYOUT__TAB_BUTTON_STAMP);const l=(0,sQ.getRenderStateEx)(t,n,o,r);let c=l.content?Nf.createElement("div",{className:s(ag.CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT)},l.content):n._getNameForOverflowMenu();const d=l.leading?Nf.createElement("div",{className:s(ag.CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING)},l.leading):null;return Nf.createElement("div",{ref:i,className:a,title:n.getHelpText()},d,c)};z1.TabButtonStamp=aQ;Object.defineProperty(D1,"__esModule",{value:!0});D1.showPopup=void 0;const L0=u,lg=Sl,Py=En,lQ=z1;function cQ(e,t,n,o,r,i){var s;const a=o.getRootDiv(),l=o.getClassName,c=e.ownerDocument,d=e.getBoundingClientRect(),f=(s=a?.getBoundingClientRect())!==null&&s!==void 0?s:new DOMRect(0,0,100,100),m=c.createElement("div");m.className=l(Py.CLASSES.FLEXLAYOUT__POPUP_MENU_CONTAINER),d.lefth()),lg.DragDrop.instance.setGlassCursorOverride("default"),a&&a.appendChild(m);const h=()=>{o.hidePortal(),lg.DragDrop.instance.hideGlass(),a&&a.removeChild(m),m.removeEventListener("mousedown",p),c.removeEventListener("mousedown",g)},p=b=>{b.stopPropagation()},g=b=>{h()};m.addEventListener("mousedown",p),c.addEventListener("mousedown",g),o.showPortal(L0.createElement(uQ,{currentDocument:c,onSelect:n,onHide:h,items:t,classNameMapper:l,layout:o,iconFactory:r,titleFactory:i}),m)}D1.showPopup=cQ;const uQ=e=>{const{items:t,onHide:n,onSelect:o,classNameMapper:r,layout:i,iconFactory:s,titleFactory:a}=e,l=(d,f)=>{o(d),n(),f.stopPropagation()},c=t.map((d,f)=>L0.createElement("div",{key:d.index,className:r(Py.CLASSES.FLEXLAYOUT__POPUP_MENU_ITEM),"data-layout-path":"/popup-menu/tb"+f,onClick:m=>l(d,m),title:d.node.getHelpText()},d.node.getModel().isLegacyOverflowMenu()?d.node._getNameForOverflowMenu():L0.createElement(lQ.TabButtonStamp,{node:d.node,layout:i,iconFactory:s,titleFactory:a})));return L0.createElement("div",{className:r(Py.CLASSES.FLEXLAYOUT__POPUP_MENU),"data-layout-path":"/popup-menu"},c)};var P1={};Object.defineProperty(P1,"__esModule",{value:!0});P1.useTabOverflow=void 0;const Dr=u,dQ=Jn,k_=xa(),cg=Sn,fQ=(e,t,n,o)=>{const r=Dr.useRef(!0),i=Dr.useRef(!1),s=Dr.useRef(new dQ.Rect(0,0,0,0)),a=Dr.useRef(null),[l,c]=Dr.useState(0),d=Dr.useRef(!1),[f,m]=Dr.useState([]),h=Dr.useRef(0);Dr.useLayoutEffect(()=>{d.current=!1},[e.getSelectedNode(),e.getRect().width,e.getRect().height]),Dr.useLayoutEffect(()=>{_()});const p=a.current;Dr.useEffect(()=>{if(p)return p.addEventListener("wheel",g,{passive:!1}),()=>{p.removeEventListener("wheel",g)}},[p]);const g=S=>{S.preventDefault()},b=S=>t===cg.Orientation.HORZ?S.x:S.y,y=S=>t===cg.Orientation.HORZ?S.getRight():S.getBottom(),v=S=>t===cg.Orientation.HORZ?S.width:S.height,_=()=>{r.current===!0&&(i.current=!1);const x=e instanceof k_.TabSetNode?e.getRect():e.getTabHeaderRect();let E=e.getChildren()[e.getChildren().length-1];const T=o.current===null?0:v(o.current.getBoundingClientRect());if(r.current===!0||h.current===0&&f.length!==0||x.width!==s.current.width||x.height!==s.current.height){h.current=f.length,s.current=x;const N=e instanceof k_.TabSetNode?e.isEnableTabStrip()===!0:!0;let I=y(x)-T;if(n.current!==null&&(I-=v(n.current.getBoundingClientRect())),N&&e.getChildren().length>0){if(f.length===0&&l===0&&y(E.getTabRect())+2=I-b(x)?R=b(x)-z:(L>I||zI&&(R=I-L))}const B=Math.max(0,I-(y(E.getTabRect())+2+R)),C=Math.min(0,l+R+B),M=C-l,A=[];for(let $=0;$I)&&A.push({node:z,index:$})}A.length>0&&(i.current=!0),r.current=!1,m(A),c(C)}}else r.current=!0};return{selfRef:a,position:l,userControlledLeft:d,hiddenTabs:f,onMouseWheel:S=>{let x=0;Math.abs(S.deltaX)>Math.abs(S.deltaY)?x=-S.deltaX:x=-S.deltaY,S.deltaMode===1&&(x*=40),c(l+x),d.current=!0,S.stopPropagation()},tabsTruncated:i.current}};P1.useTabOverflow=fQ;Object.defineProperty(xm,"__esModule",{value:!0});xm.BorderTabSet=void 0;const Zn=u,L_=ni,pQ=Sm,hQ=D1,I_=hr,N_=_s,mQ=P1,gQ=Sn,$n=En,yQ=Oo,vQ=e=>{const{border:t,layout:n,iconFactory:o,titleFactory:r,icons:i,path:s}=e,a=Zn.useRef(null),l=Zn.useRef(null),c=Zn.useRef(null),{selfRef:d,position:f,userControlledLeft:m,hiddenTabs:h,onMouseWheel:p,tabsTruncated:g}=(0,mQ.useTabOverflow)(t,gQ.Orientation.flip(t.getOrientation()),a,c),b=z=>{(0,yQ.isAuxMouseEvent)(z)&&n.auxMouseClick(t,z)},y=z=>{n.showContextMenu(t,z)},v=z=>{z.stopPropagation()},_=z=>{const L=n.getShowOverflowMenu();if(L!==void 0)L(t,z,h,w);else{const D=l.current;(0,hQ.showPopup)(D,h,w,n,o,r)}z.stopPropagation()},w=z=>{n.doAction(I_.Actions.selectTab(z.node.getId())),m.current=!1},S=z=>{const L=t.getChildren()[t.getSelected()];L!==void 0&&n.doAction(I_.Actions.floatTab(L.getId())),z.stopPropagation()},x=n.getClassName;let E=t.getTabHeaderRect().styleWithPosition({});const T=[],N=z=>{let L=t.getSelected()===z,D=t.getChildren()[z];T.push(Zn.createElement(pQ.BorderButton,{layout:n,border:t.getLocation().getName(),node:D,path:s+"/tb"+z,key:D.getId(),selected:L,iconFactory:o,titleFactory:r,icons:i})),z0&&(g?R=[...O,...R]:T.push(Zn.createElement("div",{ref:c,key:"sticky_buttons_container",onMouseDown:v,onTouchStart:v,onDragStart:z=>{z.preventDefault()},className:x($n.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},O))),h.length>0){const z=n.i18nName(N_.I18nLabel.Overflow_Menu_Tooltip);let L;typeof i.more=="function"?L=i.more(t,h):L=Zn.createElement(Zn.Fragment,null,i.more,Zn.createElement("div",{className:x($n.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},h.length)),R.splice(Math.min(B.overflowPosition,R.length),0,Zn.createElement("button",{key:"overflowbutton",ref:l,className:x($n.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+x($n.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+x($n.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+t.getLocation().getName()),title:z,onClick:_,onMouseDown:v,onTouchStart:v},L))}const C=t.getSelected();if(C!==-1){const z=t.getChildren()[C];if(z!==void 0&&n.isSupportsPopout()&&z.isEnableFloat()&&!z.isFloating()){const L=n.i18nName(N_.I18nLabel.Float_Tab);R.push(Zn.createElement("button",{key:"float",title:L,className:x($n.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+x($n.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:S,onMouseDown:v,onTouchStart:v},typeof i.popout=="function"?i.popout(z):i.popout))}}const M=Zn.createElement("div",{key:"toolbar",ref:a,className:x($n.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR)+" "+x($n.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_+t.getLocation().getName())},R);E=n.styleFont(E);let A={};const $=t.getBorderBarSize()-1;return t.getLocation()===L_.DockLocation.LEFT?A={right:$,height:$,top:f}:t.getLocation()===L_.DockLocation.RIGHT?A={left:$,height:$,top:f}:A={height:$,left:f},Zn.createElement("div",{ref:d,dir:"ltr",style:E,className:I,"data-layout-path":s,onClick:b,onAuxClick:b,onContextMenu:y,onWheel:p},Zn.createElement("div",{style:{height:$},className:x($n.CLASSES.FLEXLAYOUT__BORDER_INNER)+" "+x($n.CLASSES.FLEXLAYOUT__BORDER_INNER_+t.getLocation().getName())},Zn.createElement("div",{style:A,className:x($n.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+x($n.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+t.getLocation().getName())},T)),M)};xm.BorderTabSet=vQ;var Cm={};Object.defineProperty(Cm,"__esModule",{value:!0});Cm.Splitter=void 0;const Eu=u,R_=Sl,M_=hr,A_=bs(),Bi=Sn,Cu=En,bQ=e=>{const{layout:t,node:n,path:o}=e,r=Eu.useRef([]),i=Eu.useRef(void 0),s=n.getParent(),a=_=>{var w;R_.DragDrop.instance.setGlassCursorOverride(n.getOrientation()===Bi.Orientation.HORZ?"ns-resize":"ew-resize"),R_.DragDrop.instance.startDrag(_,c,d,m,l,void 0,void 0,t.getCurrentDocument(),(w=t.getRootDiv())!==null&&w!==void 0?w:void 0),r.current=s._getSplitterBounds(n,!0);const S=t.getRootDiv();i.current=t.getCurrentDocument().createElement("div"),i.current.style.position="absolute",i.current.className=t.getClassName(Cu.CLASSES.FLEXLAYOUT__SPLITTER_DRAG),i.current.style.cursor=n.getOrientation()===Bi.Orientation.HORZ?"ns-resize":"ew-resize";const x=n.getRect();n.getOrientation()===Bi.Orientation.VERT&&x.width<2?x.width=2:n.getOrientation()===Bi.Orientation.HORZ&&x.height<2&&(x.height=2),x.positionElement(i.current),S&&S.appendChild(i.current)},l=_=>{const w=t.getRootDiv();w&&w.removeChild(i.current)},c=()=>!0,d=_=>{const w=t.getDomRect();if(!w)return;const S={x:_.clientX-w.left,y:_.clientY-w.top};i&&(n.getOrientation()===Bi.Orientation.HORZ?i.current.style.top=h(S.y-4)+"px":i.current.style.left=h(S.x-4)+"px"),t.isRealtimeResize()&&f()},f=()=>{let _=0;if(i&&(n.getOrientation()===Bi.Orientation.HORZ?_=i.current.offsetTop:_=i.current.offsetLeft),s instanceof A_.BorderNode){const w=s._calculateSplit(n,_);t.doAction(M_.Actions.adjustBorderSplit(n.getParent().getId(),w))}else{const w=s._calculateSplit(n,_);w!==void 0&&t.doAction(M_.Actions.adjustSplit(w))}},m=()=>{f();const _=t.getRootDiv();_&&_.removeChild(i.current)},h=_=>{const w=r.current;let S=_;return _w[1]&&(S=w[1]),S},p=t.getClassName;let g=n.getRect();const b=g.styleWithPosition({cursor:n.getOrientation()===Bi.Orientation.HORZ?"ns-resize":"ew-resize"});let y=p(Cu.CLASSES.FLEXLAYOUT__SPLITTER)+" "+p(Cu.CLASSES.FLEXLAYOUT__SPLITTER_+n.getOrientation().getName());s instanceof A_.BorderNode?y+=" "+p(Cu.CLASSES.FLEXLAYOUT__SPLITTER_BORDER):n.getModel().getMaximizedTabset()!==void 0&&(b.display="none");const v=n.getModel().getSplitterExtra();if(v===0)return Eu.createElement("div",{style:b,"data-layout-path":o,className:y,onTouchStart:a,onMouseDown:a});{let _=g.clone();_.x=0,_.y=0,n.getOrientation()===Bi.Orientation.VERT?_.width+=v:_.height+=v;const w=_.styleWithPosition({cursor:n.getOrientation()===Bi.Orientation.HORZ?"ns-resize":"ew-resize"}),S=p(Cu.CLASSES.FLEXLAYOUT__SPLITTER_EXTRA);return Eu.createElement("div",{style:b,"data-layout-path":o,className:y},Eu.createElement("div",{style:w,className:S,onTouchStart:a,onMouseDown:a}))}};Cm.Splitter=bQ;var Tm={},B1={};Object.defineProperty(B1,"__esModule",{value:!0});B1.ErrorBoundary=void 0;const ug=u,O_=En;class _Q extends ug.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.debug(t),console.debug(n)}render(){return this.state.hasError?ug.createElement("div",{className:O_.CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER},ug.createElement("div",{className:O_.CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT},this.props.message)):this.props.children}}B1.ErrorBoundary=_Q;Object.defineProperty(Tm,"__esModule",{value:!0});Tm.Tab=void 0;const Tu=u,wQ=u,xQ=hr,D_=xa(),dg=En,SQ=B1,EQ=_s,CQ=bs(),z_=Oo,TQ=e=>{const{layout:t,selected:n,node:o,factory:r,path:i}=e,[s,a]=Tu.useState(!e.node.isEnableRenderOnDemand()||e.selected);Tu.useLayoutEffect(()=>{!s&&n&&a(!0)});const l=()=>{const g=o.getParent();g.getType()===D_.TabSetNode.TYPE&&(g.isActive()||t.doAction(xQ.Actions.setActiveTabset(g.getId())))},c=t.getClassName,d=o.getModel().isUseVisibility(),f=o.getParent(),m=o._styleWithPosition();n||(0,z_.hideElement)(m,d),f instanceof D_.TabSetNode&&o.getModel().getMaximizedTabset()!==void 0&&!f.isMaximized()&&(0,z_.hideElement)(m,d);let h;s&&(h=r(o));let p=c(dg.CLASSES.FLEXLAYOUT__TAB);return f instanceof CQ.BorderNode&&(p+=" "+c(dg.CLASSES.FLEXLAYOUT__TAB_BORDER),p+=" "+c(dg.CLASSES.FLEXLAYOUT__TAB_BORDER_+f.getLocation().getName())),o.getContentClassName()!==void 0&&(p+=" "+o.getContentClassName()),Tu.createElement("div",{className:p,"data-layout-path":i,onMouseDown:l,onTouchStart:l,style:m},Tu.createElement(SQ.ErrorBoundary,{message:e.layout.i18nName(EQ.I18nLabel.Error_rendering_component)},Tu.createElement(wQ.Fragment,null,h)))};Tm.Tab=TQ;var km={},Lm={};Object.defineProperty(Lm,"__esModule",{value:!0});Lm.TabButton=void 0;const ks=u,kQ=_s,fg=hr,LQ=Jn,P_=Em,Ml=En,pg=Oo,IQ=e=>{const{layout:t,node:n,selected:o,iconFactory:r,titleFactory:i,icons:s,path:a}=e,l=ks.useRef(null),c=ks.useRef(null),d=M=>{!(0,pg.isAuxMouseEvent)(M)&&!t.getEditingTab()&&t.dragStart(M,void 0,n,n.isEnableDrag(),h,p)},f=M=>{(0,pg.isAuxMouseEvent)(M)&&t.auxMouseClick(n,M)},m=M=>{t.showContextMenu(n,M)},h=()=>{t.doAction(fg.Actions.selectTab(n.getId()))},p=M=>{n.isEnableRename()&&g()},g=()=>{t.setEditingTab(n),t.getCurrentDocument().body.addEventListener("mousedown",b),t.getCurrentDocument().body.addEventListener("touchstart",b)},b=M=>{M.target!==c.current&&(t.getCurrentDocument().body.removeEventListener("mousedown",b),t.getCurrentDocument().body.removeEventListener("touchstart",b),t.setEditingTab(void 0))},y=()=>{const M=n.getCloseType();return!!(o||M===P_.ICloseType.Always||M===P_.ICloseType.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)},v=M=>{y()?t.doAction(fg.Actions.deleteTab(n.getId())):h()},_=M=>{M.stopPropagation()};ks.useLayoutEffect(()=>{w(),t.getEditingTab()===n&&c.current.select()});const w=()=>{var M;const A=t.getDomRect(),$=(M=l.current)===null||M===void 0?void 0:M.getBoundingClientRect();$&&A&&n._setTabRect(new LQ.Rect($.left-A.left,$.top-A.top,$.width,$.height))},S=M=>{M.stopPropagation()},x=M=>{M.code==="Escape"?t.setEditingTab(void 0):M.code==="Enter"&&(t.setEditingTab(void 0),t.doAction(fg.Actions.renameTab(n.getId(),M.target.value)))},E=t.getClassName,T=n.getParent(),N=T.isEnableSingleTabStretch()&&T.getChildren().length===1;let I=N?Ml.CLASSES.FLEXLAYOUT__TAB_BUTTON_STRETCH:Ml.CLASSES.FLEXLAYOUT__TAB_BUTTON,R=E(I);R+=" "+E(I+"_"+T.getTabLocation()),N||(o?R+=" "+E(I+"--selected"):R+=" "+E(I+"--unselected")),n.getClassName()!==void 0&&(R+=" "+n.getClassName());const O=(0,pg.getRenderStateEx)(t,n,r,i);let B=O.content?ks.createElement("div",{className:E(Ml.CLASSES.FLEXLAYOUT__TAB_BUTTON_CONTENT)},O.content):null;const C=O.leading?ks.createElement("div",{className:E(Ml.CLASSES.FLEXLAYOUT__TAB_BUTTON_LEADING)},O.leading):null;if(t.getEditingTab()===n&&(B=ks.createElement("input",{ref:c,className:E(Ml.CLASSES.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":a+"/textbox",type:"text",autoFocus:!0,defaultValue:n.getName(),onKeyDown:x,onMouseDown:S,onTouchStart:S})),n.isEnableClose()&&!N){const M=t.i18nName(kQ.I18nLabel.Close_Tab);O.buttons.push(ks.createElement("div",{key:"close","data-layout-path":a+"/button/close",title:M,className:E(Ml.CLASSES.FLEXLAYOUT__TAB_BUTTON_TRAILING),onMouseDown:_,onClick:v,onTouchStart:_},typeof s.close=="function"?s.close(n):s.close))}return ks.createElement("div",{ref:l,"data-layout-path":a,className:R,onMouseDown:d,onClick:f,onAuxClick:f,onContextMenu:m,onTouchStart:d,title:n.getHelpText()},C,B,O.buttons)};Lm.TabButton=IQ;Object.defineProperty(km,"__esModule",{value:!0});km.TabSet=void 0;const _t=u,Ca=_s,ku=hr,NQ=D1,RQ=Lm,MQ=P1,AQ=Sn,wt=En,hg=Oo,OQ=e=>{const{node:t,layout:n,iconFactory:o,titleFactory:r,icons:i,path:s}=e,a=_t.useRef(null),l=_t.useRef(null),c=_t.useRef(null),d=_t.useRef(null),{selfRef:f,position:m,userControlledLeft:h,hiddenTabs:p,onMouseWheel:g,tabsTruncated:b}=(0,MQ.useTabOverflow)(t,AQ.Orientation.HORZ,a,d),y=Y=>{const Z=n.getShowOverflowMenu();if(Z!==void 0)Z(t,Y,p,v);else{const oe=l.current;(0,NQ.showPopup)(oe,p,v,n,o,r)}Y.stopPropagation()},v=Y=>{n.doAction(ku.Actions.selectTab(Y.node.getId())),h.current=!1},_=Y=>{if(!(0,hg.isAuxMouseEvent)(Y)){let Z=t.getName();if(Z===void 0?Z="":Z=": "+Z,n.doAction(ku.Actions.setActiveTabset(t.getId())),!n.getEditingTab()){const oe=n.i18nName(Ca.I18nLabel.Move_Tabset,Z);t.getModel().getMaximizedTabset()!==void 0?n.dragStart(Y,oe,t,!1,ce=>{},R):n.dragStart(Y,oe,t,t.isEnableDrag(),ce=>{},R)}}},w=Y=>{(0,hg.isAuxMouseEvent)(Y)&&n.auxMouseClick(t,Y)},S=Y=>{n.showContextMenu(t,Y)},x=Y=>{Y.stopPropagation()},E=Y=>{t.canMaximize()&&n.maximize(t),Y.stopPropagation()},T=Y=>{n.doAction(ku.Actions.deleteTabset(t.getId())),Y.stopPropagation()},N=Y=>{n.doAction(ku.Actions.deleteTab(t.getChildren()[0].getId())),Y.stopPropagation()},I=Y=>{B!==void 0&&n.doAction(ku.Actions.floatTab(B.getId())),Y.stopPropagation()},R=Y=>{t.canMaximize()&&n.maximize(t)},O=n.getClassName;c.current!==null&&c.current.scrollLeft!==0&&(c.current.scrollLeft=0);const B=t.getSelectedNode();let C=t._styleWithPosition();t.getModel().getMaximizedTabset()!==void 0&&!t.isMaximized()&&(0,hg.hideElement)(C,t.getModel().isUseVisibility());const M=[];if(t.isEnableTabStrip())for(let Y=0;Y0&&(b||V?z=[...$,...z]:M.push(_t.createElement("div",{ref:d,key:"sticky_buttons_container",onMouseDown:x,onTouchStart:x,onDragStart:Y=>{Y.preventDefault()},className:O(wt.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},$))),p.length>0){const Y=n.i18nName(Ca.I18nLabel.Overflow_Menu_Tooltip);let Z;typeof i.more=="function"?Z=i.more(t,p):Z=_t.createElement(_t.Fragment,null,i.more,_t.createElement("div",{className:O(wt.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},p.length)),z.splice(Math.min(D.overflowPosition,z.length),0,_t.createElement("button",{key:"overflowbutton","data-layout-path":s+"/button/overflow",ref:l,className:O(wt.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+O(wt.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:Y,onClick:y,onMouseDown:x,onTouchStart:x},Z))}if(B!==void 0&&n.isSupportsPopout()&&B.isEnableFloat()&&!B.isFloating()){const Y=n.i18nName(Ca.I18nLabel.Float_Tab);z.push(_t.createElement("button",{key:"float","data-layout-path":s+"/button/float",title:Y,className:O(wt.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+O(wt.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:I,onMouseDown:x,onTouchStart:x},typeof i.popout=="function"?i.popout(B):i.popout))}if(t.canMaximize()){const Y=n.i18nName(Ca.I18nLabel.Restore),Z=n.i18nName(Ca.I18nLabel.Maximize);(A?L:z).push(_t.createElement("button",{key:"max","data-layout-path":s+"/button/max",title:t.isMaximized()?Y:Z,className:O(wt.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+O(wt.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(t.isMaximized()?"max":"min")),onClick:E,onMouseDown:x,onTouchStart:x},t.isMaximized()?typeof i.restore=="function"?i.restore(t):i.restore:typeof i.maximize=="function"?i.maximize(t):i.maximize))}if(!t.isMaximized()&&G){const Y=V?n.i18nName(Ca.I18nLabel.Close_Tab):n.i18nName(Ca.I18nLabel.Close_Tabset);(A?L:z).push(_t.createElement("button",{key:"close","data-layout-path":s+"/button/close",title:Y,className:O(wt.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+O(wt.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:V?N:T,onMouseDown:x,onTouchStart:x},typeof i.closeTabset=="function"?i.closeTabset(t):i.closeTabset))}const U=_t.createElement("div",{key:"toolbar",ref:a,className:O(wt.CLASSES.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:x,onTouchStart:x,onDragStart:Y=>{Y.preventDefault()}},z);let W,H,q=O(wt.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(t.getClassNameTabStrip()!==void 0&&(q+=" "+t.getClassNameTabStrip()),q+=" "+wt.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER_+t.getTabLocation(),t.isActive()&&!A&&(q+=" "+O(wt.CLASSES.FLEXLAYOUT__TABSET_SELECTED)),t.isMaximized()&&!A&&(q+=" "+O(wt.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED)),V){const Y=t.getChildren()[0];Y.getTabSetClassName()!==void 0&&(q+=" "+Y.getTabSetClassName())}if(A){const Y=_t.createElement("div",{key:"toolbar",ref:a,className:O(wt.CLASSES.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:x,onTouchStart:x,onDragStart:oe=>{oe.preventDefault()}},L);let Z=O(wt.CLASSES.FLEXLAYOUT__TABSET_HEADER);t.isActive()&&(Z+=" "+O(wt.CLASSES.FLEXLAYOUT__TABSET_SELECTED)),t.isMaximized()&&(Z+=" "+O(wt.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED)),t.getClassNameHeader()!==void 0&&(Z+=" "+t.getClassNameHeader()),W=_t.createElement("div",{className:Z,style:{height:t.getHeaderHeight()+"px"},"data-layout-path":s+"/header",onMouseDown:_,onContextMenu:S,onClick:w,onAuxClick:w,onTouchStart:_},_t.createElement("div",{className:O(wt.CLASSES.FLEXLAYOUT__TABSET_HEADER_CONTENT)},F),Y)}const j={height:t.getTabStripHeight()+"px"};H=_t.createElement("div",{className:q,style:j,"data-layout-path":s+"/tabstrip",onMouseDown:_,onContextMenu:S,onClick:w,onAuxClick:w,onTouchStart:_},_t.createElement("div",{ref:c,className:O(wt.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+O(wt.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_+t.getTabLocation())},_t.createElement("div",{style:{left:m,width:V?"100%":"10000px"},className:O(wt.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+O(wt.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+t.getTabLocation())},M)),U),C=n.styleFont(C);var X=void 0;if(t.getChildren().length===0){const Y=n.getTabSetPlaceHolderCallback();Y&&(X=Y(t))}const J=_t.createElement("div",{className:O(wt.CLASSES.FLEXLAYOUT__TABSET_CONTENT)},X);var K;return t.getTabLocation()==="top"?K=_t.createElement(_t.Fragment,null,W,H,J):K=_t.createElement(_t.Fragment,null,W,J,H),_t.createElement("div",{ref:f,dir:"ltr","data-layout-path":s,style:C,className:O(wt.CLASSES.FLEXLAYOUT__TABSET),onWheel:g},K)};km.TabSet=OQ;var Im={};Object.defineProperty(Im,"__esModule",{value:!0});Im.FloatingWindow=void 0;const Rf=u,DQ=In,zQ=Jn,PQ=En,BQ=e=>{const{title:t,id:n,url:o,rect:r,onCloseWindow:i,onSetWindow:s,children:a}=e,l=Rf.useRef(null),c=Rf.useRef(null),[d,f]=Rf.useState(void 0);return Rf.useLayoutEffect(()=>{c.current&&clearTimeout(c.current);let m=!0;const h=r||new zQ.Rect(0,0,100,100),p=Array.from(window.document.styleSheets).reduce((g,b)=>{let y;try{y=b.cssRules}catch{}try{return[...g,{href:b.href,type:b.type,rules:y?Array.from(y).map(v=>v.cssText):null}]}catch{return g}},[]);return l.current=window.open(o,n,`left=${h.x},top=${h.y},width=${h.width},height=${h.height}`),l.current!==null?(s(n,l.current),window.addEventListener("beforeunload",()=>{l.current&&(l.current.close(),l.current=null)}),l.current.addEventListener("load",()=>{if(m){const g=l.current.document;g.title=t;const b=g.createElement("div");b.className=PQ.CLASSES.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,g.body.appendChild(b),FQ(g,p).then(()=>{f(b)}),l.current.addEventListener("beforeunload",()=>{i(n)})}})):(console.warn(`Unable to open window ${o}`),i(n)),()=>{m=!1,c.current=setTimeout(()=>{l.current&&(l.current.close(),l.current=null)},0)}},[]),d!==void 0?(0,DQ.createPortal)(a,d):null};Im.FloatingWindow=BQ;function FQ(e,t){const n=e.head,o=[];for(const r of t)if(r.href){const i=e.createElement("link");i.type=r.type,i.rel="stylesheet",i.href=r.href,n.appendChild(i),o.push(new Promise(s=>{i.onload=()=>s(!0)}))}else if(r.rules){const i=e.createElement("style");for(const s of r.rules)i.appendChild(e.createTextNode(s));n.appendChild(i)}return Promise.all(o)}var Nm={};Object.defineProperty(Nm,"__esModule",{value:!0});Nm.FloatingWindowTab=void 0;const mg=u,$Q=B1,HQ=_s,VQ=u,UQ=En,jQ=e=>{const{layout:t,node:n,factory:o}=e,r=t.getClassName,i=o(n);return mg.createElement("div",{className:r(UQ.CLASSES.FLEXLAYOUT__FLOATING_WINDOW_TAB)},mg.createElement($Q.ErrorBoundary,{message:e.layout.i18nName(HQ.I18nLabel.Error_rendering_component)},mg.createElement(VQ.Fragment,null,i)))};Nm.FloatingWindowTab=jQ;var Rm={};Object.defineProperty(Rm,"__esModule",{value:!0});Rm.TabFloating=void 0;const Ls=u,B_=hr,F_=xa(),gg=En,yg=_s,$_=Oo,WQ=e=>{const{layout:t,selected:n,node:o,path:r}=e,i=()=>{o.getWindow()&&o.getWindow().focus()},s=()=>{t.doAction(B_.Actions.unFloatTab(o.getId()))},a=()=>{const y=o.getParent();y.getType()===F_.TabSetNode.TYPE&&(y.isActive()||t.doAction(B_.Actions.setActiveTabset(y.getId())))},l=y=>{y.preventDefault(),i()},c=y=>{y.preventDefault(),s()},d=t.getClassName,f=o.getParent(),m=o._styleWithPosition();n||(0,$_.hideElement)(m,o.getModel().isUseVisibility()),f instanceof F_.TabSetNode&&o.getModel().getMaximizedTabset()!==void 0&&!f.isMaximized()&&(0,$_.hideElement)(m,o.getModel().isUseVisibility());const h=t.i18nName(yg.I18nLabel.Floating_Window_Message),p=t.i18nName(yg.I18nLabel.Floating_Window_Show_Window),g=t.i18nName(yg.I18nLabel.Floating_Window_Dock_Window),b=t.getOnRenderFloatingTabPlaceholder();return b?Ls.createElement("div",{className:d(gg.CLASSES.FLEXLAYOUT__TAB_FLOATING),onMouseDown:a,onTouchStart:a,style:m},b(s,i)):Ls.createElement("div",{className:d(gg.CLASSES.FLEXLAYOUT__TAB_FLOATING),"data-layout-path":r,onMouseDown:a,onTouchStart:a,style:m},Ls.createElement("div",{className:d(gg.CLASSES.FLEXLAYOUT__TAB_FLOATING_INNER)},Ls.createElement("div",null,h),Ls.createElement("div",null,Ls.createElement("a",{href:"#",onClick:l},p)),Ls.createElement("div",null,Ls.createElement("a",{href:"#",onClick:c},g))))};Rm.TabFloating=WQ;var Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.RestoreIcon=Co.PopoutIcon=Co.EdgeIcon=Co.OverflowIcon=Co.MaximizeIcon=Co.CloseIcon=void 0;const An=u,F1={width:"1em",height:"1em",display:"flex",alignItems:"center"},GQ=()=>An.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:F1,viewBox:"0 0 24 24"},An.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),An.createElement("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}));Co.CloseIcon=GQ;const qQ=()=>An.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:F1,viewBox:"0 0 24 24",fill:"var(--color-icon)"},An.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),An.createElement("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}));Co.MaximizeIcon=qQ;const YQ=()=>An.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:F1,viewBox:"0 0 24 24",fill:"var(--color-icon)"},An.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),An.createElement("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"}));Co.OverflowIcon=YQ;const XQ=()=>An.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"block",width:10,height:10},preserveAspectRatio:"none",viewBox:"0 0 100 100"},An.createElement("path",{fill:"var(--color-edge-icon)",stroke:"var(--color-edge-icon)",d:"M10 30 L90 30 l-40 40 Z"}));Co.EdgeIcon=XQ;const JQ=()=>An.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:F1,viewBox:"0 0 20 20",fill:"var(--color-icon)"},An.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),An.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}));Co.PopoutIcon=JQ;const ZQ=()=>An.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:F1,viewBox:"0 0 24 24",fill:"var(--color-icon)"},An.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),An.createElement("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));Co.RestoreIcon=ZQ;Object.defineProperty(bm,"__esModule",{value:!0});bm.Layout=void 0;const ke=u,KQ=In,zr=ni,Is=Sl,Al=hr,QQ=bs(),H_=Cl,Ns=wa,V_=xa(),Mf=Jn,bo=En,eee=xm,U_=Cm,j_=Tm,tee=km,W_=Im,G_=Nm,q_=Rm,vg=Sn,Ta=Co,nee=z1,oee={close:ke.createElement(Ta.CloseIcon,null),closeTabset:ke.createElement(Ta.CloseIcon,null),popout:ke.createElement(Ta.PopoutIcon,null),maximize:ke.createElement(Ta.MaximizeIcon,null),restore:ke.createElement(Ta.RestoreIcon,null),more:ke.createElement(Ta.OverflowIcon,null),edgeArrow:ke.createElement(Ta.EdgeIcon,null)},ree=typeof window<"u"&&(window.document.documentMode||/Edge\//.test(window.navigator.userAgent)),iee=typeof window<"u"&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches,see=iee&&!ree;class aee extends ke.Component{constructor(t){super(t),this.firstMove=!1,this.dragRectRendered=!0,this.dragDivText=void 0,this.edgeRectLength=100,this.edgeRectWidth=10,this.onModelChange=n=>{this.forceUpdate(),this.props.onModelChange&&this.props.onModelChange(this.props.model,n)},this.updateRect=n=>{if(n||(n=this.getDomRect()),!n)return;const o=new Mf.Rect(0,0,n.width,n.height);!o.equals(this.state.rect)&&o.width!==0&&o.height!==0&&this.setState({rect:o})},this.updateLayoutMetrics=()=>{if(this.findHeaderBarSizeRef.current){const n=this.findHeaderBarSizeRef.current.getBoundingClientRect().height;n!==this.state.calculatedHeaderBarSize&&this.setState({calculatedHeaderBarSize:n})}if(this.findTabBarSizeRef.current){const n=this.findTabBarSizeRef.current.getBoundingClientRect().height;n!==this.state.calculatedTabBarSize&&this.setState({calculatedTabBarSize:n})}if(this.findBorderBarSizeRef.current){const n=this.findBorderBarSizeRef.current.getBoundingClientRect().height;n!==this.state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:n})}},this.getClassName=n=>this.props.classNameMapper===void 0?n:this.props.classNameMapper(n),this.onCloseWindow=n=>{this.doAction(Al.Actions.unFloatTab(n));try{this.props.model.getNodeById(n)._setWindow(void 0)}catch{}},this.onSetWindow=(n,o)=>{this.props.model.getNodeById(n)._setWindow(o)},this.onCancelAdd=()=>{var n,o;const r=this.selfRef.current;r&&this.dragDiv&&r.removeChild(this.dragDiv),this.dragDiv=void 0,this.hidePortal(),this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{(o=(n=this.customDrop)===null||n===void 0?void 0:n.invalidated)===null||o===void 0||o.call(n)}catch(i){console.error(i)}Is.DragDrop.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0},this.onCancelDrag=n=>{var o,r;if(n){const i=this.selfRef.current,s=this.outlineDiv;if(i&&s)try{i.removeChild(s)}catch{}const a=this.dragDiv;if(i&&a)try{i.removeChild(a)}catch{}this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{(r=(o=this.customDrop)===null||o===void 0?void 0:o.invalidated)===null||r===void 0||r.call(o)}catch(l){console.error(l)}Is.DragDrop.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0}this.setState({showHiddenBorder:zr.DockLocation.CENTER})},this.onDragDivMouseDown=n=>{n.preventDefault(),this.dragStart(n,this.dragDivText,Ns.TabNode._fromJson(this.newTabJson,this.props.model,!1),!0,void 0,void 0)},this.dragStart=(n,o,r,i,s,a)=>{var l,c;i?(this.dragNode=r,this.dragDivText=o,Is.DragDrop.instance.startDrag(n,this.onDragStart,this.onDragMove,this.onDragEnd,this.onCancelDrag,s,a,this.currentDocument,(c=this.selfRef.current)!==null&&c!==void 0?c:void 0)):Is.DragDrop.instance.startDrag(n,void 0,void 0,void 0,void 0,s,a,this.currentDocument,(l=this.selfRef.current)!==null&&l!==void 0?l:void 0)},this.dragRectRender=(n,o,r,i)=>{let s;if(n!==void 0?s=ke.createElement("div",{style:{whiteSpace:"pre"}},n.replace("
",` `)):o&&o instanceof Ns.TabNode&&(s=ke.createElement(nee.TabButtonStamp,{node:o,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory})),this.props.onRenderDragRect!==void 0){const l=this.props.onRenderDragRect(s,o,r);l!==void 0&&(s=l)}this.dragRectRendered=!1;const a=this.dragDiv;a&&(a.style.visibility="hidden",this.showPortal(ke.createElement(lee,{onRendered:()=>{this.dragRectRendered=!0,i?.()}},s),a))},this.showPortal=(n,o)=>{const r=(0,KQ.createPortal)(n,o);this.setState({portal:r})},this.hidePortal=()=>{this.setState({portal:void 0})},this.onDragStart=()=>{var n;this.dropInfo=void 0,this.customDrop=void 0;const o=this.selfRef.current;return this.outlineDiv=this.currentDocument.createElement("div"),this.outlineDiv.className=this.getClassName(bo.CLASSES.FLEXLAYOUT__OUTLINE_RECT),this.outlineDiv.style.visibility="hidden",o&&o.appendChild(this.outlineDiv),this.dragDiv==null&&(this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(bo.CLASSES.FLEXLAYOUT__DRAG_RECT),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragRectRender(this.dragDivText,this.dragNode,this.newTabJson),o&&o.appendChild(this.dragDiv)),this.props.model.getMaximizedTabset()===void 0&&this.setState({showEdges:this.props.model.isEnableEdgeDock()}),this.dragNode&&this.outlineDiv&&this.dragNode instanceof Ns.TabNode&&this.dragNode.getTabRect()!==void 0&&((n=this.dragNode.getTabRect())===null||n===void 0||n.positionElement(this.outlineDiv)),this.firstMove=!0,!0},this.onDragMove=n=>{var o,r,i,s,a,l,c;if(this.firstMove===!1){const g=this.props.model._getAttribute("tabDragSpeed");this.outlineDiv&&(this.outlineDiv.style.transition=`top ${g}s, left ${g}s, width ${g}s, height ${g}s`)}this.firstMove=!1;const d=(o=this.selfRef.current)===null||o===void 0?void 0:o.getBoundingClientRect(),f={x:n.clientX-((r=d?.left)!==null&&r!==void 0?r:0),y:n.clientY-((i=d?.top)!==null&&i!==void 0?i:0)};this.checkForBorderToShow(f.x,f.y);const m=(a=(s=this.dragDiv)===null||s===void 0?void 0:s.getBoundingClientRect())!==null&&a!==void 0?a:new DOMRect(0,0,100,100);let h=f.x-m.width/2;h+m.width>((l=d?.width)!==null&&l!==void 0?l:0)&&(h=((c=d?.width)!==null&&c!==void 0?c:0)-m.width),h=Math.max(0,h),this.dragDiv&&(this.dragDiv.style.left=h+"px",this.dragDiv.style.top=f.y+5+"px",this.dragRectRendered&&this.dragDiv.style.visibility==="hidden"&&(this.dragDiv.style.visibility="visible"));let p=this.props.model._findDropTargetNode(this.dragNode,f.x,f.y);p&&(this.props.onTabDrag?this.handleCustomTabDrag(p,f,n):(this.dropInfo=p,this.outlineDiv&&(this.outlineDiv.className=this.getClassName(p.className),p.rect.positionElement(this.outlineDiv),this.outlineDiv.style.visibility="visible")))},this.onDragEnd=n=>{const o=this.selfRef.current;if(o&&(this.outlineDiv&&o.removeChild(this.outlineDiv),this.dragDiv&&o.removeChild(this.dragDiv)),this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),Is.DragDrop.instance.hideGlass(),this.dropInfo)if(this.customDrop){this.newTabJson=void 0;try{const{callback:r,dragging:i,over:s,x:a,y:l,location:c}=this.customDrop;r(i,s,a,l,c),this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0)}catch(r){console.error(r)}}else if(this.newTabJson!==void 0){const r=this.doAction(Al.Actions.addNode(this.newTabJson,this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.fnNewNodeDropped!=null&&(this.fnNewNodeDropped(r,n),this.fnNewNodeDropped=void 0),this.newTabJson=void 0}else this.dragNode!==void 0&&this.doAction(Al.Actions.moveNode(this.dragNode.getId(),this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.setState({showHiddenBorder:zr.DockLocation.CENTER})},this.props.model._setChangeListener(this.onModelChange),this.tabIds=[],this.selfRef=ke.createRef(),this.findHeaderBarSizeRef=ke.createRef(),this.findTabBarSizeRef=ke.createRef(),this.findBorderBarSizeRef=ke.createRef(),this.supportsPopout=t.supportsPopout!==void 0?t.supportsPopout:see,this.popoutURL=t.popoutURL?t.popoutURL:"popout.html",this.icons=Object.assign(Object.assign({},oee),t.icons),this.state={rect:new Mf.Rect(0,0,0,0),calculatedHeaderBarSize:25,calculatedTabBarSize:26,calculatedBorderBarSize:30,editingTab:void 0,showHiddenBorder:zr.DockLocation.CENTER,showEdges:!1},this.onDragEnter=this.onDragEnter.bind(this)}styleFont(t){return this.props.font&&(this.selfRef.current&&(this.props.font.size&&this.selfRef.current.style.setProperty("--font-size",this.props.font.size),this.props.font.family&&this.selfRef.current.style.setProperty("--font-family",this.props.font.family)),this.props.font.style&&(t.fontStyle=this.props.font.style),this.props.font.weight&&(t.fontWeight=this.props.font.weight)),t}doAction(t){if(this.props.onAction!==void 0){const n=this.props.onAction(t);return n!==void 0?this.props.model.doAction(n):void 0}else return this.props.model.doAction(t)}componentDidMount(){this.updateRect(),this.updateLayoutMetrics(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.resizeObserver=new ResizeObserver(n=>{this.updateRect(n[0].contentRect)});const t=this.selfRef.current;t&&this.resizeObserver.observe(t)}componentDidUpdate(){this.updateLayoutMetrics(),this.props.model!==this.previousModel&&(this.previousModel!==void 0&&this.previousModel._setChangeListener(void 0),this.props.model._setChangeListener(this.onModelChange),this.previousModel=this.props.model)}getCurrentDocument(){return this.currentDocument}getDomRect(){var t;return(t=this.selfRef.current)===null||t===void 0?void 0:t.getBoundingClientRect()}getRootDiv(){return this.selfRef.current}isSupportsPopout(){return this.supportsPopout}isRealtimeResize(){var t;return(t=this.props.realtimeResize)!==null&&t!==void 0?t:!1}onTabDrag(...t){var n,o;return(o=(n=this.props).onTabDrag)===null||o===void 0?void 0:o.call(n,...t)}getPopoutURL(){return this.popoutURL}componentWillUnmount(){var t;const n=this.selfRef.current;n&&((t=this.resizeObserver)===null||t===void 0||t.unobserve(n))}setEditingTab(t){this.setState({editingTab:t})}getEditingTab(){return this.state.editingTab}render(){if(!this.selfRef.current)return ke.createElement("div",{ref:this.selfRef,className:this.getClassName(bo.CLASSES.FLEXLAYOUT__LAYOUT)},this.metricsElements());this.props.model._setPointerFine(window&&window.matchMedia&&window.matchMedia("(pointer: fine)").matches);const t=[],n=[],o=[],r={},i=[],s={headerBarSize:this.state.calculatedHeaderBarSize,tabBarSize:this.state.calculatedTabBarSize,borderBarSize:this.state.calculatedBorderBarSize};this.props.model._setShowHiddenBorder(this.state.showHiddenBorder),this.centerRect=this.props.model._layout(this.state.rect,s),this.renderBorder(this.props.model.getBorderSet(),t,r,o,i),this.renderChildren("",this.props.model.getRoot(),n,r,o,i);const a=[],l={};for(const f of this.tabIds)r[f]&&(a.push(f),l[f]=f);this.tabIds=a;for(const f of Object.keys(r))l[f]||this.tabIds.push(f);const c=[],d=this.icons.edgeArrow;if(this.state.showEdges){const f=this.centerRect,m=this.edgeRectLength,h=this.edgeRectWidth,p=this.edgeRectLength/2,g=this.getClassName(bo.CLASSES.FLEXLAYOUT__EDGE_RECT),b=50;c.push(ke.createElement("div",{key:"North",style:{top:f.y,left:f.x+f.width/2-p,width:m,height:h,borderBottomLeftRadius:b,borderBottomRightRadius:b},className:g+" "+this.getClassName(bo.CLASSES.FLEXLAYOUT__EDGE_RECT_TOP)},ke.createElement("div",{style:{transform:"rotate(180deg)"}},d))),c.push(ke.createElement("div",{key:"West",style:{top:f.y+f.height/2-p,left:f.x,width:h,height:m,borderTopRightRadius:b,borderBottomRightRadius:b},className:g+" "+this.getClassName(bo.CLASSES.FLEXLAYOUT__EDGE_RECT_LEFT)},ke.createElement("div",{style:{transform:"rotate(90deg)"}},d))),c.push(ke.createElement("div",{key:"South",style:{top:f.y+f.height-h,left:f.x+f.width/2-p,width:m,height:h,borderTopLeftRadius:b,borderTopRightRadius:b},className:g+" "+this.getClassName(bo.CLASSES.FLEXLAYOUT__EDGE_RECT_BOTTOM)},ke.createElement("div",null,d))),c.push(ke.createElement("div",{key:"East",style:{top:f.y+f.height/2-p,left:f.x+f.width-h,width:h,height:m,borderTopLeftRadius:b,borderBottomLeftRadius:b},className:g+" "+this.getClassName(bo.CLASSES.FLEXLAYOUT__EDGE_RECT_RIGHT)},ke.createElement("div",{style:{transform:"rotate(-90deg)"}},d)))}return ke.createElement("div",{ref:this.selfRef,className:this.getClassName(bo.CLASSES.FLEXLAYOUT__LAYOUT),onDragEnter:this.props.onExternalDrag?this.onDragEnter:void 0},n,this.tabIds.map(f=>r[f]),t,i,c,o,this.metricsElements(),this.state.portal)}metricsElements(){const t=this.styleFont({visibility:"hidden"});return ke.createElement(ke.Fragment,null,ke.createElement("div",{key:"findHeaderBarSize",ref:this.findHeaderBarSizeRef,style:t,className:this.getClassName(bo.CLASSES.FLEXLAYOUT__TABSET_HEADER_SIZER)},"FindHeaderBarSize"),ke.createElement("div",{key:"findTabBarSize",ref:this.findTabBarSizeRef,style:t,className:this.getClassName(bo.CLASSES.FLEXLAYOUT__TABSET_SIZER)},"FindTabBarSize"),ke.createElement("div",{key:"findBorderBarSize",ref:this.findBorderBarSizeRef,style:t,className:this.getClassName(bo.CLASSES.FLEXLAYOUT__BORDER_SIZER)},"FindBorderBarSize"))}renderBorder(t,n,o,r,i){for(const s of t.getBorders()){const a=`/border/${s.getLocation().getName()}`;if(s.isShowing()){n.push(ke.createElement(eee.BorderTabSet,{key:`border_${s.getLocation().getName()}`,path:a,border:s,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons}));const l=s._getDrawChildren();let c=0,d=0;for(const f of l){if(f instanceof H_.SplitterNode){let m=a+"/s";i.push(ke.createElement(U_.Splitter,{key:f.getId(),layout:this,node:f,path:m}))}else if(f instanceof Ns.TabNode){let m=a+"/t"+d++;if(this.supportsPopout&&f.isFloating()){const h=this._getScreenRect(f),p=f._getAttr("borderWidth"),g=f._getAttr("borderHeight");h&&(p!==-1&&s.getLocation().getOrientation()===vg.Orientation.HORZ?h.width=p:g!==-1&&s.getLocation().getOrientation()===vg.Orientation.VERT&&(h.height=g)),r.push(ke.createElement(W_.FloatingWindow,{key:f.getId(),url:this.popoutURL,rect:h,title:f.getName(),id:f.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},ke.createElement(G_.FloatingWindowTab,{layout:this,node:f,factory:this.props.factory}))),o[f.getId()]=ke.createElement(q_.TabFloating,{key:f.getId(),layout:this,path:m,node:f,selected:c===s.getSelected()})}else o[f.getId()]=ke.createElement(j_.Tab,{key:f.getId(),layout:this,path:m,node:f,selected:c===s.getSelected(),factory:this.props.factory})}c++}}}}renderChildren(t,n,o,r,i,s){const a=n._getDrawChildren();let l=0,c=0,d=0;for(const f of a)if(f instanceof H_.SplitterNode){const m=t+"/s"+l++;s.push(ke.createElement(U_.Splitter,{key:f.getId(),layout:this,path:m,node:f}))}else if(f instanceof V_.TabSetNode){const m=t+"/ts"+d++;o.push(ke.createElement(tee.TabSet,{key:f.getId(),layout:this,path:m,node:f,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons})),this.renderChildren(m,f,o,r,i,s)}else if(f instanceof Ns.TabNode){const m=t+"/t"+c++,h=f.getParent().getChildren()[f.getParent().getSelected()];if(h===void 0&&console.warn("undefined selectedTab should not happen"),this.supportsPopout&&f.isFloating()){const p=this._getScreenRect(f);i.push(ke.createElement(W_.FloatingWindow,{key:f.getId(),url:this.popoutURL,rect:p,title:f.getName(),id:f.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},ke.createElement(G_.FloatingWindowTab,{layout:this,node:f,factory:this.props.factory}))),r[f.getId()]=ke.createElement(q_.TabFloating,{key:f.getId(),layout:this,path:m,node:f,selected:f===h})}else r[f.getId()]=ke.createElement(j_.Tab,{key:f.getId(),layout:this,path:m,node:f,selected:f===h,factory:this.props.factory})}else{const m=t+(f.getOrientation()===vg.Orientation.HORZ?"/r":"/c")+d++;this.renderChildren(m,f,o,r,i,s)}}_getScreenRect(t){var n;const o=t.getRect().clone(),r=(n=this.selfRef.current)===null||n===void 0?void 0:n.getBoundingClientRect();if(!r)return null;const i=Math.min(80,this.currentWindow.outerHeight-this.currentWindow.innerHeight),s=Math.min(80,this.currentWindow.outerWidth-this.currentWindow.innerWidth);return o.x=o.x+r.x+this.currentWindow.screenX+s,o.y=o.y+r.y+this.currentWindow.screenY+i,o}addTabToTabSet(t,n){if(this.props.model.getNodeById(t)!==void 0)return this.doAction(Al.Actions.addNode(n,t,zr.DockLocation.CENTER,-1))}addTabToActiveTabSet(t){const n=this.props.model.getActiveTabset();if(n!==void 0)return this.doAction(Al.Actions.addNode(t,n.getId(),zr.DockLocation.CENTER,-1))}addTabWithDragAndDrop(t,n,o){this.fnNewNodeDropped=o,this.newTabJson=n,this.dragStart(void 0,t,Ns.TabNode._fromJson(n,this.props.model,!1),!0,void 0,void 0)}moveTabWithDragAndDrop(t,n){this.dragStart(void 0,n,t,!0,void 0,void 0)}addTabWithDragAndDropIndirect(t,n,o){this.fnNewNodeDropped=o,this.newTabJson=n,Is.DragDrop.instance.addGlass(this.onCancelAdd),this.dragDivText=t,this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(bo.CLASSES.FLEXLAYOUT__DRAG_RECT),this.dragDiv.addEventListener("mousedown",this.onDragDivMouseDown),this.dragDiv.addEventListener("touchstart",this.onDragDivMouseDown,{passive:!1}),this.dragRectRender(this.dragDivText,void 0,this.newTabJson,()=>{if(this.dragDiv){this.dragDiv.style.visibility="visible";const i=this.dragDiv.getBoundingClientRect(),s=new Mf.Rect(0,0,i?.width,i?.height);s.centerInRect(this.state.rect),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragDiv.style.left=s.x+"px",this.dragDiv.style.top=s.y+"px"}}),this.selfRef.current.appendChild(this.dragDiv)}handleCustomTabDrag(t,n,o){var r,i,s;let a=(r=this.customDrop)===null||r===void 0?void 0:r.invalidated;const l=(i=this.customDrop)===null||i===void 0?void 0:i.callback;this.customDrop=void 0;const c=this.newTabJson||(this.dragNode instanceof Ns.TabNode?this.dragNode:void 0);if(c&&(t.node instanceof V_.TabSetNode||t.node instanceof QQ.BorderNode)&&t.index===-1){const d=t.node.getSelectedNode(),f=d?.getRect();if(d&&f?.contains(n.x,n.y)){let m;try{const h=this.onTabDrag(c,d,n.x-f.x,n.y-f.y,t.location,()=>this.onDragMove(o));h&&(m={rect:new Mf.Rect(h.x+f.x,h.y+f.y,h.width,h.height),callback:h.callback,invalidated:h.invalidated,dragging:c,over:d,x:n.x-f.x,y:n.y-f.y,location:t.location,cursor:h.cursor})}catch(h){console.error(h)}m?.callback===l&&(a=void 0),this.customDrop=m}}this.dropInfo=t,this.outlineDiv&&(this.outlineDiv.className=this.getClassName(this.customDrop?bo.CLASSES.FLEXLAYOUT__OUTLINE_RECT:t.className),this.customDrop?this.customDrop.rect.positionElement(this.outlineDiv):t.rect.positionElement(this.outlineDiv)),Is.DragDrop.instance.setGlassCursorOverride((s=this.customDrop)===null||s===void 0?void 0:s.cursor),this.outlineDiv&&(this.outlineDiv.style.visibility="visible");try{a?.()}catch(d){console.error(d)}}onDragEnter(t){if(Is.DragDrop.instance.isDragging())return;const n=this.props.onExternalDrag(t);n&&(this.fnNewNodeDropped=n.onDrop,this.newTabJson=n.json,this.dragStart(t,n.dragText,Ns.TabNode._fromJson(n.json,this.props.model,!1),!0,void 0,void 0))}checkForBorderToShow(t,n){const o=this.props.model._getOuterInnerRects().outer,r=o.getCenter(),i=this.edgeRectWidth,s=this.edgeRectLength/2;let a=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===zr.DockLocation.CENTER&&(n>r.y-s&&nr.x-s&&t=o.getRight()-i?l=zr.DockLocation.RIGHT:n<=o.y+i?l=zr.DockLocation.TOP:n>=o.getBottom()-i&&(l=zr.DockLocation.BOTTOM)),l!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:l})}maximize(t){this.doAction(Al.Actions.maximizeToggle(t.getId()))}customizeTab(t,n){this.props.onRenderTab&&this.props.onRenderTab(t,n)}customizeTabSet(t,n){this.props.onRenderTabSet&&this.props.onRenderTabSet(t,n)}i18nName(t,n){let o;return this.props.i18nMapper&&(o=this.props.i18nMapper(t,n)),o===void 0&&(o=t+(n===void 0?"":n)),o}getOnRenderFloatingTabPlaceholder(){return this.props.onRenderFloatingTabPlaceholder}getShowOverflowMenu(){return this.props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this.props.onTabSetPlaceHolder}showContextMenu(t,n){this.props.onContextMenu&&this.props.onContextMenu(t,n)}auxMouseClick(t,n){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(t,n)}}bm.Layout=aee;const lee=e=>(ke.useEffect(()=>{var t;(t=e.onRendered)===null||t===void 0||t.call(e)},[e]),ke.createElement(ke.Fragment,null,e.children));var $1={};Object.defineProperty($1,"__esModule",{value:!0});$1.BorderSet=void 0;const bg=Sn,cee=bs();class G5{static _fromJson(t,n){const o=new G5(n);return o._borders=t.map(r=>cee.BorderNode._fromJson(r,n)),o}constructor(t){this._model=t,this._borders=[]}getBorders(){return this._borders}_forEachNode(t){for(const n of this._borders){t(n,0);for(const o of n.getChildren())o._forEachNode(t,1)}}_toJson(){return this._borders.map(t=>t.toJson())}_layoutBorder(t,n){const o=t.outer,r=this._model.getRoot();let i=Math.max(0,o.height-r.getMinHeight()),s=Math.max(0,o.width-r.getMinWidth()),a=0,l=0,c=0,d=0;const f=this._borders.filter(p=>p.isShowing());for(const p of f){p._setAdjustedSize(p.getSize());const g=p.getSelected()!==-1;p.getLocation().getOrientation()===bg.Orientation.HORZ?(l+=p.getBorderBarSize(),g&&(s-=this._model.getSplitterSize(),l+=p.getSize(),d+=p.getSize())):(a+=p.getBorderBarSize(),g&&(i-=this._model.getSplitterSize(),a+=p.getSize(),c+=p.getSize()))}let m=0,h=!1;for(;l>s&&d>0||a>i&&c>0;){const p=f[m];if(p.getSelected()!==-1){const g=p._getAdjustedSize();l>s&&d>0&&p.getLocation().getOrientation()===bg.Orientation.HORZ&&g>0&&g>p.getMinSize()?(p._setAdjustedSize(g-1),l--,d--,h=!0):a>i&&c>0&&p.getLocation().getOrientation()===bg.Orientation.VERT&&g>0&&g>p.getMinSize()&&(p._setAdjustedSize(g-1),a--,c--,h=!0)}if(m=(m+1)%f.length,m===0)if(h)h=!1;else break}for(const p of f)t.outer=p._layoutBorderOuter(t.outer,n);t.inner=t.outer;for(const p of f)t.inner=p._layoutBorderInner(t.inner,n);return t}_findDropTargetNode(t,n,o){for(const r of this._borders)if(r.isShowing()){const i=r.canDrop(t,n,o);if(i!==void 0)return i}}}$1.BorderSet=G5;var uL={};Object.defineProperty(uL,"__esModule",{value:!0});var dL={};Object.defineProperty(dL,"__esModule",{value:!0});var fL={};Object.defineProperty(fL,"__esModule",{value:!0});var Mm={};Object.defineProperty(Mm,"__esModule",{value:!0});Mm.Model=void 0;const De=gs,uee=ys,_g=ni,Y_=Sn,X_=Jn,_o=hr,Lu=bs(),J_=$1,Ol=j5(),Rs=wa,Pr=xa(),wg=W5();class Ho{static fromJson(t){const n=new Ho;return Ho._attributeDefinitions.fromJson(t.global,n._attributes),t.borders&&(n._borders=J_.BorderSet._fromJson(t.borders,n)),n._root=Ol.RowNode._fromJson(t.layout,n),n._tidy(),n}static _createAttributeDefinitions(){const t=new uee.AttributeDefinitions;return t.add("legacyOverflowMenu",!1).setType(De.Attribute.BOOLEAN),t.add("enableEdgeDock",!0).setType(De.Attribute.BOOLEAN),t.add("rootOrientationVertical",!1).setType(De.Attribute.BOOLEAN),t.add("marginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("enableUseVisibility",!1).setType(De.Attribute.BOOLEAN),t.add("enableRotateBorderIcons",!0).setType(De.Attribute.BOOLEAN),t.add("splitterSize",-1).setType(De.Attribute.NUMBER),t.add("splitterExtra",0).setType(De.Attribute.NUMBER),t.add("tabEnableClose",!0).setType(De.Attribute.BOOLEAN),t.add("tabCloseType",1).setType("ICloseType"),t.add("tabEnableFloat",!1).setType(De.Attribute.BOOLEAN),t.add("tabEnableDrag",!0).setType(De.Attribute.BOOLEAN),t.add("tabEnableRename",!0).setType(De.Attribute.BOOLEAN),t.add("tabContentClassName",void 0).setType(De.Attribute.STRING),t.add("tabClassName",void 0).setType(De.Attribute.STRING),t.add("tabIcon",void 0).setType(De.Attribute.STRING),t.add("tabEnableRenderOnDemand",!0).setType(De.Attribute.BOOLEAN),t.add("tabDragSpeed",.3).setType(De.Attribute.NUMBER),t.add("tabBorderWidth",-1).setType(De.Attribute.NUMBER),t.add("tabBorderHeight",-1).setType(De.Attribute.NUMBER),t.add("tabSetEnableDeleteWhenEmpty",!0).setType(De.Attribute.BOOLEAN),t.add("tabSetEnableDrop",!0).setType(De.Attribute.BOOLEAN),t.add("tabSetEnableDrag",!0).setType(De.Attribute.BOOLEAN),t.add("tabSetEnableDivide",!0).setType(De.Attribute.BOOLEAN),t.add("tabSetEnableMaximize",!0).setType(De.Attribute.BOOLEAN),t.add("tabSetEnableClose",!1).setType(De.Attribute.BOOLEAN),t.add("tabSetEnableSingleTabStretch",!1).setType(De.Attribute.BOOLEAN),t.add("tabSetAutoSelectTab",!0).setType(De.Attribute.BOOLEAN),t.add("tabSetClassNameTabStrip",void 0).setType(De.Attribute.STRING),t.add("tabSetClassNameHeader",void 0).setType(De.Attribute.STRING),t.add("tabSetEnableTabStrip",!0).setType(De.Attribute.BOOLEAN),t.add("tabSetHeaderHeight",0).setType(De.Attribute.NUMBER),t.add("tabSetTabStripHeight",0).setType(De.Attribute.NUMBER),t.add("tabSetMarginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("tabSetBorderInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("tabSetTabLocation","top").setType("ITabLocation"),t.add("tabSetMinWidth",0).setType(De.Attribute.NUMBER),t.add("tabSetMinHeight",0).setType(De.Attribute.NUMBER),t.add("borderSize",200).setType(De.Attribute.NUMBER),t.add("borderMinSize",0).setType(De.Attribute.NUMBER),t.add("borderBarSize",0).setType(De.Attribute.NUMBER),t.add("borderEnableDrop",!0).setType(De.Attribute.BOOLEAN),t.add("borderAutoSelectTabWhenOpen",!0).setType(De.Attribute.BOOLEAN),t.add("borderAutoSelectTabWhenClosed",!1).setType(De.Attribute.BOOLEAN),t.add("borderClassName",void 0).setType(De.Attribute.STRING),t.add("borderEnableAutoHide",!1).setType(De.Attribute.BOOLEAN),t}constructor(){this._borderRects={inner:X_.Rect.empty(),outer:X_.Rect.empty()},this._attributes={},this._idMap={},this._borders=new J_.BorderSet(this),this._pointerFine=!0,this._showHiddenBorder=_g.DockLocation.CENTER}_setChangeListener(t){this._changeListener=t}getActiveTabset(){if(this._activeTabSet&&this.getNodeById(this._activeTabSet.getId()))return this._activeTabSet}_getShowHiddenBorder(){return this._showHiddenBorder}_setShowHiddenBorder(t){this._showHiddenBorder=t}_setActiveTabset(t){this._activeTabSet=t}getMaximizedTabset(){return this._maximizedTabSet}_setMaximizedTabset(t){this._maximizedTabSet=t}getRoot(){return this._root}isRootOrientationVertical(){return this._attributes.rootOrientationVertical}isUseVisibility(){return this._attributes.enableUseVisibility}isEnableRotateBorderIcons(){return this._attributes.enableRotateBorderIcons}getBorderSet(){return this._borders}_getOuterInnerRects(){return this._borderRects}_getPointerFine(){return this._pointerFine}_setPointerFine(t){this._pointerFine=t}visitNodes(t){this._borders._forEachNode(t),this._root._forEachNode(t,0)}getNodeById(t){return this._idMap[t]}getFirstTabSet(t=this._root){const n=t.getChildren()[0];return n instanceof Pr.TabSetNode?n:this.getFirstTabSet(n)}doAction(t){let n;switch(t.type){case _o.Actions.ADD_NODE:{const o=new Rs.TabNode(this,t.data.json,!0),r=this._idMap[t.data.toNode];(r instanceof Pr.TabSetNode||r instanceof Lu.BorderNode||r instanceof Ol.RowNode)&&(r.drop(o,_g.DockLocation.getByName(t.data.location),t.data.index,t.data.select),n=o);break}case _o.Actions.MOVE_NODE:{const o=this._idMap[t.data.fromNode];if(o instanceof Rs.TabNode||o instanceof Pr.TabSetNode){const r=this._idMap[t.data.toNode];(r instanceof Pr.TabSetNode||r instanceof Lu.BorderNode||r instanceof Ol.RowNode)&&r.drop(o,_g.DockLocation.getByName(t.data.location),t.data.index,t.data.select)}break}case _o.Actions.DELETE_TAB:{const o=this._idMap[t.data.node];o instanceof Rs.TabNode&&o._delete();break}case _o.Actions.DELETE_TABSET:{const o=this._idMap[t.data.node];if(o instanceof Pr.TabSetNode){const r=[...o.getChildren()];for(let i=0;ithis._idMap[t.getId()]=t)}_adjustSplitSide(t,n,o){t._setWeight(n),t.getWidth()!=null&&t.getOrientation()===Y_.Orientation.VERT?t._updateAttrs({width:o}):t.getHeight()!=null&&t.getOrientation()===Y_.Orientation.HORZ&&t._updateAttrs({height:o})}toJson(){const t={};return Ho._attributeDefinitions.toJson(t,this._attributes),this.visitNodes(n=>{n._fireEvent("save",void 0)}),{global:t,borders:this._borders._toJson(),layout:this._root.toJson()}}getSplitterSize(){let t=this._attributes.splitterSize;return t===-1&&(t=this._pointerFine?8:12),t}isLegacyOverflowMenu(){return this._attributes.legacyOverflowMenu}getSplitterExtra(){return this._attributes.splitterExtra}isEnableEdgeDock(){return this._attributes.enableEdgeDock}_addNode(t){const n=t.getId();if(this._idMap[n]!==void 0)throw new Error(`Error: each node must have a unique id, duplicate id:${t.getId()}`);t.getType()!=="splitter"&&(this._idMap[n]=t)}_layout(t,n){var o;return this._borderRects=this._borders._layoutBorder({outer:t,inner:t},n),t=this._borderRects.inner.removeInsets(this._getAttribute("marginInsets")),(o=this._root)===null||o===void 0||o.calcMinSize(),this._root._layout(t,n),t}_findDropTargetNode(t,n,o){let r=this._root._findDropTargetNode(t,n,o);return r===void 0&&(r=this._borders._findDropTargetNode(t,n,o)),r}_tidy(){this._root._tidy()}_updateAttrs(t){Ho._attributeDefinitions.update(t,this._attributes)}_nextUniqueId(){return"#"+(0,wg.randomUUID)()}_getAttribute(t){return this._attributes[t]}setOnAllowDrop(t){this._onAllowDrop=t}_getOnAllowDrop(){return this._onAllowDrop}setOnCreateTabSet(t){this._onCreateTabSet=t}_getOnCreateTabSet(){return this._onCreateTabSet}static toTypescriptInterfaces(){console.log(Ho._attributeDefinitions.toTypescriptInterface("Global",void 0)),console.log(Ol.RowNode.getAttributeDefinitions().toTypescriptInterface("Row",Ho._attributeDefinitions)),console.log(Pr.TabSetNode.getAttributeDefinitions().toTypescriptInterface("TabSet",Ho._attributeDefinitions)),console.log(Rs.TabNode.getAttributeDefinitions().toTypescriptInterface("Tab",Ho._attributeDefinitions)),console.log(Lu.BorderNode.getAttributeDefinitions().toTypescriptInterface("Border",Ho._attributeDefinitions))}toString(){return JSON.stringify(this.toJson())}}Mm.Model=Ho;Ho._attributeDefinitions=Ho._createAttributeDefinitions();(function(e){var t=G1&&G1.__createBinding||(Object.create?function(o,r,i,s){s===void 0&&(s=i);var a=Object.getOwnPropertyDescriptor(r,i);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(o,s,a)}:function(o,r,i,s){s===void 0&&(s=i),o[s]=r[i]}),n=G1&&G1.__exportStar||function(o,r){for(var i in o)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&t(r,o,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(bm,e),n(O1,e),n(hr,e),n(bs(),e),n($1,e),n(Em,e),n(uL,e),n(dL,e),n(fL,e),n(Mm,e),n(vs,e),n(j5(),e),n(Cl,e),n(wa,e),n(xa(),e),n(ni,e),n(Sl,e),n(El,e),n(_s,e),n(Sn,e),n(Jn,e),n(En,e)})(kr);var We;(e=>{e.Main="MainTabSet",e.Asset="AssetTabSet",e.Inspector="InspectorTabSet",e.Graph="GraphTabSet"})(We||(We={}));var Xi;(e=>{e.Asset="AssetBrowser",e.Inspector="Inspector",e.Graph="StoryGraph",e.Settings="SettingsEditor"})(Xi||(Xi={}));const Af={id:Xi.Asset,title:"Assets",closeable:!1},Of={id:Xi.Graph,title:"Graph",closeable:!1},Df={id:Xi.Inspector,title:"Inspector",closeable:!1},pL=[{name:"Wide",scheme:JSON.stringify({type:"row",children:[{type:"tabset",weight:15,id:We.Asset,children:[]},{type:"tabset",weight:60,id:We.Main,children:[]},{type:"tabset",weight:25,id:We.Inspector,children:[]}]}),tabSets:[{id:We.Asset,tabs:[Af]},{id:We.Main,tabs:[Of]},{id:We.Inspector,tabs:[Df]}]},{name:"Tall",scheme:JSON.stringify({type:"row",children:[{type:"row",children:[{type:"tabset",weight:60,id:We.Main,children:[]},{type:"row",weight:40,children:[{type:"tabset",weight:40,id:We.Asset,children:[]},{type:"tabset",weight:60,id:We.Inspector,children:[]}]}]}]}),tabSets:[{id:We.Asset,tabs:[Af]},{id:We.Main,tabs:[Of]},{id:We.Inspector,tabs:[Df]}]},{name:"Compact",scheme:JSON.stringify({type:"row",children:[{type:"row",weight:20,children:[{type:"tabset",weight:50,id:We.Inspector,children:[]},{type:"tabset",weight:50,id:We.Asset,children:[]}]},{type:"tabset",weight:80,id:We.Main,children:[]}]}),tabSets:[{id:We.Main,tabs:[Of]},{id:We.Inspector,tabs:[Df]},{id:We.Asset,tabs:[Af]}]},{name:"4 Split",scheme:JSON.stringify({type:"row",children:[{type:"row",children:[{type:"row",children:[{type:"tabset",id:We.Main,children:[]},{type:"tabset",id:We.Inspector,children:[]}]},{type:"row",children:[{type:"tabset",id:We.Asset,children:[]},{type:"tabset",id:We.Graph,children:[]}]}]}]}),tabSets:[{id:We.Main,tabs:[]},{id:We.Graph,tabs:[Of]},{id:We.Asset,tabs:[Af]},{id:We.Inspector,tabs:[Df]}]}],hL=mL(pL[0].scheme);function mL(e){return kr.Model.fromJson({global:{tabEnableClose:!1,tabEnableRename:!1,tabSetTabStripHeight:20,tabSetEnableDeleteWhenEmpty:!1,splitterSize:2},borders:[],layout:JSON.parse(e)})}const gL=new Ye;let qn=hL;function dee(){return qn}function q5(e){qn=e,gL.broadcast(e)}function fee(e){if(e.type===kr.Actions.MOVE_NODE)return t();if(e.type===kr.Actions.DELETE_TAB)return n();return e;function t(){const o=qn.getNodeById(e.data.fromNode),r=qn.getNodeById(e.data.toNode),i=o.getParent();if(o.getType()!=="tab"||r.getType()!=="tabset")return e;qn.doAction(e),i.getChildren().length===0&&qn.doAction(kr.Actions.deleteTabset(i.getId()));const s=o.getParent(),a=s.getChildren().length-1-s.getChildren().indexOf(o);ft.moveTab(o.getId(),s.getId(),a)}function n(){const o=qn.getNodeById(e.data.node);ft.closeTab(o.getId())}}function pee(e){return e===Xi.Asset&&zf(We.Asset)?We.Asset:e===Xi.Inspector&&zf(We.Inspector)||e===Xi.Settings&&zf(We.Inspector)?We.Inspector:e===Xi.Graph&&zf(We.Graph)?We.Graph:We.Main}function hee(){const e=qn.toJson().layout;return t(e),JSON.stringify(e);function t(n){if(n.type==="tabset")n.children=[];else for(const o of n.children)t(o)}}function mee(e,t){qn.getNodeById(t)===void 0&&(t=yL(n=>n.getType()==="tabset").getId()),qn.doAction(kr.Actions.addNode({type:"tab",id:e.id,name:e.title,helpText:e.tooltip,enableClose:e.closeable},t,kr.DockLocation.CENTER,0))}function gee(e){qn.doAction(kr.Actions.selectTab(e))}function yee(e,t,n){const o={};t!==void 0&&(o.name=t),n!==void 0&&(o.helpText=n),qn.doAction(kr.Actions.updateNodeAttributes(e,o))}function vee(e){const t=qn.getNodeById(e).getParent();qn.doAction(kr.Actions.deleteTab(e)),t.getChildren().length===0&&qn.doAction(kr.Actions.deleteTabset(t.getId()))}function bee(e){q5(mL(e))}function _ee(){q5(hL)}function yL(e){return t(qn.getRoot());function t(n){for(const o of n.getChildren()){if(e(o))return o;const r=t(o);if(r!==void 0)return r}}}function zf(e){return yL(t=>t.getType()==="tabset"&&t.getId()===e)!==void 0}ft.getDefaultLayouts=()=>pL;ft.getDefaultSetForTab=pee;ft.getCurrentScheme=hee;ft.onTabAdded.subscribe(mee);ft.onTabSelected.subscribe(gee);ft.onTabRenamed.subscribe(yee);ft.onTabRemoved.subscribe(vee);ft.onSchemeChanged.subscribe(bee);ft.onLayoutCleared.subscribe(_ee);const wee="_workspace_1bg56_1",xee="_tab-icon_1bg56_5",Z_={workspace:wee,"tab-icon":"_tab-icon_1bg56_5",tabIcon:xee},See=({tabs:e})=>{const t=so(gL)??dee(),n=u.useCallback(i=>{for(const s of e)if(s.canRender(i))return s;console.warn(`Missing component for '${i}' tab.`)},[e]),o=u.useCallback(i=>{const s=i.getId(),a=n(s)?.renderContent(s);return a&&k.jsx(Kc,{children:a})},[n]),r=u.useCallback(i=>{const s=i.getId(),a=n(s)?.renderIcon(s);return a&&k.jsx("span",{className:Z_.tabIcon,children:a})},[n]);return k.jsx("div",{className:Z_.workspace,children:k.jsx(kr.Layout,{model:t,factory:o,iconFactory:r,onModelChange:q5,onAction:fee})})},Eee="_asset-browser_35v3d_1",Cee="_item_35v3d_5",Tee="_item-title_35v3d_9",kee="_folder_35v3d_20 _item_35v3d_5",Lee="_folder-toggle_35v3d_24",Iee="_folder-icon_35v3d_31",Nee="_folder-name_35v3d_36",Ree="_folder-content_35v3d_40",Mee="_file_35v3d_44 _item_35v3d_5",Aee="_file-icon_35v3d_48",Oee="_file-name_35v3d_55",Vr={"asset-browser":"_asset-browser_35v3d_1",assetBrowser:Eee,item:Cee,"item-title":"_item-title_35v3d_9",itemTitle:Tee,folder:kee,"folder-toggle":"_folder-toggle_35v3d_24",folderToggle:Lee,"folder-icon":"_folder-icon_35v3d_31",folderIcon:Iee,"folder-name":"_folder-name_35v3d_36",folderName:Nee,"folder-content":"_folder-content_35v3d_40",folderContent:Ree,file:Mee,"file-icon":"_file-icon_35v3d_48",fileIcon:Aee,"file-name":"_file-name_35v3d_55",fileName:Oee},Dee=e=>{const t=b5(e.extension);return k.jsx("div",{className:Vr.file,onDoubleClick:e.onDoubleClick,tabIndex:-1,children:k.jsxs("span",{className:Vr.itemTitle,children:[k.jsx("span",{className:Vr.fileIcon,children:t}),k.jsx("span",{className:Vr.fileName,children:e.name})]})})},zee=e=>{const t=e.open?Kh:_5,n=e.open?w5:x5;return k.jsxs("div",{className:Vr.folder,tabIndex:-1,children:[k.jsxs("span",{className:Vr.itemTitle,onDoubleClick:e.onToggle,children:[k.jsx("span",{className:Vr.folderToggle,onClick:e.onToggle,children:t}),k.jsx("span",{className:Vr.folderIcon,children:n}),k.jsx("span",{className:Vr.folderName,children:e.name})]}),k.jsx("div",{className:Vr.folderContent,children:e.children})]})},Pee=u.memo(()=>{const e=so(Hl.onChanged);return k.jsx("div",{className:Vr.assetBrowser,children:e?.items.map(t)});function t(i){return i.folder?o(i):n(i)}function n(i){const s=()=>Hl.openFile(i.uri);return k.jsx(Dee,{name:i.name,extension:i.file.extension,onDoubleClick:s},i.uri)}function o(i){const s=i.folder.children.map(t),a=()=>r(i);return k.jsx(zee,{name:i.name,open:i.folder.open,children:s,onToggle:a},i.uri)}function r(i){i.folder.open?Hl.closeFolder(i.uri):Hl.openFolder(i.uri)}}),Bee={canRender:e=>e==="AssetBrowser",renderContent:e=>u.createElement(Pee),renderIcon:e=>x5};function Pn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Gee:Wee;wL.useSyncExternalStore=zc.useSyncExternalStore!==void 0?zc.useSyncExternalStore:qee;_L.exports=wL;var Yee=_L.exports;var Am=u,Xee=Yee;function Jee(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zee=typeof Object.is=="function"?Object.is:Jee,Kee=Xee.useSyncExternalStore,Qee=Am.useRef,ete=Am.useEffect,tte=Am.useMemo,nte=Am.useDebugValue;bL.useSyncExternalStoreWithSelector=function(e,t,n,o,r){var i=Qee(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=tte(function(){function l(h){if(!c){if(c=!0,d=h,h=o(h),r!==void 0&&s.hasValue){var p=s.value;if(r(p,h))return f=p}return f=h}if(p=f,Zee(d,h))return p;var g=o(h);return r!==void 0&&r(p,g)?p:(d=h,f=g)}var c=!1,d,f,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,o,r]);var a=Kee(e,i[0],i[1]);return ete(function(){s.hasValue=!0,s.value=a},[a]),nte(a),a};vL.exports=bL;var ote=vL.exports;const rte=i4(ote);var ite={BASE_URL:"/editor",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const K_=e=>{let t;const n=new Set,o=(d,f)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const h=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(p=>p(t,h))}},r=()=>t,l={setState:o,getState:r,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(ite?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(o,r,l);return l},ste=e=>e?K_(e):K_,{useDebugValue:ate}=P,{useSyncExternalStoreWithSelector:lte}=rte,cte=e=>e;function xL(e,t=cte,n){const o=lte(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ate(o),o}const Q_=(e,t)=>{const n=ste(e),o=(r,i=t)=>xL(n,r,i);return Object.assign(o,n),o},ute=(e,t)=>e?Q_(e,t):Q_;function wn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var dte={value:()=>{}};function Om(){for(var e=0,t=arguments.length,n={},o;e=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}I0.prototype=Om.prototype={constructor:I0,on:function(e,t){var n=this._,o=fte(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i0)for(var n=new Array(r),o=0,r,i;o=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),tw.hasOwnProperty(t)?{space:tw[t],local:e}:e}function hte(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===By&&t.documentElement.namespaceURI===By?t.createElement(e):t.createElementNS(n,e)}}function mte(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function SL(e){var t=Dm(e);return(t.local?mte:hte)(t)}function gte(){}function Y5(e){return e==null?gte:function(){return this.querySelector(e)}}function yte(e){typeof e!="function"&&(e=Y5(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r=_&&(_=v+1);!(S=b[_])&&++_=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Vte(e){e||(e=Ute);function t(f,m){return f&&m?e(f.__data__,m.__data__):!f-!m}for(var n=this._groups,o=n.length,r=new Array(o),i=0;it?1:e>=t?0:NaN}function jte(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Wte(){return Array.from(this)}function Gte(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?one:typeof t=="function"?ine:rne)(e,t,n??"")):Pc(this.node(),e)}function Pc(e,t){return e.style.getPropertyValue(t)||LL(e).getComputedStyle(e,null).getPropertyValue(t)}function ane(e){return function(){delete this[e]}}function lne(e,t){return function(){this[e]=t}}function cne(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function une(e,t){return arguments.length>1?this.each((t==null?ane:typeof t=="function"?cne:lne)(e,t)):this.node()[e]}function IL(e){return e.trim().split(/^|\s+/)}function X5(e){return e.classList||new NL(e)}function NL(e){this._node=e,this._names=IL(e.getAttribute("class")||"")}NL.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 RL(e,t){for(var n=X5(e),o=-1,r=t.length;++o=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Bne(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n()=>e;function Fy(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}Fy.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Yne(e){return!e.ctrlKey&&!e.button}function Xne(){return this.parentNode}function Jne(e,t){return t??{x:e.x,y:e.y}}function Zne(){return navigator.maxTouchPoints||"ontouchstart"in this}function Kne(){var e=Yne,t=Xne,n=Jne,o=Zne,r={},i=Om("start","drag","end"),s=0,a,l,c,d,f=0;function m(w){w.on("mousedown.drag",h).filter(o).on("touchstart.drag",b).on("touchmove.drag",y,qne).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,S){if(!(d||!e.call(this,w,S))){var x=_(this,t.call(this,w,S),w,S,"mouse");x&&(wr(w.view).on("mousemove.drag",p,r1).on("mouseup.drag",g,r1),DL(w.view),Sg(w),c=!1,a=w.clientX,l=w.clientY,x("start",w))}}function p(w){if(gc(w),!c){var S=w.clientX-a,x=w.clientY-l;c=S*S+x*x>f}r.mouse("drag",w)}function g(w){wr(w.view).on("mousemove.drag mouseup.drag",null),zL(w.view,c),gc(w),r.mouse("end",w)}function b(w,S){if(e.call(this,w,S)){var x=w.changedTouches,E=t.call(this,w,S),T=x.length,N,I;for(N=0;N>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Bf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Bf(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=eoe.exec(e))?new Io(t[1],t[2],t[3],1):(t=toe.exec(e))?new Io(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=noe.exec(e))?Bf(t[1],t[2],t[3],t[4]):(t=ooe.exec(e))?Bf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=roe.exec(e))?lw(t[1],t[2]/100,t[3]/100,1):(t=ioe.exec(e))?lw(t[1],t[2]/100,t[3]/100,t[4]):nw.hasOwnProperty(e)?iw(nw[e]):e==="transparent"?new Io(NaN,NaN,NaN,0):null}function iw(e){return new Io(e>>16&255,e>>8&255,e&255,1)}function Bf(e,t,n,o){return o<=0&&(e=t=n=NaN),new Io(e,t,n,o)}function loe(e){return e instanceof V1||(e=a1(e)),e?(e=e.rgb(),new Io(e.r,e.g,e.b,e.opacity)):new Io}function $y(e,t,n,o){return arguments.length===1?loe(e):new Io(e,t,n,o??1)}function Io(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}J5(Io,$y,PL(V1,{brighter(e){return e=e==null?Xp:Math.pow(Xp,e),new Io(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?i1:Math.pow(i1,e),new Io(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Io(Qa(this.r),Qa(this.g),Qa(this.b),Jp(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:sw,formatHex:sw,formatHex8:coe,formatRgb:aw,toString:aw}));function sw(){return`#${ja(this.r)}${ja(this.g)}${ja(this.b)}`}function coe(){return`#${ja(this.r)}${ja(this.g)}${ja(this.b)}${ja((isNaN(this.opacity)?1:this.opacity)*255)}`}function aw(){const e=Jp(this.opacity);return`${e===1?"rgb(":"rgba("}${Qa(this.r)}, ${Qa(this.g)}, ${Qa(this.b)}${e===1?")":`, ${e})`}`}function Jp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ja(e){return e=Qa(e),(e<16?"0":"")+e.toString(16)}function lw(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Wr(e,t,n,o)}function BL(e){if(e instanceof Wr)return new Wr(e.h,e.s,e.l,e.opacity);if(e instanceof V1||(e=a1(e)),!e)return new Wr;if(e instanceof Wr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,l=(i+r)/2;return a?(t===i?s=(n-o)/a+(n0&&l<1?0:s,new Wr(s,a,l,e.opacity)}function uoe(e,t,n,o){return arguments.length===1?BL(e):new Wr(e,t,n,o??1)}function Wr(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}J5(Wr,uoe,PL(V1,{brighter(e){return e=e==null?Xp:Math.pow(Xp,e),new Wr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?i1:Math.pow(i1,e),new Wr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new Io(Eg(e>=240?e-240:e+120,r,o),Eg(e,r,o),Eg(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new Wr(cw(this.h),Ff(this.s),Ff(this.l),Jp(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=Jp(this.opacity);return`${e===1?"hsl(":"hsla("}${cw(this.h)}, ${Ff(this.s)*100}%, ${Ff(this.l)*100}%${e===1?")":`, ${e})`}`}}));function cw(e){return e=(e||0)%360,e<0?e+360:e}function Ff(e){return Math.max(0,Math.min(1,e||0))}function Eg(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const FL=e=>()=>e;function doe(e,t){return function(n){return e+n*t}}function foe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function poe(e){return(e=+e)==1?$L:function(t,n){return n-t?foe(t,n,e):FL(isNaN(t)?n:t)}}function $L(e,t){var n=t-e;return n?doe(e,n):FL(isNaN(e)?t:e)}const uw=function e(t){var n=poe(t);function o(r,i){var s=n((r=$y(r)).r,(i=$y(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=$L(r.opacity,i.opacity);return function(d){return r.r=s(d),r.g=a(d),r.b=l(d),r.opacity=c(d),r+""}}return o.gamma=e,o}(1);function Fs(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Hy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Cg=new RegExp(Hy.source,"g");function hoe(e){return function(){return e}}function moe(e){return function(t){return e(t)+""}}function goe(e,t){var n=Hy.lastIndex=Cg.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(o=Hy.exec(e))&&(r=Cg.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Fs(o,r)})),n=Cg.lastIndex;return n180?d+=360:d-c>180&&(c+=360),m.push({i:f.push(r(f)+"rotate(",null,o)-2,x:Fs(c,d)})):d&&f.push(r(f)+"rotate("+d+o)}function a(c,d,f,m){c!==d?m.push({i:f.push(r(f)+"skewX(",null,o)-2,x:Fs(c,d)}):d&&f.push(r(f)+"skewX("+d+o)}function l(c,d,f,m,h,p){if(c!==f||d!==m){var g=h.push(r(h)+"scale(",null,",",null,")");p.push({i:g-4,x:Fs(c,f)},{i:g-2,x:Fs(d,m)})}else(f!==1||m!==1)&&h.push(r(h)+"scale("+f+","+m+")")}return function(c,d){var f=[],m=[];return c=e(c),d=e(d),i(c.translateX,c.translateY,d.translateX,d.translateY,f,m),s(c.rotate,d.rotate,f,m),a(c.skewX,d.skewX,f,m),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,m),c=d=null,function(h){for(var p=-1,g=m.length,b;++p=0&&e._call.call(void 0,t),e=e._next;--Bc}function pw(){hl=(Kp=l1.now())+zm,Bc=Gu=0;try{Toe()}finally{Bc=0,Loe(),hl=0}}function koe(){var e=l1.now(),t=e-Kp;t>UL&&(zm-=t,Kp=e)}function Loe(){for(var e,t=Zp,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Zp=n);qu=e,Uy(o)}function Uy(e){if(!Bc){Gu&&(Gu=clearTimeout(Gu));var t=e-hl;t>24?(e<1/0&&(Gu=setTimeout(pw,e-l1.now()-zm)),Iu&&(Iu=clearInterval(Iu))):(Iu||(Kp=l1.now(),Iu=setInterval(koe,UL)),Bc=1,jL(pw))}}function hw(e,t,n){var o=new Qp;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Ioe=Om("start","end","cancel","interrupt"),Noe=[],GL=0,mw=1,jy=2,N0=3,gw=4,Wy=5,R0=6;function Pm(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Roe(e,n,{name:t,index:o,group:r,on:Ioe,tween:Noe,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:GL})}function K5(e,t){var n=oi(e,t);if(n.state>GL)throw new Error("too late; already scheduled");return n}function Oi(e,t){var n=oi(e,t);if(n.state>N0)throw new Error("too late; already running");return n}function oi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Roe(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=WL(i,0,n.time);function i(c){n.state=mw,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var d,f,m,h;if(n.state!==mw)return l();for(d in o)if(h=o[d],h.name===n.name){if(h.state===N0)return hw(s);h.state===gw?(h.state=R0,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[d]):+djy&&o.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function are(e,t,n){var o,r,i=sre(t)?K5:Oi;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function lre(e,t){var n=this._id;return arguments.length<2?oi(this.node(),n).on.on(e):this.each(are(n,e,t))}function cre(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function ure(){return this.on("end.remove",cre(this._id))}function dre(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Y5(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s()=>e;function zre(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Ji(e,t,n){this.k=e,this.x=t,this.y=n}Ji.prototype={constructor:Ji,scale:function(e){return e===1?this:new Ji(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ji(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 ts=new Ji(1,0,0);Ji.prototype;function Tg(e){e.stopImmediatePropagation()}function Nu(e){e.preventDefault(),e.stopImmediatePropagation()}function Pre(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Bre(){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 yw(){return this.__zoom||ts}function Fre(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function $re(){return navigator.maxTouchPoints||"ontouchstart"in this}function Hre(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function JL(){var e=Pre,t=Bre,n=Hre,o=Fre,r=$re,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Eoe,c=Om("start","zoom","end"),d,f,m,h=500,p=150,g=0,b=10;function y(C){C.property("__zoom",yw).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",I).filter(r).on("touchstart.zoom",R).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(C,M,A,$){var z=C.selection?C.selection():C;z.property("__zoom",yw),C!==z?S(C,M,A,$):z.interrupt().each(function(){x(this,arguments).event($).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},y.scaleBy=function(C,M,A,$){y.scaleTo(C,function(){var z=this.__zoom.k,L=typeof M=="function"?M.apply(this,arguments):M;return z*L},A,$)},y.scaleTo=function(C,M,A,$){y.transform(C,function(){var z=t.apply(this,arguments),L=this.__zoom,D=A==null?w(z):typeof A=="function"?A.apply(this,arguments):A,F=L.invert(D),V=typeof M=="function"?M.apply(this,arguments):M;return n(_(v(L,V),D,F),z,s)},A,$)},y.translateBy=function(C,M,A,$){y.transform(C,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),s)},null,$)},y.translateTo=function(C,M,A,$,z){y.transform(C,function(){var L=t.apply(this,arguments),D=this.__zoom,F=$==null?w(L):typeof $=="function"?$.apply(this,arguments):$;return n(ts.translate(F[0],F[1]).scale(D.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof A=="function"?-A.apply(this,arguments):-A),L,s)},$,z)};function v(C,M){return M=Math.max(i[0],Math.min(i[1],M)),M===C.k?C:new Ji(M,C.x,C.y)}function _(C,M,A){var $=M[0]-A[0]*C.k,z=M[1]-A[1]*C.k;return $===C.x&&z===C.y?C:new Ji(C.k,$,z)}function w(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function S(C,M,A,$){C.on("start.zoom",function(){x(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){x(this,arguments).event($).end()}).tween("zoom",function(){var z=this,L=arguments,D=x(z,L).event($),F=t.apply(z,L),V=A==null?w(F):typeof A=="function"?A.apply(z,L):A,G=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),U=z.__zoom,W=typeof M=="function"?M.apply(z,L):M,H=l(U.invert(V).concat(G/U.k),W.invert(V).concat(G/W.k));return function(q){if(q===1)q=W;else{var j=H(q),X=G/j[2];q=new Ji(X,V[0]-j[0]*X,V[1]-j[1]*X)}D.zoom(null,q)}})}function x(C,M,A){return!A&&C.__zooming||new E(C,M)}function E(C,M){this.that=C,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,M),this.taps=0}E.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,M){return this.mouse&&C!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var M=wr(this.that).datum();c.call(C,this.that,new zre(C,{sourceEvent:this.sourceEvent,target:y,type:C,transform:this.that.__zoom,dispatch:c}),M)}};function T(C,...M){if(!e.apply(this,arguments))return;var A=x(this,M).event(C),$=this.__zoom,z=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,o.apply(this,arguments)))),L=$r(C);if(A.wheel)(A.mouse[0][0]!==L[0]||A.mouse[0][1]!==L[1])&&(A.mouse[1]=$.invert(A.mouse[0]=L)),clearTimeout(A.wheel);else{if($.k===z)return;A.mouse=[L,$.invert(L)],M0(this),A.start()}Nu(C),A.wheel=setTimeout(D,p),A.zoom("mouse",n(_(v($,z),A.mouse[0],A.mouse[1]),A.extent,s));function D(){A.wheel=null,A.end()}}function N(C,...M){if(m||!e.apply(this,arguments))return;var A=C.currentTarget,$=x(this,M,!0).event(C),z=wr(C.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",G,!0),L=$r(C,A),D=C.clientX,F=C.clientY;DL(C.view),Tg(C),$.mouse=[L,this.__zoom.invert(L)],M0(this),$.start();function V(U){if(Nu(U),!$.moved){var W=U.clientX-D,H=U.clientY-F;$.moved=W*W+H*H>g}$.event(U).zoom("mouse",n(_($.that.__zoom,$.mouse[0]=$r(U,A),$.mouse[1]),$.extent,s))}function G(U){z.on("mousemove.zoom mouseup.zoom",null),zL(U.view,$.moved),Nu(U),$.event(U).end()}}function I(C,...M){if(e.apply(this,arguments)){var A=this.__zoom,$=$r(C.changedTouches?C.changedTouches[0]:C,this),z=A.invert($),L=A.k*(C.shiftKey?.5:2),D=n(_(v(A,L),$,z),t.apply(this,M),s);Nu(C),a>0?wr(this).transition().duration(a).call(S,D,$,C):wr(this).call(y.transform,D,$,C)}}function R(C,...M){if(e.apply(this,arguments)){var A=C.touches,$=A.length,z=x(this,M,C.changedTouches.length===$).event(C),L,D,F,V;for(Tg(C),D=0;D<$;++D)F=A[D],V=$r(F,this),V=[V,this.__zoom.invert(V),F.identifier],z.touch0?!z.touch1&&z.touch0[2]!==V[2]&&(z.touch1=V,z.taps=0):(z.touch0=V,L=!0,z.taps=1+!!d);d&&(d=clearTimeout(d)),L&&(z.taps<2&&(f=V[0],d=setTimeout(function(){d=null},h)),M0(this),z.start())}}function O(C,...M){if(this.__zooming){var A=x(this,M).event(C),$=C.changedTouches,z=$.length,L,D,F,V;for(Nu(C),L=0;L"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},ZL=ds.error001();function Et(e,t){const n=u.useContext(Bm);if(n===null)throw new Error(ZL);return xL(n,e,t)}const un=()=>{const e=u.useContext(Bm);if(e===null)throw new Error(ZL);return u.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},Ure=e=>e.userSelectionActive?"none":"all";function Fm({position:e,children:t,className:n,style:o,...r}){const i=Et(Ure),s=`${e}`.split("-");return P.createElement("div",{className:Pn(["react-flow__panel",n,...s]),style:{...o,pointerEvents:i},...r},t)}function jre({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:P.createElement(Fm,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},P.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Wre=({x:e,y:t,label:n,labelStyle:o={},labelShowBg:r=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const f=u.useRef(null),[m,h]=u.useState({x:0,y:0,width:0,height:0}),p=Pn(["react-flow__edge-textwrapper",c]);return u.useEffect(()=>{if(f.current){const g=f.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),typeof n>"u"||!n?null:P.createElement("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:p,visibility:m.width?"visible":"hidden",...d},r&&P.createElement("rect",{width:m.width+2*s[0],x:-s[0],y:-s[1],height:m.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),P.createElement("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:f,style:o},n),l)};var Gre=u.memo(Wre);const eb=e=>({width:e.offsetWidth,height:e.offsetHeight}),Fc=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),tb=(e={x:0,y:0},t)=>({x:Fc(e.x,t[0][0],t[1][0]),y:Fc(e.y,t[0][1],t[1][1])}),vw=(e,t,n)=>en?-Fc(Math.abs(e-n),1,50)/50:0,KL=(e,t)=>{const n=vw(e.x,35,t.width-35)*20,o=vw(e.y,35,t.height-35)*20;return[n,o]},QL=e=>e.getRootNode?.()||window?.document,eI=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),c1=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),tI=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),bw=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),qre=(e,t)=>tI(eI(c1(e),c1(t))),Gy=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Yre=e=>Er(e.width)&&Er(e.height)&&Er(e.x)&&Er(e.y),Er=e=>!isNaN(e)&&isFinite(e),Vt=Symbol.for("internals"),nI=["Enter"," ","Escape"],Xre=(e,t)=>{},Jre=e=>"nativeEvent"in e;function qy(e){const n=(Jre(e)?e.nativeEvent:e).composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const oI=e=>"clientX"in e,sa=(e,t)=>{const n=oI(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},eh=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,U1=({id:e,path:t,labelX:n,labelY:o,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:m,interactionWidth:h=20})=>P.createElement(P.Fragment,null,P.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:m}),h&&P.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),r&&Er(n)&&Er(o)?P.createElement(Gre,{x:n,y:o,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null);U1.displayName="BaseEdge";function Ru(e,t,n){return n===void 0?n:o=>{const r=t().edges.find(i=>i.id===e);r&&n(o,{...r})}}function rI({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n{const[b,y,v]=sI({sourceX:e,sourceY:t,sourcePosition:r,targetX:n,targetY:o,targetPosition:i});return P.createElement(U1,{path:b,labelX:y,labelY:v,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:m,markerEnd:h,markerStart:p,interactionWidth:g})});nb.displayName="SimpleBezierEdge";const ww={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},Zre=({source:e,sourcePosition:t=me.Bottom,target:n})=>t===me.Left||t===me.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Kre({source:e,sourcePosition:t=me.Bottom,target:n,targetPosition:o=me.Top,center:r,offset:i}){const s=ww[t],a=ww[o],l={x:e.x+s.x*i,y:e.y+s.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},d=Zre({source:l,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",m=d[f];let h=[],p,g;const b={x:0,y:0},y={x:0,y:0},[v,_,w,S]=rI({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*a[f]===-1){p=r.x??v,g=r.y??_;const E=[{x:p,y:l.y},{x:p,y:c.y}],T=[{x:l.x,y:g},{x:c.x,y:g}];s[f]===m?h=f==="x"?E:T:h=f==="x"?T:E}else{const E=[{x:l.x,y:c.y}],T=[{x:c.x,y:l.y}];if(f==="x"?h=s.x===m?T:E:h=s.y===m?E:T,t===o){const B=Math.abs(e[f]-n[f]);if(B<=i){const C=Math.min(i-1,i-B);s[f]===m?b[f]=(l[f]>e[f]?-1:1)*C:y[f]=(c[f]>n[f]?-1:1)*C}}if(t!==o){const B=f==="x"?"y":"x",C=s[f]===a[B],M=l[B]>c[B],A=l[B]=O?(p=(N.x+I.x)/2,g=h[0].y):(p=h[0].x,g=(N.y+I.y)/2)}return[[e,{x:l.x+b.x,y:l.y+b.y},...h,{x:c.x+y.x,y:c.y+y.y},n],p,g,w,S]}function Qre(e,t,n,o){const r=Math.min(xw(e,t)/2,xw(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const c=e.x{let _="";return v>0&&v{const[y,v,_]=Yy({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:o,targetPosition:m,borderRadius:g?.borderRadius,offset:g?.offset});return P.createElement(U1,{path:y,labelX:v,labelY:_,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:p,interactionWidth:b})});$m.displayName="SmoothStepEdge";const ob=u.memo(e=>P.createElement($m,{...e,pathOptions:u.useMemo(()=>({borderRadius:0,offset:e.pathOptions?.offset}),[e.pathOptions?.offset])}));ob.displayName="StepEdge";function eie({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=rI({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const rb=u.memo(({sourceX:e,sourceY:t,targetX:n,targetY:o,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:m,interactionWidth:h})=>{const[p,g,b]=eie({sourceX:e,sourceY:t,targetX:n,targetY:o});return P.createElement(U1,{path:p,labelX:g,labelY:b,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:m,interactionWidth:h})});rb.displayName="StraightEdge";function Vf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Sw({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case me.Left:return[t-Vf(t-o,i),n];case me.Right:return[t+Vf(o-t,i),n];case me.Top:return[t,n-Vf(n-r,i)];case me.Bottom:return[t,n+Vf(r-n,i)]}}function aI({sourceX:e,sourceY:t,sourcePosition:n=me.Bottom,targetX:o,targetY:r,targetPosition:i=me.Top,curvature:s=.25}){const[a,l]=Sw({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[c,d]=Sw({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[f,m,h,p]=iI({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${a},${l} ${c},${d} ${o},${r}`,f,m,h,p]}const th=u.memo(({sourceX:e,sourceY:t,targetX:n,targetY:o,sourcePosition:r=me.Bottom,targetPosition:i=me.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:m,markerEnd:h,markerStart:p,pathOptions:g,interactionWidth:b})=>{const[y,v,_]=aI({sourceX:e,sourceY:t,sourcePosition:r,targetX:n,targetY:o,targetPosition:i,curvature:g?.curvature});return P.createElement(U1,{path:y,labelX:v,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:m,markerEnd:h,markerStart:p,interactionWidth:b})});th.displayName="BezierEdge";const ib=u.createContext(null),tie=ib.Provider;ib.Consumer;const nie=()=>u.useContext(ib),oie=e=>"id"in e&&"source"in e&&"target"in e,rie=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`reactflow__edge-${e}${t||""}-${n}${o||""}`,Xy=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`,iie=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),sie=(e,t)=>{if(!e.source||!e.target)return t;let n;return oie(e)?n={...e}:n={...e,id:rie(e)},iie(n,t)?t:t.concat(n)},Jy=({x:e,y:t},[n,o,r],i,[s,a])=>{const l={x:(e-n)/r,y:(t-o)/r};return i?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},lI=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o}),el=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],o=(e.height??0)*t[1],r={x:e.position.x-n,y:e.position.y-o};return{...r,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-o}:r}},Hm=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const{x:i,y:s}=el(r,t).positionAbsolute;return eI(o,c1({x:i,y:s,width:r.width||0,height:r.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return tI(n)},cI=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1,a=[0,0])=>{const l={x:(t.x-n)/r,y:(t.y-o)/r,width:t.width/r,height:t.height/r},c=[];return e.forEach(d=>{const{width:f,height:m,selectable:h=!0,hidden:p=!1}=d;if(s&&!h||p)return!1;const{positionAbsolute:g}=el(d,a),b={x:g.x,y:g.y,width:f||0,height:m||0},y=Gy(l,b),v=typeof f>"u"||typeof m>"u"||f===null||m===null,_=i&&y>0,w=(f||0)*(m||0);(v||_||y>=w||d.dragging)&&c.push(d)}),c},uI=(e,t)=>{const n=e.map(o=>o.id);return t.filter(o=>n.includes(o.source)||n.includes(o.target))},dI=(e,t,n,o,r,i=.1)=>{const s=t/(e.width*(1+i)),a=n/(e.height*(1+i)),l=Math.min(s,a),c=Fc(l,o,r),d=e.x+e.width/2,f=e.y+e.height/2,m=t/2-d*c,h=n/2-f*c;return{x:m,y:h,zoom:c}},Na=(e,t=0)=>e.transition().duration(t);function Ew(e,t,n,o){return(t[n]||[]).reduce((r,i)=>(`${e.id}-${i.id}-${n}`!==o&&r.push({id:i.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+i.x+i.width/2,y:(e.positionAbsolute?.y??0)+i.y+i.height/2}),r),[])}function aie(e,t,n,o,r,i){const{x:s,y:a}=sa(e),c=t.elementsFromPoint(s,a).find(p=>p.classList.contains("react-flow__handle"));if(c){const p=c.getAttribute("data-nodeid");if(p){const g=sb(void 0,c),b=c.getAttribute("data-handleid"),y=i({nodeId:p,id:b,type:g});if(y){const v=r.find(_=>_.nodeId===p&&_.type===g&&_.id===b);return{handle:{id:b,type:g,nodeId:p,x:v?.x||n.x,y:v?.y||n.y},validHandleResult:y}}}}let d=[],f=1/0;if(r.forEach(p=>{const g=Math.sqrt((p.x-n.x)**2+(p.y-n.y)**2);if(g<=o){const b=i(p);g<=f&&(gp.isValid),h=d.some(({handle:p})=>p.type==="target");return d.find(({handle:p,validHandleResult:g})=>h?p.type==="target":m?g.isValid:!0)||d[0]}const lie={source:null,target:null,sourceHandle:null,targetHandle:null},fI=()=>({handleDomNode:null,isValid:!1,connection:lie,endHandle:null});function pI(e,t,n,o,r,i,s){const a=r==="target",l=s.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...fI(),handleDomNode:l};if(l){const d=sb(void 0,l),f=l.getAttribute("data-nodeid"),m=l.getAttribute("data-handleid"),h=l.classList.contains("connectable"),p=l.classList.contains("connectableend"),g={source:a?f:n,sourceHandle:a?m:o,target:a?n:f,targetHandle:a?o:m};c.connection=g,h&&p&&(t===ml.Strict?a&&d==="source"||!a&&d==="target":f!==n||m!==o)&&(c.endHandle={nodeId:f,handleId:m,type:d},c.isValid=i(g))}return c}function cie({nodes:e,nodeId:t,handleId:n,handleType:o}){return e.reduce((r,i)=>{if(i[Vt]){const{handleBounds:s}=i[Vt];let a=[],l=[];s&&(a=Ew(i,s,"source",`${t}-${n}-${o}`),l=Ew(i,s,"target",`${t}-${n}-${o}`)),r.push(...a,...l)}return r},[])}function sb(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function kg(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function uie(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function hI({event:e,handleId:t,nodeId:n,onConnect:o,isTarget:r,getState:i,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:c}){const d=QL(e.target),{connectionMode:f,domNode:m,autoPanOnConnect:h,connectionRadius:p,onConnectStart:g,panBy:b,getNodes:y,cancelConnection:v}=i();let _=0,w;const{x:S,y:x}=sa(e),E=d?.elementFromPoint(S,x),T=sb(l,E),N=m?.getBoundingClientRect();if(!N||!T)return;let I,R=sa(e,N),O=!1,B=null,C=!1,M=null;const A=cie({nodes:y(),nodeId:n,handleId:t,handleType:T}),$=()=>{if(!h)return;const[D,F]=KL(R,N);b({x:D,y:F}),_=requestAnimationFrame($)};s({connectionPosition:R,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:T,connectionStartHandle:{nodeId:n,handleId:t,type:T},connectionEndHandle:null}),g?.(e,{nodeId:n,handleId:t,handleType:T});function z(D){const{transform:F}=i();R=sa(D,N);const{handle:V,validHandleResult:G}=aie(D,d,Jy(R,F,!1,[1,1]),p,A,U=>pI(U,f,n,t,r?"target":"source",a,d));if(w=V,O||($(),O=!0),M=G.handleDomNode,B=G.connection,C=G.isValid,s({connectionPosition:w&&C?lI({x:w.x,y:w.y},F):R,connectionStatus:uie(!!w,C),connectionEndHandle:G.endHandle}),!w&&!C&&!M)return kg(I);B.source!==B.target&&M&&(kg(I),I=M,M.classList.add("connecting","react-flow__handle-connecting"),M.classList.toggle("valid",C),M.classList.toggle("react-flow__handle-valid",C))}function L(D){(w||M)&&B&&C&&o?.(B),i().onConnectEnd?.(D),l&&c?.(D),kg(I),v(),cancelAnimationFrame(_),O=!1,C=!1,B=null,M=null,d.removeEventListener("mousemove",z),d.removeEventListener("mouseup",L),d.removeEventListener("touchmove",z),d.removeEventListener("touchend",L)}d.addEventListener("mousemove",z),d.addEventListener("mouseup",L),d.addEventListener("touchmove",z),d.addEventListener("touchend",L)}const Cw=()=>!0,die=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),fie=(e,t,n)=>o=>{const{connectionStartHandle:r,connectionEndHandle:i,connectionClickStartHandle:s}=o;return{connecting:r?.nodeId===e&&r?.handleId===t&&r?.type===n||i?.nodeId===e&&i?.handleId===t&&i?.type===n,clickConnecting:s?.nodeId===e&&s?.handleId===t&&s?.type===n}},mI=u.forwardRef(({type:e="source",position:t=me.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:f,...m},h)=>{const p=s||null,g=e==="target",b=un(),y=nie(),{connectOnClick:v,noPanClassName:_}=Et(die,wn),{connecting:w,clickConnecting:S}=Et(fie(y,p,e),wn);y||b.getState().onError?.("010",ds.error010());const x=N=>{const{defaultEdgeOptions:I,onConnect:R,hasDefaultEdges:O}=b.getState(),B={...I,...N};if(O){const{edges:C,setEdges:M}=b.getState();M(sie(B,C))}R?.(B),a?.(B)},E=N=>{if(!y)return;const I=oI(N);r&&(I&&N.button===0||!I)&&hI({event:N,handleId:p,nodeId:y,onConnect:x,isTarget:g,getState:b.getState,setState:b.setState,isValidConnection:n||b.getState().isValidConnection||Cw}),I?d?.(N):f?.(N)},T=N=>{const{onClickConnectStart:I,onClickConnectEnd:R,connectionClickStartHandle:O,connectionMode:B,isValidConnection:C}=b.getState();if(!y||!O&&!r)return;if(!O){I?.(N,{nodeId:y,handleId:p,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:y,type:e,handleId:p}});return}const M=QL(N.target),A=n||C||Cw,{connection:$,isValid:z}=pI({nodeId:y,id:p,type:e},B,O.nodeId,O.handleId||null,O.type,A,M);z&&x($),R?.(N),b.setState({connectionClickStartHandle:null})};return P.createElement("div",{"data-handleid":p,"data-nodeid":y,"data-handlepos":t,"data-id":`${y}-${p}-${e}`,className:Pn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,c,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:i,connecting:S,connectionindicator:o&&(r&&!w||i&&w)}]),onMouseDown:E,onTouchStart:E,onClick:v?T:void 0,ref:h,...m},l)});mI.displayName="Handle";var Hc=u.memo(mI);const gI=({data:e,isConnectable:t,targetPosition:n=me.Top,sourcePosition:o=me.Bottom})=>P.createElement(P.Fragment,null,P.createElement(Hc,{type:"target",position:n,isConnectable:t}),e?.label,P.createElement(Hc,{type:"source",position:o,isConnectable:t}));gI.displayName="DefaultNode";var Zy=u.memo(gI);const yI=({data:e,isConnectable:t,sourcePosition:n=me.Bottom})=>P.createElement(P.Fragment,null,e?.label,P.createElement(Hc,{type:"source",position:n,isConnectable:t}));yI.displayName="InputNode";var vI=u.memo(yI);const bI=({data:e,isConnectable:t,targetPosition:n=me.Top})=>P.createElement(P.Fragment,null,P.createElement(Hc,{type:"target",position:n,isConnectable:t}),e?.label);bI.displayName="OutputNode";var _I=u.memo(bI);const ab=()=>null;ab.displayName="GroupNode";const pie=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Uf=e=>e.id;function hie(e,t){return wn(e.selectedNodes.map(Uf),t.selectedNodes.map(Uf))&&wn(e.selectedEdges.map(Uf),t.selectedEdges.map(Uf))}const wI=u.memo(({onSelectionChange:e})=>{const t=un(),{selectedNodes:n,selectedEdges:o}=Et(pie,hie);return u.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChange.forEach(i=>i(r))},[n,o,e]),null});wI.displayName="SelectionListener";const mie=e=>!!e.onSelectionChange;function gie({onSelectionChange:e}){const t=Et(mie);return e||t?P.createElement(wI,{onSelectionChange:e}):null}const yie=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Dl(e,t){u.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Ve(e,t,n){u.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const vie=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:r,onConnectStart:i,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:f,edgesFocusable:m,edgesUpdatable:h,elevateNodesOnSelect:p,minZoom:g,maxZoom:b,nodeExtent:y,onNodesChange:v,onEdgesChange:_,elementsSelectable:w,connectionMode:S,snapGrid:x,snapToGrid:E,translateExtent:T,connectOnClick:N,defaultEdgeOptions:I,fitView:R,fitViewOptions:O,onNodesDelete:B,onEdgesDelete:C,onNodeDrag:M,onNodeDragStart:A,onNodeDragStop:$,onSelectionDrag:z,onSelectionDragStart:L,onSelectionDragStop:D,noPanClassName:F,nodeOrigin:V,rfId:G,autoPanOnConnect:U,autoPanOnNodeDrag:W,onError:H,connectionRadius:q,isValidConnection:j,nodeDragThreshold:X})=>{const{setNodes:J,setEdges:K,setDefaultNodesAndEdges:Y,setMinZoom:Z,setMaxZoom:oe,setTranslateExtent:ce,setNodeExtent:ae,reset:he}=Et(yie,wn),ne=un();return u.useEffect(()=>{const Pe=o?.map(Ee=>({...Ee,...I}));return Y(n,Pe),()=>{he()}},[]),Ve("defaultEdgeOptions",I,ne.setState),Ve("connectionMode",S,ne.setState),Ve("onConnect",r,ne.setState),Ve("onConnectStart",i,ne.setState),Ve("onConnectEnd",s,ne.setState),Ve("onClickConnectStart",a,ne.setState),Ve("onClickConnectEnd",l,ne.setState),Ve("nodesDraggable",c,ne.setState),Ve("nodesConnectable",d,ne.setState),Ve("nodesFocusable",f,ne.setState),Ve("edgesFocusable",m,ne.setState),Ve("edgesUpdatable",h,ne.setState),Ve("elementsSelectable",w,ne.setState),Ve("elevateNodesOnSelect",p,ne.setState),Ve("snapToGrid",E,ne.setState),Ve("snapGrid",x,ne.setState),Ve("onNodesChange",v,ne.setState),Ve("onEdgesChange",_,ne.setState),Ve("connectOnClick",N,ne.setState),Ve("fitViewOnInit",R,ne.setState),Ve("fitViewOnInitOptions",O,ne.setState),Ve("onNodesDelete",B,ne.setState),Ve("onEdgesDelete",C,ne.setState),Ve("onNodeDrag",M,ne.setState),Ve("onNodeDragStart",A,ne.setState),Ve("onNodeDragStop",$,ne.setState),Ve("onSelectionDrag",z,ne.setState),Ve("onSelectionDragStart",L,ne.setState),Ve("onSelectionDragStop",D,ne.setState),Ve("noPanClassName",F,ne.setState),Ve("nodeOrigin",V,ne.setState),Ve("rfId",G,ne.setState),Ve("autoPanOnConnect",U,ne.setState),Ve("autoPanOnNodeDrag",W,ne.setState),Ve("onError",H,ne.setState),Ve("connectionRadius",q,ne.setState),Ve("isValidConnection",j,ne.setState),Ve("nodeDragThreshold",X,ne.setState),Dl(e,J),Dl(t,K),Dl(g,Z),Dl(b,oe),Dl(T,ce),Dl(y,ae),null},Tw={display:"none"},bie={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},xI="react-flow__node-desc",SI="react-flow__edge-desc",_ie="react-flow__aria-live",wie=e=>e.ariaLiveMessage;function xie({rfId:e}){const t=Et(wie);return P.createElement("div",{id:`${_ie}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:bie},t)}function Sie({rfId:e,disableKeyboardA11y:t}){return P.createElement(P.Fragment,null,P.createElement("div",{id:`${xI}-${e}`,style:Tw},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),P.createElement("div",{id:`${SI}-${e}`,style:Tw},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&P.createElement(xie,{rfId:e}))}var d1=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,o]=u.useState(!1),r=u.useRef(!1),i=u.useRef(new Set([])),[s,a]=u.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),d=c.reduce((f,m)=>f.concat(...m),[]);return[c,d]}return[[],[]]},[e]);return u.useEffect(()=>{const l=typeof document<"u"?document:null,c=t?.target||l;if(e!==null){const d=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey,(!r.current||r.current&&!t.actInsideInputWithModifier)&&qy(h))return!1;const g=Lw(h.code,a);i.current.add(h[g]),kw(s,i.current,!1)&&(h.preventDefault(),o(!0))},f=h=>{if((!r.current||r.current&&!t.actInsideInputWithModifier)&&qy(h))return!1;const g=Lw(h.code,a);kw(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),r.current=!1},m=()=>{i.current.clear(),o(!1)};return c?.addEventListener("keydown",d),c?.addEventListener("keyup",f),window.addEventListener("blur",m),()=>{c?.removeEventListener("keydown",d),c?.removeEventListener("keyup",f),window.removeEventListener("blur",m)}}},[e,o]),n};function kw(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function Lw(e,t){return t.includes(e)?"code":"key"}function EI(e,t,n,o){const r=e.parentNode||e.parentId;if(!r)return n;const i=t.get(r),s=el(i,o);return EI(i,t,{x:(n.x??0)+s.x,y:(n.y??0)+s.y,z:(i[Vt]?.z??0)>(n.z??0)?i[Vt]?.z??0:n.z??0},o)}function CI(e,t,n){e.forEach(o=>{const r=o.parentNode||o.parentId;if(r&&!e.has(r))throw new Error(`Parent node ${r} not found`);if(r||n?.[o.id]){const{x:i,y:s,z:a}=EI(o,e,{...o.position,z:o[Vt]?.z??0},t);o.positionAbsolute={x:i,y:s},o[Vt].z=a,n?.[o.id]&&(o[Vt].isParent=!0)}})}function Lg(e,t,n,o){const r=new Map,i={},s=o?1e3:0;return e.forEach(a=>{const l=(Er(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=t.get(a.id),d={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},f=a.parentNode||a.parentId;f&&(i[f]=!0);const m=c?.type&&c?.type!==a.type;Object.defineProperty(d,Vt,{enumerable:!1,value:{handleBounds:m?void 0:c?.[Vt]?.handleBounds,z:l}}),r.set(a.id,d)}),CI(r,n,i),r}function TI(e,t={}){const{getNodes:n,width:o,height:r,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:f}=e(),m=t.initial&&!c&&d;if(a&&l&&(m||!t.initial)){const p=n().filter(b=>{const y=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return t.nodes?.length?y&&t.nodes.some(v=>v.id===b.id):y}),g=p.every(b=>b.width&&b.height);if(p.length>0&&g){const b=Hm(p,f),{x:y,y:v,zoom:_}=dI(b,o,r,t.minZoom??i,t.maxZoom??s,t.padding??.1),w=ts.translate(y,v).scale(_);return typeof t.duration=="number"&&t.duration>0?a.transform(Na(l,t.duration),w):a.transform(l,w),!0}}return!1}function Eie(e,t){return e.forEach(n=>{const o=t.get(n.id);o&&t.set(o.id,{...o,[Vt]:o[Vt],selected:n.selected})}),new Map(t)}function Cie(e,t){return t.map(n=>{const o=e.find(r=>r.id===n.id);return o&&(n.selected=o.selected),n})}function jf({changedNodes:e,changedEdges:t,get:n,set:o}){const{nodeInternals:r,edges:i,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&o({nodeInternals:Eie(e,r)}),s?.(e)),t?.length&&(c&&o({edges:Cie(t,i)}),a?.(t))}const zl=()=>{},Tie={zoomIn:zl,zoomOut:zl,zoomTo:zl,getZoom:()=>1,setViewport:zl,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:zl,fitBounds:zl,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},kie=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Lie=()=>{const e=un(),{d3Zoom:t,d3Selection:n}=Et(kie,wn);return u.useMemo(()=>n&&t?{zoomIn:r=>t.scaleBy(Na(n,r?.duration),1.2),zoomOut:r=>t.scaleBy(Na(n,r?.duration),1/1.2),zoomTo:(r,i)=>t.scaleTo(Na(n,i?.duration),r),getZoom:()=>e.getState().transform[2],setViewport:(r,i)=>{const[s,a,l]=e.getState().transform,c=ts.translate(r.x??s,r.y??a).scale(r.zoom??l);t.transform(Na(n,i?.duration),c)},getViewport:()=>{const[r,i,s]=e.getState().transform;return{x:r,y:i,zoom:s}},fitView:r=>TI(e.getState,r),setCenter:(r,i,s)=>{const{width:a,height:l,maxZoom:c}=e.getState(),d=typeof s?.zoom<"u"?s.zoom:c,f=a/2-r*d,m=l/2-i*d,h=ts.translate(f,m).scale(d);t.transform(Na(n,s?.duration),h)},fitBounds:(r,i)=>{const{width:s,height:a,minZoom:l,maxZoom:c}=e.getState(),{x:d,y:f,zoom:m}=dI(r,s,a,l,c,i?.padding??.1),h=ts.translate(d,f).scale(m);t.transform(Na(n,i?.duration),h)},project:r=>{const{transform:i,snapToGrid:s,snapGrid:a}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Jy(r,i,s,a)},screenToFlowPosition:r=>{const{transform:i,snapToGrid:s,snapGrid:a,domNode:l}=e.getState();if(!l)return r;const{x:c,y:d}=l.getBoundingClientRect(),f={x:r.x-c,y:r.y-d};return Jy(f,i,s,a)},flowToScreenPosition:r=>{const{transform:i,domNode:s}=e.getState();if(!s)return r;const{x:a,y:l}=s.getBoundingClientRect(),c=lI(r,i);return{x:c.x+a,y:c.y+l}},viewportInitialized:!0}:Tie,[t,n])};function Vm(){const e=Lie(),t=un(),n=u.useCallback(()=>t.getState().getNodes().map(g=>({...g})),[]),o=u.useCallback(g=>t.getState().nodeInternals.get(g),[]),r=u.useCallback(()=>{const{edges:g=[]}=t.getState();return g.map(b=>({...b}))},[]),i=u.useCallback(g=>{const{edges:b=[]}=t.getState();return b.find(y=>y.id===g)},[]),s=u.useCallback(g=>{const{getNodes:b,setNodes:y,hasDefaultNodes:v,onNodesChange:_}=t.getState(),w=b(),S=typeof g=="function"?g(w):g;if(v)y(S);else if(_){const x=S.length===0?w.map(E=>({type:"remove",id:E.id})):S.map(E=>({item:E,type:"reset"}));_(x)}},[]),a=u.useCallback(g=>{const{edges:b=[],setEdges:y,hasDefaultEdges:v,onEdgesChange:_}=t.getState(),w=typeof g=="function"?g(b):g;if(v)y(w);else if(_){const S=w.length===0?b.map(x=>({type:"remove",id:x.id})):w.map(x=>({item:x,type:"reset"}));_(S)}},[]),l=u.useCallback(g=>{const b=Array.isArray(g)?g:[g],{getNodes:y,setNodes:v,hasDefaultNodes:_,onNodesChange:w}=t.getState();if(_){const x=[...y(),...b];v(x)}else if(w){const S=b.map(x=>({item:x,type:"add"}));w(S)}},[]),c=u.useCallback(g=>{const b=Array.isArray(g)?g:[g],{edges:y=[],setEdges:v,hasDefaultEdges:_,onEdgesChange:w}=t.getState();if(_)v([...y,...b]);else if(w){const S=b.map(x=>({item:x,type:"add"}));w(S)}},[]),d=u.useCallback(()=>{const{getNodes:g,edges:b=[],transform:y}=t.getState(),[v,_,w]=y;return{nodes:g().map(S=>({...S})),edges:b.map(S=>({...S})),viewport:{x:v,y:_,zoom:w}}},[]),f=u.useCallback(({nodes:g,edges:b})=>{const{nodeInternals:y,getNodes:v,edges:_,hasDefaultNodes:w,hasDefaultEdges:S,onNodesDelete:x,onEdgesDelete:E,onNodesChange:T,onEdgesChange:N}=t.getState(),I=(g||[]).map(M=>M.id),R=(b||[]).map(M=>M.id),O=v().reduce((M,A)=>{const $=A.parentNode||A.parentId,z=!I.includes(A.id)&&$&&M.find(D=>D.id===$);return(typeof A.deletable=="boolean"?A.deletable:!0)&&(I.includes(A.id)||z)&&M.push(A),M},[]),B=_.filter(M=>typeof M.deletable=="boolean"?M.deletable:!0),C=B.filter(M=>R.includes(M.id));if(O||C){const M=uI(O,B),A=[...C,...M],$=A.reduce((z,L)=>(z.includes(L.id)||z.push(L.id),z),[]);if((S||w)&&(S&&t.setState({edges:_.filter(z=>!$.includes(z.id))}),w&&(O.forEach(z=>{y.delete(z.id)}),t.setState({nodeInternals:new Map(y)}))),$.length>0&&(E?.(A),N&&N($.map(z=>({id:z,type:"remove"})))),O.length>0&&(x?.(O),T)){const z=O.map(L=>({id:L.id,type:"remove"}));T(z)}}},[]),m=u.useCallback(g=>{const b=Yre(g),y=b?null:t.getState().nodeInternals.get(g.id);return!b&&!y?[null,null,b]:[b?g:bw(y),y,b]},[]),h=u.useCallback((g,b=!0,y)=>{const[v,_,w]=m(g);return v?(y||t.getState().getNodes()).filter(S=>{if(!w&&(S.id===_.id||!S.positionAbsolute))return!1;const x=bw(S),E=Gy(x,v);return b&&E>0||E>=v.width*v.height}):[]},[]),p=u.useCallback((g,b,y=!0)=>{const[v]=m(g);if(!v)return!1;const _=Gy(v,b);return y&&_>0||_>=v.width*v.height},[]);return u.useMemo(()=>({...e,getNodes:n,getNode:o,getEdges:r,getEdge:i,setNodes:s,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:p}),[e,n,o,r,i,s,a,l,c,d,f,h,p])}const Iie={actInsideInputWithModifier:!1};var Nie=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=un(),{deleteElements:o}=Vm(),r=d1(e,Iie),i=d1(t);u.useEffect(()=>{if(r){const{edges:s,getNodes:a}=n.getState(),l=a().filter(d=>d.selected),c=s.filter(d=>d.selected);o({nodes:l,edges:c}),n.setState({nodesSelectionActive:!1})}},[r]),u.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function Rie(e){const t=un();u.useEffect(()=>{let n;const o=()=>{if(!e.current)return;const r=eb(e.current);(r.height===0||r.width===0)&&t.getState().onError?.("004",ds.error004()),t.setState({width:r.width||500,height:r.height||500})};return o(),window.addEventListener("resize",o),e.current&&(n=new ResizeObserver(()=>o()),n.observe(e.current)),()=>{window.removeEventListener("resize",o),n&&e.current&&n.unobserve(e.current)}},[])}const lb={position:"absolute",width:"100%",height:"100%",top:0,left:0},Mie=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Wf=e=>({x:e.x,y:e.y,zoom:e.k}),Pl=(e,t)=>e.target.closest(`.${t}`),Iw=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Nw=e=>{const t=e.ctrlKey&&eh()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Aie=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Oie=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:o,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=Wa.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:m,translateExtent:h,minZoom:p,maxZoom:g,zoomActivationKeyCode:b,preventScrolling:y=!0,children:v,noWheelClassName:_,noPanClassName:w})=>{const S=u.useRef(),x=un(),E=u.useRef(!1),T=u.useRef(!1),N=u.useRef(null),I=u.useRef({x:0,y:0,zoom:0}),{d3Zoom:R,d3Selection:O,d3ZoomHandler:B,userSelectionActive:C}=Et(Aie,wn),M=d1(b),A=u.useRef(0),$=u.useRef(!1),z=u.useRef();return Rie(N),u.useEffect(()=>{if(N.current){const L=N.current.getBoundingClientRect(),D=JL().scaleExtent([p,g]).translateExtent(h),F=wr(N.current).call(D),V=ts.translate(m.x,m.y).scale(Fc(m.zoom,p,g)),G=[[0,0],[L.width,L.height]],U=D.constrain()(V,G,h);D.transform(F,U),D.wheelDelta(Nw),x.setState({d3Zoom:D,d3Selection:F,d3ZoomHandler:F.on("wheel.zoom"),transform:[U.x,U.y,U.k],domNode:N.current.closest(".react-flow")})}},[]),u.useEffect(()=>{O&&R&&(s&&!M&&!C?O.on("wheel.zoom",L=>{if(Pl(L,_))return!1;L.preventDefault(),L.stopImmediatePropagation();const D=O.property("__zoom").k||1;if(L.ctrlKey&&i){const j=$r(L),X=Nw(L),J=D*Math.pow(2,X);R.scaleTo(O,J,j,L);return}const F=L.deltaMode===1?20:1;let V=l===Wa.Vertical?0:L.deltaX*F,G=l===Wa.Horizontal?0:L.deltaY*F;!eh()&&L.shiftKey&&l!==Wa.Vertical&&(V=L.deltaY*F,G=0),R.translateBy(O,-(V/D)*a,-(G/D)*a,{internal:!0});const U=Wf(O.property("__zoom")),{onViewportChangeStart:W,onViewportChange:H,onViewportChangeEnd:q}=x.getState();clearTimeout(z.current),$.current||($.current=!0,t?.(L,U),W?.(U)),$.current&&(e?.(L,U),H?.(U),z.current=setTimeout(()=>{n?.(L,U),q?.(U),$.current=!1},150))},{passive:!1}):typeof B<"u"&&O.on("wheel.zoom",function(L,D){if(!y&&L.type==="wheel"&&!L.ctrlKey||Pl(L,_))return null;L.preventDefault(),B.call(this,L,D)},{passive:!1}))},[C,s,l,O,R,B,M,i,y,_,t,e,n]),u.useEffect(()=>{R&&R.on("start",L=>{if(!L.sourceEvent||L.sourceEvent.internal)return null;A.current=L.sourceEvent?.button;const{onViewportChangeStart:D}=x.getState(),F=Wf(L.transform);E.current=!0,I.current=F,L.sourceEvent?.type==="mousedown"&&x.setState({paneDragging:!0}),D?.(F),t?.(L.sourceEvent,F)})},[R,t]),u.useEffect(()=>{R&&(C&&!E.current?R.on("zoom",null):C||R.on("zoom",L=>{const{onViewportChange:D}=x.getState();if(x.setState({transform:[L.transform.x,L.transform.y,L.transform.k]}),T.current=!!(o&&Iw(f,A.current??0)),(e||D)&&!L.sourceEvent?.internal){const F=Wf(L.transform);D?.(F),e?.(L.sourceEvent,F)}}))},[C,R,e,f,o]),u.useEffect(()=>{R&&R.on("end",L=>{if(!L.sourceEvent||L.sourceEvent.internal)return null;const{onViewportChangeEnd:D}=x.getState();if(E.current=!1,x.setState({paneDragging:!1}),o&&Iw(f,A.current??0)&&!T.current&&o(L.sourceEvent),T.current=!1,(n||D)&&Mie(I.current,L.transform)){const F=Wf(L.transform);I.current=F,clearTimeout(S.current),S.current=setTimeout(()=>{D?.(F),n?.(L.sourceEvent,F)},s?150:0)}})},[R,s,f,n,o]),u.useEffect(()=>{R&&R.filter(L=>{const D=M||r,F=i&&L.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&L.button===1&&L.type==="mousedown"&&(Pl(L,"react-flow__node")||Pl(L,"react-flow__edge")))return!0;if(!f&&!D&&!s&&!c&&!i||C||!c&&L.type==="dblclick"||Pl(L,_)&&L.type==="wheel"||Pl(L,w)&&(L.type!=="wheel"||s&&L.type==="wheel"&&!M)||!i&&L.ctrlKey&&L.type==="wheel"||!D&&!s&&!F&&L.type==="wheel"||!f&&(L.type==="mousedown"||L.type==="touchstart")||Array.isArray(f)&&!f.includes(L.button)&&L.type==="mousedown")return!1;const V=Array.isArray(f)&&f.includes(L.button)||!L.button||L.button<=1;return(!L.ctrlKey||L.type==="wheel")&&V})},[C,R,r,i,s,c,f,d,M]),P.createElement("div",{className:"react-flow__renderer",ref:N,style:lb},v)},Die=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function zie(){const{userSelectionActive:e,userSelectionRect:t}=Et(Die,wn);return e&&t?P.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Rw(e,t){const n=t.parentNode||t.parentId,o=e.find(r=>r.id===n);if(o){const r=t.position.x+t.width-o.width,i=t.position.y+t.height-o.height;if(r>0||i>0||t.position.x<0||t.position.y<0){if(o.style={...o.style},o.style.width=o.style.width??o.width,o.style.height=o.style.height??o.height,r>0&&(o.style.width+=r),i>0&&(o.style.height+=i),t.position.x<0){const s=Math.abs(t.position.x);o.position.x=o.position.x-s,o.style.width+=s,t.position.x=0}if(t.position.y<0){const s=Math.abs(t.position.y);o.position.y=o.position.y-s,o.style.height+=s,t.position.y=0}o.width=o.style.width,o.height=o.style.height}}}function kI(e,t){if(e.some(o=>o.type==="reset"))return e.filter(o=>o.type==="reset").map(o=>o.item);const n=e.filter(o=>o.type==="add").map(o=>o.item);return t.reduce((o,r)=>{const i=e.filter(a=>a.id===r.id);if(i.length===0)return o.push(r),o;const s={...r};for(const a of i)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&Rw(o,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&Rw(o,s);break}case"remove":return o}return o.push(s),o},n)}function cb(e,t){return kI(e,t)}function LI(e,t){return kI(e,t)}const $s=(e,t)=>({id:e,type:"select",selected:t});function nc(e,t){return e.reduce((n,o)=>{const r=t.includes(o.id);return!o.selected&&r?(o.selected=!0,n.push($s(o.id,!0))):o.selected&&!r&&(o.selected=!1,n.push($s(o.id,!1))),n},[])}const Ig=(e,t)=>n=>{n.target===t.current&&e?.(n)},Pie=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),II=u.memo(({isSelecting:e,selectionMode:t=u1.Full,panOnDrag:n,onSelectionStart:o,onSelectionEnd:r,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:f})=>{const m=u.useRef(null),h=un(),p=u.useRef(0),g=u.useRef(0),b=u.useRef(),{userSelectionActive:y,elementsSelectable:v,dragging:_}=Et(Pie,wn),w=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,g.current=0},S=B=>{i?.(B),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},x=B=>{if(Array.isArray(n)&&n?.includes(2)){B.preventDefault();return}s?.(B)},E=a?B=>a(B):void 0,T=B=>{const{resetSelectedElements:C,domNode:M}=h.getState();if(b.current=M?.getBoundingClientRect(),!v||!e||B.button!==0||B.target!==m.current||!b.current)return;const{x:A,y:$}=sa(B,b.current);C(),h.setState({userSelectionRect:{width:0,height:0,startX:A,startY:$,x:A,y:$}}),o?.(B)},N=B=>{const{userSelectionRect:C,nodeInternals:M,edges:A,transform:$,onNodesChange:z,onEdgesChange:L,nodeOrigin:D,getNodes:F}=h.getState();if(!e||!b.current||!C)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const V=sa(B,b.current),G=C.startX??0,U=C.startY??0,W={...C,x:V.xJ.id),X=q.map(J=>J.id);if(p.current!==X.length){p.current=X.length;const J=nc(H,X);J.length&&z?.(J)}if(g.current!==j.length){g.current=j.length;const J=nc(A,j);J.length&&L?.(J)}h.setState({userSelectionRect:W})},I=B=>{if(B.button!==0)return;const{userSelectionRect:C}=h.getState();!y&&C&&B.target===m.current&&S?.(B),h.setState({nodesSelectionActive:p.current>0}),w(),r?.(B)},R=B=>{y&&(h.setState({nodesSelectionActive:p.current>0}),r?.(B)),w()},O=v&&(e||y);return P.createElement("div",{className:Pn(["react-flow__pane",{dragging:_,selection:e}]),onClick:O?void 0:Ig(S,m),onContextMenu:Ig(x,m),onWheel:Ig(E,m),onMouseEnter:O?void 0:l,onMouseDown:O?T:void 0,onMouseMove:O?N:c,onMouseUp:O?I:void 0,onMouseLeave:O?R:d,ref:m,style:lb},f,P.createElement(zie,null))});II.displayName="Pane";function NI(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const o=t.get(n);return o?o.selected?!0:NI(o,t):!1}function Mw(e,t,n){let o=e;do{if(o?.matches(t))return!0;if(o===n.current)return!1;o=o.parentElement}while(o);return!1}function Bie(e,t,n,o){return Array.from(e.values()).filter(r=>(r.selected||r.id===o)&&(!r.parentNode||r.parentId||!NI(r,e))&&(r.draggable||t&&typeof r.draggable>"u")).map(r=>({id:r.id,position:r.position||{x:0,y:0},positionAbsolute:r.positionAbsolute||{x:0,y:0},distance:{x:n.x-(r.positionAbsolute?.x??0),y:n.y-(r.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:r.extent,parentNode:r.parentNode||r.parentId,parentId:r.parentNode||r.parentId,width:r.width,height:r.height,expandParent:r.expandParent}))}function Fie(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function RI(e,t,n,o,r=[0,0],i){const s=Fie(e,e.extent||o);let a=s;const l=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(l&&e.width&&e.height){const f=n.get(l),{x:m,y:h}=el(f,r).positionAbsolute;a=f&&Er(m)&&Er(h)&&Er(f.width)&&Er(f.height)?[[m+e.width*r[0],h+e.height*r[1]],[m+f.width-e.width+e.width*r[0],h+f.height-e.height+e.height*r[1]]]:a}else i?.("005",ds.error005()),a=s;else if(e.extent&&l&&e.extent!=="parent"){const f=n.get(l),{x:m,y:h}=el(f,r).positionAbsolute;a=[[e.extent[0][0]+m,e.extent[0][1]+h],[e.extent[1][0]+m,e.extent[1][1]+h]]}let c={x:0,y:0};if(l){const f=n.get(l);c=el(f,r).positionAbsolute}const d=a&&a!=="parent"?tb(t,a):t;return{position:{x:d.x-c.x,y:d.y-c.y},positionAbsolute:d}}function Ng({nodeId:e,dragItems:t,nodeInternals:n}){const o=t.map(r=>({...n.get(r.id),position:r.position,positionAbsolute:r.positionAbsolute}));return[e?o.find(r=>r.id===e):o[0],o]}const Aw=(e,t,n,o)=>{const r=t.querySelectorAll(e);if(!r||!r.length)return null;const i=Array.from(r),s=t.getBoundingClientRect(),a={x:s.width*o[0],y:s.height*o[1]};return i.map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/n,y:(c.top-s.top-a.y)/n,...eb(l)}})};function Mu(e,t,n){return n===void 0?n:o=>{const r=t().nodeInternals.get(e);r&&n(o,{...r})}}function Ky({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:a,onError:l}=t.getState(),c=a.get(e);if(!c){l?.("012",ds.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function $ie(){const e=un();return u.useCallback(({sourceEvent:n})=>{const{transform:o,snapGrid:r,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,l={x:(s-o[0])/o[2],y:(a-o[1])/o[2]};return{xSnapped:i?r[0]*Math.round(l.x/r[0]):l.x,ySnapped:i?r[1]*Math.round(l.y/r[1]):l.y,...l}},[])}function Rg(e){return(t,n,o)=>e?.(t,o)}function MI({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,selectNodesOnDrag:s}){const a=un(),[l,c]=u.useState(!1),d=u.useRef([]),f=u.useRef({x:null,y:null}),m=u.useRef(0),h=u.useRef(null),p=u.useRef({x:0,y:0}),g=u.useRef(null),b=u.useRef(!1),y=u.useRef(!1),v=$ie();return u.useEffect(()=>{if(e?.current){const _=wr(e.current),w=({x:E,y:T})=>{const{nodeInternals:N,onNodeDrag:I,onSelectionDrag:R,updateNodePositions:O,nodeExtent:B,snapGrid:C,snapToGrid:M,nodeOrigin:A,onError:$}=a.getState();f.current={x:E,y:T};let z=!1,L={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&B){const F=Hm(d.current,A);L=c1(F)}if(d.current=d.current.map(F=>{const V={x:E-F.distance.x,y:T-F.distance.y};M&&(V.x=C[0]*Math.round(V.x/C[0]),V.y=C[1]*Math.round(V.y/C[1]));const G=[[B[0][0],B[0][1]],[B[1][0],B[1][1]]];d.current.length>1&&B&&!F.extent&&(G[0][0]=F.positionAbsolute.x-L.x+B[0][0],G[1][0]=F.positionAbsolute.x+(F.width??0)-L.x2+B[1][0],G[0][1]=F.positionAbsolute.y-L.y+B[0][1],G[1][1]=F.positionAbsolute.y+(F.height??0)-L.y2+B[1][1]);const U=RI(F,V,N,G,A,$);return z=z||F.position.x!==U.position.x||F.position.y!==U.position.y,F.position=U.position,F.positionAbsolute=U.positionAbsolute,F}),!z)return;O(d.current,!0,!0),c(!0);const D=r?I:Rg(R);if(D&&g.current){const[F,V]=Ng({nodeId:r,dragItems:d.current,nodeInternals:N});D(g.current,F,V)}},S=()=>{if(!h.current)return;const[E,T]=KL(p.current,h.current);if(E!==0||T!==0){const{transform:N,panBy:I}=a.getState();f.current.x=(f.current.x??0)-E/N[2],f.current.y=(f.current.y??0)-T/N[2],I({x:E,y:T})&&w(f.current)}m.current=requestAnimationFrame(S)},x=E=>{const{nodeInternals:T,multiSelectionActive:N,nodesDraggable:I,unselectNodesAndEdges:R,onNodeDragStart:O,onSelectionDragStart:B}=a.getState();y.current=!0;const C=r?O:Rg(B);(!s||!i)&&!N&&r&&(T.get(r)?.selected||R()),r&&i&&s&&Ky({id:r,store:a,nodeRef:e});const M=v(E);if(f.current=M,d.current=Bie(T,I,M,r),C&&d.current){const[A,$]=Ng({nodeId:r,dragItems:d.current,nodeInternals:T});C(E.sourceEvent,A,$)}};if(t)_.on(".drag",null);else{const E=Kne().on("start",T=>{const{domNode:N,nodeDragThreshold:I}=a.getState();I===0&&x(T);const R=v(T);f.current=R,h.current=N?.getBoundingClientRect()||null,p.current=sa(T.sourceEvent,h.current)}).on("drag",T=>{const N=v(T),{autoPanOnNodeDrag:I,nodeDragThreshold:R}=a.getState();if(!b.current&&y.current&&I&&(b.current=!0,S()),!y.current){const O=N.xSnapped-(f?.current?.x??0),B=N.ySnapped-(f?.current?.y??0);Math.sqrt(O*O+B*B)>R&&x(T)}(f.current.x!==N.xSnapped||f.current.y!==N.ySnapped)&&d.current&&y.current&&(g.current=T.sourceEvent,p.current=sa(T.sourceEvent,h.current),w(N))}).on("end",T=>{if(y.current&&(c(!1),b.current=!1,y.current=!1,cancelAnimationFrame(m.current),d.current)){const{updateNodePositions:N,nodeInternals:I,onNodeDragStop:R,onSelectionDragStop:O}=a.getState(),B=r?R:Rg(O);if(N(d.current,!1,!1),B){const[C,M]=Ng({nodeId:r,dragItems:d.current,nodeInternals:I});B(T.sourceEvent,C,M)}}}).filter(T=>{const N=T.target;return!T.button&&(!n||!Mw(N,`.${n}`,e))&&(!o||Mw(N,o,e))});return _.call(E),()=>{_.on(".drag",null)}}}},[e,t,n,o,i,a,r,s,v]),l}function AI(){const e=un();return u.useCallback(n=>{const{nodeInternals:o,nodeExtent:r,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=e.getState(),f=s().filter(v=>v.selected&&(v.draggable||d&&typeof v.draggable>"u")),m=a?l[0]:5,h=a?l[1]:5,p=n.isShiftPressed?4:1,g=n.x*m*p,b=n.y*h*p,y=f.map(v=>{if(v.positionAbsolute){const _={x:v.positionAbsolute.x+g,y:v.positionAbsolute.y+b};a&&(_.x=l[0]*Math.round(_.x/l[0]),_.y=l[1]*Math.round(_.y/l[1]));const{positionAbsolute:w,position:S}=RI(v,_,o,r,void 0,c);v.position=S,v.positionAbsolute=w}return v});i(y,!0,!1)},[])}const vc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Au=e=>{const t=({id:n,type:o,data:r,xPos:i,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:f,onMouseMove:m,onMouseLeave:h,onContextMenu:p,onDoubleClick:g,style:b,className:y,isDraggable:v,isSelectable:_,isConnectable:w,isFocusable:S,selectNodesOnDrag:x,sourcePosition:E,targetPosition:T,hidden:N,resizeObserver:I,dragHandle:R,zIndex:O,isParent:B,noDragClassName:C,noPanClassName:M,initialized:A,disableKeyboardA11y:$,ariaLabel:z,rfId:L,hasHandleBounds:D})=>{const F=un(),V=u.useRef(null),G=u.useRef(null),U=u.useRef(E),W=u.useRef(T),H=u.useRef(o),q=_||v||d||f||m||h,j=AI(),X=Mu(n,F.getState,f),J=Mu(n,F.getState,m),K=Mu(n,F.getState,h),Y=Mu(n,F.getState,p),Z=Mu(n,F.getState,g),oe=he=>{const{nodeDragThreshold:ne}=F.getState();if(_&&(!x||!v||ne>0)&&Ky({id:n,store:F,nodeRef:V}),d){const Pe=F.getState().nodeInternals.get(n);Pe&&d(he,{...Pe})}},ce=he=>{if(!qy(he)&&!$)if(nI.includes(he.key)&&_){const ne=he.key==="Escape";Ky({id:n,store:F,unselect:ne,nodeRef:V})}else v&&c&&Object.prototype.hasOwnProperty.call(vc,he.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${he.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),j({x:vc[he.key].x,y:vc[he.key].y,isShiftPressed:he.shiftKey}))};u.useEffect(()=>()=>{G.current&&(I?.unobserve(G.current),G.current=null)},[]),u.useEffect(()=>{if(V.current&&!N){const he=V.current;(!A||!D||G.current!==he)&&(G.current&&I?.unobserve(G.current),I?.observe(he),G.current=he)}},[N,A,D]),u.useEffect(()=>{const he=H.current!==o,ne=U.current!==E,Pe=W.current!==T;V.current&&(he||ne||Pe)&&(he&&(H.current=o),ne&&(U.current=E),Pe&&(W.current=T),F.getState().updateNodeDimensions([{id:n,nodeElement:V.current,forceUpdate:!0}]))},[n,o,E,T]);const ae=MI({nodeRef:V,disabled:N||!v,noDragClassName:C,handleSelector:R,nodeId:n,isSelectable:_,selectNodesOnDrag:x});return N?null:P.createElement("div",{className:Pn(["react-flow__node",`react-flow__node-${o}`,{[M]:v},y,{selected:c,selectable:_,parent:B,dragging:ae}]),ref:V,style:{zIndex:O,transform:`translate(${a}px,${l}px)`,pointerEvents:q?"all":"none",visibility:A?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:X,onMouseMove:J,onMouseLeave:K,onContextMenu:Y,onClick:oe,onDoubleClick:Z,onKeyDown:S?ce:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":$?void 0:`${xI}-${L}`,"aria-label":z},P.createElement(tie,{value:n},P.createElement(e,{id:n,data:r,type:o,xPos:i,yPos:s,selected:c,isConnectable:w,sourcePosition:E,targetPosition:T,dragging:ae,dragHandle:R,zIndex:O})))};return t.displayName="NodeWrapper",u.memo(t)};const Hie=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Hm(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function Vie({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=un(),{width:r,height:i,x:s,y:a,transformString:l,userSelectionActive:c}=Et(Hie,wn),d=AI(),f=u.useRef(null);if(u.useEffect(()=>{n||f.current?.focus({preventScroll:!0})},[n]),MI({nodeRef:f}),c||!r||!i)return null;const m=e?p=>{const g=o.getState().getNodes().filter(b=>b.selected);e(p,g)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(vc,p.key)&&d({x:vc[p.key].x,y:vc[p.key].y,isShiftPressed:p.shiftKey})};return P.createElement("div",{className:Pn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l}},P.createElement("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:i,top:a,left:s}}))}var Uie=u.memo(Vie);const jie=e=>e.nodesSelectionActive,OI=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:m,selectionMode:h,onSelectionStart:p,onSelectionEnd:g,multiSelectionKeyCode:b,panActivationKeyCode:y,zoomActivationKeyCode:v,elementsSelectable:_,zoomOnScroll:w,zoomOnPinch:S,panOnScroll:x,panOnScrollSpeed:E,panOnScrollMode:T,zoomOnDoubleClick:N,panOnDrag:I,defaultViewport:R,translateExtent:O,minZoom:B,maxZoom:C,preventScrolling:M,onSelectionContextMenu:A,noWheelClassName:$,noPanClassName:z,disableKeyboardA11y:L})=>{const D=Et(jie),F=d1(f),V=d1(y),G=V||I,U=V||x,W=F||m&&G!==!0;return Nie({deleteKeyCode:a,multiSelectionKeyCode:b}),P.createElement(Oie,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:_,zoomOnScroll:w,zoomOnPinch:S,panOnScroll:U,panOnScrollSpeed:E,panOnScrollMode:T,zoomOnDoubleClick:N,panOnDrag:!F&&G,defaultViewport:R,translateExtent:O,minZoom:B,maxZoom:C,zoomActivationKeyCode:v,preventScrolling:M,noWheelClassName:$,noPanClassName:z},P.createElement(II,{onSelectionStart:p,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:G,isSelecting:!!W,selectionMode:h},e,D&&P.createElement(Uie,{onSelectionContextMenu:A,noPanClassName:z,disableKeyboardA11y:L})))};OI.displayName="FlowRenderer";var Wie=u.memo(OI);function Gie(e){return Et(u.useCallback(n=>e?cI(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function qie(e){const t={input:Au(e.input||vI),default:Au(e.default||Zy),output:Au(e.output||_I),group:Au(e.group||ab)},n={},o=Object.keys(e).filter(r=>!["input","default","output","group"].includes(r)).reduce((r,i)=>(r[i]=Au(e[i]||Zy),r),n);return{...t,...o}}const Yie=({x:e,y:t,width:n,height:o,origin:r})=>!n||!o?{x:e,y:t}:r[0]<0||r[1]<0||r[0]>1||r[1]>1?{x:e,y:t}:{x:e-n*r[0],y:t-o*r[1]},Xie=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),DI=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,updateNodeDimensions:i,onError:s}=Et(Xie,wn),a=Gie(e.onlyRenderVisibleElements),l=u.useRef(),c=u.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(f=>{const m=f.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(m)});return l.current=d,d},[]);return u.useEffect(()=>()=>{l?.current?.disconnect()},[]),P.createElement("div",{className:"react-flow__nodes",style:lb},a.map(d=>{let f=d.type||"default";e.nodeTypes[f]||(s?.("003",ds.error003(f)),f="default");const m=e.nodeTypes[f]||e.nodeTypes.default,h=!!(d.draggable||t&&typeof d.draggable>"u"),p=!!(d.selectable||r&&typeof d.selectable>"u"),g=!!(d.connectable||n&&typeof d.connectable>"u"),b=!!(d.focusable||o&&typeof d.focusable>"u"),y=e.nodeExtent?tb(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,v=y?.x??0,_=y?.y??0,w=Yie({x:v,y:_,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return P.createElement(m,{key:d.id,id:d.id,className:d.className,style:d.style,type:f,data:d.data,sourcePosition:d.sourcePosition||me.Bottom,targetPosition:d.targetPosition||me.Top,hidden:d.hidden,xPos:v,yPos:_,xPosOrigin:w.x,yPosOrigin:w.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:h,isSelectable:p,isConnectable:g,isFocusable:b,resizeObserver:c,dragHandle:d.dragHandle,zIndex:d[Vt]?.z??0,isParent:!!d[Vt]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel,hasHandleBounds:!!d[Vt]?.handleBounds})}))};DI.displayName="NodeRenderer";var Jie=u.memo(DI);const Zie=(e,t,n)=>n===me.Left?e-t:n===me.Right?e+t:e,Kie=(e,t,n)=>n===me.Top?e-t:n===me.Bottom?e+t:e,Ow="react-flow__edgeupdater",Dw=({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a})=>P.createElement("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:Pn([Ow,`${Ow}-${a}`]),cx:Zie(t,o,e),cy:Kie(n,o,e),r:o,stroke:"transparent",fill:"transparent"}),Qie=()=>!0;var Bl=e=>{const t=({id:n,className:o,type:r,data:i,onClick:s,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:g,style:b,source:y,target:v,sourceX:_,sourceY:w,targetX:S,targetY:x,sourcePosition:E,targetPosition:T,elementsSelectable:N,hidden:I,sourceHandleId:R,targetHandleId:O,onContextMenu:B,onMouseEnter:C,onMouseMove:M,onMouseLeave:A,edgeUpdaterRadius:$,onEdgeUpdate:z,onEdgeUpdateStart:L,onEdgeUpdateEnd:D,markerEnd:F,markerStart:V,rfId:G,ariaLabel:U,isFocusable:W,isUpdatable:H,pathOptions:q,interactionWidth:j,disableKeyboardA11y:X})=>{const J=u.useRef(null),[K,Y]=u.useState(!1),[Z,oe]=u.useState(!1),ce=un(),ae=u.useMemo(()=>`url('#${Xy(V,G)}')`,[V,G]),he=u.useMemo(()=>`url('#${Xy(F,G)}')`,[F,G]);if(I)return null;const ne=Fe=>{const{edges:Kt,addSelectedEdges:Wt,unselectNodesAndEdges:Cn,multiSelectionActive:fn}=ce.getState(),nn=Kt.find(Xt=>Xt.id===n);nn&&(N&&(ce.setState({nodesSelectionActive:!1}),nn.selected&&fn?(Cn({nodes:[],edges:[nn]}),J.current?.blur()):Wt([n])),s&&s(Fe,nn))},Pe=Ru(n,ce.getState,a),Ee=Ru(n,ce.getState,B),Ie=Ru(n,ce.getState,C),Ce=Ru(n,ce.getState,M),ge=Ru(n,ce.getState,A),Xe=(Fe,Kt)=>{if(Fe.button!==0)return;const{edges:Wt,isValidConnection:Cn}=ce.getState(),fn=Kt?v:y,nn=(Kt?O:R)||null,Xt=Kt?"target":"source",ho=Cn||Qie,Po=Kt,mo=Wt.find($e=>$e.id===n);oe(!0),L?.(Fe,mo,Xt);const bt=$e=>{oe(!1),D?.($e,mo,Xt)};hI({event:Fe,handleId:nn,nodeId:fn,onConnect:$e=>z?.(mo,$e),isTarget:Po,getState:ce.getState,setState:ce.setState,isValidConnection:ho,edgeUpdaterType:Xt,onEdgeUpdateEnd:bt})},Be=Fe=>Xe(Fe,!0),Oe=Fe=>Xe(Fe,!1),Qe=()=>Y(!0),Bt=()=>Y(!1),Yt=!N&&!s,dn=Fe=>{if(!X&&nI.includes(Fe.key)&&N){const{unselectNodesAndEdges:Kt,addSelectedEdges:Wt,edges:Cn}=ce.getState();Fe.key==="Escape"?(J.current?.blur(),Kt({edges:[Cn.find(nn=>nn.id===n)]})):Wt([n])}};return P.createElement("g",{className:Pn(["react-flow__edge",`react-flow__edge-${r}`,o,{selected:l,animated:c,inactive:Yt,updating:K}]),onClick:ne,onDoubleClick:Pe,onContextMenu:Ee,onMouseEnter:Ie,onMouseMove:Ce,onMouseLeave:ge,onKeyDown:W?dn:void 0,tabIndex:W?0:void 0,role:W?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":U===null?void 0:U||`Edge from ${y} to ${v}`,"aria-describedby":W?`${SI}-${G}`:void 0,ref:J},!Z&&P.createElement(e,{id:n,source:y,target:v,selected:l,animated:c,label:d,labelStyle:f,labelShowBg:m,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:g,data:i,style:b,sourceX:_,sourceY:w,targetX:S,targetY:x,sourcePosition:E,targetPosition:T,sourceHandleId:R,targetHandleId:O,markerStart:ae,markerEnd:he,pathOptions:q,interactionWidth:j}),H&&P.createElement(P.Fragment,null,(H==="source"||H===!0)&&P.createElement(Dw,{position:E,centerX:_,centerY:w,radius:$,onMouseDown:Be,onMouseEnter:Qe,onMouseOut:Bt,type:"source"}),(H==="target"||H===!0)&&P.createElement(Dw,{position:T,centerX:S,centerY:x,radius:$,onMouseDown:Oe,onMouseEnter:Qe,onMouseOut:Bt,type:"target"})))};return t.displayName="EdgeWrapper",u.memo(t)};function ese(e){const t={default:Bl(e.default||th),straight:Bl(e.bezier||rb),step:Bl(e.step||ob),smoothstep:Bl(e.step||$m),simplebezier:Bl(e.simplebezier||nb)},n={},o=Object.keys(e).filter(r=>!["default","bezier"].includes(r)).reduce((r,i)=>(r[i]=Bl(e[i]||th),r),n);return{...t,...o}}function zw(e,t,n=null){const o=(n?.x||0)+t.x,r=(n?.y||0)+t.y,i=n?.width||t.width,s=n?.height||t.height;switch(e){case me.Top:return{x:o+i/2,y:r};case me.Right:return{x:o+i,y:r+s/2};case me.Bottom:return{x:o+i/2,y:r+s};case me.Left:return{x:o,y:r+s/2}}}function Pw(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const tse=(e,t,n,o,r,i)=>{const s=zw(n,e,t),a=zw(i,o,r);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function nse({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:o,targetWidth:r,targetHeight:i,width:s,height:a,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+r),y2:Math.max(e.y+o,t.y+i)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=c1({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),f=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),m=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(f*m)>0}function Bw(e){const t=e?.[Vt]?.handleBounds||null,n=t&&e?.width&&e?.height&&typeof e?.positionAbsolute?.x<"u"&&typeof e?.positionAbsolute?.y<"u";return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const ose=[{level:0,isMaxLevel:!0,edges:[]}];function rse(e,t,n=!1){let o=-1;const r=e.reduce((s,a)=>{const l=Er(a.zIndex);let c=l?a.zIndex:0;if(n){const d=t.get(a.target),f=t.get(a.source),m=a.selected||d?.selected||f?.selected,h=Math.max(f?.[Vt]?.z||0,d?.[Vt]?.z||0,1e3);c=(l?a.zIndex:0)+(m?h:0)}return s[c]?s[c].push(a):s[c]=[a],o=c>o?c:o,s},{}),i=Object.entries(r).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===o}});return i.length===0?ose:i}function ise(e,t,n){const o=Et(u.useCallback(r=>e?r.edges.filter(i=>{const s=t.get(i.source),a=t.get(i.target);return s?.width&&s?.height&&a?.width&&a?.height&&nse({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:r.width,height:r.height,transform:r.transform})}):r.edges,[e,t]));return rse(o,t,n)}const sse=({color:e="none",strokeWidth:t=1})=>P.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),ase=({color:e="none",strokeWidth:t=1})=>P.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Fw={[$c.Arrow]:sse,[$c.ArrowClosed]:ase};function lse(e){const t=un();return u.useMemo(()=>Object.prototype.hasOwnProperty.call(Fw,e)?Fw[e]:(t.getState().onError?.("009",ds.error009(e)),null),[e])}const cse=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=lse(t);return l?P.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0"},P.createElement(l,{color:n,strokeWidth:s})):null},use=({defaultColor:e,rfId:t})=>n=>{const o=[];return n.edges.reduce((r,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=Xy(s,t);o.includes(a)||(r.push({id:a,color:s.color||e,...s}),o.push(a))}}),r),[]).sort((r,i)=>r.id.localeCompare(i.id))},zI=({defaultColor:e,rfId:t})=>{const n=Et(u.useCallback(use({defaultColor:e,rfId:t}),[e,t]),(o,r)=>!(o.length!==r.length||o.some((i,s)=>i.id!==r[s].id)));return P.createElement("defs",null,n.map(o=>P.createElement(cse,{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})))};zI.displayName="MarkerDefinitions";var dse=u.memo(zI);const fse=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),PI=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:o,edgeTypes:r,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:f,edgeUpdaterRadius:m,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:g,children:b,disableKeyboardA11y:y})=>{const{edgesFocusable:v,edgesUpdatable:_,elementsSelectable:w,width:S,height:x,connectionMode:E,nodeInternals:T,onError:N}=Et(fse,wn),I=ise(t,T,n);return S?P.createElement(P.Fragment,null,I.map(({level:R,edges:O,isMaxLevel:B})=>P.createElement("svg",{key:R,style:{zIndex:R},width:S,height:x,className:"react-flow__edges react-flow__container"},B&&P.createElement(dse,{defaultColor:e,rfId:o}),P.createElement("g",null,O.map(C=>{const[M,A,$]=Bw(T.get(C.source)),[z,L,D]=Bw(T.get(C.target));if(!$||!D)return null;let F=C.type||"default";r[F]||(N?.("011",ds.error011(F)),F="default");const V=r[F]||r.default,G=E===ml.Strict?L.target:(L.target??[]).concat(L.source??[]),U=Pw(A.source,C.sourceHandle),W=Pw(G,C.targetHandle),H=U?.position||me.Bottom,q=W?.position||me.Top,j=!!(C.focusable||v&&typeof C.focusable>"u"),X=typeof s<"u"&&(C.updatable||_&&typeof C.updatable>"u");if(!U||!W)return N?.("008",ds.error008(U,C)),null;const{sourceX:J,sourceY:K,targetX:Y,targetY:Z}=tse(M,U,H,z,W,q);return P.createElement(V,{key:C.id,id:C.id,className:Pn([C.className,i]),type:F,data:C.data,selected:!!C.selected,animated:!!C.animated,hidden:!!C.hidden,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,style:C.style,source:C.source,target:C.target,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerEnd:C.markerEnd,markerStart:C.markerStart,sourceX:J,sourceY:K,targetX:Y,targetY:Z,sourcePosition:H,targetPosition:q,elementsSelectable:w,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:f,edgeUpdaterRadius:m,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:g,rfId:o,ariaLabel:C.ariaLabel,isFocusable:j,isUpdatable:X,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth,disableKeyboardA11y:y})})))),b):null};PI.displayName="EdgeRenderer";var pse=u.memo(PI);const hse=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function mse({children:e}){const t=Et(hse);return P.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function gse(e){const t=Vm(),n=u.useRef(!1);u.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const yse={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top},BI=({nodeId:e,handleType:t,style:n,type:o=js.Bezier,CustomComponent:r,connectionStatus:i})=>{const{fromNode:s,handleId:a,toX:l,toY:c,connectionMode:d}=Et(u.useCallback(x=>({fromNode:x.nodeInternals.get(e),handleId:x.connectionHandleId,toX:(x.connectionPosition.x-x.transform[0])/x.transform[2],toY:(x.connectionPosition.y-x.transform[1])/x.transform[2],connectionMode:x.connectionMode}),[e]),wn),f=s?.[Vt]?.handleBounds;let m=f?.[t];if(d===ml.Loose&&(m=m||f?.[t==="source"?"target":"source"]),!s||!m)return null;const h=a?m.find(x=>x.id===a):m[0],p=h?h.x+h.width/2:(s.width??0)/2,g=h?h.y+h.height/2:s.height??0,b=(s.positionAbsolute?.x??0)+p,y=(s.positionAbsolute?.y??0)+g,v=h?.position,_=v?yse[v]:null;if(!v||!_)return null;if(r)return P.createElement(r,{connectionLineType:o,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:b,fromY:y,toX:l,toY:c,fromPosition:v,toPosition:_,connectionStatus:i});let w="";const S={sourceX:b,sourceY:y,sourcePosition:v,targetX:l,targetY:c,targetPosition:_};return o===js.Bezier?[w]=aI(S):o===js.Step?[w]=Yy({...S,borderRadius:0}):o===js.SmoothStep?[w]=Yy(S):o===js.SimpleBezier?[w]=sI(S):w=`M${b},${y} ${l},${c}`,P.createElement("path",{d:w,fill:"none",className:"react-flow__connection-path",style:n})};BI.displayName="ConnectionLine";const vse=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function bse({containerStyle:e,style:t,type:n,component:o}){const{nodeId:r,handleType:i,nodesConnectable:s,width:a,height:l,connectionStatus:c}=Et(vse,wn);return!(r&&i&&a&&s)?null:P.createElement("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},P.createElement("g",{className:Pn(["react-flow__connection",c])},P.createElement(BI,{nodeId:r,handleType:i,style:t,type:n,CustomComponent:o,connectionStatus:c})))}function $w(e,t){return u.useRef(null),un(),u.useMemo(()=>t(e),[e])}const FI=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:o,onMoveEnd:r,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:m,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:g,onSelectionEnd:b,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:_,connectionLineContainerStyle:w,selectionKeyCode:S,selectionOnDrag:x,selectionMode:E,multiSelectionKeyCode:T,panActivationKeyCode:N,zoomActivationKeyCode:I,deleteKeyCode:R,onlyRenderVisibleElements:O,elementsSelectable:B,selectNodesOnDrag:C,defaultViewport:M,translateExtent:A,minZoom:$,maxZoom:z,preventScrolling:L,defaultMarkerColor:D,zoomOnScroll:F,zoomOnPinch:V,panOnScroll:G,panOnScrollSpeed:U,panOnScrollMode:W,zoomOnDoubleClick:H,panOnDrag:q,onPaneClick:j,onPaneMouseEnter:X,onPaneMouseMove:J,onPaneMouseLeave:K,onPaneScroll:Y,onPaneContextMenu:Z,onEdgeUpdate:oe,onEdgeContextMenu:ce,onEdgeMouseEnter:ae,onEdgeMouseMove:he,onEdgeMouseLeave:ne,edgeUpdaterRadius:Pe,onEdgeUpdateStart:Ee,onEdgeUpdateEnd:Ie,noDragClassName:Ce,noWheelClassName:ge,noPanClassName:Xe,elevateEdgesOnSelect:Be,disableKeyboardA11y:Oe,nodeOrigin:Qe,nodeExtent:Bt,rfId:Yt})=>{const dn=$w(e,qie),Fe=$w(t,ese);return gse(i),P.createElement(Wie,{onPaneClick:j,onPaneMouseEnter:X,onPaneMouseMove:J,onPaneMouseLeave:K,onPaneContextMenu:Z,onPaneScroll:Y,deleteKeyCode:R,selectionKeyCode:S,selectionOnDrag:x,selectionMode:E,onSelectionStart:g,onSelectionEnd:b,multiSelectionKeyCode:T,panActivationKeyCode:N,zoomActivationKeyCode:I,elementsSelectable:B,onMove:n,onMoveStart:o,onMoveEnd:r,zoomOnScroll:F,zoomOnPinch:V,zoomOnDoubleClick:H,panOnScroll:G,panOnScrollSpeed:U,panOnScrollMode:W,panOnDrag:q,defaultViewport:M,translateExtent:A,minZoom:$,maxZoom:z,onSelectionContextMenu:p,preventScrolling:L,noDragClassName:Ce,noWheelClassName:ge,noPanClassName:Xe,disableKeyboardA11y:Oe},P.createElement(mse,null,P.createElement(pse,{edgeTypes:Fe,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeUpdate:oe,onlyRenderVisibleElements:O,onEdgeContextMenu:ce,onEdgeMouseEnter:ae,onEdgeMouseMove:he,onEdgeMouseLeave:ne,onEdgeUpdateStart:Ee,onEdgeUpdateEnd:Ie,edgeUpdaterRadius:Pe,defaultMarkerColor:D,noPanClassName:Xe,elevateEdgesOnSelect:!!Be,disableKeyboardA11y:Oe,rfId:Yt},P.createElement(bse,{style:v,type:y,component:_,containerStyle:w})),P.createElement("div",{className:"react-flow__edgelabel-renderer"}),P.createElement(Jie,{nodeTypes:dn,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:m,onNodeContextMenu:h,selectNodesOnDrag:C,onlyRenderVisibleElements:O,noPanClassName:Xe,noDragClassName:Ce,disableKeyboardA11y:Oe,nodeOrigin:Qe,nodeExtent:Bt,rfId:Yt})))};FI.displayName="GraphView";var _se=u.memo(FI);const Qy=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ms={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Qy,nodeExtent:Qy,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ml.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Xre,isValidConnection:void 0},wse=()=>ute((e,t)=>({...Ms,setNodes:n=>{const{nodeInternals:o,nodeOrigin:r,elevateNodesOnSelect:i}=t();e({nodeInternals:Lg(n,o,r,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:o={}}=t();e({edges:n.map(r=>({...o,...r}))})},setDefaultNodesAndEdges:(n,o)=>{const r=typeof n<"u",i=typeof o<"u",s=r?Lg(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?o:[],hasDefaultNodes:r,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:o,nodeInternals:r,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:c}=t(),d=l?.querySelector(".react-flow__viewport");if(!d)return;const f=window.getComputedStyle(d),{m22:m}=new window.DOMMatrixReadOnly(f.transform),h=n.reduce((g,b)=>{const y=r.get(b.id);if(y?.hidden)r.set(y.id,{...y,[Vt]:{...y[Vt],handleBounds:void 0}});else if(y){const v=eb(b.nodeElement);!!(v.width&&v.height&&(y.width!==v.width||y.height!==v.height||b.forceUpdate))&&(r.set(y.id,{...y,[Vt]:{...y[Vt],handleBounds:{source:Aw(".source",b.nodeElement,m,c),target:Aw(".target",b.nodeElement,m,c)}},...v}),g.push({id:y.id,type:"dimensions",dimensions:v}))}return g},[]);CI(r,c);const p=s||i&&!s&&TI(t,{initial:!0,...a});e({nodeInternals:new Map(r),fitViewOnInitDone:p}),h?.length>0&&o?.(h)},updateNodePositions:(n,o=!0,r=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(a=>{const l={id:a.id,type:"position",dragging:r};return o&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});i(s)},triggerNodeChanges:n=>{const{onNodesChange:o,nodeInternals:r,hasDefaultNodes:i,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=t();if(n?.length){if(i){const c=cb(n,a()),d=Lg(c,r,s,l);e({nodeInternals:d})}o?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:o,edges:r,getNodes:i}=t();let s,a=null;o?s=n.map(l=>$s(l,!0)):(s=nc(i(),n),a=nc(r,[])),jf({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:o,edges:r,getNodes:i}=t();let s,a=null;o?s=n.map(l=>$s(l,!0)):(s=nc(r,n),a=nc(i(),[])),jf({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:o}={})=>{const{edges:r,getNodes:i}=t(),s=n||i(),a=o||r,l=s.map(d=>(d.selected=!1,$s(d.id,!1))),c=a.map(d=>$s(d.id,!1));jf({changedNodes:l,changedEdges:c,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:o,maxZoom:r}=t();o?.scaleExtent([n,r]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:o,minZoom:r}=t();o?.scaleExtent([r,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:o}=t(),i=o().filter(a=>a.selected).map(a=>$s(a.id,!1)),s=n.filter(a=>a.selected).map(a=>$s(a.id,!1));jf({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:o}=t();o.forEach(r=>{r.positionAbsolute=tb(r.position,n)}),e({nodeExtent:n,nodeInternals:new Map(o)})},panBy:n=>{const{transform:o,width:r,height:i,d3Zoom:s,d3Selection:a,translateExtent:l}=t();if(!s||!a||!n.x&&!n.y)return!1;const c=ts.translate(o[0]+n.x,o[1]+n.y).scale(o[2]),d=[[0,0],[r,i]],f=s?.constrain()(c,d,l);return s.transform(a,f),o[0]!==f.x||o[1]!==f.y||o[2]!==f.k},cancelConnection:()=>e({connectionNodeId:Ms.connectionNodeId,connectionHandleId:Ms.connectionHandleId,connectionHandleType:Ms.connectionHandleType,connectionStatus:Ms.connectionStatus,connectionStartHandle:Ms.connectionStartHandle,connectionEndHandle:Ms.connectionEndHandle}),reset:()=>e({...Ms})}),Object.is),nh=({children:e})=>{const t=u.useRef(null);return t.current||(t.current=wse()),P.createElement(Vre,{value:t.current},e)};nh.displayName="ReactFlowProvider";const $I=({children:e})=>u.useContext(Bm)?P.createElement(P.Fragment,null,e):P.createElement(nh,null,e);$I.displayName="ReactFlowWrapper";const xse={input:vI,default:Zy,output:_I,group:ab},Sse={default:th,straight:rb,step:ob,smoothstep:$m,simplebezier:nb},Ese=[0,0],Cse=[15,15],Tse={x:0,y:0,zoom:1},kse={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},HI=u.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i=xse,edgeTypes:s=Sse,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:f,onMoveEnd:m,onConnect:h,onConnectStart:p,onConnectEnd:g,onClickConnectStart:b,onClickConnectEnd:y,onNodeMouseEnter:v,onNodeMouseMove:_,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:x,onNodeDragStart:E,onNodeDrag:T,onNodeDragStop:N,onNodesDelete:I,onEdgesDelete:R,onSelectionChange:O,onSelectionDragStart:B,onSelectionDrag:C,onSelectionDragStop:M,onSelectionContextMenu:A,onSelectionStart:$,onSelectionEnd:z,connectionMode:L=ml.Strict,connectionLineType:D=js.Bezier,connectionLineStyle:F,connectionLineComponent:V,connectionLineContainerStyle:G,deleteKeyCode:U="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:H=!1,selectionMode:q=u1.Full,panActivationKeyCode:j="Space",multiSelectionKeyCode:X=eh()?"Meta":"Control",zoomActivationKeyCode:J=eh()?"Meta":"Control",snapToGrid:K=!1,snapGrid:Y=Cse,onlyRenderVisibleElements:Z=!1,selectNodesOnDrag:oe=!0,nodesDraggable:ce,nodesConnectable:ae,nodesFocusable:he,nodeOrigin:ne=Ese,edgesFocusable:Pe,edgesUpdatable:Ee,elementsSelectable:Ie,defaultViewport:Ce=Tse,minZoom:ge=.5,maxZoom:Xe=2,translateExtent:Be=Qy,preventScrolling:Oe=!0,nodeExtent:Qe,defaultMarkerColor:Bt="#b1b1b7",zoomOnScroll:Yt=!0,zoomOnPinch:dn=!0,panOnScroll:Fe=!1,panOnScrollSpeed:Kt=.5,panOnScrollMode:Wt=Wa.Free,zoomOnDoubleClick:Cn=!0,panOnDrag:fn=!0,onPaneClick:nn,onPaneMouseEnter:Xt,onPaneMouseMove:ho,onPaneMouseLeave:Po,onPaneScroll:mo,onPaneContextMenu:bt,children:be,onEdgeUpdate:$e,onEdgeContextMenu:At,onEdgeDoubleClick:nt,onEdgeMouseEnter:Je,onEdgeMouseMove:Ot,onEdgeMouseLeave:Qt,onEdgeUpdateStart:It,onEdgeUpdateEnd:go,edgeUpdaterRadius:ri=10,onNodesChange:Bo,onEdgesChange:ws,noDragClassName:Tl="nodrag",noWheelClassName:yo="nowheel",noPanClassName:mr="nopan",fitView:xs=!1,fitViewOptions:kl,connectOnClick:Sa=!0,attributionPosition:nN,proOptions:oN,defaultEdgeOptions:rN,elevateNodesOnSelect:iN=!0,elevateEdgesOnSelect:sN=!1,disableKeyboardA11y:fb=!1,autoPanOnConnect:aN=!0,autoPanOnNodeDrag:lN=!0,connectionRadius:cN=20,isValidConnection:uN,onError:dN,style:fN,id:pb,nodeDragThreshold:pN,...hN},mN)=>{const jm=pb||"1";return P.createElement("div",{...hN,style:{...fN,...kse},ref:mN,className:Pn(["react-flow",r]),"data-testid":"rf__wrapper",id:pb},P.createElement($I,null,P.createElement(_se,{onInit:c,onMove:d,onMoveStart:f,onMoveEnd:m,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:v,onNodeMouseMove:_,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:x,nodeTypes:i,edgeTypes:s,connectionLineType:D,connectionLineStyle:F,connectionLineComponent:V,connectionLineContainerStyle:G,selectionKeyCode:W,selectionOnDrag:H,selectionMode:q,deleteKeyCode:U,multiSelectionKeyCode:X,panActivationKeyCode:j,zoomActivationKeyCode:J,onlyRenderVisibleElements:Z,selectNodesOnDrag:oe,defaultViewport:Ce,translateExtent:Be,minZoom:ge,maxZoom:Xe,preventScrolling:Oe,zoomOnScroll:Yt,zoomOnPinch:dn,zoomOnDoubleClick:Cn,panOnScroll:Fe,panOnScrollSpeed:Kt,panOnScrollMode:Wt,panOnDrag:fn,onPaneClick:nn,onPaneMouseEnter:Xt,onPaneMouseMove:ho,onPaneMouseLeave:Po,onPaneScroll:mo,onPaneContextMenu:bt,onSelectionContextMenu:A,onSelectionStart:$,onSelectionEnd:z,onEdgeUpdate:$e,onEdgeContextMenu:At,onEdgeDoubleClick:nt,onEdgeMouseEnter:Je,onEdgeMouseMove:Ot,onEdgeMouseLeave:Qt,onEdgeUpdateStart:It,onEdgeUpdateEnd:go,edgeUpdaterRadius:ri,defaultMarkerColor:Bt,noDragClassName:Tl,noWheelClassName:yo,noPanClassName:mr,elevateEdgesOnSelect:sN,rfId:jm,disableKeyboardA11y:fb,nodeOrigin:ne,nodeExtent:Qe}),P.createElement(vie,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:h,onConnectStart:p,onConnectEnd:g,onClickConnectStart:b,onClickConnectEnd:y,nodesDraggable:ce,nodesConnectable:ae,nodesFocusable:he,edgesFocusable:Pe,edgesUpdatable:Ee,elementsSelectable:Ie,elevateNodesOnSelect:iN,minZoom:ge,maxZoom:Xe,nodeExtent:Qe,onNodesChange:Bo,onEdgesChange:ws,snapToGrid:K,snapGrid:Y,connectionMode:L,translateExtent:Be,connectOnClick:Sa,defaultEdgeOptions:rN,fitView:xs,fitViewOptions:kl,onNodesDelete:I,onEdgesDelete:R,onNodeDragStart:E,onNodeDrag:T,onNodeDragStop:N,onSelectionDrag:C,onSelectionDragStart:B,onSelectionDragStop:M,noPanClassName:mr,nodeOrigin:ne,rfId:jm,autoPanOnConnect:aN,autoPanOnNodeDrag:lN,onError:dN,connectionRadius:cN,isValidConnection:uN,nodeDragThreshold:pN}),P.createElement(gie,{onSelectionChange:O}),be,P.createElement(jre,{proOptions:oN,position:nN}),P.createElement(Sie,{rfId:jm,disableKeyboardA11y:fb})))});HI.displayName="ReactFlow";function VI(e){return t=>{const[n,o]=u.useState(t),r=u.useCallback(i=>o(s=>e(i,s)),[]);return[n,o,r]}}const Lse=VI(cb),Ise=VI(LI),Nse=e=>t=>t.nodeInternals.size===0?!1:t.getNodes().filter(n=>e.includeHiddenNodes?!0:!n.hidden).every(n=>n[Vt]?.handleBounds!==void 0),Rse={includeHiddenNodes:!1};function Mse(e=Rse){return Et(Nse(e))}const UI=({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:l,className:c,borderRadius:d,shapeRendering:f,onClick:m,selected:h})=>{const{background:p,backgroundColor:g}=i||{},b=s||p||g;return P.createElement("rect",{className:Pn(["react-flow__minimap-node",{selected:h},c]),x:t,y:n,rx:d,ry:d,width:o,height:r,fill:b,stroke:a,strokeWidth:l,shapeRendering:f,onClick:m?y=>m(y,e):void 0})};UI.displayName="MiniMapNode";var Ase=u.memo(UI);const Ose=e=>e.nodeOrigin,Dse=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),Mg=e=>e instanceof Function?e:()=>e;function zse({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r=2,nodeComponent:i=Ase,onClick:s}){const a=Et(Dse,wn),l=Et(Ose),c=Mg(t),d=Mg(e),f=Mg(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return P.createElement(P.Fragment,null,a.map(h=>{const{x:p,y:g}=el(h,l).positionAbsolute;return P.createElement(i,{key:h.id,x:p,y:g,width:h.width,height:h.height,style:h.style,selected:h.selected,className:f(h),color:c(h),borderRadius:o,strokeColor:d(h),strokeWidth:r,shapeRendering:m,onClick:s,id:h.id})}))}var Pse=u.memo(zse);const Bse=200,Fse=150,$se=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?qre(Hm(t,e.nodeOrigin),n):n,rfId:e.rfId}},Hse="react-flow__minimap-desc";function jI({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:o="#e2e2e2",nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s=2,nodeComponent:a,maskColor:l="rgb(240, 240, 240, 0.6)",maskStrokeColor:c="none",maskStrokeWidth:d=1,position:f="bottom-right",onClick:m,onNodeClick:h,pannable:p=!1,zoomable:g=!1,ariaLabel:b="React Flow mini map",inversePan:y=!1,zoomStep:v=10,offsetScale:_=5}){const w=un(),S=u.useRef(null),{boundingRect:x,viewBB:E,rfId:T}=Et($se,wn),N=e?.width??Bse,I=e?.height??Fse,R=x.width/N,O=x.height/I,B=Math.max(R,O),C=B*N,M=B*I,A=_*B,$=x.x-(C-x.width)/2-A,z=x.y-(M-x.height)/2-A,L=C+A*2,D=M+A*2,F=`${Hse}-${T}`,V=u.useRef(0);V.current=B,u.useEffect(()=>{if(S.current){const W=wr(S.current),H=X=>{const{transform:J,d3Selection:K,d3Zoom:Y}=w.getState();if(X.sourceEvent.type!=="wheel"||!K||!Y)return;const Z=-X.sourceEvent.deltaY*(X.sourceEvent.deltaMode===1?.05:X.sourceEvent.deltaMode?1:.002)*v,oe=J[2]*Math.pow(2,Z);Y.scaleTo(K,oe)},q=X=>{const{transform:J,d3Selection:K,d3Zoom:Y,translateExtent:Z,width:oe,height:ce}=w.getState();if(X.sourceEvent.type!=="mousemove"||!K||!Y)return;const ae=V.current*Math.max(1,J[2])*(y?-1:1),he={x:J[0]-X.sourceEvent.movementX*ae,y:J[1]-X.sourceEvent.movementY*ae},ne=[[0,0],[oe,ce]],Pe=ts.translate(he.x,he.y).scale(J[2]),Ee=Y.constrain()(Pe,ne,Z);Y.transform(K,Ee)},j=JL().on("zoom",p?q:null).on("zoom.wheel",g?H:null);return W.call(j),()=>{W.on("zoom",null)}}},[p,g,y,v]);const G=m?W=>{const H=$r(W);m(W,{x:H[0],y:H[1]})}:void 0,U=h?(W,H)=>{const q=w.getState().nodeInternals.get(H);h(W,q)}:void 0;return P.createElement(Fm,{position:f,style:e,className:Pn(["react-flow__minimap",t]),"data-testid":"rf__minimap"},P.createElement("svg",{width:N,height:I,viewBox:`${$} ${z} ${L} ${D}`,role:"img","aria-labelledby":F,ref:S,onClick:G},b&&P.createElement("title",{id:F},b),P.createElement(Pse,{onClick:U,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),P.createElement("path",{className:"react-flow__minimap-mask",d:`M${$-A},${z-A}h${L+A*2}v${D+A*2}h${-L-A*2}z M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fill:l,fillRule:"evenodd",stroke:c,strokeWidth:d,pointerEvents:"none"})))}jI.displayName="MiniMap";var Vse=u.memo(jI);function Use(){return P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},P.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function jse(){return P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},P.createElement("path",{d:"M0 0h32v4.2H0z"}))}function Wse(){return P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},P.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 Gse(){return P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},P.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 qse(){return P.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},P.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"}))}const Yu=({children:e,className:t,...n})=>P.createElement("button",{type:"button",className:Pn(["react-flow__controls-button",t]),...n},e);Yu.displayName="ControlButton";const Yse=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),WI=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:d,position:f="bottom-left"})=>{const m=un(),[h,p]=u.useState(!1),{isInteractive:g,minZoomReached:b,maxZoomReached:y}=Et(Yse,wn),{zoomIn:v,zoomOut:_,fitView:w}=Vm();if(u.useEffect(()=>{p(!0)},[]),!h)return null;const S=()=>{v(),i?.()},x=()=>{_(),s?.()},E=()=>{w(r),a?.()},T=()=>{m.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),l?.(!g)};return P.createElement(Fm,{className:Pn(["react-flow__controls",c]),position:f,style:e,"data-testid":"rf__controls"},t&&P.createElement(P.Fragment,null,P.createElement(Yu,{onClick:S,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:y},P.createElement(Use,null)),P.createElement(Yu,{onClick:x,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b},P.createElement(jse,null))),n&&P.createElement(Yu,{className:"react-flow__controls-fitview",onClick:E,title:"fit view","aria-label":"fit view"},P.createElement(Wse,null)),o&&P.createElement(Yu,{className:"react-flow__controls-interactive",onClick:T,title:"toggle interactivity","aria-label":"toggle interactivity"},g?P.createElement(qse,null):P.createElement(Gse,null)),d)};WI.displayName="Controls";var Xse=u.memo(WI),sr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(sr||(sr={}));function Jse({color:e,dimensions:t,lineWidth:n}){return P.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function Zse({color:e,radius:t}){return P.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const Kse={[sr.Dots]:"#91919a",[sr.Lines]:"#eee",[sr.Cross]:"#e2e2e2"},Qse={[sr.Dots]:1,[sr.Lines]:1,[sr.Cross]:6},eae=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function GI({id:e,variant:t=sr.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=2,color:s,style:a,className:l}){const c=u.useRef(null),{transform:d,patternId:f}=Et(eae,wn),m=s||Kse[t],h=o||Qse[t],p=t===sr.Dots,g=t===sr.Cross,b=Array.isArray(n)?n:[n,n],y=[b[0]*d[2]||1,b[1]*d[2]||1],v=h*d[2],_=g?[v,v]:y,w=p?[v/i,v/i]:[_[0]/i,_[1]/i];return P.createElement("svg",{className:Pn(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},P.createElement("pattern",{id:f+e,x:d[0]%y[0],y:d[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${w[0]},-${w[1]})`},p?P.createElement(Zse,{color:m,radius:v/i}):P.createElement(Jse,{dimensions:_,color:m,lineWidth:r})),P.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}GI.displayName="Background";var Hw=u.memo(GI),Xu=(e=>(e.Expand="Expand",e.Shrink="Shrink",e))(Xu||{}),To=(e=>(e.In="In",e.Out="Out",e))(To||{});function tae(e,t,n){return Promise.all([nae(e,t),oae(e,t,n)])}function nae(e,t){const n=iae(t);if(n)return uae(e).animate(n,aae()).finished}function oae(e,t,n){if(!t.focusNodeId)return;const{deltaX:o,deltaY:r}=rae(cae(e).getBoundingClientRect(),n.getViewport(),n.getNode(t.focusNodeId)),i=sae(t,o,r);if(i)return dae(e).animate(i,lae(t))}function rae(e,t,n){const o=t.zoom,r=1-o,i=e.width/2,s=e.height/2,a=i-t.x,l=s-t.y,c=-r*i+(t.x-i*r)/o*r,d=-r*s+(t.y-s*r)/o*r,f=n.position.x+n.width/2,m=n.position.y+n.height/2;return{deltaX:-(f-a+c)*o,deltaY:-(m-l+d)*o}}function iae(e){if(e?.scale==="Expand"&&e?.move==="In")return[{transform:"scale(0.1)"},{transform:"scale(1)"}];if(e?.scale==="Expand"&&e?.move==="Out")return[{transform:"scale(1)"},{transform:"scale(10)"}];if(e?.scale==="Shrink"&&e?.move==="In")return[{transform:"scale(10)"},{transform:"scale(1)"}];if(e?.scale==="Shrink"&&e?.move==="Out")return[{transform:"scale(1)"},{transform:"scale(0.1)"}]}function sae(e,t,n){if(e?.scale==="Expand"&&e?.move==="Out")return[{transform:"translate(0, 0)"},{transform:`translate(${t}px, ${n}px)`}];if(e?.scale==="Shrink"&&e?.move==="In")return[{transform:`translate(${t}px, ${n}px)`},{transform:"translate(0, 0)"}]}function aae(e){return{duration:666,easing:"ease"}}function lae(e){if(e?.scale==="Expand"&&e?.move==="Out")return{duration:333,easing:"ease"};if(e?.scale==="Shrink"&&e?.move==="In")return{duration:666,easing:"ease"}}function cae(e){return document.querySelector(`#${e}`)}function uae(e){return document.querySelector(`#${e} .react-flow__renderer`)}function dae(e){return document.querySelector(`#${e} .react-flow__renderer > div`)}const qI="StoryGraph",gl="__root",fae="_story-graph-instances-container_1nbj3_1",pae="_story-graph-instance_1nbj3_1",hae="_story-graph-instance-active_1nbj3_18",mae="_bg-pattern-1_1nbj3_23",gae="_bg-pattern-2_1nbj3_27",yae="_edge_1nbj3_31",vae="_edge-conditional_1nbj3_44",bae="_story-node_1nbj3_48",_ae="_expandable-node_1nbj3_62",wae="_node-with-ports_1nbj3_66",xae="_node-title_1nbj3_70",Sae="_node-title-with-tooltip_1nbj3_82",Eae="_node-synopsis_1nbj3_88",Cae="_node-ports_1nbj3_95",Tae="_node-port_1nbj3_95",kae="_node-port-in_1nbj3_108",Lae="_node-port-out_1nbj3_112",Iae="_node-port-title_1nbj3_116",Nae="_node-handle_1nbj3_129",Rae="_node-port-label_1nbj3_151",Mae="_node-port-with-tooltip_1nbj3_162",Aae="_node-port-tooltip_1nbj3_168",Oae="_breadcrumbs_1nbj3_178",Dae="_breadcrumbs-item_1nbj3_184",dt={"story-graph-instances-container":"_story-graph-instances-container_1nbj3_1",storyGraphInstancesContainer:fae,"story-graph-instance":"_story-graph-instance_1nbj3_1",storyGraphInstance:pae,"story-graph-instance-active":"_story-graph-instance-active_1nbj3_18",storyGraphInstanceActive:hae,"bg-pattern-1":"_bg-pattern-1_1nbj3_23",bgPattern1:mae,"bg-pattern-2":"_bg-pattern-2_1nbj3_27",bgPattern2:gae,edge:yae,"edge-conditional":"_edge-conditional_1nbj3_44",edgeConditional:vae,"story-node":"_story-node_1nbj3_48",storyNode:bae,"expandable-node":"_expandable-node_1nbj3_62",expandableNode:_ae,"node-with-ports":"_node-with-ports_1nbj3_66",nodeWithPorts:wae,"node-title":"_node-title_1nbj3_70",nodeTitle:xae,"node-title-with-tooltip":"_node-title-with-tooltip_1nbj3_82",nodeTitleWithTooltip:Sae,"node-synopsis":"_node-synopsis_1nbj3_88",nodeSynopsis:Eae,"node-ports":"_node-ports_1nbj3_95",nodePorts:Cae,"node-port":"_node-port_1nbj3_95",nodePort:Tae,"node-port-in":"_node-port-in_1nbj3_108",nodePortIn:kae,"node-port-out":"_node-port-out_1nbj3_112",nodePortOut:Lae,"node-port-title":"_node-port-title_1nbj3_116",nodePortTitle:Iae,"node-handle":"_node-handle_1nbj3_129",nodeHandle:Nae,"node-port-label":"_node-port-label_1nbj3_151",nodePortLabel:Rae,"node-port-with-tooltip":"_node-port-with-tooltip_1nbj3_162",nodePortWithTooltip:Mae,"node-port-tooltip":"_node-port-tooltip_1nbj3_168",nodePortTooltip:Aae,breadcrumbs:Oae,"breadcrumbs-item":"_breadcrumbs-item_1nbj3_184",breadcrumbsItem:Dae},Ga=new Ye,Jo=(e,t,n,o,r,i)=>({id:e,type:"story",position:t,data:{title:i??to(e),synopsis:n,expand:o,ports:r}}),So=(e,t,n,o,r,i,s)=>({id:e,className:ln(dt.edge,s&&dt.edgeConditional),markerStart:i?{type:$c.Arrow,width:18,height:18}:void 0,markerEnd:{type:$c.ArrowClosed,width:18,height:18},source:t,sourceHandle:n,target:o,targetHandle:r}),zae={nodes:[Jo("ScriptWithShortSynopsis",{x:35,y:180},"Lorem ipsum dolor sit amet.",void 0,[{type:"out",id:"WorkInProgress.OtherLabel",condition:"points > 10"},{type:"in",id:"UnusedLabel"},{type:"out",id:"Script003.FooBarBaz"},{type:"out",id:"WorkInProgress"}]),Jo("WorkInProgress",{x:315,y:180},"The story graph is currently being worked on; please ignore this tab for now. Click menu button in the upper-left corner of the editor to open a project.",void 0,[{type:"in",id:""},{type:"in",id:"Label"},{type:"out",id:"Script003.FooBarBaz",condition:"foo(10) & bar <= 5 & baz"},{type:"out",id:"ExpandableNode.InnerScript2",title:"InnerScript2",condition:"bar > 0"},{type:"out",id:"ExpandableNode.InnerScript1",title:"InnerScript1"},{type:"in",id:"OtherLabel"},{type:"out",id:".Label"},{type:"out",id:"ExpandableNode.InnerScript1.SomeLabel",title:"InnerScript1.SomeLabel"}]),Jo("ExpandableNode",{x:645,y:280},"Double-click to enter sub-graph.",{id:"ExpandableNode",move:To.In},[{type:"in",id:"InnerScript1"},{type:"in",id:"InnerScript2"},{type:"in",id:"InnerScript1.SomeLabel"},{type:"out",id:"Script003"}]),Jo("Script003",{x:935,y:90},"Lorem ipsum dolor sit amet.",void 0,[{type:"in",id:""},{type:"in",id:"FooBarBaz"}]),Jo("ScriptWithoutContent",{x:35,y:380}),Jo("ScriptWith1In",{x:35,y:455},void 0,void 0,[{type:"in",id:"Nya"}]),Jo("ScriptWith1Out",{x:35,y:550},void 0,void 0,[{type:"out",id:"Nowhere"}])],edges:[So("1","ScriptWithShortSynopsis","WorkInProgress.OtherLabel","WorkInProgress","OtherLabel",!0,!0),So("2","ScriptWithShortSynopsis","Script003.FooBarBaz","Script003","FooBarBaz"),So("3","ScriptWithShortSynopsis","WorkInProgress","WorkInProgress",""),So("4","WorkInProgress","ExpandableNode.InnerScript2","ExpandableNode","InnerScript2",!1,!0),So("5","WorkInProgress","ExpandableNode.InnerScript1","ExpandableNode","InnerScript1"),So("6","WorkInProgress","Script003.FooBarBaz","Script003","FooBarBaz",!1,!0),So("7","WorkInProgress",".Label","WorkInProgress","Label"),So("8","WorkInProgress","ExpandableNode.InnerScript1.SomeLabel","ExpandableNode","InnerScript1.SomeLabel",!0),So("9","ExpandableNode","Script003","Script003","")]},Pae={nodes:[Jo("FromRoot",{x:150,y:150},void 0,{id:gl,move:To.Out},[{type:"out",id:"WorkInProgress1",title:"Work In Progress"},{type:"out",id:"WorkInProgress2",title:"Work In Progress",condition:"bar > 0"},{type:"out",id:"WorkInProgress3",title:"Work In Progress"}],"Root"),Jo("InnerScript1",{x:380,y:210},"First inner script.",void 0,[{type:"in",id:""},{type:"in",id:"SomeLabel"},{type:"out",id:"InnerScript2"}]),Jo("InnerScript2",{x:600,y:270},"Second inner script.",void 0,[{type:"in",id:""},{type:"out",id:"Script003"}]),Jo("ToRoot",{x:850,y:350},void 0,{id:gl,move:To.Out},[{type:"in",id:"Script003"}],"Root"),Jo("AnotherExpandable",{x:380,y:500},void 0,{id:"InnerGraph2",move:To.In},[])],edges:[So("1","FromRoot","WorkInProgress1","InnerScript1",""),So("2","FromRoot","WorkInProgress2","InnerScript2","",!1,!0),So("3","FromRoot","WorkInProgress3","InnerScript1","SomeLabel",!0),So("4","InnerScript1","InnerScript2","InnerScript2",""),So("5","InnerScript2","Script003","ToRoot","Script003")]},Bae={nodes:[Jo("NodeOfInnerGraph2",{x:380,y:210})],edges:[]},Fae=e=>e===gl?zae:e==="InnerGraph2"?Bae:Pae,$ae=({id:e,data:{title:t,showSynopsis:n,showCondition:o,synopsis:r,expand:i,ports:s}})=>{const a=s?.find(y=>y.id.length===0);a&&(s=s?.filter(y=>y.id!==a.id));const l=ln(dt.storyNode,i&&dt.expandableNode,s&&s.length>0&&dt.nodeWithPorts),c=u.useCallback(()=>{i&&Ga.broadcast({id:i.id,move:i.move,focusNodeId:e})},[i,e]),d=u.useCallback(()=>!n||!r||r.length===0?null:k.jsx("div",{className:dt.nodeSynopsis,children:r}),[n,r]),f=u.useCallback((y,v)=>k.jsxs("div",{className:ln(dt.nodePort,dt.nodePortIn,y===""&&dt.nodePortTitle),children:[k.jsx(Hc,{type:"target",id:y,position:me.Left,className:dt.nodeHandle}),k.jsx("span",{className:dt.nodePortLabel,children:v??y})]},y),[]),m=u.useCallback((y,v,_)=>{const w=!o&&_?dt.nodePortWithTooltip:void 0,S=!o&&_?cn(_):void 0,x=ln(dt.nodePort,dt.nodePortOut,w,y===""&&dt.nodePortTitle);return k.jsxs("div",{...S,className:x,children:[k.jsx(Hc,{type:"source",id:y,position:me.Right,className:dt.nodeHandle}),k.jsx("span",{className:dt.nodePortLabel,children:v??y}),o&&_&&k.jsx("div",{className:dt.nodePortTooltip,children:_})]},y)},[o]),h=u.useCallback(y=>y.type==="in"?f(y.id,y.title):m(y.id,y.title,y.condition),[f,m]),p=u.useCallback(()=>{const y=!n&&r&&r.length>0?cn(r):void 0,v=ln(dt.nodeTitle,y&&dt.nodeTitleWithTooltip);return k.jsxs("div",{className:v,...y,children:[t,a&&h(a),d()]})},[h,d,n,r,t,a]),g=u.useCallback(()=>s==null||s.length===0?null:k.jsx("div",{className:dt.nodePorts,children:s.map(h)}),[s,h]),b=N1(!i&&{label:"Edit Script",icon:Hp,hotkey:de.EditScript,onClick:()=>{}},!i&&{label:"Duplicate Script",icon:Qh,hotkey:de.Duplicate,onClick:()=>{}},!i&&{label:"Delete Script",icon:Ri,hotkey:de.Delete,onClick:()=>{}},i&&{label:"Enter Group",icon:aW,hotkey:de.EnterGroup,onClick:c},i&&{label:"Delete Group",icon:Ri,hotkey:de.Delete,onClick:()=>{}});return k.jsxs("div",{className:l,onDoubleClick:c,onContextMenu:b,children:[p(),g()]})},YI=new Ye,XI=new Ye;function ub(e){YI.broadcast(e)}function e4(e){XI.broadcast(e)}const Hae="_inspector_6gclz_1",Vae="_header_6gclz_5",Uae="_components_6gclz_12",jae="_footer_6gclz_16",Wae="_component_6gclz_12",Gae="_component-header_6gclz_29",qae="_component-header-collapsed_6gclz_41",Yae="_component-header-sortable_6gclz_49",Xae="_component-collapse_6gclz_53",Jae="_component-icon_6gclz_59",Zae="_component-title_6gclz_65",Kae="_component-title-with-tooltip_6gclz_71 _component-title_6gclz_65",Qae="_component-drag-area_6gclz_76",ele="_component-context-menu_6gclz_81 _minimal_xapm2_53",tle="_component-content_6gclz_87",Qn={inspector:Hae,header:Vae,components:Uae,footer:jae,component:Wae,"component-header":"_component-header_6gclz_29",componentHeader:Gae,"component-header-collapsed":"_component-header-collapsed_6gclz_41",componentHeaderCollapsed:qae,"component-header-sortable":"_component-header-sortable_6gclz_49",componentHeaderSortable:Yae,"component-collapse":"_component-collapse_6gclz_53",componentCollapse:Xae,"component-icon":"_component-icon_6gclz_59",componentIcon:Jae,"component-title":"_component-title_6gclz_65",componentTitle:Zae,"component-title-with-tooltip":"_component-title-with-tooltip_6gclz_71 _component-title_6gclz_65",componentTitleWithTooltip:Kae,"component-drag-area":"_component-drag-area_6gclz_76",componentDragArea:Qae,"component-context-menu":"_component-context-menu_6gclz_81 _minimal_xapm2_53",componentContextMenu:ele,"component-content":"_component-content_6gclz_87",componentContent:tle},nle=({collapsed:e,content:t,icon:n,index:o,menuItems:r,sortable:i,title:s,tooltip:a})=>{const[l,c]=u.useState(e??!1),d=mv(o,{disabled:!i,moveOnly:!0});u.useLayoutEffect(()=>c(e??!1),[t,e]);const f=u.useCallback(()=>r&&k.jsx(hs,{align:eu.End,icon:lW,buttonClass:Qn.componentContextMenu,tooltip:"Context Menu",children:r.map((g,b)=>k.jsx("span",{children:g},b))}),[r]),m=u.useCallback(()=>c(!l),[l]),h=u.useCallback(()=>{if(!s)return null;const g=l?_5:Kh,b=Qn.componentHeader+(l?` ${Qn.componentHeaderCollapsed}`:"")+(i?` ${Qn.componentHeaderSortable}`:""),y=a?Qn.componentTitleWithTooltip:Qn.componentTitle;return k.jsxs("div",{className:b,onClick:m,children:[k.jsx("span",{className:Qn.componentCollapse,children:g}),k.jsx("span",{className:Qn.componentIcon,children:n}),k.jsx("span",{className:y,...cn(a,{doc:!0}),children:s}),k.jsx("span",{className:Qn.componentDragArea,...d.handle}),f()]})},[m,n,l,d.handle,f,i,s,a]),p=u.useCallback(()=>!l&&k.jsx("div",{className:Qn.componentContent,children:t}),[t,l]);return k.jsxs("div",{...d.node,className:Qn.component,children:[h(),p()]})},ole=u.memo(()=>{const[e,t]=u.useState(),n=u.useCallback(()=>e?.header&&k.jsx("div",{className:Qn.header,children:e.header}),[e?.header]),o=u.useCallback(()=>{if(!e)return null;const i=e.components.map((s,a)=>s&&u.createElement(nle,{...s,index:a,key:a}));return k.jsx("div",{className:Qn.components,children:k.jsx(Tv,{handleSort:e.handleSort,bound:Lc.Ancestor,children:i})})},[e]),r=u.useCallback(()=>e?.footer?k.jsx("div",{className:Qn.footer,children:e.footer}):null,[e?.footer]);return Nr(YI,t,[]),Nr(XI,i=>{e===i&&t(void 0)},[e]),k.jsx("div",{className:Qn.inspector,children:k.jsxs(OE,{children:[n(),o(),r()]})})}),rle={canRender:e=>e==="Inspector",renderContent:e=>u.createElement(ole),renderIcon:e=>IW},ile="_header_1m650_1",sle="_header-inspection-button_1m650_8",ale="_header-inspection-label_1m650_12",lle="_header-line-type_1m650_19",cle="_header-edit-menu_1m650_23",ule="_icon-comment_1m650_27",dle="_icon-label_1m650_31",fle="_icon-command_1m650_35",ple="_icon-generic-author_1m650_39",hle="_icon-generic-text_1m650_43",mle="_parameter_1m650_47",gle="_unassigned_1m650_51",yle="_inline-menu_1m650_59",vle="_inline-menu-button_1m650_66",ble="_inline-menu-dropdown_1m650_72",Rn={header:ile,"header-inspection-button":"_header-inspection-button_1m650_8",headerInspectionButton:sle,"header-inspection-label":"_header-inspection-label_1m650_12",headerInspectionLabel:ale,"header-line-type":"_header-line-type_1m650_19",headerLineType:lle,"header-edit-menu":"_header-edit-menu_1m650_23",headerEditMenu:cle,"icon-comment":"_icon-comment_1m650_27",iconComment:ule,"icon-label":"_icon-label_1m650_31",iconLabel:dle,"icon-command":"_icon-command_1m650_35",iconCommand:fle,"icon-generic-author":"_icon-generic-author_1m650_39",iconGenericAuthor:ple,"icon-generic-text":"_icon-generic-text_1m650_43",iconGenericText:hle,parameter:mle,unassigned:gle,"inline-menu":"_inline-menu_1m650_59",inlineMenu:yle,"inline-menu-button":"_inline-menu-button_1m650_66",inlineMenuButton:vle,"inline-menu-dropdown":"_inline-menu-dropdown_1m650_72",inlineMenuDropdown:ble},vd=qa.LineType,db=k.jsx("span",{className:Rn.iconComment,children:EW}),Um=k.jsx("span",{className:Rn.iconLabel,children:NW}),su=k.jsx("span",{className:Rn.iconCommand,children:oW}),j1=k.jsx("span",{className:Rn.iconGenericText,children:AW});function _le(e){return e===vd.Comment?db:e===vd.Label?Um:e===vd.Command?su:j1}function wle(e,t,n,o){Nr(Re.onScriptChanged,r,n?[...n,e]:[e],o);function r(i){i===e&&t()}}function xle(e){if(Re.isScriptTab(e))return Re.getScriptIdFromTab(e)}function JI(e){return e?.map(t=>t.expression!==void 0?{body:t.expression}:t.textId!==void 0?{text:t.text,id:t.textId}:t.text??"")??[]}function ZI(e){const t=e.map(n=>JT(n)?{expression:n.body}:ZT(n)?{text:n.text,textId:n.id}:{text:n});return t.length===0?void 0:t}function KI(e){const t=!e.name||e.name.length===0?void 0:e.name,n=!e.value||e.value.length===0?void 0:e.value;if(!(t===void 0&&n==null))return[t,n]}function Sle(e){return KI(e)??[void 0,void 0]}function Ele(e){if(e!==void 0)return{type:e.group==="Commands"?vd.Command:vd[e.value],commandId:e.group==="Commands"?e.value:void 0}}const Cle="_header_so1gz_1",Tle="_header-inspection-button_so1gz_8",kle="_header-inspection-label_so1gz_12",Lle="_icon-synopsis_so1gz_19",Ile="_icon-outline_so1gz_23",Nle="_icon-mutations_so1gz_27",Rle="_outline-container_so1gz_31",Mle="_outline-item_so1gz_38",Ale="_outline-item-icon_so1gz_53",Ole="_outline-item-label_so1gz_61",Do={header:Cle,"header-inspection-button":"_header-inspection-button_so1gz_8",headerInspectionButton:Tle,"header-inspection-label":"_header-inspection-label_so1gz_12",headerInspectionLabel:kle,"icon-synopsis":"_icon-synopsis_so1gz_19",iconSynopsis:Lle,"icon-outline":"_icon-outline_so1gz_23",iconOutline:Ile,"icon-mutations":"_icon-mutations_so1gz_27",iconMutations:Nle,"outline-container":"_outline-container_so1gz_31",outlineContainer:Rle,"outline-item":"_outline-item_so1gz_38",outlineItem:Mle,"outline-item-icon":"_outline-item-icon_so1gz_53",outlineItemIcon:Ale,"outline-item-label":"_outline-item-label_so1gz_61",outlineItemLabel:Ole};function Dle(e){const t=e.filter(n=>n.selected);return t.length>0?zle(t[0]):ub(void 0),e}function zle(e){const t=e.data.ports?.filter(n=>n.id.length>0);ub({header:Ple(e.id),components:[Ble(e.data.synopsis),t&&Fle(t),Hle()]})}function Ple(e){return k.jsxs("div",{className:Do.header,children:[k.jsxs(hs,{buttonClass:Do.headerEditMenu,icon:tk,tooltip:"Edit Script",children:[k.jsx(at,{label:"Edit Script",icon:Hp,hotkey:de.EditScript,onClick:()=>{}}),k.jsx(at,{label:"Create New Script",icon:em,hotkey:de.CreateScript,onClick:()=>{}}),k.jsx(at,{label:"Duplicate Script",icon:Qh,hotkey:de.Duplicate,onClick:()=>{}}),k.jsx(at,{label:"Delete Script",icon:Ri,hotkey:de.Delete,onClick:()=>{}})]}),k.jsx(yn,{className:Do.headerInspectionButton,icon:Hp,handler:()=>{},label:`Assets/Scripts/${e}`,tooltip:"Open Script"})]})}function Ble(e){return{title:"Synopsis",tooltip:"An optional brief summary or the script content.",icon:k.jsx("span",{className:Do.iconSynopsis,children:OW}),content:k.jsx(qk,{submit:()=>{},value:e})}}function Fle(e){return{title:"Outline",tooltip:"Lines shaping script navigation structure, such as labels and goto commands.",icon:k.jsx("span",{className:Do.iconOutline,children:vW}),content:k.jsx("div",{className:Do.outlineContainer,children:e.map($le)})}}function $le(e){const t=e.title??e.id,n=e.condition?` if:${e.condition}`:"",o=k.jsx("span",{className:Do.outlineItemLabel,children:e.type==="in"?t:`goto ${t}${n}`}),r=k.jsx("span",{className:Do.outlineItemIcon,children:e.type==="in"?Um:su});return k.jsx(yn,{style:ei.Minimal,className:Do.outlineItem,label:o,icon:r,handler:()=>{}},e.id)}function Hle(){return{title:"Mutations",tooltip:"List of variable changes in the script.",icon:k.jsx("span",{className:Do.iconMutations,children:rk}),content:k.jsxs("div",{className:Do.outlineContainer,children:[Ou("set foo=bar","command"),Ou("set baz={foo == bar ? 0 : 1}","inlined"),Ou('choice "Option 1" set:score++',"command"),Ou('choice "Option 2" set:score--',"command"),Ou('set foo="Lorem";bar="Ipsum" if:score>10',"command")]})}}function Ou(e,t){const n=k.jsx("span",{className:Do.outlineItemLabel,children:e}),o=k.jsx("span",{className:Do.outlineItemIcon,children:t==="command"?su:j1});return k.jsx(yn,{style:ei.Minimal,className:Do.outlineItem,label:n,icon:o,handler:()=>{}},e)}const Vle={story:$ae},Vw=({id:e,active:t,animation:n,breadcrumbs:o})=>{const r=kn(hn.GraphMinZoom),i=kn(hn.GraphMaxZoom),s=kn(hn.GraphSelectionMode),a=kn(hn.GraphShowGrid),l=kn(hn.GraphSnapToGrid),c=kn(hn.GraphControlsPosition),d=kn(hn.GraphMapPosition),f=kn(hn.GraphBreadcrumbsPosition),m=kn(hn.GraphShowSynopsis),h=kn(hn.GraphShowCondition),p=kn(hn.GraphEdgeType),g=p==="bezier"?"default":p,b=kn(hn.GraphAnimateTransition),y=Vm(),v=u.useRef(null),_=Mse(),[w,S]=u.useState({normal:"",selected:""}),[x,E]=Lse([]),[T,N]=Ise([]),I=u.useMemo(()=>{if(o)return o.length>1?o[o.length-2].id:o.length===1?gl:void 0},[o]),R=u.useCallback(U=>({...U,data:{...U.data,showSynopsis:m,showCondition:h}}),[m,h]),O=u.useCallback(U=>{const W=U.selected?w.selected:w.normal;return U.markerStart&&(U.markerStart={...U.markerStart,color:W}),U.markerEnd&&(U.markerEnd={...U.markerEnd,color:W}),{...U,type:g,zIndex:U.selected?.1:void 0}},[w,g]),B=u.useCallback(U=>{const W=cb(U,x).map(R);E(W),Dle(W)},[R,x,E]),C=u.useCallback(U=>{N(W=>LI(U,W).map(O))},[O,N]),M=u.useCallback(U=>{const W=T.filter(H=>!H.selected&&(H.source===U.id||H.target===U.id)).map(H=>Ag(H.id,!0));W.length>0&&C(W)},[T,C]),A=u.useCallback(U=>{U.edges.length===0&&U.nodes.at(0)?.selected&&M(U.nodes[0])},[M]),$=u.useCallback((U,W)=>{B(x.map(H=>Ag(H.id,H.id===W.id))),C(T.map(H=>Ag(H.id,!1))),M(W)},[x,T,C,B,M]);u.useEffect(()=>S(Wle()),[]),u.useEffect(()=>{if(!t)return;const U=Fae(e);E(U.nodes.map(R)),N(U.edges.map(O))},[e,t,R,O,E,N]),u.useEffect(()=>{b&&n&&_&&tae(e,n,y).then(()=>Ga.last?.at(0)?.id!==e&&e===v.current?.id&&y.setNodes([]))},[n,b,e,y,_]);const z=N1({label:"Create Script",icon:em,hotkey:de.CreateScript,onClick:()=>{}},{label:"Create Group",icon:RW,hotkey:de.CreateGroup,onClick:()=>{}},I!=null&&{label:"Exit Group",icon:DW,hotkey:de.ExitGroup,onClick:()=>Ga.broadcast({id:I,move:To.Out})}),L=u.useCallback(()=>c!=="hide"&&k.jsx(Xse,{id:`controls-${e}`,position:c}),[e,c]),D=u.useCallback(()=>d!=="hide"&&k.jsx(Vse,{id:`minimap-${e}`,pannable:!0,inversePan:!0,zoomable:!0,zoomStep:2,offsetScale:1,maskStrokeWidth:0,position:d}),[e,d]),F=u.useCallback(()=>a&&k.jsxs(k.Fragment,{children:[k.jsx(Hw,{id:`bg-1-${e}`,variant:sr.Lines,gap:10,className:dt.bgPattern1}),k.jsx(Hw,{id:`bg-2-${e}`,variant:sr.Lines,gap:100,offset:1,className:dt.bgPattern2})]}),[e,a]),V=u.useCallback(U=>{const W=U.id===e,H=to(U.id),q=W?"You are here":`Return to ${H}`,j=W?void 0:()=>Ga.broadcast({id:U.id,move:To.Out});return k.jsx("span",{className:dt.breadcrumbsItem,onClick:j,...cn(q),children:H},U.id)},[e]),G=u.useCallback(()=>f!=="hide"&&o&&o.length>0&&k.jsxs(Fm,{id:`breadcrumbs-${e}`,position:f,className:dt.breadcrumbs,children:[k.jsx("span",{className:dt.breadcrumbsItem,onClick:()=>Ga.broadcast({id:gl,move:To.Out}),...cn("Return to top"),children:gW},"root"),o.map(V)]}),[e,f,o,V]);return k.jsxs(HI,{id:e,ref:v,edges:T,nodes:x,nodeTypes:Vle,onNodesChange:B,onEdgesChange:C,className:ln(dt.storyGraphInstance,[t,dt.storyGraphInstanceActive]),minZoom:r,maxZoom:i,onFocus:jle,onSelectionChange:A,onError:Ule,onNodeContextMenu:$,proOptions:{hideAttribution:!0},snapToGrid:l,snapGrid:[10,10],panOnDrag:[1,2],selectionMode:s,onPaneContextMenu:z,nodesConnectable:!1,deleteKeyCode:null,selectionOnDrag:!0,elementsSelectable:!0,children:[G(),L(),D(),F()]})};function Ule(e,t){e!=="004"&&console.warn(t)}function jle(){ft.focusTab(qI)}function Wle(){const e=getComputedStyle(document.body);return{normal:e.getPropertyValue("--dim-font-color"),selected:e.getPropertyValue("--light-accent-color")}}function Ag(e,t){return{type:"select",id:e,selected:t}}const Gle=u.memo(()=>{const[e,t]=u.useState({id:"",active:!1}),[n,o]=u.useState({id:gl,active:!0}),[r,i]=u.useState([]),s=u.useCallback(()=>[e.active?[e,t]:[n,o],e.active?[n,o]:[e,t]],[e,n]),a=u.useCallback((d,f)=>{const[[m,h],[p,g]]=s(),b=[...r,{id:d,move:To.Out}];h({...m,active:!1,animation:{scale:Xu.Expand,move:To.Out,focusNodeId:f}}),g({id:d,active:!0,breadcrumbs:b,animation:{scale:Xu.Expand,move:To.In,focusNodeId:void 0}}),i(b)},[r,s]),l=u.useCallback(d=>{const[[f,m],[h,p]]=s(),g=d===h.id?h.animation?.focusNodeId:void 0,b=d===gl?[]:r.slice(0,r.findIndex(y=>y.id===d)+1);m({...f,active:!1,animation:{scale:Xu.Shrink,move:To.Out,focusNodeId:void 0}}),p({id:d,active:!0,breadcrumbs:b,animation:{scale:Xu.Shrink,move:To.In,focusNodeId:g}}),i(b)},[r,s]),c=u.useCallback(d=>{d.move===To.In?a(d.id,d.focusNodeId):l(d.id)},[a,l]);return u.useEffect(()=>(Ga.subscribe(c),()=>Ga.unsubscribe(c)),[c]),k.jsxs("div",{className:dt.storyGraphInstancesContainer,children:[k.jsx(nh,{children:k.jsx(Vw,{...e})}),k.jsx(nh,{children:k.jsx(Vw,{...n})})]})}),qle={canRender:e=>e===qI,renderContent:e=>u.createElement(Gle),renderIcon:e=>rW},Yle="_script-view_q1fzl_1",Xle="_script-line_q1fzl_6",Jle="_fadein_q1fzl_1",Zle="_script-line-inspected_q1fzl_25",Kle="_line-indent_q1fzl_30",Qle="_line-icon_q1fzl_36",ece="_line-content_q1fzl_47",tce="_comment-line_q1fzl_54",nce="_label-line_q1fzl_58",oce="_command-line_q1fzl_62",rce="_generic-line_q1fzl_66",ice="_insert-preview-line_q1fzl_70",Vo={"script-view":"_script-view_q1fzl_1",scriptView:Yle,"script-line":"_script-line_q1fzl_6",scriptLine:Xle,fadein:Jle,"script-line-inspected":"_script-line-inspected_q1fzl_25",scriptLineInspected:Zle,"line-indent":"_line-indent_q1fzl_30",lineIndent:Kle,"line-icon":"_line-icon_q1fzl_36",lineIcon:Qle,"line-content":"_line-content_q1fzl_47",lineContent:ece,"comment-line":"_comment-line_q1fzl_54",commentLine:tce,"label-line":"_label-line_q1fzl_58",labelLine:nce,"command-line":"_command-line_q1fzl_62",commandLine:oce,"generic-line":"_generic-line_q1fzl_66",genericLine:rce,"insert-preview-line":"_insert-preview-line_q1fzl_70",insertPreviewLine:ice},sce=({line:e,lineIndex:t,handleSelected:n,inspected:o,editor:r})=>{const i=so(Ae.onBridgingChanged),s=mv(t,{hidePreview:!0}),a=kn(hn.FadeScriptLines),l=u.useMemo(()=>a?s.combined.style:{...s.combined.style,animation:"none"},[a,s.combined.style]),c=u.useMemo(()=>e.content.length>0?_le(e.type):null,[e.content.length,e.type]),d=u.useCallback(()=>{const S=`${Vo.scriptLine} ${o?Vo.scriptLineInspected:""} `;return e.type==qa.LineType.Comment?S+Vo.commentLine:e.type==qa.LineType.Label?S+Vo.labelLine:e.type==qa.LineType.Command?S+Vo.commandLine:S+Vo.genericLine},[o,e.type]),f=u.useCallback(()=>{n(t)},[n,t]),m=u.useCallback(()=>{r.insertLine({lineIndex:t+1})},[r,t]),h=u.useCallback(()=>{r.indentLine({lineIndex:t})},[r,t]),p=u.useCallback(()=>{r.unIndentLine({lineIndex:t})},[r,t]),g=u.useCallback(()=>{r.duplicateLine({lineIndex:t})},[r,t]),b=u.useCallback(()=>{r.deleteLine({lineIndex:t})},[r,t]),y=u.useCallback(()=>{r.gotoLine(t)},[r,t]),v=N1({label:"Insert New Line",icon:em,hotkey:de.InsertLine,onClick:m},{label:"Indent Line",icon:ok,hotkey:de.IndentLine,onClick:h},e.indent>0&&{label:"Un-Indent Line",icon:ek,hotkey:de.UnIndentLine,onClick:p},{label:"Duplicate Line",icon:Qh,hotkey:de.Duplicate,onClick:g},{label:"Delete Line",icon:Ri,hotkey:de.Delete,onClick:b},i!=null&&{label:"Goto Line",icon:KT,hotkey:de.GotoLine,onClick:y}),_=u.useCallback(S=>{f(),v?.(S)},[f,v]),w=u.useMemo(()=>{const S=[];for(let x=0;x({...t,group:"Commands"}))]}function lce(e){return[{value:"Text",icon:j1,description:"Print authored text"},{value:"to:Commands",label:"Command",icon:su,description:"Insert action in the text"},...e.map(t=>({...t,group:"Commands"}))]}function cce(e){return e}function tN(e){t(t4,ace),t(QI,lce),t(eN,cce);function t(n,o){n.length=0,e!==void 0&&n.push(...o(e))}}tN(Re.onCommandOptionsChanged.last?.[0]);Re.onCommandOptionsChanged.subscribe(tN);const uce=({editor:{changeLineType:e,indentLine:t,unIndentLine:n,deleteLine:o,duplicateLine:r,insertLine:i,showLine:s},lineIndex:a,lineType:l,pickType:c,scriptUri:d})=>{const f=u.useCallback(S=>{const x=Ele(S);x!==void 0&&e({lineIndex:a,...x})},[e,a]),m=u.useCallback(()=>{i({lineIndex:a+1})},[i,a]),h=u.useCallback(()=>{t({lineIndex:a})},[t,a]),p=u.useCallback(()=>{n({lineIndex:a})},[n,a]),g=u.useCallback(()=>{r({lineIndex:a})},[r,a]),b=u.useCallback(()=>{o({lineIndex:a})},[o,a]),y=u.useCallback(()=>{s(a)},[a,s]),v=u.useCallback(()=>{let S=d.startsWith("/")?d.substring(1):d;S.endsWith(".nani")&&(S=S.substring(0,S.indexOf(".nani")));const x=k.jsxs("span",{className:Rn.headerInspectionLabel,children:[S,"#",a+1]});return k.jsx(yn,{className:Rn.headerInspectionButton,icon:KT,handler:y,label:x,tooltip:"Show Inspected Line"})},[a,d,y]),_=u.useCallback(()=>{const S=t4.find(x=>x.label===`${qa.LineType[l]} Line`);return k.jsx(ru,{containerClass:Rn.headerLineType,tooltip:"Change Line Type",value:S,submit:f,options:t4,open:c,searchable:!0})},[f,l,c]),w=u.useCallback(()=>k.jsxs(hs,{buttonClass:Rn.headerEditMenu,icon:tk,tooltip:"Edit Line",children:[k.jsx(at,{label:"Insert New Line",icon:em,hotkey:de.InsertLine,onClick:m}),k.jsx(at,{label:"Indent Line",icon:ok,hotkey:de.IndentLine,onClick:h}),k.jsx(at,{label:"Un-Indent Line",icon:ek,hotkey:de.UnIndentLine,onClick:p}),k.jsx(at,{label:"Duplicate Line",icon:Qh,hotkey:de.Duplicate,onClick:g}),k.jsx(at,{label:"Delete Line",icon:Ri,hotkey:de.Delete,onClick:b})]}),[h,p,b,g,m]);return k.jsxs("div",{className:Rn.header,children:[w(),v(),_()]})},dce=({inlineIndex:e,lineIndex:t,paramId:n,scriptId:o,unassigned:r,view:{containerType:i,dynamicValue:s,id:a,textId:l,tooltip:c,value:d,valueContext:f,valueOptions:m,valueType:h}})=>{const p=d?.map(L=>L??void 0),g=m?.map(L=>L??void 0),b=f?.map(L=>L??void 0),y=to(a),v=s!==void 0,_=`${Rn.parameter} ${r?Rn.unassigned:""}`,w=u.useCallback((L,D)=>Re.editParameter(o,{lineIndex:t,inlineIndex:e,parameterId:n,value:L,textId:l,dynamicValue:D}),[e,t,n,o,l]),S=u.useCallback(()=>w(void 0,[{expression:" "}]),[w]),x=u.useCallback(()=>w([""],void 0),[w]),E=u.useCallback(()=>w(void 0,void 0),[w]),T=vm(!v&&[de.MixParameter,S]),N=N1(v?{label:"To Static",icon:kW,onClick:x}:{label:"To Dynamic",icon:rk,hotkey:de.MixParameter,onClick:S},!r&&{label:"Unassign",icon:Ri,hotkey:de.UnassignParameter,onClick:E}),I=u.useCallback(L=>{const D=L.value===void 0?void 0:L.value.toLowerCase()==="true";return k.jsx(E5,{...L,value:D,submit:F=>L.submit(F?.toString())})},[]),R=u.useCallback((L,D)=>{const F=L.value==null?void 0:Number(L.value);return k.jsx(fl,{...L,value:F,submit:V=>L.submit(V?.toString()),integer:D})},[]),O=u.useCallback(()=>k.jsx(Xk,{label:y,value:JI(s),tooltip:c,labelAttrs:{onContextMenu:N},submit:L=>w(void 0,ZI(L))}),[s,y,N,w,c]),B=u.useCallback(()=>k.jsx(NJ,{label:y,tooltip:c,labelAttrs:{onContextMenu:N},components:b[0].subType.split(","),value:p?.map(L=>L===void 0?void 0:Number(L)),submit:L=>w(L?.map(D=>D?.toString()))}),[b,y,N,p,w,c]),C=u.useCallback((L,D,F)=>F?.type===$i.ValueContextType.Color?k.jsx(eL,{...L}):h===$i.ValueType.Boolean?I(L):h===$i.ValueType.Integer?R(L,!0):h===$i.ValueType.Decimal?R(L):k.jsx(Iy,{...L,options:D,searchable:!0}),[I,R,h]),M=u.useCallback(()=>b?.at(0)?.type===$i.ValueContextType.Vector?B():k.jsx(z5,{label:y,values:p??[],tooltip:c,createDefault:()=>{},labelAttrs:{onContextMenu:N},renderItem:(L,D)=>C({value:L,submit:D},g?.at(0),b?.at(0)),submit:L=>w(L==null||L.length===0?void 0:[...L])}),[b,y,N,g,p,C,B,w,c]),A=u.useCallback(()=>k.jsx(Yk,{label:y,value:{name:p?.at(0),value:p?.at(1)},tooltip:c,nameOptions:g?.at(0),createDefault:()=>{},labelAttrs:{onContextMenu:N},renderNamed:(L,D)=>C({value:L,submit:D},g?.at(1),b?.at(1)),submit:L=>w(KI(L))}),[b,y,N,g,p,C,w,c]),$=u.useCallback(()=>{const L=p??[],D=Array(L.length/2);for(let F=0;F{},labelAttrs:{onContextMenu:N},renderNamed:(F,V)=>C({value:F,submit:V},g?.at(1),b?.at(1)),submit:F=>w(F==null||F.length===0?void 0:F.flatMap(Sle))})},[b,y,N,g,p,C,w,c]),z=u.useCallback(()=>v?O():i===$i.ValueContainerType.List?M():i===$i.ValueContainerType.Named?A():i===$i.ValueContainerType.NamedList?$():C({value:p?.at(0),submit:L=>w(L===void 0||L.length===0?void 0:[L]),labelAttrs:{onContextMenu:N},label:y,tooltip:c},g?.at(0),b?.at(0)),[i,b,v,y,N,g,p,O,M,A,$,C,w,c]);return k.jsx("div",{className:_,onKeyDown:T,children:z()})},fce=({scriptId:e,lineIndex:t,inlineIndex:n,view:o})=>{const r=u.useCallback(a=>a.value||a.dynamicValue,[]),i=u.useCallback((a,l)=>{const c=!r(a)&&!a.required,d=l+a.id+c;return k.jsx(dce,{view:a,scriptId:e,lineIndex:t,inlineIndex:n,paramId:a.id,unassigned:c},d)},[n,r,t,e]),s=u.useCallback((a,l)=>a.required&&!l.required?-1:!a.required&&l.required?1:r(a)&&!r(l)?-1:!r(a)&&r(l)?1:0,[r]);return k.jsx(k.Fragment,{children:o.parameters?.sort(s).map(i)})},pce=({inline:e,inlineIndex:t,lineIndex:n,scriptId:o,text:r})=>{const i=vm([de.InlineCommand,()=>e.broadcast(t+1)]),s=u.useCallback(a=>{hce(a,r.length,t)||Re.editText(o,{lineIndex:n,inlineIndex:t,text:ZI(a)})},[t,n,o,r.length]);return k.jsx("span",{onKeyDown:i,children:k.jsx(Xk,{value:JI(r),submit:s,multiline:!0})})};function hce(e,t,n){return e.length===0&&n===0&&t===0}const mce=({commandOnly:e,inlineIndex:t,lineIndex:n,onInline:o,scriptId:r})=>{const[i,s]=u.useState(!1),[a,l]=u.useState(),c=u.useCallback(()=>{s(!1),l(void 0)},[]),d=u.useCallback(()=>{Re.editText(r,{lineIndex:n,inlineIndex:t,text:[]})},[t,n,r]),f=u.useCallback(g=>{Re.inlineCommand(r,{lineIndex:n,inlineIndex:a??t,commandId:g})},[a,t,n,r]),m=u.useCallback(()=>k.jsx(yn,{label:e?"Inline Command":"Add Component",className:Rn.inlineMenuButton,handler:()=>s(!0),onDown:!0}),[e]),h=u.useCallback(g=>{g?.value==="Text"?d():g?.value!=null&&f(g.value),c()},[c,f,d]),p=u.useCallback(()=>k.jsx(ru,{containerClass:Rn.inlineMenuDropdown,options:e?eN:QI,submit:h,value:void 0,open:!0,searchable:!0,expand:!0}),[e,h]);return Nr(o,l),u.useEffect(()=>{a!==void 0&&s(!0)},[a]),k.jsx("div",{className:Rn.inlineMenu,onBlur:c,onMouseDown:()=>i&&c(),children:i?p():m()})},Og=qa.LineType;function Du(e){const t=e.scriptId,n=e.lineIndex,o=Re.getLineType(t,n);ft.onTabRemoved.subscribe(a);let r,i;const s={header:l(),components:c(),footer:r,handleSort:i};return ub(s),{scriptId:t,index:n,inspection:s};function a(p){xle(p)===t&&(ft.onTabRemoved.unsubscribe(a),e4(s))}function l(){return k.jsx(uce,{...e,lineType:o})}function c(){return o===Og.Comment?[d(Re.viewComment(t,n))]:o===Og.Label?[f(Re.viewLabel(t,n))]:o===Og.Command?[m(Re.viewCommand(t,n))]:h(Re.viewGeneric(t,n))}function d(p){return{title:"Comment",tooltip:"A note or annotation; ignored by the engine at runtime.",icon:db,content:k.jsx(qk,{submit:g,value:p.comment,eol:"
"})};function g(b){Re.editComment(e.scriptId,{lineIndex:n,comment:b??""})}}function f(p){return{title:"Label",tooltip:"A script playback navigation point for @goto and similar commands.",icon:Um,content:k.jsx(ti,{submit:g,value:p.label,format:jr.Identifier})};function g(b){Re.editLabel(e.scriptId,{lineIndex:n,label:b??""})}}function m(p,g){return{title:to(p.id),icon:su,tooltip:p.tooltip,collapsed:g!=null&&p.parameters?.every(b=>!b.value&&!b.dynamicValue&&!b.required),content:k.jsx(fce,{scriptId:t,lineIndex:n,inlineIndex:g,view:p}),menuItems:g==null?void 0:[k.jsx(at,{icon:Ri,label:"Remove Command",onClick:()=>Re.removeInlined(t,{lineIndex:n,inlineIndex:g})},"remove-command")],sortable:g!==void 0}}function h(p){const g=new Ye,b=p.content.map((x,E)=>x.command?m(x.command,E):_(x.text,E));return w()&&b.splice(0,0,_([],0)),r=S(),i=v,[y(),...b];function y(){const x=k.jsx(Iy,{label:"Character",options:p.prefix?.authorOptions,value:p.prefix?.author,format:jr.Identifier,submit:T=>Re.editAuthor(t,{lineIndex:n,value:T}),tooltip:"Character to make the author of the printed text.",searchable:!0,containerClass:`${p.prefix?.author==null?Rn.unassigned:null}`},"character"),E=k.jsx(Iy,{label:"Appearance",searchable:!0,value:p.prefix?.appearance,options:p.prefix?.appearanceOptions,submit:T=>Re.editAppearance(t,{lineIndex:n,value:T?.replace(/\s/g,"")}),tooltip:"Appearance to set for the assigned character.",readonly:p.prefix?.author==null,containerClass:`${p.prefix?.appearance==null?Rn.unassigned:null}`},"appearance");return{title:"Author",tooltip:"Can be used to specify author information of the generic line.",icon:k.jsx("span",{className:Rn.iconGenericAuthor,children:zW}),content:[x,E]}}function v(x,E){x=w()?x-2:x-1,E=Math.max(w()?E-2:E-1,0),Re.moveContent(e.scriptId,{lineIndex:n,fromIndex:x,toIndex:E})}function _(x,E){return{title:"Text",tooltip:"The text to print.",icon:j1,content:k.jsx(pce,{scriptId:t,lineIndex:n,inline:g,inlineIndex:E,text:x}),menuItems:E==0?void 0:[k.jsx(at,{icon:Ri,label:"Remove Text",onClick:()=>Re.editText(t,{lineIndex:n,inlineIndex:E})},"remove-text")],sortable:E>0||x.length>0}}function w(){return p.content.at(0)?.text==null}function S(){const x=p.content.at(p.content.length-1)?.command==null;return k.jsx(mce,{commandOnly:x,scriptId:t,onInline:g,lineIndex:n,inlineIndex:p.content.length})}}}const gce=u.memo(({scriptId:e})=>{const t=so(Ae.onBridgingChanged),n=kn(hn.SmoothScroll),o=u.useRef(null),[r,i]=u.useState(Re.isScriptLoaded(e)),[s,a]=u.useState(),[l,c]=u.useState(),[d,f]=u.useState({firstIndex:0,lastIndex:0}),{uri:m,lineCount:h}=r?Re.viewScript(e):{uri:"",lineCount:0},p={changeLineType:_,insertLine:w,indentLine:S,unIndentLine:x,duplicateLine:E,deleteLine:T,showLine:R,gotoLine:O};return u.useEffect(()=>{r||Re.loadScript(e).then(()=>i(!0))},[e,r]),wle(e,()=>{s!==void 0&&(s.index{C===C&&(B(M)||c(M),v(M))},[e,d]),iu([[de.InsertLine,()=>w({lineIndex:s?s.index+1:void 0})],s&&[de.IndentLine,()=>S({lineIndex:s.index})],s&&[de.UnIndentLine,()=>x({lineIndex:s.index})],s&&[de.Duplicate,()=>E({lineIndex:s.index})],s&&[de.Delete,()=>T({lineIndex:s.index})],s&&[de.Cancel,()=>N(s)],t!=null&&s&&[de.GotoLine,()=>O(s.index)]],[s]),k.jsx("div",{ref:o,className:Vo.scriptView,children:r?g():null});function g(){return k.jsx(Tv,{renderOverlay:b,indexRange:d,handleSort:I,bound:Lc.Scrollable,children:k.jsx(AE,{totalCount:h+1,handleRangeChanged:f,renderItem:b,scrollTo:l,smoothScroll:n,handleScrollDone:()=>c(void 0)})})}function b(C){if(C===h)return y();const M=Re.previewLine(e,C);return k.jsx(sce,{lineIndex:C,editor:p,line:M,handleSelected:v,inspected:s?.index===C})}function y(){const C=`${Vo.scriptLine} ${Vo.insertPreviewLine}`;return k.jsx("div",{className:C,onClick:()=>w({}),children:k.jsx("span",{className:Vo.lineContent,...cn("Append Line"),children:nk})})}function v(C){a(Du({scriptId:e,scriptUri:m,lineIndex:C,editor:p}))}function _(C){Re.changeLine(e,C)}function w(C){Re.insertLine(e,C),a(Du({scriptId:e,scriptUri:m,lineIndex:C?.lineIndex??h,pickType:!0,editor:p})),c(C?.lineIndex??h)}function S(C){Re.indentLine(e,C),a(Du({scriptId:e,scriptUri:m,lineIndex:C.lineIndex,editor:p})),c(C.lineIndex)}function x(C){Re.unIndentLine(e,C),a(Du({scriptId:e,scriptUri:m,lineIndex:C.lineIndex,editor:p})),c(C.lineIndex)}function E(C){Re.duplicateLine(e,C),a(Du({scriptId:e,scriptUri:m,lineIndex:C.lineIndex+1,pickType:!0,editor:p})),c(C.lineIndex+1)}function T(C){C.lineIndex===h-1&&s?.index===C.lineIndex&&N(s),Re.removeLine(e,C),c(C.lineIndex)}function N(C){e4(C.inspection),a(void 0),document.activeElement?.blur()}function I(C,M){Re.moveLine(e,{fromIndex:C,toIndex:M}),v(M)}function R(C){ft.focusTab(Re.buildTabIdFromScript(e)),c(C)}function O(C){Re.goto(e,C)}function B(C){return d.firstIndex<=C&&C<=d.lastIndex}}),yce={canRender:Re.isScriptTab,renderContent:e=>u.createElement(gce,{scriptId:Re.getScriptIdFromTab(e)}),renderIcon:e=>Hp},vce="_text-editor_n47gw_1",bce={"text-editor":"_text-editor_n47gw_1",textEditor:vce},_ce=u.memo(({script:e})=>k.jsx("div",{className:bce.textEditor,children:e})),wce={canRender:e=>e==="TextEditor:",renderContent:e=>u.createElement(_ce,{script:e.substring(11)}),renderIcon:e=>sW},Fl={TooltipWindow:T$,ContextMenu:SZ,ModalWindow:UZ,LoginWindow:XZ,ControlPanel:$K,Workspace:See},xce=[Bee,qle,yce,wce,dZ,rle];await kR();gS(document.getElementById("app")).render(u.createElement(u.StrictMode,null,u.createElement(Fl.TooltipWindow),u.createElement(Fl.ContextMenu),u.createElement(Fl.ModalWindow),u.createElement(Fl.LoginWindow,null,u.createElement(Fl.ControlPanel),u.createElement(Fl.Workspace,{tabs:xce})))); diff --git a/docs/public/editor/index.html b/docs/public/editor/index.html index d6c311c23..67fb384ef 100644 --- a/docs/public/editor/index.html +++ b/docs/public/editor/index.html @@ -45,7 +45,7 @@ to { transform: scale(53%) } } - + diff --git a/docs/public/editor/sw.js b/docs/public/editor/sw.js index 95bb1659f..ed46c23b3 100644 --- a/docs/public/editor/sw.js +++ b/docs/public/editor/sw.js @@ -1 +1 @@ -if(!self.define){let e,i={};const n=(n,s)=>(n=new URL(n+".js",s).href,i[n]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=i,document.head.appendChild(e)}else e=n,importScripts(n),i()})).then((()=>{let e=i[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e})));self.define=(s,a)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let b={};const c=e=>n(e,o),r={module:{uri:o},exports:b,require:c};i[o]=Promise.all(s.map((e=>r[e]||c(e)))).then((e=>(a(...e),b)))}}define(["./workbox-7cfec069"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"assets/index-Cjhj5q0g.js",revision:null},{url:"assets/index-LWg8iLyb.css",revision:null},{url:"assets/workbox-window.prod.es5-D5gOYdM7.js",revision:null},{url:"bin/aot-instances.wasm",revision:"9f13a4561015f5e89e8ccd1f4fd8b6e3"},{url:"bin/Bootsharp.Common.wasm",revision:"5c2b830fab8ec532c61f1bc68758fdb3"},{url:"bin/Bootsharp.FileSystem.wasm",revision:"8fedbd570d3001a77af4b8b9d9f2487c"},{url:"bin/Bootsharp.Inject.wasm",revision:"2f844a7768b36220baa1f773394359a0"},{url:"bin/dotnet.js",revision:"9ba0c821a4c6b7d2045b92218439de44"},{url:"bin/dotnet.native.js",revision:"cbb1bb6580a23bf9bc44e5f53c911deb"},{url:"bin/dotnet.native.wasm",revision:"2dca4027b79629c70edd7dd996c25c4d"},{url:"bin/dotnet.runtime.js",revision:"ac516a0ebda9999ae81ebb294621c74a"},{url:"bin/Humanizer.wasm",revision:"4e26c5f489e49df1aaee92cc1d681bdb"},{url:"bin/Microsoft.Extensions.DependencyInjection.Abstractions.wasm",revision:"79f2be38f1773e178b95547931baeef8"},{url:"bin/Microsoft.Extensions.DependencyInjection.wasm",revision:"c22c029391cbf53297a880e5e525e7e7"},{url:"bin/Naninovel.Common.Bindings.wasm",revision:"5b6dab618bc485953836bc13b3ec3c57"},{url:"bin/Naninovel.Common.Modern.wasm",revision:"117bc821c3de08a6d664fc456d7002b8"},{url:"bin/Naninovel.Common.wasm",revision:"22c883be07c9227d99456aa9b831d58f"},{url:"bin/Naninovel.Editor.wasm",revision:"446d8eaf26b58282ca3786e65f29b01c"},{url:"bin/Naninovel.Editor.WASM.wasm",revision:"50beca114b3458993cbf95a3d35d448e"},{url:"bin/System.Collections.Concurrent.wasm",revision:"a64ca0340b8f6695379747e24f08bfe1"},{url:"bin/System.Collections.wasm",revision:"26b92eaf4b9c5144b373468ab68f67cc"},{url:"bin/System.ComponentModel.wasm",revision:"aaa25dc66f472b375091fc6727eb0e41"},{url:"bin/System.Linq.wasm",revision:"524e5ce0b98879ace35612b91a937dc4"},{url:"bin/System.Memory.wasm",revision:"cc100f6dc6b9406a2c572cd92b87f2ea"},{url:"bin/System.Net.Http.wasm",revision:"afedf374acb2d0607006a0018240ea81"},{url:"bin/System.Net.WebSockets.Client.wasm",revision:"5a85085a0c6a564171a0ba8f9b43592b"},{url:"bin/System.Net.WebSockets.wasm",revision:"9a29389eef1a29d11c76ab61d4688148"},{url:"bin/System.Private.CoreLib.wasm",revision:"21b687ad60fd3cf5d84f5c226ba8543b"},{url:"bin/System.Private.Uri.wasm",revision:"6999d9bfcee4721d92dddb81904a5843"},{url:"bin/System.Runtime.InteropServices.JavaScript.wasm",revision:"76457149257764b4408bfe9768b789b9"},{url:"bin/System.Text.Encodings.Web.wasm",revision:"eb0d96cfe81a1b22a547f13abbe24242"},{url:"bin/System.Text.Json.wasm",revision:"be4d10cf6ea47155b1c415cbcaf2a379"},{url:"bin/System.Text.RegularExpressions.wasm",revision:"15bd7b05b59ed480044fd191d5eca0a9"},{url:"fonts/inter-italic.woff2",revision:"650756001f1c3d7c39c59e812c2736e7"},{url:"fonts/inter.woff2",revision:"499fcada6ddb2c38718c2c16a190d639"},{url:"fonts/jb-italic.ttf",revision:"bf423b77f11b3cef4969bab1a7939dd8"},{url:"fonts/jb.ttf",revision:"4e546cf31f9ad0c6c43a0c9abbc9f9d4"},{url:"icons/logo-192.png",revision:"3d81e6ecc6ac86ad1d9f328fa508de2d"},{url:"icons/logo-512.png",revision:"a70eca74f96de5ba6848a9976a33345f"},{url:"icons/logo-mask.png",revision:"631cab3802424bec688753f9927fdaf8"},{url:"icons/logo.svg",revision:"2ae881ff911e8a9d5979a3ad441ae3cd"},{url:"index.html",revision:"04cf498042c237cd8ff0bc2cbb13de49"},{url:"shots/shot1.webp",revision:"43542e1773b799750562ebf109c1d0aa"},{url:"icons/logo.svg",revision:"2ae881ff911e8a9d5979a3ad441ae3cd"},{url:"icons/logo-192.png",revision:"3d81e6ecc6ac86ad1d9f328fa508de2d"},{url:"icons/logo-512.png",revision:"a70eca74f96de5ba6848a9976a33345f"},{url:"icons/logo-mask.png",revision:"631cab3802424bec688753f9927fdaf8"},{url:"manifest.webmanifest",revision:"397f04e68c79d2b442155f49d2bcb8c0"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))})); +if(!self.define){let e,i={};const n=(n,s)=>(n=new URL(n+".js",s).href,i[n]||new Promise((i=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=i,document.head.appendChild(e)}else e=n,importScripts(n),i()})).then((()=>{let e=i[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e})));self.define=(s,a)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let b={};const r=e=>n(e,o),c={module:{uri:o},exports:b,require:r};i[o]=Promise.all(s.map((e=>c[e]||r(e)))).then((e=>(a(...e),b)))}}define(["./workbox-7cfec069"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"assets/index-BwqHJ3f2.js",revision:null},{url:"assets/index-LWg8iLyb.css",revision:null},{url:"assets/workbox-window.prod.es5-D5gOYdM7.js",revision:null},{url:"bin/aot-instances.wasm",revision:"9f13a4561015f5e89e8ccd1f4fd8b6e3"},{url:"bin/Bootsharp.Common.wasm",revision:"5c2b830fab8ec532c61f1bc68758fdb3"},{url:"bin/Bootsharp.FileSystem.wasm",revision:"8fedbd570d3001a77af4b8b9d9f2487c"},{url:"bin/Bootsharp.Inject.wasm",revision:"2f844a7768b36220baa1f773394359a0"},{url:"bin/dotnet.js",revision:"9ba0c821a4c6b7d2045b92218439de44"},{url:"bin/dotnet.native.js",revision:"cbb1bb6580a23bf9bc44e5f53c911deb"},{url:"bin/dotnet.native.wasm",revision:"2dca4027b79629c70edd7dd996c25c4d"},{url:"bin/dotnet.runtime.js",revision:"ac516a0ebda9999ae81ebb294621c74a"},{url:"bin/Humanizer.wasm",revision:"4e26c5f489e49df1aaee92cc1d681bdb"},{url:"bin/Microsoft.Extensions.DependencyInjection.Abstractions.wasm",revision:"79f2be38f1773e178b95547931baeef8"},{url:"bin/Microsoft.Extensions.DependencyInjection.wasm",revision:"c22c029391cbf53297a880e5e525e7e7"},{url:"bin/Naninovel.Common.Bindings.wasm",revision:"5b6dab618bc485953836bc13b3ec3c57"},{url:"bin/Naninovel.Common.Modern.wasm",revision:"117bc821c3de08a6d664fc456d7002b8"},{url:"bin/Naninovel.Common.wasm",revision:"22c883be07c9227d99456aa9b831d58f"},{url:"bin/Naninovel.Editor.wasm",revision:"446d8eaf26b58282ca3786e65f29b01c"},{url:"bin/Naninovel.Editor.WASM.wasm",revision:"50beca114b3458993cbf95a3d35d448e"},{url:"bin/System.Collections.Concurrent.wasm",revision:"a64ca0340b8f6695379747e24f08bfe1"},{url:"bin/System.Collections.wasm",revision:"26b92eaf4b9c5144b373468ab68f67cc"},{url:"bin/System.ComponentModel.wasm",revision:"aaa25dc66f472b375091fc6727eb0e41"},{url:"bin/System.Linq.wasm",revision:"524e5ce0b98879ace35612b91a937dc4"},{url:"bin/System.Memory.wasm",revision:"cc100f6dc6b9406a2c572cd92b87f2ea"},{url:"bin/System.Net.Http.wasm",revision:"afedf374acb2d0607006a0018240ea81"},{url:"bin/System.Net.WebSockets.Client.wasm",revision:"5a85085a0c6a564171a0ba8f9b43592b"},{url:"bin/System.Net.WebSockets.wasm",revision:"9a29389eef1a29d11c76ab61d4688148"},{url:"bin/System.Private.CoreLib.wasm",revision:"21b687ad60fd3cf5d84f5c226ba8543b"},{url:"bin/System.Private.Uri.wasm",revision:"6999d9bfcee4721d92dddb81904a5843"},{url:"bin/System.Runtime.InteropServices.JavaScript.wasm",revision:"76457149257764b4408bfe9768b789b9"},{url:"bin/System.Text.Encodings.Web.wasm",revision:"eb0d96cfe81a1b22a547f13abbe24242"},{url:"bin/System.Text.Json.wasm",revision:"be4d10cf6ea47155b1c415cbcaf2a379"},{url:"bin/System.Text.RegularExpressions.wasm",revision:"15bd7b05b59ed480044fd191d5eca0a9"},{url:"fonts/inter-italic.woff2",revision:"650756001f1c3d7c39c59e812c2736e7"},{url:"fonts/inter.woff2",revision:"499fcada6ddb2c38718c2c16a190d639"},{url:"fonts/jb-italic.ttf",revision:"bf423b77f11b3cef4969bab1a7939dd8"},{url:"fonts/jb.ttf",revision:"4e546cf31f9ad0c6c43a0c9abbc9f9d4"},{url:"icons/logo-192.png",revision:"3d81e6ecc6ac86ad1d9f328fa508de2d"},{url:"icons/logo-512.png",revision:"a70eca74f96de5ba6848a9976a33345f"},{url:"icons/logo-mask.png",revision:"631cab3802424bec688753f9927fdaf8"},{url:"icons/logo.svg",revision:"2ae881ff911e8a9d5979a3ad441ae3cd"},{url:"index.html",revision:"a81637b5fd34db61c2caebbb5ee391f2"},{url:"shots/shot1.webp",revision:"43542e1773b799750562ebf109c1d0aa"},{url:"icons/logo.svg",revision:"2ae881ff911e8a9d5979a3ad441ae3cd"},{url:"icons/logo-192.png",revision:"3d81e6ecc6ac86ad1d9f328fa508de2d"},{url:"icons/logo-512.png",revision:"a70eca74f96de5ba6848a9976a33345f"},{url:"icons/logo-mask.png",revision:"631cab3802424bec688753f9927fdaf8"},{url:"manifest.webmanifest",revision:"397f04e68c79d2b442155f49d2bcb8c0"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html")))}));