@interopio/home-ui-react 2.0.2 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,38 +1,38 @@
1
- "use strict";var mh=Object.defineProperty;var gh=(t,n,e)=>n in t?mh(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var It=(t,n,e)=>(gh(t,typeof n!="symbol"?n+"":n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),Un=require("react-dom"),De=require("@interopio/react-hooks"),Co=require("@interopio/workspaces-ui-react");function _l(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const M=_l(g),Ll=_l(Un);function Rl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wi,Fl={exports:{}};/*!
1
+ "use strict";var mh=Object.defineProperty;var gh=(t,n,e)=>n in t?mh(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var It=(t,n,e)=>(gh(t,typeof n!="symbol"?n+"":n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),g=require("react"),Un=require("react-dom"),De=require("@interopio/react-hooks"),Co=require("@interopio/workspaces-ui-react");function Ll(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const D=Ll(g),Rl=Ll(Un);function Fl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wi,Bl={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
5
- */Wi=Fl,function(){var t={}.hasOwnProperty;function n(){for(var r="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(r=o(r,e(a)))}return r}function e(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var a in r)t.call(r,a)&&r[a]&&(i=o(i,a));return i}function o(r,i){return i?r?r+" "+i:r+i:r}Wi.exports?(n.default=n,Wi.exports=n):window.classNames=n}();var K=Rl(Fl.exports);function et({className:t,size:n="16",variant:e="workspace",...o}){const r=K("icon",n&&[`icon-size-${n}`],t);return s.jsx("span",{className:r,...o,children:s.jsx("i",{className:`icon-${e}`})})}const Ue=g.forwardRef(({className:t,variant:n="default",icon:e="workspace",size:o="16",iconSize:r="16",onClick:i,disabled:a,children:c,...l},u)=>{const p=K("io-btn-icon",n!=="default"&&[`io-btn-icon-${n}`],[`io-btn-icon-size-${o}`],t),f=g.useCallback(d=>{if(!a)return i?i(d):void 0;d.preventDefault()},[i,a]);return s.jsx("button",{className:p,type:"button",ref:u,"aria-label":"button",onClick:f,disabled:a,...l,children:c??(e&&s.jsx(et,{variant:e,size:r}))})});Ue.displayName="ButtonIcon";const vh={default:void 0,info:"info",success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function yh({className:t,variant:n="default",size:e="normal",text:o,close:r=!1,closeButtonOnClick:i,append:a,...c}){const l=K("io-alert",`io-alert-${n}`,e==="large"&&"io-alert-lg",t),u=vh[n];return s.jsxs("div",{"data-testid":"io-alert",className:l,...c,children:[u&&s.jsx(et,{"data-testid":"io-alert-icon",variant:u,className:"icon-severity"}),o&&s.jsx("p",{"data-testid":"io-alert-text",className:"io-text-smaller",children:o}),e==="large"&&a,r&&s.jsx(Ue,{"data-testid":"io-alert-close-button",className:"ms-auto",size:"16",iconSize:"10",icon:"close",onClick:i})]})}function Bl({className:t,variant:n="default",children:e,...o}){const r=K("io-badge",n!=="default"&&[`io-badge-${n}`],t);return s.jsx("div",{className:r,...o,children:e})}function nn({className:t,tag:n="h2",size:e="normal",text:o="Title",...r}){const i=n,a=K(e==="small"&&"io-title-semibold",e==="normal"&&"io-title",e==="large"&&"io-title-large",t);return s.jsx(i,{className:a,...r,children:o})}function Ke({className:t,title:n,titleSize:e="normal",tag:o,hint:r,children:i,...a}){const c=K("io-block",t);return s.jsxs("div",{className:c,...a,children:[n&&s.jsx(nn,{tag:o,text:n,size:e}),i,r&&s.jsx("p",{className:"io-text-smaller",children:r})]})}const Ge=g.forwardRef(({className:t,variant:n="default",size:e="normal",icon:o,iconSize:r="12",iconRight:i=!1,text:a,onClick:c,disabled:l,children:u,...p},f)=>{const d=K("io-btn",(n==="primary"||n==="critical"||n==="outline"||n==="link")&&[`io-btn-${n}`],e==="large"&&"io-btn-lg",t),h=g.useCallback(m=>{if(!l)return c?c(m):void 0;m.preventDefault()},[c,l]);return s.jsxs("button",{className:d,ref:f,type:"button","aria-label":"button",onClick:h,disabled:l,tabIndex:0,...p,children:[o&&!i&&s.jsx(et,{variant:o,size:r}),u??a,o&&i&&s.jsx(et,{variant:o,size:r})]})});Ge.displayName="Button";const fi=g.createContext({}),Hl=g.forwardRef(({icon:t="chevron-down",onClick:n,...e},o)=>{const{handleToggle:r,disabled:i,setTriggerRef:a}=g.useContext(fi),c=g.useCallback(u=>{a==null||a(u),o&&(typeof o=="function"?o(u):o.current=u)},[o,a]),l=g.useCallback(u=>{u.stopPropagation(),n==null||n(u),u.defaultPrevented||(r==null||r())},[n,r]);return s.jsx(Ge,{icon:t,iconRight:!0,onClick:l,disabled:i,ref:c,...e})});Hl.displayName="DropdownButton";const Wl=g.forwardRef(({size:t="32",onClick:n,...e},o)=>{const{handleToggle:r,disabled:i,setTriggerRef:a}=g.useContext(fi),c=g.useCallback(u=>{a==null||a(u),o&&(typeof o=="function"?o(u):o.current=u)},[o,a]),l=g.useCallback(u=>{u.stopPropagation(),n==null||n(u),u.defaultPrevented||(r==null||r())},[n,r]);return s.jsx(Ue,{size:t,onClick:l,disabled:i,ref:c,...e})});function zl({className:t,...n}){const e=K("io-dropdown-content",t);return s.jsx("div",{className:e,...n})}Wl.displayName="DropdownButtonIcon";const $l=g.createContext({}),pi=g.forwardRef((t,n)=>{const{className:e,prepend:o,append:r,isSelected:i,onClick:a,description:c,disabled:l=!1,children:u,tooltip:p,onItemSelect:f,...d}=t,{variant:h="default",selected:m,checkIcon:v,handleItemClick:y}=g.useContext($l),b=i??(m==null?void 0:m.some(j=>j.children===u)),S=h!=="default"&&!!v,k=S||o,C=K("io-list-item",k&&"io-list-item-left",r&&"io-list-item-right",h!=="default"&&b&&"selected",c&&"io-list-item-description",l&&"io-list-item-disabled",e);return s.jsxs("li",{className:C,ref:n,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:j=>{l?j.preventDefault():(y==null||y(j,{children:u}),a==null||a(j),f==null||f())},...d,children:[k&&s.jsxs("div",{className:"io-list-left-column",children:[S&&s.jsx(et,{variant:v.variant,title:b?v.tooltip:void 0}),o]}),s.jsx("span",{className:"io-list-text",title:p,children:u}),r&&s.jsx("div",{className:"io-list-right-column",children:r}),c&&s.jsx("div",{className:"io-list-text-description",children:c})]})});pi.displayName="ListItem";const cs=g.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=K("io-list-item",n&&"io-list-item-left",e&&"io-list-item-right","io-list-item-title",t);return s.jsxs("li",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});cs.displayName="ListItemTitle";const ls=g.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=K("io-list-item",n&&"io-list-item-left",e&&"io-list-item-right","io-list-item-section",t);return s.jsxs("li",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});ls.displayName="ListItemSection";const Ul=g.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=K("io-list-item-header",t);return s.jsxs("div",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});Ul.displayName="ListItemHeader";const Vl=g.forwardRef(({className:t,children:n,...e},o)=>{const r=K("io-list-item","io-list-with-sub-items",t);return s.jsx("li",{className:r,ref:o,...e,children:n})});Vl.displayName="ListItemWithSubItems";const Gl=g.forwardRef((t,n)=>{const{className:e,variant:o="default",checkIcon:r,children:i,...a}=t,[c,l]=g.useState([]),u=K("io-list",o!=="default"&&"io-list-selectable",e),p=g.useMemo(()=>{if(r)return typeof r=="object"?r:{variant:r}},[r]),f=g.useCallback((h,m)=>{if(o==="default")return;const v=c.some(y=>{var b,S;return((b=y.children)==null?void 0:b.toString())===((S=m.children)==null?void 0:S.toString())});o==="single"?l([m]):(()=>{const y=v?c.filter(b=>b.children!==m.children):[...c,m];l(y)})()},[c,o]),d=g.useMemo(()=>({variant:o,selected:c,checkIcon:p,handleItemClick:f}),[o,c,p,f]);return s.jsx($l.Provider,{value:d,children:s.jsx("ul",{className:u,ref:n,...a,children:i})})});Gl.displayName="List";const ut=Gl;ut.Item=pi,ut.ItemTitle=cs,ut.ItemSection=ls,ut.ItemHeader=Ul,ut.ItemWithSubItems=Vl;const Yl=g.forwardRef((t,n)=>s.jsx(ut,{...t,ref:n}));Yl.displayName="DropdownList";const Zl=g.forwardRef((t,n)=>{const{handleClose:e}=g.useContext(fi),{onClick:o,...r}=t;return s.jsx(pi,{...r,ref:n,onClick:i=>{o==null||o(i),e==null||e()}})});Zl.displayName="DropdownItem";const Kl=g.forwardRef((t,n)=>s.jsx(cs,{...t,ref:n}));Kl.displayName="DropdownItemTitle";const ql=g.forwardRef((t,n)=>s.jsx(ls,{...t,ref:n}));function hr({className:t,...n}){const e=K("io-separator",t);return s.jsx("hr",{className:e,...n})}ql.displayName="DropdownItemSection";const Jl=g.forwardRef((t,n)=>s.jsx(hr,{...t}));Jl.displayName="DropdownSeparator";const ae=g.forwardRef(({className:t,variant:n="outline",align:e="down",disabled:o,isOpen:r,onOpenChange:i,children:a,...c},l)=>{const u=g.useRef(null),p=g.useRef(null),f=l??u,{isOpen:d,handleOpen:h,handleClose:m}=((b,S)=>{const[k,C]=g.useState(!1),j=b!==void 0,E=j?b:k,P=g.useCallback(q=>{j||C(q),S==null||S(q)},[j,S]),H=g.useCallback(()=>P(!0),[P]),z=g.useCallback(()=>P(!1),[P]);return{isOpen:E,setOpen:P,handleOpen:H,handleClose:z}})(r,i);((b,S,k=!0)=>{g.useEffect(()=>{if(!k)return;const C=E=>{const P=E.target;P&&b.current&&!b.current.contains(P)&&(E.composedPath&&E.composedPath().some(H=>H===b.current||b.current&&H.nodeType===Node.ELEMENT_NODE&&b.current.contains(H))||S())},j=requestAnimationFrame(()=>{document.addEventListener("mousedown",C,!0)});return()=>{cancelAnimationFrame(j),document.removeEventListener("mousedown",C,!0)}},[b,S,k])})(f,m,d);const v=g.useMemo(()=>({variant:n,align:e,disabled:o,isOpen:d,handleOpen:h,handleClose:m,handleToggle:d?m:h,setTriggerRef:b=>p.current=b}),[n,e,o,d,h,m]),y=K("io-dropdown",d&&"io-dropdown-open",n!=="default"&&`io-dropdown-${n}`,t);return s.jsx(fi.Provider,{value:v,children:s.jsx("div",{className:y,ref:f,...c,children:a})})});function Re({className:t,variant:n="default",align:e="left",children:o,...r}){const i=K("io-btn-group",n==="sticky"&&"io-btn-group-sticky",n==="append"&&"io-btn-group-append",n==="fullwidth"&&"io-btn-group-fullwidth",e==="right"&&"io-btn-group-right",t);return s.jsx("div",{className:i,...r,children:o})}function Ft({className:t,draggable:n=!1,children:e,...o}){const r=K("io-header",n&&["draggable"],t);return s.jsx("header",{className:r,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--spacing-8)"},...o,children:e})}function Lo({className:t,children:n,...e}){const o=K("io-dialog-header",t);return s.jsx(Ft,{"data-testid":"io-dialog-header",className:o,...e,children:n})}function bh({className:t,children:n,...e}){const o=K("io-dialog-body",t);return s.jsx("div",{"data-testid":"io-dialog-body",className:o,...e,children:n})}function Vn({className:t,children:n,...e}){const o=K("io-footer",t);return s.jsx("footer",{className:o,...e,children:n})}function xr({className:t,...n}){const e=K("io-dialog-footer",t);return s.jsx(Vn,{"data-testid":"io-dialog-footer",className:e,...n})}function hi(){return typeof window<"u"}function Nn(t){return Xl(t)?(t.nodeName||"").toLowerCase():"#document"}function Bt(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function fn(t){var n;return(n=(Xl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function Xl(t){return!!hi()&&(t instanceof Node||t instanceof Bt(t).Node)}function Ye(t){return!!hi()&&(t instanceof Element||t instanceof Bt(t).Element)}function dt(t){return!!hi()&&(t instanceof HTMLElement||t instanceof Bt(t).HTMLElement)}function xa(t){return!(!hi()||typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof Bt(t).ShadowRoot)}function or(t){const{overflow:n,overflowX:e,overflowY:o,display:r}=Vt(t);return/auto|scroll|overlay|hidden|clip/.test(n+o+e)&&!["inline","contents"].includes(r)}function wh(t){return["table","td","th"].includes(Nn(t))}function xh(t){return[":popover-open",":modal"].some(n=>{try{return t.matches(n)}catch{return!1}})}function Ca(t){const n=mi(),e=Ye(t)?Vt(t):t;return e.transform!=="none"||e.perspective!=="none"||!!e.containerType&&e.containerType!=="normal"||!n&&!!e.backdropFilter&&e.backdropFilter!=="none"||!n&&!!e.filter&&e.filter!=="none"||["transform","perspective","filter"].some(o=>(e.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(e.contain||"").includes(o))}function mi(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function En(t){return["html","body","#document"].includes(Nn(t))}function Vt(t){return Bt(t).getComputedStyle(t)}function gi(t){return Ye(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function dn(t){if(Nn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||xa(t)&&t.host||fn(t);return xa(n)?n.host:n}function Ql(t){const n=dn(t);return En(n)?t.ownerDocument?t.ownerDocument.body:t.body:dt(n)&&or(n)?n:Ql(n)}function jn(t,n,e){var o;n===void 0&&(n=[]),e===void 0&&(e=!0);const r=Ql(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),a=Bt(r);if(i){const c=function(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}(a);return n.concat(a,a.visualViewport||[],or(r)?r:[],c&&e?jn(c):[])}return n.concat(r,jn(r,[],e))}function un(t){let n=t.activeElement;for(;((e=n)==null||(e=e.shadowRoot)==null?void 0:e.activeElement)!=null;){var e;n=n.shadowRoot.activeElement}return n}function vt(t,n){if(!t||!n)return!1;const e=n.getRootNode==null?void 0:n.getRootNode();if(t.contains(n))return!0;if(e&&xa(e)){let o=n;for(;o;){if(t===o)return!0;o=o.parentNode||o.host}}return!1}function eu(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function tu(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(n=>{let{brand:e,version:o}=n;return e+"/"+o}).join(" "):navigator.userAgent}function nu(t){return!(t.mozInputSource!==0||!t.isTrusted)||(ka()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType)}function ou(t){return!tu().includes("jsdom/")&&(!ka()&&t.width===0&&t.height===0||ka()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch")}function ru(){return/apple/i.test(navigator.vendor)}function ka(){const t=/android/i;return t.test(eu())||t.test(tu())}function Yo(t,n){const e=["mouse","pen"];return n||e.push("",void 0),e.includes(t)}function kt(t){return(t==null?void 0:t.ownerDocument)||document}function zi(t,n){if(n==null)return!1;if("composedPath"in t)return t.composedPath().includes(n);const e=t;return e.target!=null&&n.contains(e.target)}function bn(t){return"composedPath"in t?t.composedPath()[0]:t.target}ae.Button=Hl,ae.ButtonIcon=Wl,ae.Content=zl,ae.List=Yl,ae.Item=Zl,ae.ItemTitle=Kl,ae.ItemSection=ql,ae.Separator=Jl,Re.Button=Ge,Re.ButtonIcon=Ue,Re.Dropdown=ae,Ft.Title=nn,Ft.ButtonGroup=Re,Ft.Button=Ge,Ft.ButtonIcon=Ue,Ft.Dropdown=ae,Lo.Title=nn,Lo.ButtonGroup=Re,Lo.Button=Ge,Lo.ButtonIcon=Ue,Lo.Dropdown=ae,bh.Content=function({className:t,children:n,...e}){const o=K("io-dialog-content",t);return s.jsx("div",{className:o,...e,children:n})},Vn.ButtonGroup=Re,Vn.Button=Ge,Vn.ButtonIcon=Ue,Vn.Dropdown=ae,xr.ButtonGroup=Re,xr.Button=Ge,xr.ButtonIcon=Ue,xr.Dropdown=ae;const Ch="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function iu(t){return dt(t)&&t.matches(Ch)}function Nt(t){t.preventDefault(),t.stopPropagation()}function Sa(t){return!!t&&t.getAttribute("role")==="combobox"&&iu(t)}const Zr=Math.min,Zn=Math.max,Kr=Math.round,go=Math.floor,In=t=>({x:t,y:t}),kh={left:"right",right:"left",bottom:"top",top:"bottom"},Sh={start:"end",end:"start"};function ac(t,n,e){return Zn(t,Zr(n,e))}function vi(t,n){return typeof t=="function"?t(n):t}function Kn(t){return t.split("-")[0]}function qr(t){return t.split("-")[1]}function au(t){return t==="x"?"y":"x"}function su(t){return t==="y"?"height":"width"}function yi(t){return["top","bottom"].includes(Kn(t))?"y":"x"}function cu(t){return au(yi(t))}function $i(t){return t.replace(/start|end/g,n=>Sh[n])}function Cr(t){return t.replace(/left|right|bottom|top/g,n=>kh[n])}function Jr(t){const{x:n,y:e,width:o,height:r}=t;return{width:o,height:r,top:e,left:n,right:n+o,bottom:e+r,x:n,y:e}}/*!
5
+ */Wi=Bl,function(){var t={}.hasOwnProperty;function n(){for(var r="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(r=o(r,e(a)))}return r}function e(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var a in r)t.call(r,a)&&r[a]&&(i=o(i,a));return i}function o(r,i){return i?r?r+" "+i:r+i:r}Wi.exports?(n.default=n,Wi.exports=n):window.classNames=n}();var q=Fl(Bl.exports);function et({className:t,size:n="16",variant:e="workspace",...o}){const r=q("icon",n&&[`icon-size-${n}`],t);return s.jsx("span",{className:r,...o,children:s.jsx("i",{className:`icon-${e}`})})}const Ue=g.forwardRef(({className:t,variant:n="default",icon:e="workspace",size:o="16",iconSize:r="16",onClick:i,disabled:a,children:c,...l},u)=>{const f=q("io-btn-icon",n!=="default"&&[`io-btn-icon-${n}`],[`io-btn-icon-size-${o}`],t),p=g.useCallback(d=>{if(!a)return i?i(d):void 0;d.preventDefault()},[i,a]);return s.jsx("button",{className:f,type:"button",ref:u,"aria-label":"button",onClick:p,disabled:a,...l,children:c??(e&&s.jsx(et,{variant:e,size:r}))})});Ue.displayName="ButtonIcon";const vh={default:void 0,info:"info",success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function yh({className:t,variant:n="default",size:e="normal",text:o,close:r=!1,closeButtonOnClick:i,append:a,...c}){const l=q("io-alert",`io-alert-${n}`,e==="large"&&"io-alert-lg",t),u=vh[n];return s.jsxs("div",{"data-testid":"io-alert",className:l,...c,children:[u&&s.jsx(et,{"data-testid":"io-alert-icon",variant:u,className:"icon-severity"}),o&&s.jsx("p",{"data-testid":"io-alert-text",className:"io-text-smaller",children:o}),e==="large"&&a,r&&s.jsx(Ue,{"data-testid":"io-alert-close-button",className:"ms-auto",size:"16",iconSize:"10",icon:"close",onClick:i})]})}function Hl({className:t,variant:n="default",children:e,...o}){const r=q("io-badge",n!=="default"&&[`io-badge-${n}`],t);return s.jsx("div",{className:r,...o,children:e})}function nn({className:t,tag:n="h2",size:e="normal",text:o="Title",...r}){const i=n,a=q(e==="small"&&"io-title-semibold",e==="normal"&&"io-title",e==="large"&&"io-title-large",t);return s.jsx(i,{className:a,...r,children:o})}function Ke({className:t,title:n,titleSize:e="normal",tag:o,hint:r,children:i,...a}){const c=q("io-block",t);return s.jsxs("div",{className:c,...a,children:[n&&s.jsx(nn,{tag:o,text:n,size:e}),i,r&&s.jsx("p",{className:"io-text-smaller",children:r})]})}const Ge=g.forwardRef(({className:t,variant:n="default",size:e="normal",icon:o,iconSize:r="12",iconRight:i=!1,text:a,onClick:c,disabled:l,children:u,...f},p)=>{const d=q("io-btn",(n==="primary"||n==="critical"||n==="outline"||n==="link")&&[`io-btn-${n}`],e==="large"&&"io-btn-lg",t),h=g.useCallback(m=>{if(!l)return c?c(m):void 0;m.preventDefault()},[c,l]);return s.jsxs("button",{className:d,ref:p,type:"button","aria-label":"button",onClick:h,disabled:l,tabIndex:0,...f,children:[o&&!i&&s.jsx(et,{variant:o,size:r}),u??a,o&&i&&s.jsx(et,{variant:o,size:r})]})});Ge.displayName="Button";const fi=g.createContext({}),Wl=g.forwardRef(({icon:t="chevron-down",onClick:n,...e},o)=>{const{handleToggle:r,disabled:i,setTriggerRef:a}=g.useContext(fi),c=g.useCallback(u=>{a==null||a(u),o&&(typeof o=="function"?o(u):o.current=u)},[o,a]),l=g.useCallback(u=>{u.stopPropagation(),n==null||n(u),u.defaultPrevented||(r==null||r())},[n,r]);return s.jsx(Ge,{icon:t,iconRight:!0,onClick:l,disabled:i,ref:c,...e})});Wl.displayName="DropdownButton";const zl=g.forwardRef(({size:t="32",onClick:n,...e},o)=>{const{handleToggle:r,disabled:i,setTriggerRef:a}=g.useContext(fi),c=g.useCallback(u=>{a==null||a(u),o&&(typeof o=="function"?o(u):o.current=u)},[o,a]),l=g.useCallback(u=>{u.stopPropagation(),n==null||n(u),u.defaultPrevented||(r==null||r())},[n,r]);return s.jsx(Ue,{size:t,onClick:l,disabled:i,ref:c,...e})});function $l({className:t,...n}){const e=q("io-dropdown-content",t);return s.jsx("div",{className:e,...n})}zl.displayName="DropdownButtonIcon";const Ul=g.createContext({}),pi=g.forwardRef((t,n)=>{const{className:e,prepend:o,append:r,isSelected:i,onClick:a,description:c,disabled:l=!1,children:u,tooltip:f,onItemSelect:p,...d}=t,{variant:h="default",selected:m,checkIcon:v,handleItemClick:y}=g.useContext(Ul),b=i??(m==null?void 0:m.some(E=>E.children===u)),S=h!=="default"&&!!v,w=S||o,x=q("io-list-item",w&&"io-list-item-left",r&&"io-list-item-right",h!=="default"&&b&&"selected",c&&"io-list-item-description",l&&"io-list-item-disabled",e);return s.jsxs("li",{className:x,ref:n,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:E=>{l?E.preventDefault():(y==null||y(E,{children:u}),a==null||a(E),p==null||p())},...d,children:[w&&s.jsxs("div",{className:"io-list-left-column",children:[S&&s.jsx(et,{variant:v.variant,title:b?v.tooltip:void 0}),o]}),s.jsx("span",{className:"io-list-text",title:f,children:u}),r&&s.jsx("div",{className:"io-list-right-column",children:r}),c&&s.jsx("div",{className:"io-list-text-description",children:c})]})});pi.displayName="ListItem";const ls=g.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=q("io-list-item",n&&"io-list-item-left",e&&"io-list-item-right","io-list-item-title",t);return s.jsxs("li",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});ls.displayName="ListItemTitle";const us=g.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=q("io-list-item",n&&"io-list-item-left",e&&"io-list-item-right","io-list-item-section",t);return s.jsxs("li",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});us.displayName="ListItemSection";const Vl=g.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=q("io-list-item-header",t);return s.jsxs("div",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});Vl.displayName="ListItemHeader";const Gl=g.forwardRef(({className:t,children:n,...e},o)=>{const r=q("io-list-item","io-list-with-sub-items",t);return s.jsx("li",{className:r,ref:o,...e,children:n})});Gl.displayName="ListItemWithSubItems";const Yl=g.forwardRef((t,n)=>{const{className:e,variant:o="default",checkIcon:r,children:i,...a}=t,[c,l]=g.useState([]),u=q("io-list",o!=="default"&&"io-list-selectable",e),f=g.useMemo(()=>{if(r)return typeof r=="object"?r:{variant:r}},[r]),p=g.useCallback((h,m)=>{if(o==="default")return;const v=c.some(y=>{var b,S;return((b=y.children)==null?void 0:b.toString())===((S=m.children)==null?void 0:S.toString())});o==="single"?l([m]):(()=>{const y=v?c.filter(b=>b.children!==m.children):[...c,m];l(y)})()},[c,o]),d=g.useMemo(()=>({variant:o,selected:c,checkIcon:f,handleItemClick:p}),[o,c,f,p]);return s.jsx(Ul.Provider,{value:d,children:s.jsx("ul",{className:u,ref:n,...a,children:i})})});Yl.displayName="List";const ut=Yl;ut.Item=pi,ut.ItemTitle=ls,ut.ItemSection=us,ut.ItemHeader=Vl,ut.ItemWithSubItems=Gl;const Zl=g.forwardRef((t,n)=>s.jsx(ut,{...t,ref:n}));Zl.displayName="DropdownList";const Kl=g.forwardRef((t,n)=>{const{handleClose:e}=g.useContext(fi),{onClick:o,...r}=t;return s.jsx(pi,{...r,ref:n,onClick:i=>{o==null||o(i),e==null||e()}})});Kl.displayName="DropdownItem";const ql=g.forwardRef((t,n)=>s.jsx(ls,{...t,ref:n}));ql.displayName="DropdownItemTitle";const Jl=g.forwardRef((t,n)=>s.jsx(us,{...t,ref:n}));function hr({className:t,...n}){const e=q("io-separator",t);return s.jsx("hr",{className:e,...n})}Jl.displayName="DropdownItemSection";const Xl=g.forwardRef((t,n)=>s.jsx(hr,{...t}));Xl.displayName="DropdownSeparator";const pe=g.forwardRef(({className:t,variant:n="outline",align:e="down",disabled:o,isOpen:r,onOpenChange:i,children:a,...c},l)=>{const u=g.useRef(null),f=g.useRef(null),p=l??u,{isOpen:d,handleOpen:h,handleClose:m}=((b,S)=>{const[w,x]=g.useState(!1),E=b!==void 0,O=E?b:w,M=g.useCallback(Z=>{E||x(Z),S==null||S(Z)},[E,S]),B=g.useCallback(()=>M(!0),[M]),$=g.useCallback(()=>M(!1),[M]);return{isOpen:O,setOpen:M,handleOpen:B,handleClose:$}})(r,i);((b,S,w=!0)=>{g.useEffect(()=>{if(!w)return;const x=O=>{const M=O.target;M&&b.current&&!b.current.contains(M)&&(O.composedPath&&O.composedPath().some(B=>B===b.current||b.current&&B.nodeType===Node.ELEMENT_NODE&&b.current.contains(B))||S())},E=requestAnimationFrame(()=>{document.addEventListener("mousedown",x,!0)});return()=>{cancelAnimationFrame(E),document.removeEventListener("mousedown",x,!0)}},[b,S,w])})(p,m,d);const v=g.useMemo(()=>({variant:n,align:e,disabled:o,isOpen:d,handleOpen:h,handleClose:m,handleToggle:d?m:h,setTriggerRef:b=>f.current=b}),[n,e,o,d,h,m]),y=q("io-dropdown",d&&"io-dropdown-open",n!=="default"&&`io-dropdown-${n}`,t);return s.jsx(fi.Provider,{value:v,children:s.jsx("div",{className:y,ref:p,...c,children:a})})});function Re({className:t,variant:n="default",align:e="left",children:o,...r}){const i=q("io-btn-group",n==="sticky"&&"io-btn-group-sticky",n==="append"&&"io-btn-group-append",n==="fullwidth"&&"io-btn-group-fullwidth",e==="right"&&"io-btn-group-right",t);return s.jsx("div",{className:i,...r,children:o})}function Ft({className:t,draggable:n=!1,children:e,...o}){const r=q("io-header",n&&["draggable"],t);return s.jsx("header",{className:r,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--spacing-8)"},...o,children:e})}function Lo({className:t,children:n,...e}){const o=q("io-dialog-header",t);return s.jsx(Ft,{"data-testid":"io-dialog-header",className:o,...e,children:n})}function bh({className:t,children:n,...e}){const o=q("io-dialog-body",t);return s.jsx("div",{"data-testid":"io-dialog-body",className:o,...e,children:n})}function Vn({className:t,children:n,...e}){const o=q("io-footer",t);return s.jsx("footer",{className:o,...e,children:n})}function xr({className:t,...n}){const e=q("io-dialog-footer",t);return s.jsx(Vn,{"data-testid":"io-dialog-footer",className:e,...n})}function hi(){return typeof window<"u"}function Nn(t){return Ql(t)?(t.nodeName||"").toLowerCase():"#document"}function Bt(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function fn(t){var n;return(n=(Ql(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function Ql(t){return!!hi()&&(t instanceof Node||t instanceof Bt(t).Node)}function Ye(t){return!!hi()&&(t instanceof Element||t instanceof Bt(t).Element)}function dt(t){return!!hi()&&(t instanceof HTMLElement||t instanceof Bt(t).HTMLElement)}function xa(t){return!(!hi()||typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof Bt(t).ShadowRoot)}function or(t){const{overflow:n,overflowX:e,overflowY:o,display:r}=Vt(t);return/auto|scroll|overlay|hidden|clip/.test(n+o+e)&&!["inline","contents"].includes(r)}function wh(t){return["table","td","th"].includes(Nn(t))}function xh(t){return[":popover-open",":modal"].some(n=>{try{return t.matches(n)}catch{return!1}})}function Ca(t){const n=mi(),e=Ye(t)?Vt(t):t;return e.transform!=="none"||e.perspective!=="none"||!!e.containerType&&e.containerType!=="normal"||!n&&!!e.backdropFilter&&e.backdropFilter!=="none"||!n&&!!e.filter&&e.filter!=="none"||["transform","perspective","filter"].some(o=>(e.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(e.contain||"").includes(o))}function mi(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function En(t){return["html","body","#document"].includes(Nn(t))}function Vt(t){return Bt(t).getComputedStyle(t)}function gi(t){return Ye(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function dn(t){if(Nn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||xa(t)&&t.host||fn(t);return xa(n)?n.host:n}function eu(t){const n=dn(t);return En(n)?t.ownerDocument?t.ownerDocument.body:t.body:dt(n)&&or(n)?n:eu(n)}function jn(t,n,e){var o;n===void 0&&(n=[]),e===void 0&&(e=!0);const r=eu(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),a=Bt(r);if(i){const c=function(l){return l.parent&&Object.getPrototypeOf(l.parent)?l.frameElement:null}(a);return n.concat(a,a.visualViewport||[],or(r)?r:[],c&&e?jn(c):[])}return n.concat(r,jn(r,[],e))}function un(t){let n=t.activeElement;for(;((e=n)==null||(e=e.shadowRoot)==null?void 0:e.activeElement)!=null;){var e;n=n.shadowRoot.activeElement}return n}function vt(t,n){if(!t||!n)return!1;const e=n.getRootNode==null?void 0:n.getRootNode();if(t.contains(n))return!0;if(e&&xa(e)){let o=n;for(;o;){if(t===o)return!0;o=o.parentNode||o.host}}return!1}function tu(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function nu(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(n=>{let{brand:e,version:o}=n;return e+"/"+o}).join(" "):navigator.userAgent}function ou(t){return!(t.mozInputSource!==0||!t.isTrusted)||(ka()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType)}function ru(t){return!nu().includes("jsdom/")&&(!ka()&&t.width===0&&t.height===0||ka()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch")}function iu(){return/apple/i.test(navigator.vendor)}function ka(){const t=/android/i;return t.test(tu())||t.test(nu())}function Yo(t,n){const e=["mouse","pen"];return n||e.push("",void 0),e.includes(t)}function kt(t){return(t==null?void 0:t.ownerDocument)||document}function zi(t,n){if(n==null)return!1;if("composedPath"in t)return t.composedPath().includes(n);const e=t;return e.target!=null&&n.contains(e.target)}function bn(t){return"composedPath"in t?t.composedPath()[0]:t.target}pe.Button=Wl,pe.ButtonIcon=zl,pe.Content=$l,pe.List=Zl,pe.Item=Kl,pe.ItemTitle=ql,pe.ItemSection=Jl,pe.Separator=Xl,Re.Button=Ge,Re.ButtonIcon=Ue,Re.Dropdown=pe,Ft.Title=nn,Ft.ButtonGroup=Re,Ft.Button=Ge,Ft.ButtonIcon=Ue,Ft.Dropdown=pe,Lo.Title=nn,Lo.ButtonGroup=Re,Lo.Button=Ge,Lo.ButtonIcon=Ue,Lo.Dropdown=pe,bh.Content=function({className:t,children:n,...e}){const o=q("io-dialog-content",t);return s.jsx("div",{className:o,...e,children:n})},Vn.ButtonGroup=Re,Vn.Button=Ge,Vn.ButtonIcon=Ue,Vn.Dropdown=pe,xr.ButtonGroup=Re,xr.Button=Ge,xr.ButtonIcon=Ue,xr.Dropdown=pe;const Ch="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function au(t){return dt(t)&&t.matches(Ch)}function Nt(t){t.preventDefault(),t.stopPropagation()}function Sa(t){return!!t&&t.getAttribute("role")==="combobox"&&au(t)}const Zr=Math.min,Zn=Math.max,Kr=Math.round,go=Math.floor,In=t=>({x:t,y:t}),kh={left:"right",right:"left",bottom:"top",top:"bottom"},Sh={start:"end",end:"start"};function sc(t,n,e){return Zn(t,Zr(n,e))}function vi(t,n){return typeof t=="function"?t(n):t}function Kn(t){return t.split("-")[0]}function qr(t){return t.split("-")[1]}function su(t){return t==="x"?"y":"x"}function cu(t){return t==="y"?"height":"width"}function yi(t){return["top","bottom"].includes(Kn(t))?"y":"x"}function lu(t){return su(yi(t))}function $i(t){return t.replace(/start|end/g,n=>Sh[n])}function Cr(t){return t.replace(/left|right|bottom|top/g,n=>kh[n])}function Jr(t){const{x:n,y:e,width:o,height:r}=t;return{width:o,height:r,top:e,left:n,right:n+o,bottom:e+r,x:n,y:e}}/*!
6
6
  * tabbable 6.2.0
7
7
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
8
- */var Xr=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),lu=typeof Element>"u",ko=lu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Br=!lu&&Element.prototype.getRootNode?function(t){var n;return t==null||(n=t.getRootNode)===null||n===void 0?void 0:n.call(t)}:function(t){return t==null?void 0:t.ownerDocument},Qr=function t(n,e){var o;e===void 0&&(e=!0);var r=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert");return r===""||r==="true"||e&&n&&t(n.parentNode)},Eh=function t(n,e,o){for(var r=[],i=Array.from(n);i.length;){var a=i.shift();if(!Qr(a,!1))if(a.tagName==="SLOT"){var c=a.assignedElements(),l=t(c.length?c:a.children,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:a,candidates:l})}else{ko.call(a,Xr)&&o.filter(a)&&(e||!n.includes(a))&&r.push(a);var u=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),p=!Qr(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(u&&p){var f=t(u===!0?a.children:u.children,!0,o);o.flatten?r.push.apply(r,f):r.push({scopeParent:a,candidates:f})}else i.unshift.apply(i,a.children)}}return r},uu=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},du=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(n){var e,o=n==null||(e=n.getAttribute)===null||e===void 0?void 0:e.call(n,"contenteditable");return o===""||o==="true"}(t))&&!uu(t)?0:t.tabIndex},jh=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},fu=function(t){return t.tagName==="INPUT"},Oh=function(t){return function(n){return fu(n)&&n.type==="radio"}(t)&&!function(n){if(!n.name)return!0;var e,o=n.form||Br(n),r=function(a){return o.querySelectorAll('input[type="radio"][name="'+a+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")e=r(window.CSS.escape(n.name));else try{e=r(n.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=function(a,c){for(var l=0;l<a.length;l++)if(a[l].checked&&a[l].form===c)return a[l]}(e,n.form);return!i||i===n}(t)},sc=function(t){var n=t.getBoundingClientRect(),e=n.width,o=n.height;return e===0&&o===0},Nh=function(t,n){var e=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=ko.call(t,"details>summary:first-of-type")?t.parentElement:t;if(ko.call(r,"details:not([open]) *"))return!0;if(e&&e!=="full"&&e!=="legacy-full"){if(e==="non-zero-area")return sc(t)}else{if(typeof o=="function"){for(var i=t;t;){var a=t.parentElement,c=Br(t);if(a&&!a.shadowRoot&&o(a)===!0)return sc(t);t=t.assignedSlot?t.assignedSlot:a||c===t.ownerDocument?a:c.host}t=i}if(function(l){var u,p,f,d,h=l&&Br(l),m=(u=h)===null||u===void 0?void 0:u.host,v=!1;if(h&&h!==l)for(v=!!((p=m)!==null&&p!==void 0&&(f=p.ownerDocument)!==null&&f!==void 0&&f.contains(m)||l!=null&&(d=l.ownerDocument)!==null&&d!==void 0&&d.contains(l));!v&&m;){var y,b,S;v=!((b=m=(y=h=Br(m))===null||y===void 0?void 0:y.host)===null||b===void 0||(S=b.ownerDocument)===null||S===void 0||!S.contains(m))}return v}(t))return!t.getClientRects().length;if(e!=="legacy-full")return!0}return!1},Ih=function(t,n){return!(n.disabled||Qr(n)||function(e){return fu(e)&&e.type==="hidden"}(n)||Nh(n,t)||function(e){return e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"})}(n)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var o=e.parentElement;o;){if(o.tagName==="FIELDSET"&&o.disabled){for(var r=0;r<o.children.length;r++){var i=o.children.item(r);if(i.tagName==="LEGEND")return!!ko.call(o,"fieldset[disabled] *")||!i.contains(e)}return!0}o=o.parentElement}return!1}(n))},Ea=function(t,n){return!(Oh(n)||du(n)<0||!Ih(t,n))},Ah=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ph=function t(n){var e=[],o=[];return n.forEach(function(r,i){var a=!!r.scopeParent,c=a?r.scopeParent:r,l=function(p,f){var d=du(p);return d<0&&f&&!uu(p)?0:d}(c,a),u=a?t(r.candidates):c;l===0?a?e.push.apply(e,u):e.push(c):o.push({documentOrder:i,tabIndex:l,item:r,isScope:a,content:u})}),o.sort(jh).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(e)},us=function(t,n){var e;return e=(n=n||{}).getShadowRoot?Eh([t],n.includeContainer,{filter:Ea.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ah}):function(o,r,i){if(Qr(o))return[];var a=Array.prototype.slice.apply(o.querySelectorAll(Xr));return r&&ko.call(o,Xr)&&a.unshift(o),a.filter(i)}(t,n.includeContainer,Ea.bind(null,n)),Ph(e)},Th=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ko.call(t,Xr)!==!1&&Ea(n,t)};function cc(t,n,e){let{reference:o,floating:r}=t;const i=yi(n),a=cu(n),c=su(a),l=Kn(n),u=i==="y",p=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let h;switch(l){case"top":h={x:p,y:o.y-r.height};break;case"bottom":h={x:p,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}switch(qr(n)){case"start":h[a]-=d*(e&&u?-1:1);break;case"end":h[a]+=d*(e&&u?-1:1)}return h}async function pu(t,n){var e;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:a,elements:c,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=vi(n,t),m=function(j){return typeof j!="number"?function(E){return{top:0,right:0,bottom:0,left:0,...E}}(j):{top:j,right:j,bottom:j,left:j}}(h),v=c[d?f==="floating"?"reference":"floating":f],y=Jr(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(v)))==null||e?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:p,strategy:l})),b=f==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),k=await(i.isElement==null?void 0:i.isElement(S))&&await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1},C=Jr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:S,strategy:l}):b);return{top:(y.top-C.top+m.top)/k.y,bottom:(C.bottom-y.bottom+m.bottom)/k.y,left:(y.left-C.left+m.left)/k.x,right:(C.right-y.right+m.right)/k.x}}function hu(t){const n=Vt(t);let e=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=dt(t),i=r?t.offsetWidth:e,a=r?t.offsetHeight:o,c=Kr(e)!==i||Kr(o)!==a;return c&&(e=i,o=a),{width:e,height:o,$:c}}function ds(t){return Ye(t)?t:t.contextElement}function yo(t){const n=ds(t);if(!dt(n))return In(1);const e=n.getBoundingClientRect(),{width:o,height:r,$:i}=hu(n);let a=(i?Kr(e.width):e.width)/o,c=(i?Kr(e.height):e.height)/r;return a&&Number.isFinite(a)||(a=1),c&&Number.isFinite(c)||(c=1),{x:a,y:c}}const Dh=In(0);function mu(t){const n=Bt(t);return mi()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:Dh}function Xn(t,n,e,o){n===void 0&&(n=!1),e===void 0&&(e=!1);const r=t.getBoundingClientRect(),i=ds(t);let a=In(1);n&&(o?Ye(o)&&(a=yo(o)):a=yo(t));const c=function(d,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==Bt(d))&&h}(i,e,o)?mu(i):In(0);let l=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,p=r.width/a.x,f=r.height/a.y;if(i){const d=Bt(i),h=o&&Ye(o)?Bt(o):o;let m=d,v=m.frameElement;for(;v&&o&&h!==m;){const y=yo(v),b=v.getBoundingClientRect(),S=Vt(v),k=b.left+(v.clientLeft+parseFloat(S.paddingLeft))*y.x,C=b.top+(v.clientTop+parseFloat(S.paddingTop))*y.y;l*=y.x,u*=y.y,p*=y.x,f*=y.y,l+=k,u+=C,m=Bt(v),v=m.frameElement}}return Jr({width:p,height:f,x:l,y:u})}const Mh=[":popover-open",":modal"];function ja(t){return Mh.some(n=>{try{return t.matches(n)}catch{return!1}})}function gu(t){return Xn(fn(t)).left+gi(t).scrollLeft}function lc(t,n,e){let o;if(n==="viewport")o=function(r,i){const a=Bt(r),c=fn(r),l=a.visualViewport;let u=c.clientWidth,p=c.clientHeight,f=0,d=0;if(l){u=l.width,p=l.height;const h=mi();(!h||h&&i==="fixed")&&(f=l.offsetLeft,d=l.offsetTop)}return{width:u,height:p,x:f,y:d}}(t,e);else if(n==="document")o=function(r){const i=fn(r),a=gi(r),c=r.ownerDocument.body,l=Zn(i.scrollWidth,i.clientWidth,c.scrollWidth,c.clientWidth),u=Zn(i.scrollHeight,i.clientHeight,c.scrollHeight,c.clientHeight);let p=-a.scrollLeft+gu(r);const f=-a.scrollTop;return Vt(c).direction==="rtl"&&(p+=Zn(i.clientWidth,c.clientWidth)-l),{width:l,height:u,x:p,y:f}}(fn(t));else if(Ye(n))o=function(r,i){const a=Xn(r,!0,i==="fixed"),c=a.top+r.clientTop,l=a.left+r.clientLeft,u=dt(r)?yo(r):In(1);return{width:r.clientWidth*u.x,height:r.clientHeight*u.y,x:l*u.x,y:c*u.y}}(n,e);else{const r=mu(t);o={...n,x:n.x-r.x,y:n.y-r.y}}return Jr(o)}function vu(t,n){const e=dn(t);return!(e===n||!Ye(e)||En(e))&&(Vt(e).position==="fixed"||vu(e,n))}function _h(t,n,e){const o=dt(n),r=fn(n),i=e==="fixed",a=Xn(t,!0,i,n);let c={scrollLeft:0,scrollTop:0};const l=In(0);if(o||!o&&!i)if((Nn(n)!=="body"||or(r))&&(c=gi(n)),o){const u=Xn(n,!0,i,n);l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}else r&&(l.x=gu(r));return{x:a.left+c.scrollLeft-l.x,y:a.top+c.scrollTop-l.y,width:a.width,height:a.height}}function Ui(t){return Vt(t).position==="static"}function uc(t,n){return dt(t)&&Vt(t).position!=="fixed"?n?n(t):t.offsetParent:null}function dc(t,n){const e=Bt(t);if(ja(t))return e;if(!dt(t)){let r=dn(t);for(;r&&!En(r);){if(Ye(r)&&!Ui(r))return r;r=dn(r)}return e}let o=uc(t,n);for(;o&&wh(o)&&Ui(o);)o=uc(o,n);return o&&En(o)&&Ui(o)&&!Ca(o)?e:o||function(r){let i=dn(r);for(;dt(i)&&!En(i);){if(Ca(i))return i;if(xh(i))return null;i=dn(i)}return null}(t)||e}const Lh={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:n,rect:e,offsetParent:o,strategy:r}=t;const i=r==="fixed",a=fn(o),c=!!n&&ja(n.floating);if(o===a||c&&i)return e;let l={scrollLeft:0,scrollTop:0},u=In(1);const p=In(0),f=dt(o);if((f||!f&&!i)&&((Nn(o)!=="body"||or(a))&&(l=gi(o)),dt(o))){const d=Xn(o);u=yo(o),p.x=d.x+o.clientLeft,p.y=d.y+o.clientTop}return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+p.x,y:e.y*u.y-l.scrollTop*u.y+p.y}},getDocumentElement:fn,getClippingRect:function(t){let{element:n,boundary:e,rootBoundary:o,strategy:r}=t;const i=[...e==="clippingAncestors"?ja(n)?[]:function(l,u){const p=u.get(l);if(p)return p;let f=jn(l,[],!1).filter(v=>Ye(v)&&Nn(v)!=="body"),d=null;const h=Vt(l).position==="fixed";let m=h?dn(l):l;for(;Ye(m)&&!En(m);){const v=Vt(m),y=Ca(m);y||v.position!=="fixed"||(d=null),(h?!y&&!d:!y&&v.position==="static"&&d&&["absolute","fixed"].includes(d.position)||or(m)&&!y&&vu(l,m))?f=f.filter(b=>b!==m):d=v,m=dn(m)}return u.set(l,f),f}(n,this._c):[].concat(e),o],a=i[0],c=i.reduce((l,u)=>{const p=lc(n,u,r);return l.top=Zn(p.top,l.top),l.right=Zr(p.right,l.right),l.bottom=Zr(p.bottom,l.bottom),l.left=Zn(p.left,l.left),l},lc(n,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:dc,getElementRects:async function(t){const n=this.getOffsetParent||dc,e=this.getDimensions,o=await e(t.floating);return{reference:_h(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:n,height:e}=hu(t);return{width:n,height:e}},getScale:yo,isElement:Ye,isRTL:function(t){return Vt(t).direction==="rtl"}};function Rh(t,n,e,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=ds(t),p=r||i?[...u?jn(u):[],...jn(n)]:[];p.forEach(y=>{r&&y.addEventListener("scroll",e,{passive:!0}),i&&y.addEventListener("resize",e)});const f=u&&c?function(y,b){let S,k=null;const C=fn(y);function j(){var E;clearTimeout(S),(E=k)==null||E.disconnect(),k=null}return function E(P,H){P===void 0&&(P=!1),H===void 0&&(H=1),j();const{left:z,top:q,width:B,height:A}=y.getBoundingClientRect();if(P||b(),!B||!A)return;const fe={rootMargin:-go(q)+"px "+-go(C.clientWidth-(z+B))+"px "+-go(C.clientHeight-(q+A))+"px "+-go(z)+"px",threshold:Zn(0,Zr(1,H))||1};let ve=!0;function Y(de){const he=de[0].intersectionRatio;if(he!==H){if(!ve)return E();he?E(!1,he):S=setTimeout(()=>{E(!1,1e-7)},1e3)}ve=!1}try{k=new IntersectionObserver(Y,{...fe,root:C.ownerDocument})}catch{k=new IntersectionObserver(Y,fe)}k.observe(y)}(!0),j}(u,e):null;let d,h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&m&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(n)})),e()}),u&&!l&&m.observe(u),m.observe(n));let v=l?Xn(t):null;return l&&function y(){const b=Xn(t);!v||b.x===v.x&&b.y===v.y&&b.width===v.width&&b.height===v.height||e(),v=b,d=requestAnimationFrame(y)}(),e(),()=>{var y;p.forEach(b=>{r&&b.removeEventListener("scroll",e),i&&b.removeEventListener("resize",e)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const Fh=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var e,o;const{x:r,y:i,placement:a,middlewareData:c}=n,l=await async function(u,p){const{placement:f,platform:d,elements:h}=u,m=await(d.isRTL==null?void 0:d.isRTL(h.floating)),v=Kn(f),y=qr(f),b=yi(f)==="y",S=["left","top"].includes(v)?-1:1,k=m&&b?-1:1,C=vi(p,u);let{mainAxis:j,crossAxis:E,alignmentAxis:P}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...C};return y&&typeof P=="number"&&(E=y==="end"?-1*P:P),b?{x:E*k,y:j*S}:{x:j*S,y:E*k}}(n,t);return a===((e=c.offset)==null?void 0:e.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},Bh=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:e,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:S}=y;return{x:b,y:S}}},...l}=vi(t,n),u={x:e,y:o},p=await pu(n,l),f=yi(Kn(r)),d=au(f);let h=u[d],m=u[f];if(i){const y=d==="y"?"bottom":"right";h=ac(h+p[d==="y"?"top":"left"],h,h-p[y])}if(a){const y=f==="y"?"bottom":"right";m=ac(m+p[f==="y"?"top":"left"],m,m-p[y])}const v=c.fn({...n,[d]:h,[f]:m});return{...v,data:{x:v.x-e,y:v.y-o}}}}},Hh=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var e,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:c,platform:l,elements:u}=n,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...y}=vi(t,n);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const b=Kn(r),S=Kn(c)===c,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=d||(S||!v?[Cr(c)]:function(A){const fe=Cr(A);return[$i(A),fe,$i(fe)]}(c));d||m==="none"||C.push(...function(A,fe,ve,Y){const de=qr(A);let he=function(Oe,ce,W){const Q=["left","right"],me=["right","left"],pe=["top","bottom"],V=["bottom","top"];switch(Oe){case"top":case"bottom":return W?ce?me:Q:ce?Q:me;case"left":case"right":return ce?pe:V;default:return[]}}(Kn(A),ve==="start",Y);return de&&(he=he.map(Oe=>Oe+"-"+de),fe&&(he=he.concat(he.map($i)))),he}(c,v,m,k));const j=[c,...C],E=await pu(n,y),P=[];let H=((o=i.flip)==null?void 0:o.overflows)||[];if(p&&P.push(E[b]),f){const A=function(fe,ve,Y){Y===void 0&&(Y=!1);const de=qr(fe),he=cu(fe),Oe=su(he);let ce=he==="x"?de===(Y?"end":"start")?"right":"left":de==="start"?"bottom":"top";return ve.reference[Oe]>ve.floating[Oe]&&(ce=Cr(ce)),[ce,Cr(ce)]}(r,a,k);P.push(E[A[0]],E[A[1]])}if(H=[...H,{placement:r,overflows:P}],!P.every(A=>A<=0)){var z,q;const A=(((z=i.flip)==null?void 0:z.index)||0)+1,fe=j[A];if(fe)return{data:{index:A,overflows:H},reset:{placement:fe}};let ve=(q=H.filter(Y=>Y.overflows[0]<=0).sort((Y,de)=>Y.overflows[1]-de.overflows[1])[0])==null?void 0:q.placement;if(!ve)switch(h){case"bestFit":{var B;const Y=(B=H.map(de=>[de.placement,de.overflows.filter(he=>he>0).reduce((he,Oe)=>he+Oe,0)]).sort((de,he)=>de[1]-he[1])[0])==null?void 0:B[0];Y&&(ve=Y);break}case"initialPlacement":ve=c}if(r!==ve)return{reset:{placement:ve}}}return{}}}},Wh=(t,n,e)=>{const o=new Map,r={platform:Lh,...e},i={...r.platform,_c:o};return(async(a,c,l)=>{const{placement:u="bottom",strategy:p="absolute",middleware:f=[],platform:d}=l,h=f.filter(Boolean),m=await(d.isRTL==null?void 0:d.isRTL(c));let v=await d.getElementRects({reference:a,floating:c,strategy:p}),{x:y,y:b}=cc(v,u,m),S=u,k={},C=0;for(let j=0;j<h.length;j++){const{name:E,fn:P}=h[j],{x:H,y:z,data:q,reset:B}=await P({x:y,y:b,initialPlacement:u,placement:S,strategy:p,middlewareData:k,rects:v,platform:d,elements:{reference:a,floating:c}});y=H??y,b=z??b,k={...k,[E]:{...k[E],...q}},B&&C<=50&&(C++,typeof B=="object"&&(B.placement&&(S=B.placement),B.rects&&(v=B.rects===!0?await d.getElementRects({reference:a,floating:c,strategy:p}):B.rects),{x:y,y:b}=cc(v,S,m)),j=-1)}return{x:y,y:b,placement:S,strategy:p,middlewareData:k}})(t,n,{...r,platform:i})};var Hr=typeof document<"u"?g.useLayoutEffect:g.useEffect;function ei(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="function"&&t.toString()===n.toString())return!0;let e,o,r;if(t&&n&&typeof t=="object"){if(Array.isArray(t)){if(e=t.length,e!==n.length)return!1;for(o=e;o--!=0;)if(!ei(t[o],n[o]))return!1;return!0}if(r=Object.keys(t),e=r.length,e!==Object.keys(n).length)return!1;for(o=e;o--!=0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=e;o--!=0;){const i=r[o];if((i!=="_owner"||!t.$$typeof)&&!ei(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}function yu(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function fc(t,n){const e=yu(t);return Math.round(n*e)/e}function Vi(t){const n=M.useRef(t);return Hr(()=>{n.current=t}),n}const zh=(t,n)=>({...Bh(t),options:[t,n]}),$h=(t,n)=>({...Hh(t),options:[t,n]});function bu(t){return M.useMemo(()=>t.every(n=>n==null)?null:n=>{t.forEach(e=>{typeof e=="function"?e(n):e!=null&&(e.current=n)})},t)}const wu={...M},Uh=wu.useInsertionEffect||(t=>t());function Pt(t){const n=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Uh(()=>{n.current=t}),M.useCallback(function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return n.current==null?void 0:n.current(...o)},[])}const fs="ArrowUp",Xo="ArrowDown",wn="ArrowLeft",xn="ArrowRight";function kr(t,n,e){return Math.floor(t/n)!==e}function Ro(t,n){return n<0||n>=t.current.length}function Gi(t,n){return xt(t,{disabledIndices:n})}function pc(t,n){return xt(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}function xt(t,n){let{startingIndex:e=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n;const a=t.current;let c=e;do c+=o?-i:i;while(c>=0&&c<=a.length-1&&Wr(a,c,r));return c}function Vh(t,n,e,o,r){if(t===-1)return-1;const i=e.indexOf(t),a=n[t];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return e.lastIndexOf(t)}}function Gh(t,n){return n.flatMap((e,o)=>t.includes(e)?[o]:[])}function Wr(t,n,e){if(e)return e.includes(n);const o=t[n];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}var Je=typeof document<"u"?g.useLayoutEffect:g.useEffect;function Yh(t,n){const e=t.compareDocumentPosition(n);return e&Node.DOCUMENT_POSITION_FOLLOWING||e&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:e&Node.DOCUMENT_POSITION_PRECEDING||e&Node.DOCUMENT_POSITION_CONTAINS?1:0}const xu=M.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Zh(t){const{children:n,elementsRef:e,labelsRef:o}=t,[r,i]=M.useState(()=>new Map),a=M.useCallback(l=>{i(u=>new Map(u).set(l,null))},[]),c=M.useCallback(l=>{i(u=>{const p=new Map(u);return p.delete(l),p})},[]);return Je(()=>{const l=new Map(r);Array.from(l.keys()).sort(Yh).forEach((u,p)=>{l.set(u,p)}),function(u,p){if(u.size!==p.size)return!1;for(const[f,d]of u.entries())if(d!==p.get(f))return!1;return!0}(r,l)||i(l)},[r]),M.createElement(xu.Provider,{value:M.useMemo(()=>({register:a,unregister:c,map:r,elementsRef:e,labelsRef:o}),[a,c,r,e,o])},n)}function Cu(t){t===void 0&&(t={});const{label:n}=t,{register:e,unregister:o,map:r,elementsRef:i,labelsRef:a}=M.useContext(xu),[c,l]=M.useState(null),u=M.useRef(null),p=M.useCallback(f=>{if(u.current=f,c!==null&&(i.current[c]=f,a)){var d;const h=n!==void 0;a.current[c]=h?n:(d=f==null?void 0:f.textContent)!=null?d:null}},[c,i,a,n]);return Je(()=>{const f=u.current;if(f)return e(f),()=>{o(f)}},[e,o]),Je(()=>{const f=u.current?r.get(u.current):null;f!=null&&l(f)},[r]),M.useMemo(()=>({ref:p,index:c??-1}),[c,p])}function ti(){return ti=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},ti.apply(this,arguments)}let hc=!1,Kh=0;const mc=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Kh++,Oa=wu.useId||function(){const[t,n]=M.useState(()=>hc?mc():void 0);return Je(()=>{t==null&&n(mc())},[]),M.useEffect(()=>{hc=!0},[]),t};let rr;function Yi(){for(var t,n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];const r="Floating UI: "+e.join(" ");var i;(t=rr)!=null&&t.has(r)||((i=rr)==null||i.add(r),console.warn(r))}function ku(){const t=new Map;return{emit(n,e){var o;(o=t.get(n))==null||o.forEach(r=>r(e))},on(n,e){t.set(n,[...t.get(n)||[],e])},off(n,e){var o;t.set(n,((o=t.get(n))==null?void 0:o.filter(r=>r!==e))||[])}}}process.env.NODE_ENV!=="production"&&(rr=new Set);const Su=M.createContext(null),Eu=M.createContext(null),kn=()=>{var t;return((t=M.useContext(Su))==null?void 0:t.id)||null},Sn=()=>M.useContext(Eu);function qh(t){const{children:n,id:e}=t,o=kn();return M.createElement(Su.Provider,{value:M.useMemo(()=>({id:e,parentId:o}),[e,o])},n)}function Jh(t){const{children:n}=t,e=M.useRef([]),o=M.useCallback(a=>{e.current=[...e.current,a]},[]),r=M.useCallback(a=>{e.current=e.current.filter(c=>c!==a)},[]),i=M.useState(()=>ku())[0];return M.createElement(Eu.Provider,{value:M.useMemo(()=>({nodesRef:e,addNode:o,removeNode:r,events:i}),[o,r,i])},n)}function ir(t){return"data-floating-ui-"+t}function qt(t){const n=g.useRef(t);return Je(()=>{n.current=t}),n}const gc=ir("safe-polygon");function Zi(t,n,e){return e&&!Yo(e)?0:typeof t=="number"?t:t==null?void 0:t[n]}let vc=0;function yn(t,n){n===void 0&&(n={});const{preventScroll:e=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(vc);const i=()=>t==null?void 0:t.focus({preventScroll:e});r?i():vc=requestAnimationFrame(i)}function qn(t,n){let e=t.filter(r=>{var i;return r.parentId===n&&((i=r.context)==null?void 0:i.open)}),o=e;for(;o.length;)o=t.filter(r=>{var i;return(i=o)==null?void 0:i.some(a=>{var c;return r.parentId===a.id&&((c=r.context)==null?void 0:c.open)})}),e=e.concat(o);return e}let io=new WeakMap,Sr=new WeakSet,Er={},Ki=0;const ju=t=>t&&(t.host||ju(t.parentNode)),Xh=(t,n)=>n.map(e=>{if(t.contains(e))return e;const o=ju(e);return t.contains(o)?o:null}).filter(e=>e!=null);function yc(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);const o=kt(t[0]).body;return function(r,i,a,c){const l="data-floating-ui-inert",u=c?"inert":a?"aria-hidden":null,p=Xh(i,r),f=new Set,d=new Set(p),h=[];Er[l]||(Er[l]=new WeakMap);const m=Er[l];return p.forEach(function v(y){y&&!f.has(y)&&(f.add(y),y.parentNode&&v(y.parentNode))}),function v(y){y&&!d.has(y)&&[].forEach.call(y.children,b=>{if(Nn(b)!=="script")if(f.has(b))v(b);else{const S=u?b.getAttribute(u):null,k=S!==null&&S!=="false",C=(io.get(b)||0)+1,j=(m.get(b)||0)+1;io.set(b,C),m.set(b,j),h.push(b),C===1&&k&&Sr.add(b),j===1&&b.setAttribute(l,""),!k&&u&&b.setAttribute(u,"true")}})}(i),f.clear(),Ki++,()=>{h.forEach(v=>{const y=(io.get(v)||0)-1,b=(m.get(v)||0)-1;io.set(v,y),m.set(v,b),y||(!Sr.has(v)&&u&&v.removeAttribute(u),Sr.delete(v)),b||v.removeAttribute(l)}),Ki--,Ki||(io=new WeakMap,io=new WeakMap,Sr=new WeakSet,Er={})}}(t.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,n,e)}const ni=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function bc(t,n){const e=us(t,ni());n==="prev"&&e.reverse();const o=e.indexOf(un(kt(t)));return e.slice(o+1)[0]}function wc(t,n){const e=n||t.currentTarget,o=t.relatedTarget;return!o||!vt(e,o)}const ps={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function xc(t){t.key==="Tab"&&(t.target,clearTimeout(void 0))}const Cc=M.forwardRef(function(t,n){const[e,o]=M.useState();Je(()=>(ru()&&o("button"),document.addEventListener("keydown",xc),()=>{document.removeEventListener("keydown",xc)}),[]);const r={ref:n,tabIndex:0,role:e,"aria-hidden":!e||void 0,[ir("focus-guard")]:"",style:ps};return M.createElement("span",ti({},t,r))}),Qh=M.createContext(null),Na="data-floating-ui-focusable";function Ou(t){return t?t.hasAttribute(Na)?t:t.querySelector("["+Na+"]")||t:null}const em=20;let _n=[];function qi(t){_n=_n.filter(e=>e.isConnected);let n=t;if(n&&Nn(n)!=="body"){if(!Th(n,ni())){const e=us(n,ni())[0];e&&(n=e)}_n.push(n),_n.length>em&&(_n=_n.slice(-20))}}function kc(){return _n.slice().reverse().find(t=>t.isConnected)}const tm=M.forwardRef(function(t,n){return M.createElement("button",ti({},t,{type:"button",ref:n,tabIndex:-1,style:ps}))});function nm(t){const{context:n,children:e,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:p=!1,closeOnFocusOut:f=!0}=t,{open:d,refs:h,nodeId:m,onOpenChange:v,events:y,dataRef:b,floatingId:S,elements:{domReference:k,floating:C}}=n,j=typeof a=="number"&&a<0,E=Sa(k)&&j,P=typeof HTMLElement>"u"||!("inert"in HTMLElement.prototype)||i,H=qt(r),z=qt(a),q=qt(c),B=Sn(),A=M.useContext(Qh),fe=M.useRef(null),ve=M.useRef(null),Y=M.useRef(!1),de=M.useRef(!1),he=M.useRef(-1),Oe=A!=null,ce=Ou(C),W=Pt(function(V){return V===void 0&&(V=ce),V?us(V,ni()):[]}),Q=Pt(V=>{const D=W(V);return H.current.map(T=>k&&T==="reference"?k:ce&&T==="floating"?ce:D).filter(Boolean).flat()});function me(V){return!o&&p&&u?M.createElement(tm,{ref:V==="start"?fe:ve,onClick:D=>v(!1,D.nativeEvent)},typeof p=="string"?p:"Dismiss"):null}M.useEffect(()=>{if(o||!u)return;function V(T){if(T.key==="Tab"){vt(ce,un(kt(ce)))&&W().length===0&&!E&&Nt(T);const L=Q(),G=bn(T);H.current[0]==="reference"&&G===k&&(Nt(T),T.shiftKey?yn(L[L.length-1]):yn(L[1])),H.current[1]==="floating"&&G===ce&&T.shiftKey&&(Nt(T),yn(L[0]))}}const D=kt(ce);return D.addEventListener("keydown",V),()=>{D.removeEventListener("keydown",V)}},[o,k,ce,u,H,E,W,Q]),M.useEffect(()=>{if(!o&&C)return C.addEventListener("focusin",V),()=>{C.removeEventListener("focusin",V)};function V(D){const T=bn(D),L=W().indexOf(T);L!==-1&&(he.current=L)}},[o,C,W]),M.useEffect(()=>{if(!o&&f)return C&&dt(k)?(k.addEventListener("focusout",D),k.addEventListener("pointerdown",V),C.addEventListener("focusout",D),()=>{k.removeEventListener("focusout",D),k.removeEventListener("pointerdown",V),C.removeEventListener("focusout",D)}):void 0;function V(){de.current=!0,setTimeout(()=>{de.current=!1})}function D(T){const L=T.relatedTarget;queueMicrotask(()=>{const G=!(vt(k,L)||vt(C,L)||vt(L,C)||vt(A==null?void 0:A.portalNode,L)||L!=null&&L.hasAttribute(ir("focus-guard"))||B&&(qn(B.nodesRef.current,m).find(U=>{var re,te;return vt((re=U.context)==null?void 0:re.elements.floating,L)||vt((te=U.context)==null?void 0:te.elements.domReference,L)})||function(U,re){var te;let I=[],ke=(te=U.find(xe=>xe.id===re))==null?void 0:te.parentId;for(;ke;){const xe=U.find(_e=>_e.id===ke);ke=xe==null?void 0:xe.parentId,xe&&(I=I.concat(xe))}return I}(B.nodesRef.current,m).find(U=>{var re,te;return((re=U.context)==null?void 0:re.elements.floating)===L||((te=U.context)==null?void 0:te.elements.domReference)===L})));if(l&&G&&un(kt(ce))===kt(ce).body){dt(ce)&&ce.focus();const U=he.current,re=W(),te=re[U]||re[re.length-1]||ce;dt(te)&&te.focus()}!E&&u||!L||!G||de.current||L===kc()||(Y.current=!0,v(!1,T,"focus-out"))})}},[o,k,C,ce,u,m,B,A,v,f,l,W,E]),M.useEffect(()=>{var V;if(o)return;const D=Array.from((A==null||(V=A.portalNode)==null?void 0:V.querySelectorAll("["+ir("portal")+"]"))||[]);if(C){const T=[C,...D,fe.current,ve.current,H.current.includes("reference")||E?k:null].filter(G=>G!=null),L=u||E?yc(T,P,!P):yc(T);return()=>{L()}}},[o,k,C,u,H,A,E,P]),Je(()=>{if(o||!dt(ce))return;const V=un(kt(ce));queueMicrotask(()=>{const D=Q(ce),T=z.current,L=(typeof T=="number"?D[T]:T.current)||ce,G=vt(ce,V);j||G||!d||yn(L,{preventScroll:L===ce})})},[o,d,ce,j,Q,z]),Je(()=>{if(o||!ce)return;let V=!1;const D=kt(ce),T=un(D);let L=b.current.openEvent;function G(re){let{open:te,reason:I,event:ke,nested:xe}=re;te&&(L=ke),I==="escape-key"&&h.domReference.current&&qi(h.domReference.current),I==="hover"&&ke.type==="mouseleave"&&(Y.current=!0),I==="outside-press"&&(xe?(Y.current=!1,V=!0):Y.current=!(nu(ke)||ou(ke)))}qi(T),y.on("openchange",G);const U=D.createElement("span");return U.setAttribute("tabindex","-1"),U.setAttribute("aria-hidden","true"),Object.assign(U.style,ps),Oe&&k&&k.insertAdjacentElement("afterend",U),()=>{y.off("openchange",G);const re=un(D),te=vt(C,re)||B&&qn(B.nodesRef.current,m).some(ke=>{var xe;return vt((xe=ke.context)==null?void 0:xe.elements.floating,re)});(te||L&&["click","mousedown"].includes(L.type))&&h.domReference.current&&qi(h.domReference.current);const I=typeof q.current=="boolean"?kc()||U:q.current.current||U;queueMicrotask(()=>{q.current&&!Y.current&&dt(I)&&(I===re||re===D.body||te)&&I.focus({preventScroll:V}),U.remove()})}},[o,C,ce,q,b,h,y,B,m,Oe,k]),M.useEffect(()=>{queueMicrotask(()=>{Y.current=!1})},[o]),Je(()=>{if(!o&&A)return A.setFocusManagerState({modal:u,closeOnFocusOut:f,open:d,onOpenChange:v,refs:h}),()=>{A.setFocusManagerState(null)}},[o,A,u,d,v,h,f]),Je(()=>{if(o||!ce||typeof MutationObserver!="function"||j)return;const V=()=>{const T=ce.getAttribute("tabindex"),L=W(),G=un(kt(C)),U=L.indexOf(G);U!==-1&&(he.current=U),H.current.includes("floating")||G!==h.domReference.current&&L.length===0?T!=="0"&&ce.setAttribute("tabindex","0"):T!=="-1"&&ce.setAttribute("tabindex","-1")};V();const D=new MutationObserver(V);return D.observe(ce,{childList:!0,subtree:!0,attributes:!0}),()=>{D.disconnect()}},[o,C,ce,h,H,W,j]);const pe=!o&&P&&(!u||!E)&&(Oe||u);return M.createElement(M.Fragment,null,pe&&M.createElement(Cc,{"data-type":"inside",ref:A==null?void 0:A.beforeInsideRef,onFocus:V=>{if(u){const T=Q();yn(r[0]==="reference"?T[0]:T[T.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(Y.current=!1,wc(V,A.portalNode)){const T=bc(document.body,"next")||k;T==null||T.focus()}else{var D;(D=A.beforeOutsideRef.current)==null||D.focus()}}}),!E&&me("start"),e,me("end"),pe&&M.createElement(Cc,{"data-type":"inside",ref:A==null?void 0:A.afterInsideRef,onFocus:V=>{if(u)yn(Q()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(f&&(Y.current=!0),wc(V,A.portalNode)){const T=bc(document.body,"prev")||k;T==null||T.focus()}else{var D;(D=A.afterOutsideRef.current)==null||D.focus()}}}))}function Sc(t){return dt(t.target)&&t.target.tagName==="BUTTON"}function Ec(t){return iu(t)}const om={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},rm={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},jc=t=>{var n,e;return{escapeKey:typeof t=="boolean"?t:(n=t==null?void 0:t.escapeKey)!=null&&n,outsidePress:typeof t=="boolean"?t:(e=t==null?void 0:t.outsidePress)==null||e}};function im(t){const{open:n=!1,onOpenChange:e,elements:o}=t,r=Oa(),i=M.useRef({}),[a]=M.useState(()=>ku()),c=kn()!=null;if(process.env.NODE_ENV!=="production"){const h=o.reference;h&&!Ye(h)&&function(){for(var m,v=arguments.length,y=new Array(v),b=0;b<v;b++)y[b]=arguments[b];const S="Floating UI: "+y.join(" ");var k;(m=rr)!=null&&m.has(S)||((k=rr)==null||k.add(S),console.error(S))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=M.useState(o.reference),p=Pt((h,m,v)=>{i.current.openEvent=h?m:void 0,a.emit("openchange",{open:h,event:m,reason:v,nested:c}),e==null||e(h,m,v)}),f=M.useMemo(()=>({setPositionReference:u}),[]),d=M.useMemo(()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference}),[l,o.reference,o.floating]);return M.useMemo(()=>({dataRef:i,open:n,onOpenChange:p,elements:d,events:a,floatingId:r,refs:f}),[n,p,d,a,r,f])}function am(t){t===void 0&&(t={});const{nodeId:n}=t,e=im({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||e,r=o.elements,[i,a]=M.useState(null),[c,l]=M.useState(null),u=(r==null?void 0:r.domReference)||i,p=M.useRef(null),f=Sn();Je(()=>{u&&(p.current=u)},[u]);const d=function(S){S===void 0&&(S={});const{placement:k="bottom",strategy:C="absolute",middleware:j=[],platform:E,elements:{reference:P,floating:H}={},transform:z=!0,whileElementsMounted:q,open:B}=S,[A,fe]=M.useState({x:0,y:0,strategy:C,placement:k,middlewareData:{},isPositioned:!1}),[ve,Y]=M.useState(j);ei(ve,j)||Y(j);const[de,he]=M.useState(null),[Oe,ce]=M.useState(null),W=M.useCallback(Ie=>{Ie!==V.current&&(V.current=Ie,he(Ie))},[]),Q=M.useCallback(Ie=>{Ie!==D.current&&(D.current=Ie,ce(Ie))},[]),me=P||de,pe=H||Oe,V=M.useRef(null),D=M.useRef(null),T=M.useRef(A),L=q!=null,G=Vi(q),U=Vi(E),re=Vi(B),te=M.useCallback(()=>{if(!V.current||!D.current)return;const Ie={placement:k,strategy:C,middleware:ve};U.current&&(Ie.platform=U.current),Wh(V.current,D.current,Ie).then(Pe=>{const ge={...Pe,isPositioned:re.current!==!1};I.current&&!ei(T.current,ge)&&(T.current=ge,Ll.flushSync(()=>{fe(ge)}))})},[ve,k,C,U,re]);Hr(()=>{B===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,fe(Ie=>({...Ie,isPositioned:!1})))},[B]);const I=M.useRef(!1);Hr(()=>(I.current=!0,()=>{I.current=!1}),[]),Hr(()=>{if(me&&(V.current=me),pe&&(D.current=pe),me&&pe){if(G.current)return G.current(me,pe,te);te()}},[me,pe,te,G,L]);const ke=M.useMemo(()=>({reference:V,floating:D,setReference:W,setFloating:Q}),[W,Q]),xe=M.useMemo(()=>({reference:me,floating:pe}),[me,pe]),_e=M.useMemo(()=>{const Ie={position:C,left:0,top:0};if(!xe.floating)return Ie;const Pe=fc(xe.floating,A.x),ge=fc(xe.floating,A.y);return z?{...Ie,transform:"translate("+Pe+"px, "+ge+"px)",...yu(xe.floating)>=1.5&&{willChange:"transform"}}:{position:C,left:Pe,top:ge}},[C,z,xe.floating,A.x,A.y]);return M.useMemo(()=>({...A,update:te,refs:ke,elements:xe,floatingStyles:_e}),[A,te,ke,xe,_e])}({...t,elements:{...r,...c&&{reference:c}}}),h=M.useCallback(S=>{const k=Ye(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;l(k),d.refs.setReference(k)},[d.refs]),m=M.useCallback(S=>{(Ye(S)||S===null)&&(p.current=S,a(S)),(Ye(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!Ye(S))&&d.refs.setReference(S)},[d.refs]),v=M.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:p}),[d.refs,m,h]),y=M.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),b=M.useMemo(()=>({...d,...o,refs:v,elements:y,nodeId:n}),[d,v,y,n,o]);return Je(()=>{o.dataRef.current.floatingContext=b;const S=f==null?void 0:f.nodesRef.current.find(k=>k.id===n);S&&(S.context=b)}),M.useMemo(()=>({...d,context:b,refs:v,elements:y}),[d,v,y,b])}const Oc="active",Nc="selected";function Ji(t,n,e){const o=new Map,r=e==="item";let i=t;if(r&&t){const{[Oc]:a,[Nc]:c,...l}=t;i=l}return{...e==="floating"&&{tabIndex:-1,[Na]:""},...i,...n.map(a=>{const c=a?a[e]:null;return typeof c=="function"?t?c(t):null:c}).concat(t).reduce((a,c)=>(c&&Object.entries(c).forEach(l=>{let[u,p]=l;var f;r&&[Oc,Nc].includes(u)||(u.indexOf("on")===0?(o.has(u)||o.set(u,[]),typeof p=="function"&&((f=o.get(u))==null||f.push(p),a[u]=function(){for(var d,h=arguments.length,m=new Array(h),v=0;v<h;v++)m[v]=arguments[v];return(d=o.get(u))==null?void 0:d.map(y=>y(...m)).find(y=>y!==void 0)})):a[u]=p)}),a),{})}}let Ic=!1;function bi(t,n,e){switch(t){case"vertical":return n;case"horizontal":return e;default:return n||e}}function Ac(t,n){return bi(n,t===fs||t===Xo,t===wn||t===xn)}function Xi(t,n,e){return bi(n,t===Xo,e?t===wn:t===xn)||t==="Enter"||t===" "||t===""}function Pc(t,n,e){return bi(n,e?t===xn:t===wn,t===fs)}function sm(t,n){const{open:e,onOpenChange:o,elements:r}=t,{listRef:i,activeIndex:a,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:p=!1,loop:f=!1,nested:d=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:S,orientation:k="vertical",cols:C=1,scrollItemIntoView:j=!0,virtualItemRef:E,itemSizes:P,dense:H=!1}=n;process.env.NODE_ENV!=="production"&&(p&&(f||Yi("`useListNavigation` looping must be enabled to allow escaping."),m||Yi("`useListNavigation` must be virtual to allow escaping.")),k==="vertical"&&C>1&&Yi("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const z=qt(Ou(r.floating)),q=kn(),B=Sn(),A=Pt(c),fe=Sa(r.domReference),ve=M.useRef(v),Y=M.useRef(u??-1),de=M.useRef(null),he=M.useRef(!0),Oe=M.useRef(A),ce=M.useRef(!!r.floating),W=M.useRef(e),Q=M.useRef(!1),me=M.useRef(!1),pe=qt(S),V=qt(e),D=qt(j),T=qt(u),[L,G]=M.useState(),[U,re]=M.useState(),te=Pt(function(ge,x,w){function O(R){m?(G(R.id),B==null||B.events.emit("virtualfocus",R),E&&(E.current=R)):yn(R,{preventScroll:!0,sync:!(!eu().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!ru())&&(Ic||Q.current)})}w===void 0&&(w=!1);const N=ge.current[x.current];N&&O(N),requestAnimationFrame(()=>{const R=ge.current[x.current]||N;if(!R)return;N||O(R);const ne=D.current;ne&&ke&&(w||!he.current)&&(R.scrollIntoView==null||R.scrollIntoView(typeof ne=="boolean"?{block:"nearest",inline:"nearest"}:ne))})});Je(()=>{document.createElement("div").focus({get preventScroll(){return Ic=!0,!1}})},[]),Je(()=>{l&&(e&&r.floating?ve.current&&u!=null&&(me.current=!0,Y.current=u,A(u)):ce.current&&(Y.current=-1,Oe.current(null)))},[l,e,r.floating,u,A]),Je(()=>{if(l&&e&&r.floating)if(a==null){if(Q.current=!1,T.current!=null)return;if(ce.current&&(Y.current=-1,te(i,Y)),(!W.current||!ce.current)&&ve.current&&(de.current!=null||ve.current===!0&&de.current==null)){let ge=0;const x=()=>{i.current[0]==null?(ge<2&&(ge?requestAnimationFrame:queueMicrotask)(x),ge++):(Y.current=de.current==null||Xi(de.current,k,h)||d?Gi(i,pe.current):pc(i,pe.current),de.current=null,A(Y.current))};x()}}else Ro(i,a)||(Y.current=a,te(i,Y,me.current),me.current=!1)},[l,e,r.floating,a,T,d,i,k,h,A,te,pe]),Je(()=>{var ge;if(!l||r.floating||!B||m||!ce.current)return;const x=B.nodesRef.current,w=(ge=x.find(R=>R.id===q))==null||(ge=ge.context)==null?void 0:ge.elements.floating,O=un(kt(r.floating)),N=x.some(R=>R.context&&vt(R.context.elements.floating,O));w&&!N&&he.current&&w.focus({preventScroll:!0})},[l,r.floating,B,q,m]),Je(()=>{if(l&&B&&m&&!q)return B.events.on("virtualfocus",ge),()=>{B.events.off("virtualfocus",ge)};function ge(x){re(x.id),E&&(E.current=x)}},[l,B,m,q,E]),Je(()=>{Oe.current=A,ce.current=!!r.floating}),Je(()=>{e||(de.current=null)},[e]),Je(()=>{W.current=e},[e]);const I=a!=null,ke=M.useMemo(()=>{function ge(x){if(!e)return;const w=i.current.indexOf(x);w!==-1&&A(w)}return{onFocus(x){let{currentTarget:w}=x;ge(w)},onClick:x=>{let{currentTarget:w}=x;return w.focus({preventScroll:!0})},...y&&{onMouseMove(x){let{currentTarget:w}=x;ge(w)},onPointerLeave(x){let{pointerType:w}=x;he.current&&w!=="touch"&&(Y.current=-1,te(i,Y),A(null),m||yn(z.current,{preventScroll:!0}))}}}},[e,z,te,y,i,A,m]),xe=Pt(ge=>{if(he.current=!1,Q.current=!0,ge.which===229||!V.current&&ge.currentTarget===z.current)return;if(d&&Pc(ge.key,k,h))return Nt(ge),o(!1,ge.nativeEvent,"list-navigation"),void(dt(r.domReference)&&(m?B==null||B.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const x=Y.current,w=Gi(i,S),O=pc(i,S);if(fe||(ge.key==="Home"&&(Nt(ge),Y.current=w,A(Y.current)),ge.key==="End"&&(Nt(ge),Y.current=O,A(Y.current))),C>1){const N=P||Array.from({length:i.current.length},()=>({width:1,height:1})),R=function(F,Z,le){const ie=[];let oe=0;return F.forEach((ee,ye)=>{let{width:Ae,height:Ve}=ee;if(Ae>Z&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+ye+" is greater than grid columns");let je=!1;for(le&&(oe=0);!je;){const Se=[];for(let Ce=0;Ce<Ae;Ce++)for(let ue=0;ue<Ve;ue++)Se.push(oe+Ce+ue*Z);oe%Z+Ae<=Z&&Se.every(Ce=>ie[Ce]==null)?(Se.forEach(Ce=>{ie[Ce]=ye}),je=!0):oe++}}),[...ie]}(N,C,H),ne=R.findIndex(F=>F!=null&&!Wr(i.current,F,S)),J=R.reduce((F,Z,le)=>Z==null||Wr(i.current,Z,S)?F:le,-1),$=R[function(F,Z){let{event:le,orientation:ie,loop:oe,rtl:ee,cols:ye,disabledIndices:Ae,minIndex:Ve,maxIndex:je,prevIndex:Se,stopEvent:Ce=!1}=Z,ue=Se;if(le.key===fs){if(Ce&&Nt(le),Se===-1)ue=je;else if(ue=xt(F,{startingIndex:ue,amount:ye,decrement:!0,disabledIndices:Ae}),oe&&(Se-ye<Ve||ue<0)){const be=Se%ye,Te=je%ye,Ne=je-(Te-be);ue=Te===be?je:Te>be?Ne:Ne-ye}Ro(F,ue)&&(ue=Se)}if(le.key===Xo&&(Ce&&Nt(le),Se===-1?ue=Ve:(ue=xt(F,{startingIndex:Se,amount:ye,disabledIndices:Ae}),oe&&Se+ye>je&&(ue=xt(F,{startingIndex:Se%ye-ye,amount:ye,disabledIndices:Ae}))),Ro(F,ue)&&(ue=Se)),ie==="both"){const be=go(Se/ye);le.key===(ee?wn:xn)&&(Ce&&Nt(le),Se%ye!=ye-1?(ue=xt(F,{startingIndex:Se,disabledIndices:Ae}),oe&&kr(ue,ye,be)&&(ue=xt(F,{startingIndex:Se-Se%ye-1,disabledIndices:Ae}))):oe&&(ue=xt(F,{startingIndex:Se-Se%ye-1,disabledIndices:Ae})),kr(ue,ye,be)&&(ue=Se)),le.key===(ee?xn:wn)&&(Ce&&Nt(le),Se%ye!=0?(ue=xt(F,{startingIndex:Se,decrement:!0,disabledIndices:Ae}),oe&&kr(ue,ye,be)&&(ue=xt(F,{startingIndex:Se+(ye-Se%ye),decrement:!0,disabledIndices:Ae}))):oe&&(ue=xt(F,{startingIndex:Se+(ye-Se%ye),decrement:!0,disabledIndices:Ae})),kr(ue,ye,be)&&(ue=Se));const Te=go(je/ye)===be;Ro(F,ue)&&(ue=oe&&Te?le.key===(ee?xn:wn)?je:xt(F,{startingIndex:Se-Se%ye-1,disabledIndices:Ae}):Se)}return ue}({current:R.map(F=>F!=null?i.current[F]:null)},{event:ge,orientation:k,loop:f,rtl:h,cols:C,disabledIndices:Gh([...S||i.current.map((F,Z)=>Wr(i.current,Z)?Z:void 0),void 0],R),minIndex:ne,maxIndex:J,prevIndex:Vh(Y.current>O?w:Y.current,N,R,C,ge.key===Xo?"bl":ge.key===(h?wn:xn)?"tr":"tl"),stopEvent:!0})];if($!=null&&(Y.current=$,A(Y.current)),k==="both")return}if(Ac(ge.key,k)){if(Nt(ge),e&&!m&&un(ge.currentTarget.ownerDocument)===ge.currentTarget)return Y.current=Xi(ge.key,k,h)?w:O,void A(Y.current);Xi(ge.key,k,h)?Y.current=f?x>=O?p&&x!==i.current.length?-1:w:xt(i,{startingIndex:x,disabledIndices:S}):Math.min(O,xt(i,{startingIndex:x,disabledIndices:S})):Y.current=f?x<=w?p&&x!==-1?i.current.length:O:xt(i,{startingIndex:x,decrement:!0,disabledIndices:S}):Math.max(w,xt(i,{startingIndex:x,decrement:!0,disabledIndices:S})),Ro(i,Y.current)?A(null):A(Y.current)}}),_e=M.useMemo(()=>m&&e&&I&&{"aria-activedescendant":U||L},[m,e,I,U,L]),Ie=M.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...!Sa(r.domReference)&&_e,onKeyDown:xe,onPointerMove(){he.current=!0}}),[_e,xe,r.domReference,k]),Pe=M.useMemo(()=>{function ge(x){v==="auto"&&nu(x.nativeEvent)&&(ve.current=!0)}return{..._e,onKeyDown(x){he.current=!1;const w=x.key.startsWith("Arrow"),O=["Home","End"].includes(x.key),N=w||O,R=function(ie,oe,ee){return bi(oe,ee?ie===wn:ie===xn,ie===Xo)}(x.key,k,h),ne=Pc(x.key,k,h),J=Ac(x.key,k),$=(d?R:J)||x.key==="Enter"||x.key.trim()==="";if(m&&e){const ie=B==null?void 0:B.nodesRef.current.find(ee=>ee.parentId==null),oe=B&&ie?function(ee,ye){let Ae,Ve=-1;return function je(Se,Ce){Ce>Ve&&(Ae=Se,Ve=Ce),qn(ee,Se).forEach(ue=>{je(ue.id,Ce+1)})}(ye,0),ee.find(je=>je.id===Ae)}(B.nodesRef.current,ie.id):null;if(N&&oe&&E){const ee=new KeyboardEvent("keydown",{key:x.key,bubbles:!0});if(R||ne){var F,Z;const ye=((F=oe.context)==null?void 0:F.elements.domReference)===x.currentTarget,Ae=ne&&!ye?(Z=oe.context)==null?void 0:Z.elements.domReference:R?i.current.find(Ve=>(Ve==null?void 0:Ve.id)===L):null;Ae&&(Nt(x),Ae.dispatchEvent(ee),re(void 0))}var le;if((J||O)&&oe.context&&oe.context.open&&oe.parentId&&x.currentTarget!==oe.context.elements.domReference)return Nt(x),void((le=oe.context.elements.domReference)==null||le.dispatchEvent(ee))}return xe(x)}(e||b||!w)&&($&&(de.current=d&&J?null:x.key),d?R&&(Nt(x),e?(Y.current=Gi(i,pe.current),A(Y.current)):o(!0,x.nativeEvent,"list-navigation")):J&&(u!=null&&(Y.current=u),Nt(x),!e&&b?o(!0,x.nativeEvent,"list-navigation"):xe(x),e&&A(Y.current)))},onFocus(){e&&!m&&A(null)},onPointerDown:function(x){ve.current=v,v==="auto"&&ou(x.nativeEvent)&&(ve.current=!0)},onMouseDown:ge,onClick:ge}},[L,_e,xe,pe,v,i,d,A,o,e,b,k,h,u,B,m,E]);return M.useMemo(()=>l?{reference:Pe,floating:Ie,item:ke}:{},[l,Pe,Ie,ke])}const cm=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Tc(t,n){const[e,o]=t;let r=!1;const i=n.length;for(let a=0,c=i-1;a<i;c=a++){const[l,u]=n[a]||[0,0],[p,f]=n[c]||[0,0];u>=o!=f>=o&&e<=(p-l)*(o-u)/(f-u)+l&&(r=!r)}return r}function lm(t){t===void 0&&(t={});const{buffer:n=.5,blockPointerEvents:e=!1,requireIntent:o=!0}=t;let r,i=!1,a=null,c=null,l=performance.now();const u=p=>{let{x:f,y:d,placement:h,elements:m,onClose:v,nodeId:y,tree:b}=p;return function(S){function k(){clearTimeout(r),v()}if(clearTimeout(r),!m.domReference||!m.floating||h==null||f==null||d==null)return;const{clientX:C,clientY:j}=S,E=[C,j],P=bn(S),H=S.type==="mouseleave",z=vt(m.floating,P),q=vt(m.domReference,P),B=m.domReference.getBoundingClientRect(),A=m.floating.getBoundingClientRect(),fe=h.split("-")[0],ve=f>A.right-A.width/2,Y=d>A.bottom-A.height/2,de=function(V,D){return V[0]>=D.x&&V[0]<=D.x+D.width&&V[1]>=D.y&&V[1]<=D.y+D.height}(E,B),he=A.width>B.width,Oe=A.height>B.height,ce=(he?B:A).left,W=(he?B:A).right,Q=(Oe?B:A).top,me=(Oe?B:A).bottom;if(z&&(i=!0,!H))return;if(q&&(i=!1),q&&!H)return void(i=!0);if(H&&Ye(S.relatedTarget)&&vt(m.floating,S.relatedTarget)||b&&qn(b.nodesRef.current,y).some(V=>{let{context:D}=V;return D==null?void 0:D.open}))return;if(fe==="top"&&d>=B.bottom-1||fe==="bottom"&&d<=B.top+1||fe==="left"&&f>=B.right-1||fe==="right"&&f<=B.left+1)return k();let pe=[];switch(fe){case"top":pe=[[ce,B.top+1],[ce,A.bottom-1],[W,A.bottom-1],[W,B.top+1]];break;case"bottom":pe=[[ce,A.top+1],[ce,B.bottom-1],[W,B.bottom-1],[W,A.top+1]];break;case"left":pe=[[A.right-1,me],[A.right-1,Q],[B.left+1,Q],[B.left+1,me]];break;case"right":pe=[[B.right-1,me],[B.right-1,Q],[A.left+1,Q],[A.left+1,me]]}if(!Tc([C,j],pe)){if(i&&!de)return k();if(!H&&o){const V=function(D,T){const L=performance.now(),G=L-l;if(a===null||c===null||G===0)return a=D,c=T,l=L,null;const U=D-a,re=T-c,te=Math.sqrt(U*U+re*re);return a=D,c=T,l=L,te/G}(S.clientX,S.clientY);if(V!==null&&V<.1)return k()}Tc([C,j],function(V){let[D,T]=V;switch(fe){case"top":return[[he?D+n/2:ve?D+4*n:D-4*n,T+n+1],[he?D-n/2:ve?D+4*n:D-4*n,T+n+1],[A.left,ve||he?A.bottom-n:A.top],[A.right,ve?he?A.bottom-n:A.top:A.bottom-n]];case"bottom":return[[he?D+n/2:ve?D+4*n:D-4*n,T-n],[he?D-n/2:ve?D+4*n:D-4*n,T-n],[A.left,ve||he?A.top+n:A.bottom],[A.right,ve?he?A.top+n:A.bottom:A.top+n]];case"left":{const L=[D+n+1,Oe?T+n/2:Y?T+4*n:T-4*n],G=[D+n+1,Oe?T-n/2:Y?T+4*n:T-4*n];return[[Y||Oe?A.right-n:A.left,A.top],[Y?Oe?A.right-n:A.left:A.right-n,A.bottom],L,G]}case"right":return[[D-n,Oe?T+n/2:Y?T+4*n:T-4*n],[D-n,Oe?T-n/2:Y?T+4*n:T-4*n],[Y||Oe?A.left+n:A.right,A.top],[Y?Oe?A.left+n:A.right:A.left+n,A.bottom]]}}([f,d]))?!i&&o&&(r=window.setTimeout(k,40)):k()}}};return u.__options={blockPointerEvents:e},u}const Ia=g.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),Nu=g.forwardRef(({className:t,disabled:n,children:e,...o},r)=>{const i=g.useContext(Ia),a=Cu(),c=Sn(),l=a.index===i.activeIndex,u=K("io-dropdown-menu-item",n&&"io-dropdown-menu-item-disabled",t);return s.jsx("div",{ref:bu([a.ref,r]),role:"menuitem",className:u,tabIndex:l?0:-1,...o,...i.getItemProps({onClick(p){var f;(f=o.onClick)==null||f.call(o,p),i.setIsOpen(!1),c==null||c.events.emit("click")},onFocus(p){var f;(f=o.onFocus)==null||f.call(o,p),i.setHasFocusInside(!0)}}),children:e})});Nu.displayName="DropdownMenuItem";const Aa=g.forwardRef(({className:t,variant:n="default",icon:e,iconRight:o,text:r="",disabled:i,children:a,...c},l)=>{const[u,p]=g.useState(!1),[f,d]=g.useState(!1),[h,m]=g.useState(null),v=g.useRef([]),y=g.useRef([]),b=g.useContext(Ia),S=Sn(),k=function(D){const T=Oa(),L=Sn(),G=kn();return Je(()=>{const U={id:T,parentId:G};return L==null||L.addNode(U),()=>{L==null||L.removeNode(U)}},[L,T,G]),T}(),C=kn(),j=Cu(),E=C!=null,{floatingStyles:P,refs:H,context:z}=am({nodeId:k,open:u,onOpenChange:p,placement:E?"right-start":"bottom-start",middleware:[(q={mainAxis:E?0:4,alignmentAxis:E?-4:0},{...Fh(q),options:[q,B]}),$h(),zh()],whileElementsMounted:Rh});var q,B;const A=function(D,T){T===void 0&&(T={});const{open:L,onOpenChange:G,dataRef:U,events:re,elements:te}=D,{enabled:I=!0,delay:ke=0,handleClose:xe=null,mouseOnly:_e=!1,restMs:Ie=0,move:Pe=!0}=T,ge=Sn(),x=kn(),w=qt(xe),O=qt(ke),N=qt(L),R=M.useRef(),ne=M.useRef(-1),J=M.useRef(),$=M.useRef(-1),F=M.useRef(!0),Z=M.useRef(!1),le=M.useRef(()=>{}),ie=M.useRef(!1),oe=M.useCallback(()=>{var Ce;const ue=(Ce=U.current.openEvent)==null?void 0:Ce.type;return(ue==null?void 0:ue.includes("mouse"))&&ue!=="mousedown"},[U]);M.useEffect(()=>{if(I)return re.on("openchange",Ce),()=>{re.off("openchange",Ce)};function Ce(ue){let{open:be}=ue;be||(clearTimeout(ne.current),clearTimeout($.current),F.current=!0,ie.current=!1)}},[I,re]),M.useEffect(()=>{if(!I||!w.current||!L)return;function Ce(be){oe()&&G(!1,be,"hover")}const ue=kt(te.floating).documentElement;return ue.addEventListener("mouseleave",Ce),()=>{ue.removeEventListener("mouseleave",Ce)}},[te.floating,L,G,I,w,oe]);const ee=M.useCallback(function(Ce,ue,be){ue===void 0&&(ue=!0),be===void 0&&(be="hover");const Te=Zi(O.current,"close",R.current);Te&&!J.current?(clearTimeout(ne.current),ne.current=window.setTimeout(()=>G(!1,Ce,be),Te)):ue&&(clearTimeout(ne.current),G(!1,Ce,be))},[O,G]),ye=Pt(()=>{le.current(),J.current=void 0}),Ae=Pt(()=>{if(Z.current){const Ce=kt(te.floating).body;Ce.style.pointerEvents="",Ce.removeAttribute(gc),Z.current=!1}}),Ve=Pt(()=>!!U.current.openEvent&&["click","mousedown"].includes(U.current.openEvent.type));M.useEffect(()=>{if(I&&Ye(te.domReference)){var Ce;const Ne=te.domReference;return L&&Ne.addEventListener("mouseleave",Te),(Ce=te.floating)==null||Ce.addEventListener("mouseleave",Te),Pe&&Ne.addEventListener("mousemove",ue,{once:!0}),Ne.addEventListener("mouseenter",ue),Ne.addEventListener("mouseleave",be),()=>{var qe;L&&Ne.removeEventListener("mouseleave",Te),(qe=te.floating)==null||qe.removeEventListener("mouseleave",Te),Pe&&Ne.removeEventListener("mousemove",ue),Ne.removeEventListener("mouseenter",ue),Ne.removeEventListener("mouseleave",be)}}function ue(Ne){if(clearTimeout(ne.current),F.current=!1,_e&&!Yo(R.current)||Ie>0&&!Zi(O.current,"open"))return;const qe=Zi(O.current,"open",R.current);qe?ne.current=window.setTimeout(()=>{N.current||G(!0,Ne,"hover")},qe):L||G(!0,Ne,"hover")}function be(Ne){if(Ve())return;le.current();const qe=kt(te.floating);if(clearTimeout($.current),ie.current=!1,w.current&&U.current.floatingContext){L||clearTimeout(ne.current),J.current=w.current({...U.current.floatingContext,tree:ge,x:Ne.clientX,y:Ne.clientY,onClose(){Ae(),ye(),Ve()||ee(Ne,!0,"safe-polygon")}});const Kt=J.current;return qe.addEventListener("mousemove",Kt),void(le.current=()=>{qe.removeEventListener("mousemove",Kt)})}(R.current!=="touch"||!vt(te.floating,Ne.relatedTarget))&&ee(Ne)}function Te(Ne){Ve()||U.current.floatingContext&&(w.current==null||w.current({...U.current.floatingContext,tree:ge,x:Ne.clientX,y:Ne.clientY,onClose(){Ae(),ye(),Ve()||ee(Ne)}})(Ne))}},[te,I,D,_e,Ie,Pe,ee,ye,Ae,G,L,N,ge,O,w,U,Ve]),Je(()=>{var Ce;if(I&&L&&(Ce=w.current)!=null&&Ce.__options.blockPointerEvents&&oe()){Z.current=!0;const be=te.floating;if(Ye(te.domReference)&&be){var ue;const Te=kt(te.floating).body;Te.setAttribute(gc,"");const Ne=te.domReference,qe=ge==null||(ue=ge.nodesRef.current.find(Kt=>Kt.id===x))==null||(ue=ue.context)==null?void 0:ue.elements.floating;return qe&&(qe.style.pointerEvents=""),Te.style.pointerEvents="none",Ne.style.pointerEvents="auto",be.style.pointerEvents="auto",()=>{Te.style.pointerEvents="",Ne.style.pointerEvents="",be.style.pointerEvents=""}}}},[I,L,x,te,ge,w,oe]),Je(()=>{L||(R.current=void 0,ie.current=!1,ye(),Ae())},[L,ye,Ae]),M.useEffect(()=>()=>{ye(),clearTimeout(ne.current),clearTimeout($.current),Ae()},[I,te.domReference,ye,Ae]);const je=M.useMemo(()=>{function Ce(ue){R.current=ue.pointerType}return{onPointerDown:Ce,onPointerEnter:Ce,onMouseMove(ue){const{nativeEvent:be}=ue;function Te(){F.current||N.current||G(!0,be,"hover")}_e&&!Yo(R.current)||L||Ie===0||ie.current&&ue.movementX**2+ue.movementY**2<2||(clearTimeout($.current),R.current==="touch"?Te():(ie.current=!0,$.current=window.setTimeout(Te,Ie)))}}},[_e,G,L,N,Ie]),Se=M.useMemo(()=>({onMouseEnter(){clearTimeout(ne.current)},onMouseLeave(Ce){Ve()||ee(Ce.nativeEvent,!1)}}),[ee,Ve]);return M.useMemo(()=>I?{reference:je,floating:Se}:{},[I,je,Se])}(z,{enabled:E,delay:{open:75},handleClose:lm({blockPointerEvents:!0})}),fe=function(D,T){T===void 0&&(T={});const{open:L,onOpenChange:G,dataRef:U,elements:{domReference:re}}=D,{enabled:te=!0,event:I="click",toggle:ke=!0,ignoreMouse:xe=!1,keyboardHandlers:_e=!0,stickIfOpen:Ie=!0}=T,Pe=M.useRef(),ge=M.useRef(!1),x=M.useMemo(()=>({onPointerDown(w){Pe.current=w.pointerType},onMouseDown(w){const O=Pe.current;w.button===0&&I!=="click"&&(Yo(O,!0)&&xe||(!L||!ke||U.current.openEvent&&Ie&&U.current.openEvent.type!=="mousedown"?(w.preventDefault(),G(!0,w.nativeEvent,"click")):G(!1,w.nativeEvent,"click")))},onClick(w){const O=Pe.current;I==="mousedown"&&Pe.current?Pe.current=void 0:Yo(O,!0)&&xe||(!L||!ke||U.current.openEvent&&Ie&&U.current.openEvent.type!=="click"?G(!0,w.nativeEvent,"click"):G(!1,w.nativeEvent,"click"))},onKeyDown(w){Pe.current=void 0,w.defaultPrevented||!_e||Sc(w)||(w.key!==" "||Ec(re)||(w.preventDefault(),ge.current=!0),w.key==="Enter"&&G(!L||!ke,w.nativeEvent,"click"))},onKeyUp(w){w.defaultPrevented||!_e||Sc(w)||Ec(re)||w.key===" "&&ge.current&&(ge.current=!1,G(!L||!ke,w.nativeEvent,"click"))}}),[U,re,I,xe,_e,G,L,Ie,ke]);return M.useMemo(()=>te?{reference:x}:{},[te,x])}(z,{event:"mousedown",toggle:!E,ignoreMouse:E}),ve=function(D,T){var L;T===void 0&&(T={});const{open:G,floatingId:U}=D,{enabled:re=!0,role:te="dialog"}=T,I=(L=cm.get(te))!=null?L:te,ke=Oa(),xe=kn()!=null,_e=M.useMemo(()=>I==="tooltip"||te==="label"?{["aria-"+(te==="label"?"labelledby":"describedby")]:G?U:void 0}:{"aria-expanded":G?"true":"false","aria-haspopup":I==="alertdialog"?"dialog":I,"aria-controls":G?U:void 0,...I==="listbox"&&{role:"combobox"},...I==="menu"&&{id:ke},...I==="menu"&&xe&&{role:"menuitem"},...te==="select"&&{"aria-autocomplete":"none"},...te==="combobox"&&{"aria-autocomplete":"list"}},[I,U,xe,G,ke,te]),Ie=M.useMemo(()=>{const ge={id:U,...I&&{role:I}};return I==="tooltip"||te==="label"?ge:{...ge,...I==="menu"&&{"aria-labelledby":ke}}},[I,U,ke,te]),Pe=M.useCallback(ge=>{let{active:x,selected:w}=ge;const O={role:"option",...x&&{id:U+"-option"}};switch(te){case"select":return{...O,"aria-selected":x&&w};case"combobox":return{...O,...x&&{"aria-selected":!0}}}return{}},[U,te]);return M.useMemo(()=>re?{reference:_e,floating:Ie,item:Pe}:{},[re,_e,Ie,Pe])}(z,{role:"menu"}),Y=function(D,T){T===void 0&&(T={});const{open:L,onOpenChange:G,elements:U,dataRef:re}=D,{enabled:te=!0,escapeKey:I=!0,outsidePress:ke=!0,outsidePressEvent:xe="pointerdown",referencePress:_e=!1,referencePressEvent:Ie="pointerdown",ancestorScroll:Pe=!1,bubbles:ge,capture:x}=T,w=Sn(),O=Pt(typeof ke=="function"?ke:()=>!1),N=typeof ke=="function"?O:ke,R=M.useRef(!1),ne=M.useRef(!1),{escapeKey:J,outsidePress:$}=jc(ge),{escapeKey:F,outsidePress:Z}=jc(x),le=M.useRef(!1),ie=Pt(je=>{var Se;if(!L||!te||!I||je.key!=="Escape"||le.current)return;const Ce=(Se=re.current.floatingContext)==null?void 0:Se.nodeId,ue=w?qn(w.nodesRef.current,Ce):[];if(!J&&(je.stopPropagation(),ue.length>0)){let be=!0;if(ue.forEach(Te=>{var Ne;(Ne=Te.context)==null||!Ne.open||Te.context.dataRef.current.__escapeKeyBubbles||(be=!1)}),!be)return}G(!1,function(be){return"nativeEvent"in be}(je)?je.nativeEvent:je,"escape-key")}),oe=Pt(je=>{var Se;const Ce=()=>{var ue;ie(je),(ue=bn(je))==null||ue.removeEventListener("keydown",Ce)};(Se=bn(je))==null||Se.addEventListener("keydown",Ce)}),ee=Pt(je=>{var Se;const Ce=R.current;R.current=!1;const ue=ne.current;if(ne.current=!1,xe==="click"&&ue||Ce||typeof N=="function"&&!N(je))return;const be=bn(je),Te="["+ir("inert")+"]",Ne=kt(U.floating).querySelectorAll(Te);let qe=Ye(be)?be:null;for(;qe&&!En(qe);){const $t=dn(qe);if(En($t)||!Ye($t))break;qe=$t}if(Ne.length&&Ye(be)&&!be.matches("html,body")&&!vt(be,U.floating)&&Array.from(Ne).every($t=>!vt(qe,$t)))return;if(dt(be)&&Ve){const $t=be.clientWidth>0&&be.scrollWidth>be.clientWidth,vn=be.clientHeight>0&&be.scrollHeight>be.clientHeight;let _o=vn&&je.offsetX>be.clientWidth;if(vn&&Vt(be).direction==="rtl"&&(_o=je.offsetX<=be.offsetWidth-be.clientWidth),_o||$t&&je.offsetY>be.clientHeight)return}const Kt=(Se=re.current.floatingContext)==null?void 0:Se.nodeId,rc=w&&qn(w.nodesRef.current,Kt).some($t=>{var vn;return zi(je,(vn=$t.context)==null?void 0:vn.elements.floating)});if(zi(je,U.floating)||zi(je,U.domReference)||rc)return;const ic=w?qn(w.nodesRef.current,Kt):[];if(ic.length>0){let $t=!0;if(ic.forEach(vn=>{var _o;(_o=vn.context)==null||!_o.open||vn.context.dataRef.current.__outsidePressBubbles||($t=!1)}),!$t)return}G(!1,je,"outside-press")}),ye=Pt(je=>{var Se;const Ce=()=>{var ue;ee(je),(ue=bn(je))==null||ue.removeEventListener(xe,Ce)};(Se=bn(je))==null||Se.addEventListener(xe,Ce)});M.useEffect(()=>{if(!L||!te)return;re.current.__escapeKeyBubbles=J,re.current.__outsidePressBubbles=$;let je=-1;function Se(Ne){G(!1,Ne,"ancestor-scroll")}function Ce(){window.clearTimeout(je),le.current=!0}function ue(){je=window.setTimeout(()=>{le.current=!1},mi()?5:0)}const be=kt(U.floating);I&&(be.addEventListener("keydown",F?oe:ie,F),be.addEventListener("compositionstart",Ce),be.addEventListener("compositionend",ue)),N&&be.addEventListener(xe,Z?ye:ee,Z);let Te=[];return Pe&&(Ye(U.domReference)&&(Te=jn(U.domReference)),Ye(U.floating)&&(Te=Te.concat(jn(U.floating))),!Ye(U.reference)&&U.reference&&U.reference.contextElement&&(Te=Te.concat(jn(U.reference.contextElement)))),Te=Te.filter(Ne=>{var qe;return Ne!==((qe=be.defaultView)==null?void 0:qe.visualViewport)}),Te.forEach(Ne=>{Ne.addEventListener("scroll",Se,{passive:!0})}),()=>{I&&(be.removeEventListener("keydown",F?oe:ie,F),be.removeEventListener("compositionstart",Ce),be.removeEventListener("compositionend",ue)),N&&be.removeEventListener(xe,Z?ye:ee,Z),Te.forEach(Ne=>{Ne.removeEventListener("scroll",Se)}),window.clearTimeout(je)}},[re,U,I,N,xe,L,G,Pe,te,J,$,ie,F,oe,ee,Z,ye]),M.useEffect(()=>{R.current=!1},[N,xe]);const Ae=M.useMemo(()=>({onKeyDown:ie,[om[Ie]]:je=>{_e&&G(!1,je.nativeEvent,"reference-press")}}),[ie,G,_e,Ie]),Ve=M.useMemo(()=>({onKeyDown:ie,onMouseDown(){ne.current=!0},onMouseUp(){ne.current=!0},[rm[xe]]:()=>{R.current=!0}}),[ie,xe]);return M.useMemo(()=>te?{reference:Ae,floating:Ve}:{},[te,Ae,Ve])}(z,{bubbles:!0}),de=sm(z,{listRef:v,activeIndex:h,nested:E,onNavigate:m}),{getReferenceProps:he,getFloatingProps:Oe,getItemProps:ce}=function(D){D===void 0&&(D=[]);const T=D.map(I=>I==null?void 0:I.reference),L=D.map(I=>I==null?void 0:I.floating),G=D.map(I=>I==null?void 0:I.item),U=M.useCallback(I=>Ji(I,D,"reference"),T),re=M.useCallback(I=>Ji(I,D,"floating"),L),te=M.useCallback(I=>Ji(I,D,"item"),G);return M.useMemo(()=>({getReferenceProps:U,getFloatingProps:re,getItemProps:te}),[U,re,te])}([A,fe,ve,Y,de]);g.useEffect(()=>{if(S)return S.events.on("click",D),S.events.on("menuopen",T),()=>{S.events.off("click",D),S.events.off("menuopen",T)};function D(){p(!1)}function T(L){L.nodeId!==k&&L.parentId===C&&p(!1)}},[S,k,C]),g.useEffect(()=>{u&&S&&S.events.emit("menuopen",{parentId:C,nodeId:k})},[S,u,k,C]);const W={activeIndex:h,setActiveIndex:m,getItemProps:ce,setHasFocusInside:d,isOpen:u,setIsOpen:p},Q=g.useMemo(()=>W,[h,m,ce,d,u]),me=K("io-dropdown-menu-button",E&&"io-dropdown-menu-item",u&&!E&&"active",t),pe=bu([H.setReference,j.ref,l]),V=b.activeIndex===j.index?0:-1;return s.jsxs(qh,{id:k,children:[s.jsx(Ge,{className:me,ref:pe,variant:E?"link":n,tabIndex:E?V:void 0,role:E?"menuitem":void 0,"data-open":u?"":void 0,"data-nested":E?"":void 0,"data-focus-inside":f?"":void 0,text:r,icon:E?"chevron-right":e,iconSize:"10",iconRight:!!E||o,disabled:i,...he(b.getItemProps({onFocus(D){var T;(T=c.onFocus)==null||T.call(c,D),d(!1),b.setHasFocusInside(!0)},...c}))}),s.jsx(Ia.Provider,{value:Q,children:s.jsx(Zh,{elementsRef:v,labelsRef:y,children:u&&s.jsx(nm,{context:z,modal:!1,initialFocus:E?-1:0,returnFocus:!E,children:s.jsx("div",{ref:H.setFloating,className:"io-dropdown-menu",style:P,...Oe(),children:a})})})})]})});Aa.displayName="DropdownMenu";const Jt=g.forwardRef(({...t},n)=>kn()===null?s.jsx(Jh,{children:s.jsx(Aa,{ref:n,...t})}):s.jsx(Aa,{ref:n,...t}));function Iu({className:t,variant:n="default",size:e="16",src:o,alt:r,...i}){const a=K("io-image-icon",n==="grayscale"&&[`io-image-icon-${n}`],e&&[`io-image-icon-${e}`],t);return s.jsx("img",{className:a,style:{width:`${e}px`,filter:n==="grayscale"?"grayscale(100%)":"none"},src:o,alt:r,...i})}function um({className:t,size:n="large",variant:e="default",align:o="up",text:r,...i}){const a=K("io-loader",{[`io-loader-${e}`]:e!=="default"},n==="normal"&&"io-loader-md",n==="small"&&"io-loader-sm",o&&[`direction-${o}`],t);return s.jsxs("div",{className:a,...i,children:[s.jsx("div",{className:"io-loader-icon"}),r&&s.jsx("div",{className:"io-loader-text",children:r})]})}function Cn({className:t,children:n,...e}){const o=K("io-panel-header",t);return s.jsx(Ft,{className:o,...e,children:n})}Jt.displayName="DropdownMenu",Jt.Item=Nu,Jt.Separator=hr,Cn.Title=nn,Cn.ButtonGroup=Re,Cn.Button=Ge,Cn.ButtonIcon=Ue,Cn.Dropdown=ae;const So=g.forwardRef(({className:t,children:n,...e},o)=>{const r=K("io-panel-body",t);return s.jsx("div",{className:r,ref:o,...e,children:n})});function po({className:t,...n}){const e=K("io-panel-footer",t);return s.jsx(Vn,{className:e,...n})}function Ze({className:t,children:n,...e}){const o=K("io-panel",t);return s.jsx("div",{className:o,...e,children:n})}function Au({className:t,variant:n="default",children:e,...o}){const r=K("io-pill",n!=="default"&&[`io-pill-${n}`],t);return s.jsx("div",{className:r,...o,children:e})}function dm({className:t,variant:n="active",value:e=0,...o}){const r=K("io-progress",n,t);return s.jsx("div",{className:r,...o,children:s.jsx("div",{className:"io-progress-bar",style:{width:`${e<0?0:e>100?100:e}%`}})})}function wi({text:t="Label",...n}){return s.jsx("label",{...n,children:t})}So.displayName="PanelBody",po.ButtonGroup=Re,po.Button=Ge,po.ButtonIcon=Ue,po.Dropdown=ae,Ze.Header=Cn,Ze.Body=So,Ze.Footer=po,Au.Icon=et;const Qn=g.forwardRef(({id:t="input",className:n,type:e="text",name:o="input",align:r="up",label:i,iconPrepend:a,iconPrependOnClick:c,iconAppend:l,iconAppendOnClick:u,placeholder:p,disabled:f,readOnly:d,errorMessage:h,errorDataTestId:m,...v},y)=>{const b=K("io-control-input",a&&"io-control-leading-icon",l&&"io-control-trailing-icon",f&&"io-control-disabled",d&&"io-control-readonly",h&&"io-control-error",r&&[`direction-${r}`],n),S=g.useCallback(C=>{f?C.preventDefault():c&&c(C)},[c,f]),k=g.useCallback(C=>{f?C.preventDefault():u&&u(C)},[u,f]);return s.jsxs("div",{className:b,children:[i&&s.jsx(wi,{htmlFor:t,text:i}),a&&s.jsx(et,{variant:a,onClick:C=>S(C)}),s.jsx("input",{id:t,className:"io-input",ref:y,type:e,name:o,tabIndex:0,placeholder:p??(()=>{switch(e){case"email":return"Enter your email here...";case"number":return"Enter number here...";case"password":return"Enter your password here...";case"tel":return"Enter your phone number here...";case"file":return"Select a file...";default:return"Enter text here..."}})(),disabled:f,readOnly:d,...v}),l&&s.jsx(et,{variant:l,onClick:C=>k(C)}),h&&s.jsxs("div",{"data-testid":m,children:[s.jsx(et,{variant:"close"}),h]})]})});Qn.displayName="Input";const xi=g.forwardRef(({id:t="textarea",className:n,name:e="textarea",align:o="up",label:r,rows:i=4,placeholder:a="Enter text here...",disabled:c,readOnly:l,...u},p)=>{const f=K("io-control-textarea",c&&"io-control-disabled",l&&"io-control-readonly",o&&[`direction-${o}`],n);return s.jsxs("div",{className:f,children:[r&&s.jsx(wi,{htmlFor:t,text:r}),s.jsx("textarea",{id:t,className:"io-textarea",ref:p,name:e,tabIndex:0,placeholder:a,disabled:c,readOnly:l,rows:i,...u})]})});xi.displayName="Textarea";const Ci=g.forwardRef(({id:t="checkbox",className:n,name:e="checkbox",align:o="left",label:r,checked:i,disabled:a,...c},l)=>{const u=K("io-control-checkbox",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsxs("div",{className:u,children:[s.jsx("input",{type:"checkbox",id:t,className:"io-checkbox",ref:l,name:e,tabIndex:0,checked:i,disabled:a,...c}),r&&s.jsx(wi,{htmlFor:t,text:r})]})});Ci.displayName="Checkbox";const fm=g.forwardRef(({id:t="radio",className:n,name:e="radio",align:o="left",label:r,checked:i,disabled:a,...c},l)=>{const u=K("io-control-radio",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsxs("div",{className:u,children:[s.jsx("input",{type:"radio",id:t,className:"io-radio",ref:l,name:e,tabIndex:0,checked:i,disabled:a,...c}),r&&s.jsx(wi,{htmlFor:t,text:r})]})});fm.displayName="Radio";const ft=g.forwardRef(({id:t="toggle",className:n,name:e="toggle",align:o="left",label:r="Toggle",checked:i,disabled:a,...c},l)=>{const u=K("io-control-toggle",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsx("div",{className:u,children:s.jsxs("label",{className:"io-toggle",children:[s.jsx("input",{type:"checkbox",id:t,className:"io-checkbox",ref:l,name:e,checked:i,disabled:a,...c}),s.jsx("span",{className:"slider"}),r]})})});function pm(){const t=g.useContext(De.IOConnectContext),[n,e]=g.useState({}),o=g.useCallback(async a=>{var c;t&&await((c=t.prefs)==null?void 0:c.set(a))},[t]),r=g.useCallback(async a=>{var c;t&&await((c=t.prefs)==null?void 0:c.update(a))},[t]),i=g.useCallback(async()=>{var a;t&&await((a=t.prefs)==null?void 0:a.clear())},[t]);return g.useEffect(()=>{var c;if(!t)return;const a=(c=t.prefs)==null?void 0:c.subscribe(l=>{e(u=>u===null?l.data:{...u,...l.data})});return()=>{a==null||a()}},[t]),{appPrefs:n,setPrefs:o,updatePrefs:r,clearPrefs:i}}function Pu(t,n=500){const[e,o]=g.useState(t);return g.useEffect(()=>{const r=setTimeout(()=>{o(t)},n);return()=>clearTimeout(r)},[t,n]),e}function hm(t,n){g.useEffect(()=>{const e=o=>{o.code===t&&n()};return document.addEventListener("keyup",e),()=>document.removeEventListener("keyup",e)},[t,n])}ft.displayName="Toggle";const ki=()=>window.glue42gd!==void 0||window.iodesktop!==void 0;function Be(){return g.useMemo(()=>typeof window=="object"&&ki(),[])}g.createContext({theme:"dark"});const Dc="io-connect-platform",Hn="___platform_prefs___",Pa="_launchpad_isPinned",Tu="_launchpad_pinnedPosition",Du="_launchpad_allowDocking",Mu="_launchpad_minimizeToTray",_u="_launchpad_autoCloseStartingAppsAndWorkspaces",Lu="_launchpad_showTutorialOnStartup",Ru="_layouts_restoreLastSaved",Fu="_layouts_saveCurrentOnExit",Bu="_layouts_showUnsavedChangesPrompt",Hu="_layouts_showDeletePrompt",Wu="_downloads_askForEachDownload",mm={_launchpad_collapsedSections:[],_launchpad_favorites:[],_launchpad_isLayoutsPanelOpen:!1,_launchpad_isCollapsed:!1,[Pa]:!1,[Tu]:"Left",[Du]:!0,[Mu]:!1,[_u]:!0,[Lu]:!0,[Ru]:!0,[Fu]:!0,[Bu]:!0,[Hu]:!0,[Wu]:!0,_downloads_location:"",_system_scheduleRestart:!1,_system_scheduleRestartTime:"12:00 AM",_system_scheduleRestartFrequency:"daily",_system_scheduleRestartDay:"Monday",_system_scheduleShutdown:!1,_system_scheduleShutdownTime:"12:00 AM",_system_scheduleShutdownFrequency:"daily",_system_scheduleShutdownDay:"Monday"},Wn=t=>typeof t=="string"?t:t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):JSON.stringify(t),hs={SUCCESS:"success",WARNING:"warning"},gm={success:5e3,warning:1e4};var ht=function(t){return{ok:!0,result:t}},it=function(t){return{ok:!1,error:t}},Mc=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:ht(t(n.result,e.result))},Qi=function(t,n){return n.ok===!0?n:it(t(n.error))},Ta=function(){return Ta=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ta.apply(this,arguments)};function Da(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!Da(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!Da(t[o[e]],n[o[e]]))return!1;return!0}}var Zo=function(t){return Array.isArray(t)},jr=function(t){return typeof t=="object"&&t!==null&&!Zo(t)},an=function(t,n){return"expected "+t+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}}(n)},Fo=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Bo=function(t,n){var e=n.at,o=function(r,i){var a={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&i.indexOf(c)<0&&(a[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(c=Object.getOwnPropertySymbols(r);l<c.length;l++)i.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(r,c[l])&&(a[c[l]]=r[c[l]])}return a}(n,["at"]);return Ta({at:t+(e||"")},o)},ct=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return Qi(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return(r=e.run(o)).ok===!0?Promise.resolve(r.result):Promise.reject(r.error);var r},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(e.run(o))},this.map=function(o){return new t(function(r){return function(i,a){return a.ok===!0?ht(i(a.result)):a}(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?ht(n):it({message:an("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?ht(n):it({message:an("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?ht(n):it({message:an("a boolean",n)})})},t.constant=function(n){return new t(function(e){return Da(e,n)?ht(n):it({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(jr(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok!==!0)return e[r]===void 0?it({message:"the key '"+r+"' is required but was not present"}):it(Bo("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return ht(o)}return jr(e)?ht(e):it({message:an("an object",e)})})},t.array=function(n){return new t(function(e){return Zo(e)&&n?e.reduce(function(o,r,i){return Mc(function(a,c){return a.concat([c])},o,function(a,c){return Qi(function(l){return Bo("["+c+"]",l)},n.decode(a))}(r,i))},ht([])):Zo(e)?ht(e):it({message:an("an array",e)})})},t.tuple=function(n){return new t(function(e){if(Zo(e)){if(e.length!==n.length)return it({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(!i.ok)return it(Bo("["+r+"]",i.error));o[r]=i.result}return ht(o)}return it({message:an("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return Mc(Object.assign,a,c.decode(i))},ht({}))})},t.anyJson=function(){return new t(function(n){return ht(n)})},t.unknownJson=function(){return new t(function(n){return ht(n)})},t.dict=function(n){return new t(function(e){if(jr(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok!==!0)return it(Bo("."+r,i.error));o[r]=i.result}return ht(o)}return it({message:an("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?ht(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return it({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return ht(function(r,i){return i.ok===!0?i.result:r}(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return it({at:Fo(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!jr(r))return it({at:Fo(n.slice(0,i+1)),message:an("an object",r)});if(typeof n[i]=="number"&&!Zo(r))return it({at:Fo(n.slice(0,i+1)),message:an("an array",r)});r=r[n[i]]}return Qi(function(a){return r===void 0?{at:Fo(n),message:"path does not exist"}:Bo(Fo(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return ht(n)})},t.fail=function(n){return new t(function(e){return it({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),zu=ct.string;ct.number;var At=ct.boolean,$u=ct.anyJson;ct.unknownJson;var _=ct.constant,Uu=ct.object,Ma=ct.array;ct.tuple,ct.dict;var $e=ct.optional,Si=ct.oneOf;ct.union,ct.intersection,ct.withDefault,ct.valueAt,ct.succeed,ct.fail,ct.lazy;const _c=["name","title","version","customProperties","icon","caption","type"],vm=["appId","name","type","details","version","title","tooltip","lang","description","categories","icons","screenshots","contactEmail","moreInfo","publisher","customConfig","hostManifests","interop","localizedVersions"];var mt=function(t){return{ok:!0,result:t}},at=function(t){return{ok:!1,error:t}},Lc=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:mt(t(n.result,e.result))},ea=function(t,n){return n.ok===!0?n:at(t(n.error))},_a=function(){return _a=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},_a.apply(this,arguments)};function La(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!La(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!La(t[o[e]],n[o[e]]))return!1;return!0}}var Ko=function(t){return Array.isArray(t)},Or=function(t){return typeof t=="object"&&t!==null&&!Ko(t)},sn=function(t,n){return"expected "+t+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}}(n)},Ho=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Wo=function(t,n){var e=n.at,o=function(r,i){var a={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&i.indexOf(c)<0&&(a[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(c=Object.getOwnPropertySymbols(r);l<c.length;l++)i.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(r,c[l])&&(a[c[l]]=r[c[l]])}return a}(n,["at"]);return _a({at:t+(e||"")},o)},lt=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ea(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return(r=e.run(o)).ok===!0?Promise.resolve(r.result):Promise.reject(r.error);var r},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(e.run(o))},this.map=function(o){return new t(function(r){return function(i,a){return a.ok===!0?mt(i(a.result)):a}(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?mt(n):at({message:sn("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?mt(n):at({message:sn("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?mt(n):at({message:sn("a boolean",n)})})},t.constant=function(n){return new t(function(e){return La(e,n)?mt(n):at({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Or(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok!==!0)return e[r]===void 0?at({message:"the key '"+r+"' is required but was not present"}):at(Wo("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return mt(o)}return Or(e)?mt(e):at({message:sn("an object",e)})})},t.array=function(n){return new t(function(e){return Ko(e)&&n?e.reduce(function(o,r,i){return Lc(function(a,c){return a.concat([c])},o,function(a,c){return ea(function(l){return Wo("["+c+"]",l)},n.decode(a))}(r,i))},mt([])):Ko(e)?mt(e):at({message:sn("an array",e)})})},t.tuple=function(n){return new t(function(e){if(Ko(e)){if(e.length!==n.length)return at({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(!i.ok)return at(Wo("["+r+"]",i.error));o[r]=i.result}return mt(o)}return at({message:sn("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return Lc(Object.assign,a,c.decode(i))},mt({}))})},t.anyJson=function(){return new t(function(n){return mt(n)})},t.unknownJson=function(){return new t(function(n){return mt(n)})},t.dict=function(n){return new t(function(e){if(Or(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok!==!0)return at(Wo("."+r,i.error));o[r]=i.result}return mt(o)}return at({message:sn("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?mt(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return at({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return mt(function(r,i){return i.ok===!0?i.result:r}(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return at({at:Ho(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Or(r))return at({at:Ho(n.slice(0,i+1)),message:sn("an object",r)});if(typeof n[i]=="number"&&!Ko(r))return at({at:Ho(n.slice(0,i+1)),message:sn("an array",r)});r=r[n[i]]}return ea(function(a){return r===void 0?{at:Ho(n),message:"path does not exist"}:Wo(Ho(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return mt(n)})},t.fail=function(n){return new t(function(e){return at({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),ar=lt.string,Ra=lt.number,ym=lt.boolean,eo=lt.anyJson;lt.unknownJson;var zo=lt.constant,bt=lt.object,rt=lt.array;lt.tuple;var Fa=lt.dict,se=lt.optional,Vu=lt.oneOf;lt.union,lt.intersection,lt.withDefault,lt.valueAt,lt.succeed,lt.fail,lt.lazy;const we=ar().where(t=>t.length>0,"Expected a non-empty string"),Ba=Ra().where(t=>t>=0,"Expected a non-negative number"),Gu=bt({name:we,displayName:se(ar()),contexts:se(rt(ar())),customConfig:se(bt())}),bm=Vu(zo("web"),zo("native"),zo("citrix"),zo("onlineNative"),zo("other")),Yu=bt({url:we}),Zu=bt({src:we,size:se(we),type:se(we)}),Ku=bt({src:we,size:se(we),type:se(we),label:se(we)}),wm=bt({contexts:rt(we),displayName:se(we),resultType:se(we),customConfig:se(eo())}),xm=bt({listensFor:se(Fa(wm)),raises:se(Fa(rt(we)))}),Cm=bt({broadcasts:se(rt(we)),listensFor:se(rt(we))}),km=bt({name:we,description:se(we),broadcasts:se(rt(we)),listensFor:se(rt(we))}),qu=bt({intents:se(xm),userChannels:se(Cm),appChannels:se(rt(km))}),Sm=bt({url:se(we),top:se(Ra()),left:se(Ra()),width:se(Ba),height:se(Ba)}),Em=bt({name:se(we),type:se(we.where(t=>t==="window","Expected a value of window")),title:se(we),version:se(we),customProperties:se(eo()),icon:se(ar()),caption:se(ar()),details:se(Sm),intents:se(rt(Gu)),hidden:se(ym())}),Ju=bt({name:we,appId:we,title:se(we),version:se(we),manifest:we,manifestType:we,tooltip:se(we),description:se(we),contactEmail:se(we),supportEmail:se(we),publisher:se(we),images:se(rt(bt({url:se(we)}))),icons:se(rt(bt({icon:se(we)}))),customConfig:eo(),intents:se(rt(Gu))}),jm=bt({appId:se(we),name:se(we),details:se(Yu),version:se(we),title:se(we),tooltip:se(we),lang:se(we),description:se(we),categories:se(rt(we)),icons:se(rt(Zu)),screenshots:se(rt(Ku)),contactEmail:se(we),supportEmail:se(we),moreInfo:se(we),publisher:se(we),customConfig:se(rt(eo())),hostManifests:se(eo()),interop:se(qu)}),Xu=bt({appId:we,name:se(we),type:bm,details:Yu,version:se(we),title:se(we),tooltip:se(we),lang:se(we),description:se(we),categories:se(rt(we)),icons:se(rt(Zu)),screenshots:se(rt(Ku)),contactEmail:se(we),supportEmail:se(we),moreInfo:se(we),publisher:se(we),customConfig:se(rt(eo())),hostManifests:se(eo()),interop:se(qu),localizedVersions:se(Fa(jm))}),zr=Vu(Ju,Xu),Nr=t=>`${t.kind} at ${t.at}: ${JSON.stringify(t.input)}. Reason - ${t.message}`;class Om{constructor(){It(this,"fdc3ToDesktopDefinitionType",{web:"window",native:"exe",citrix:"citrix",onlineNative:"clickonce",other:"window"})}toApi(){return{isFdc3Definition:this.isFdc3Definition.bind(this),parseToBrowserBaseAppData:this.parseToBrowserBaseAppData.bind(this),parseToDesktopAppConfig:this.parseToDesktopAppConfig.bind(this)}}isFdc3Definition(n){const e=zr.run(n);return e.ok?n.appId&&n.details?{isFdc3:!0,version:"2.0"}:n.manifest?{isFdc3:!0,version:"1.2"}:{isFdc3:!1,reason:"The passed definition is not FDC3"}:{isFdc3:!1,reason:Nr(e.error)}}parseToBrowserBaseAppData(n){var p,f;const{isFdc3:e,version:o}=this.isFdc3Definition(n);if(!e)throw new Error("The passed definition is not FDC3");const r=zr.run(n);if(!r.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Nr(r.error)}`);const i=this.getUserPropertiesFromDefinition(n,o),a={url:this.getUrl(n,o)},c={name:n.appId,type:"window",createOptions:a,userProperties:{...i,intents:o==="1.2"?i.intents:this.getIntentsFromV2AppDefinition(n),details:a},title:n.title,version:n.version,icon:this.getIconFromDefinition(n,o),caption:n.description,fdc3:o==="2.0"?{...n,definitionVersion:"2.0"}:void 0},l=((p=n.hostManifests)==null?void 0:p.ioConnect)||((f=n.hostManifests)==null?void 0:f.Glue42);if(!l)return c;const u=Em.run(l);if(!u.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Nr(u.error)}`);return Object.keys(u.result).length?this.mergeBaseAppDataWithGlueManifest(c,u.result):c}parseToDesktopAppConfig(n){var l,u,p;const{isFdc3:e,version:o}=this.isFdc3Definition(n);if(!e)throw new Error("The passed definition is not FDC3");const r=zr.run(n);if(!r.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Nr(r.error)}`);if(o==="1.2"){const f=n;return{name:f.appId,type:"window",details:{url:this.getUrl(n,o)},version:f.version,title:f.title,tooltip:f.tooltip,caption:f.description,icon:(l=f.icons)==null?void 0:l[0].icon,intents:f.intents,customProperties:{manifestType:f.manifestType,images:f.images,contactEmail:f.contactEmail,supportEmail:f.supportEmail,publisher:f.publisher,icons:f.icons,customConfig:f.customConfig}}}const i=n,a={name:i.appId,type:this.fdc3ToDesktopDefinitionType[i.type],details:i.details,version:i.version,title:i.title,tooltip:i.tooltip,caption:i.description,icon:this.getIconFromDefinition(i,"2.0"),intents:this.getIntentsFromV2AppDefinition(i),fdc3:{...i,definitionVersion:"2.0"}},c=((u=n.hostManifests)==null?void 0:u.ioConnect)||((p=n.hostManifests)==null?void 0:p.Glue42);if(!c)return a;if(typeof c!="object"||Array.isArray(c))throw new Error(`Invalid '${n.hostManifests.ioConnect?"hostManifests.ioConnect":"hostManifests['Glue42']"}' key`);return this.mergeDesktopConfigWithGlueManifest(a,c)}getUserPropertiesFromDefinition(n,e){return Object.fromEntries(e==="1.2"?Object.entries(n).filter(([o])=>!_c.includes(o)):Object.entries(n).filter(([o])=>!_c.includes(o)&&!vm.includes(o)))}getUrl(n,e){var r,i;let o;if(e==="1.2"){const a=JSON.parse(n.manifest);o=((r=a.details)==null?void 0:r.url)||a.url}else o=(i=n.details)==null?void 0:i.url;if(!o||typeof o!="string")throw new Error(`Invalid FDC3 ${e} definition. Provide valid 'url' under '${e==="1.2"?"manifest":"details"}' key`);return o}getIntentsFromV2AppDefinition(n){var o,r;const e=(r=(o=n.interop)==null?void 0:o.intents)==null?void 0:r.listensFor;if(e)return Object.entries(e).map(i=>{const[a,c]=i;return{name:a,...c}})}getIconFromDefinition(n,e){var o,r,i,a;return e==="1.2"?((r=(o=n.icons)==null?void 0:o.find(c=>c.icon))==null?void 0:r.icon)||void 0:((a=(i=n.icons)==null?void 0:i.find(c=>c.src))==null?void 0:a.src)||void 0}mergeBaseAppDataWithGlueManifest(n,e){let o=n;if(e.customProperties&&(o.userProperties={...n.userProperties,...e.customProperties}),e.details){const r={...n.createOptions,...e.details};o.createOptions=r,o.userProperties.details=r}return Array.isArray(e.intents)&&(o.userProperties.intents=(o.userProperties.intents||[]).concat(e.intents)),o={...o,...e},delete o.details,delete o.intents,o}mergeDesktopConfigWithGlueManifest(n,e){const o=Object.assign({},n,e,{details:{...n.details,...e.details}});return Array.isArray(e.intents)&&(o.intents=(n.intents||[]).concat(e.intents)),o}}const Nm={common:{nonEmptyStringDecoder:we,nonNegativeNumberDecoder:Ba},fdc3:{allDefinitionsDecoder:zr,v1DefinitionDecoder:Ju,v2DefinitionDecoder:Xu}};var Ha;(function(t){t.USER_CANCELLED="User Closed Intents Resolver UI without choosing a handler",t.CALLER_NOT_DEFINED="Caller Id is not defined",t.TIMEOUT_HIT="Timeout hit",t.INTENT_NOT_FOUND="Cannot find Intent",t.HANDLER_NOT_FOUND="Cannot find Intent Handler",t.TARGET_INSTANCE_UNAVAILABLE="Cannot start Target Instance",t.INTENT_DELIVERY_FAILED="Target Instance did not add a listener",t.RESOLVER_UNAVAILABLE="Intents Resolver UI unavailable",t.RESOLVER_TIMEOUT="User did not choose a handler",t.INVALID_RESOLVER_RESPONSE="Intents Resolver UI returned invalid response",t.INTENT_HANDLER_REJECTION="Intent Handler function processing the raised intent threw an error or rejected the promise it returned"})(Ha||(Ha={}));const ms=new class{constructor(){It(this,"_fdc3");It(this,"_decoders",Nm);It(this,"_errors",{intents:Ha})}get fdc3(){return this._fdc3||(this._fdc3=new Om().toApi()),this._fdc3}get decoders(){return this._decoders}get errors(){return this._errors}};ms.fdc3;const Im=ms.decoders;ms.errors;const Gn=Im.common.nonEmptyStringDecoder,Am=Si(_("add"),_("align-bottom"),_("align-bottom-solid"),_("align-left"),_("align-left-bottom"),_("align-left-bottom-solid"),_("align-left-solid"),_("align-left-top"),_("align-left-top-solid"),_("align-right"),_("align-right-bottom"),_("align-right-bottom-solid"),_("align-right-solid"),_("align-right-top"),_("align-right-top-solid"),_("align-top"),_("align-top-solid"),_("always-on-top"),_("always-on-top-on"),_("application"),_("arrow-down-long"),_("arrow-down-to-bracket"),_("arrow-left-long"),_("arrow-right-from-bracket"),_("arrow-right-long"),_("arrow-right"),_("arrow-up"),_("arrow-up-long"),_("ban"),_("bell"),_("bell-solid"),_("bookmark"),_("bullseye-pointer"),_("certificate"),_("check"),_("check-light"),_("check-solid"),_("chevron-down"),_("chevron-left"),_("chevron-right"),_("chevron-up"),_("circle-info"),_("circle-xmark"),_("circle-xmark-full"),_("clock"),_("clock-rotate-left"),_("clone"),_("close"),_("cog"),_("cog-solid"),_("collapse"),_("copy"),_("download"),_("delete-left"),_("dev-tools"),_("ellipsis"),_("ellipsis-vertical"),_("expand"),_("envelope"),_("envelope-open"),_("exclamation-mark"),_("expand"),_("feedback"),_("filter"),_("floppy"),_("floppy-disk-pen"),_("folder"),_("folder-open"),_("globe"),_("group"),_("hidden"),_("home"),_("house"),_("info"),_("keyboard"),_("layout"),_("link"),_("list-ul"),_("lock"),_("logo"),_("minimize"),_("minimize-down"),_("paper-plane-top"),_("paperclip"),_("pause"),_("pen-line"),_("pen-to-square"),_("pin"),_("play"),_("pop-in"),_("pop-in-widget"),_("pop-out"),_("power-off"),_("publish"),_("refresh"),_("resize"),_("restore"),_("rotate-right"),_("search"),_("search-filled"),_("sliders"),_("snooze"),_("spinner"),_("square"),_("square-arrow-down"),_("square-arrow-up"),_("star"),_("star-full"),_("sticky-off"),_("sticky-off-hover"),_("sticky-on"),_("sticky-on-hover"),_("subscribe"),_("system-close"),_("system-maximize"),_("system-minimize"),_("thumbs-down"),_("thumbs-up"),_("trash"),_("trash-can"),_("triangle-exclamation"),_("unlock"),_("unpin"),_("up-to-line"),_("user"),_("user-gear"),_("visible"),_("workspace")),Pm=Uu({id:Gn,title:Gn,description:$e(zu()),icon:$e(Am),iconSrc:$e(Gn),contextMenuActions:$e(Ma($u())),type:Gn}),Tm=Si(_("Left"),_("Right")),Rc=Si(_("daily"),_("weekly")),Fc=Si(_("Sunday"),_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday")),$r=Uu({customPrefs:$e($u()),_launchpad_collapsedSections:$e(Ma(Gn)),_launchpad_favorites:$e(Ma(Pm)),_launchpad_isLayoutsPanelOpen:$e(At()),_launchpad_isCollapsed:$e(At()),_launchpad_isPinned:$e(At()),_launchpad_pinnedPosition:$e(Tm),_launchpad_allowDocking:$e(At()),_launchpad_minimizeToTray:$e(At()),_launchpad_autoCloseStartingAppsAndWorkspaces:$e(At()),_launchpad_showTutorialOnStartup:$e(At()),_layouts_restoreLastSaved:$e(At()),_layouts_saveCurrentOnExit:$e(At()),_layouts_showUnsavedChangesPrompt:$e(At()),_layouts_showDeletePrompt:$e(At()),_downloads_askForEachDownload:$e(At()),_downloads_location:$e(zu()),_system_scheduleRestart:$e(At()),_system_scheduleRestartTime:$e(Gn),_system_scheduleRestartFrequency:$e(Rc),_system_scheduleRestartDay:$e(Fc),_system_scheduleShutdown:$e(At()),_system_scheduleShutdownTime:$e(Gn),_system_scheduleShutdownFrequency:$e(Rc),_system_scheduleShutdownDay:$e(Fc)}),Qu=async t=>{const{io:n,variant:e,text:o,error:r}=t,i=Wn(r);try{if(e===hs.WARNING&&n.logger.warn(i?`${o} ${i}`:o),!("modals"in n)||!n.modals)throw new Error("Modals are not enabled.");const a={text:o,variant:e,ttl:gm[e]};await n.modals.alerts.request(a)}catch(a){console.warn("Failed to request alert. ",{error:a})}},gs=g.createContext(void 0),Ei=({children:t,launchpadMode:n})=>{const[e,o]=g.useState(),[r,i]=g.useState(!1),[a,c]=g.useState(),l=g.useContext(De.IOConnectContext),u=g.useMemo(()=>({prefs:e,isInitialSetupCompleted:r,initialSetupError:a}),[e,r,a]);return g.useEffect(()=>{if(!l)return;let p=!1;const f=l.contexts.subscribe(Hn,d=>{if(p)return;const h=$r.run(d);if(!h.ok)return void l.logger.warn(`The received data for context ${Hn} is with an invalid shape: ${Wn(h.error.message)}`);const m=h.result;o(m),l.prefs.updateFor(Dc,m).catch(v=>{l.logger.warn(`Failed to update platform prefs. Error: ${Wn(v)}`)})});return()=>{p=!0,f.then(d=>{d()})}},[l]),g.useEffect(()=>{l&&(async()=>{var p;try{const f=await l.contexts.get(Hn),d=$r.run(f);if(!d.ok)throw new Error(`The data in context ${Hn} is with an invalid shape: ${Wn(d.error.message)}`);const h=d.result;if(Object.keys(h).length>0)return;const m=((p=await l.prefs.get(Dc))==null?void 0:p.data)??{},v=$r.run(m);if(!v.ok)throw new Error(`The stored platform prefs in io.prefs are with an invalid shape: ${Wn(v.error.message)}`);const y={[Pa]:n==="pinned"||(m[Pa]??!1)},b={...mm,...v.result,...y};await l.contexts.set(Hn,b)}catch(f){c({message:Wn(f)}),await Qu({io:l,variant:hs.WARNING,text:"Initial platform prefs setup failed.",error:f})}finally{i(!0)}})().catch(console.error)},[l,n]),s.jsx(gs.Provider,{value:u,children:t})};function ed(){const t=g.useContext(gs);if(t===void 0)throw new Error("usePlatformPrefs must be used within a PlatformPrefsProvider");return t}function Ht({prefKey:t}){var f;const n=g.useContext(De.IOConnectContext),e=g.useContext(gs),o=(f=e==null?void 0:e.prefs)==null?void 0:f[t],r=(e==null?void 0:e.isInitialSetupCompleted)??!1,[i,a]=g.useState(!r),[c,l]=g.useState(),u=g.useRef(0);g.useEffect(()=>{r&&u.current===0&&a(!1)},[r]);const p=g.useCallback(async d=>{if(!n)return;const h=++u.current;a(!0),l(void 0);const m=async y=>{y&&await Qu({io:n,variant:hs.WARNING,text:`Failed to update prefKey "${t}".`,error:y}),h===u.current&&(a(!1),y&&l({message:Wn(y)}))};let v;if(d instanceof Function)try{v=d((await n.contexts.get(Hn))[t])}catch(y){return m(y)}else v=d;try{const y=$r.runWithException({[t]:v});await n.contexts.update(Hn,y)}catch(y){return m(y)}await m()},[n,t]);if(e===void 0)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return{error:c,isLoading:i,update:p,value:o}}const Ir={dark:"var(--io-neutrals-0)",light:"var(--io-neutrals-900)"};function td(t){var r;let n,e,o;if(t.startsWith("#")){let i=t.slice(1);i.length===3&&(i=i.split("").map(a=>a+a).join("")),n=parseInt(i.substring(0,2),16),e=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16)}else{if(!t.startsWith("rgb")){const i=document.createElement("canvas").getContext("2d");return i?(i.fillStyle=t,td(i.fillStyle)):Ir.light}{const i=(r=t.match(/\d+/g))==null?void 0:r.map(Number);if(!i||i.length<3)return Ir.light;[n,e,o]=i}}return(.2126*n+.7152*e+.0722*o)/255>.5?Ir.light:Ir.dark}function Dm({className:t,channel:n,...e}){const o=K("io-channel-badge",t),r=g.useMemo(()=>td(n.color),[n.color]);return s.jsx("div",{className:o,style:{color:r,backgroundColor:n.color},...e,children:s.jsx("span",{className:"io-channel-badge-label",children:n.label})})}function Mm(){return s.jsx(et,{variant:"check"})}function _m({channel:t,handleChannelRestricted:n,lockedChannelRestriction:e}){return s.jsxs(s.Fragment,{children:[s.jsx("div",{children:t.isSelected&&s.jsx("span",{children:"Active"})}),s.jsx("div",{role:"button",onClick:o=>o.stopPropagation(),onKeyDown:o=>{o.key!=="Enter"&&o.key!==" "||o.stopPropagation()},tabIndex:0,children:s.jsx(ft,{label:"Publish",checked:t.write,onChange:()=>{n({...t,write:!t.write})},disabled:!t.isSelected||(e==null?void 0:e.write)})}),s.jsx("div",{role:"button",onClick:o=>o.stopPropagation(),onKeyDown:o=>{o.key!=="Enter"&&o.key!==" "||o.stopPropagation()},tabIndex:0,children:s.jsx(ft,{label:"Subscribe",checked:t.read,onChange:()=>{n({...t,read:!t.read})},disabled:!t.isSelected||(e==null?void 0:e.read)})})]})}const nd=g.createContext({});function Lm({channel:t,isSelected:n,onChannelSelect:e,onChannelRestrict:o,...r}){const{variant:i,selectedChannels:a,lockedChannelRestrictions:c}=g.useContext(nd),l=n||t.isSelected||(a==null?void 0:a.includes(t)),u=c==null?void 0:c.find(d=>d.name===t.name),p=g.useCallback(()=>e==null?void 0:e({...t,isSelected:!l}),[t,e,l]),f=g.useCallback(d=>{o==null||o(d)},[o]);return s.jsx(pi,{prepend:s.jsx(Dm,{channel:t}),append:i==="single"||i==="multi"?l&&s.jsx(Mm,{}):s.jsx(_m,{channel:t,handleChannelRestricted:f,lockedChannelRestriction:u}),isSelected:l,onClick:p,...r,children:t.name},t.name)}const Rm=g.forwardRef(({className:t,variant:n="single",variantToggle:e=!1,channels:o=[],lockedChannelRestrictions:r=[],onVariantChange:i,onChannelSelect:a,onChannelRestrict:c,...l},u)=>{const p=K("io-list-channels",(n==="directionalSingle"||n==="directionalMulti")&&"io-list-channels-directional",t),f=g.useMemo(()=>({variant:n,selectedChannels:o.filter(d=>d.isSelected),lockedChannelRestrictions:r,onVariantChange:i,onChannelSelect:a,onChannelRestrict:c}),[o,n,r,i,a,c]);return s.jsx(nd.Provider,{value:f,children:s.jsx("div",{className:p,ref:u,children:s.jsxs(ut,{...l,children:[s.jsx(ut.ItemTitle,{append:e&&s.jsx(ft,{label:"Directional",align:"right",onChange:d=>i&&i(d.target.checked),checked:n==="directionalSingle"||n==="directionalMulti"}),children:{single:"Select Channel",directionalSingle:"Select Directional Channel",multi:"Select Channels",directionalMulti:"Select Directional Channels"}[n]}),o==null?void 0:o.map(d=>s.jsx(Lm,{channel:d,isSelected:d.isSelected,onChannelSelect:a,onChannelRestrict:c},d.name))]})})})});Rm.displayName="ChannelSelector";g.createContext({config:{message:""},theme:"dark",setResult:()=>{}});function Fm({title:t="Downloads"}){const{ItemSearch:n,HeaderButtons:e}=ji();return s.jsxs("div",{className:"io-dm-header",children:[s.jsxs(Ft,{children:[s.jsx(Ft.Title,{tag:"h1",text:t,size:"large"}),s.jsx(e,{})]}),s.jsx(n,{})]})}const Bm=g.createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),Pn=()=>g.useContext(Bm);function Hm({className:t,icon:n="search",placeholder:e="Search",...o}){const r=K("io-header-search",t),i=g.useRef(null),{searchQuery:a,setSearch:c,itemsCount:l}=Pn();return s.jsxs("div",{className:r,children:[s.jsx(Qn,{ref:i,value:a,iconPrepend:n,placeholder:e,onChange:u=>c(u.target.value),...o}),a.length>0&&s.jsx("p",{className:"io-header-search-count",children:`${l} results`})]})}function Wm({className:t,...n}){const{SettingsButton:e,MoreButton:o}=ji();return s.jsxs(Re,{className:t,align:"right",...n,children:[s.jsx(e,{}),s.jsx(o,{})]})}function zm({icon:t="cog",...n}){const{showSettings:e}=Pn();return s.jsx(Ue,{icon:t,variant:"circle",size:"32",onClick:e,...n})}function $m({icon:t="ellipsis",...n}){const{items:e,clearItems:o}=Pn(),r=e.length===0;return s.jsxs(ae,{variant:"light",...n,children:[s.jsx(ae.ButtonIcon,{icon:t,variant:"circle",size:"32"}),s.jsx(ae.Content,{children:s.jsx(ae.List,{children:s.jsx(ae.Item,{disabled:r,onClick:i=>(a=>{r?a.stopPropagation():o()})(i),children:"Clear All"})})})]})}function ao(t,n=!1,e=!1,o=!1){const r=t.getDate(),i=["January","February","March","April","May","June","July","August","September","October","November","December"][t.getMonth()],a=t.getFullYear(),c=t.getHours(),l=t.getMinutes();let u="";return u=l<10?`0${l}`:`${l}`,n?n==="Today"?e?"Today":`Today at ${c}:${u}`:n==="Yesterday"?e?"Yesterday":`Yesterday at ${c}:${u}`:`${c}:${u}`:o?e?`${i} ${r}`:`${i} ${r} at ${c}:${u}`:e?`${i} ${r}, ${a}`:`${i} ${r}, ${a} at ${c}:${u}`}function od(t,n={showTime:!0}){const e=new Date(1e3*t),o=new Date,r=Math.round((o-e)/1e3),i=Math.round(r/60),a=o.toDateString()===e.toDateString(),c=new Date(o.setDate(o.getDate()-1)).toDateString()===e.toDateString(),l=o.getFullYear()===e.getFullYear();return n.showTime?r<5?"Just Now":r<60?`${r} seconds ago`:r<90?"about a minute ago":i<60?`${i} minutes ago`:a?ao(e,"Today",!1,!0):c?ao(e,"Yesterday",!1,!0):l?ao(e,!1,!1,!0):ao(e):a?"Today":c?"Yesterday":l?ao(e,!1,!0,!0):ao(e,!1,!0)}function Um({className:t,...n}){const e=K("io-dm-body",t),{DownloadListEmpty:o,ItemGroup:r,Item:i}=ji(),{items:a,searchQuery:c,setCount:l,sortItems:u}=Pn(),p=u(a),f=Pu(c),d=g.useMemo(()=>p.filter(v=>v.displayInfo.filename.toLowerCase().includes(f.toLowerCase())||v.displayInfo.url.toLowerCase().includes(f.toLowerCase())),[p,f]),h=g.useMemo(()=>d.map(v=>({...v,displayInfo:{...v.displayInfo,startTime:od(v.displayInfo.startTime,{showTime:!1})}})),[d]),m=g.useMemo(()=>Object.values(h.reduce((v={},y)=>{var b;return v[y.displayInfo.startTime]=((b=v[y.displayInfo.startTime])==null?void 0:b.concat([]))??[],v[y.displayInfo.startTime].push(y),v},{})),[h]);return g.useEffect(()=>{l(d.length)},[d,l]),s.jsx("div",{className:e,...n,children:m&&m.length!==0?m.map(v=>s.jsx(r,{title:String(v[0].displayInfo.startTime)??null,children:v.map(y=>s.jsx(i,{item:y},y.id))},v[0].id??"")):s.jsx(o,{})})}function Vm({className:t,icon:n="download",text:e="No downloads to display.",...o}){const r=K("io-dm-no-items",t);return s.jsxs("div",{className:r,...o,children:[s.jsx(et,{variant:n}),s.jsx("p",{children:e})]})}function Gm({className:t,title:n,children:e,...o}){const r=K("io-dm-item-group",t);return s.jsxs("div",{className:r,...o,children:[n&&s.jsx("p",{children:n}),e]})}function Ym({className:t,item:n,...e}){const{ItemHeader:o,ItemBody:r,ItemFooter:i}=ji(),{state:a,url:c,filename:l,receivedBytes:u,totalBytes:p,speed:f,timeRemaining:d}=n.displayInfo;if(!n)return s.jsx(s.Fragment,{});const h=K("io-dm-item",n.displayInfo.state&&[a],t);return s.jsxs("div",{className:h,...e,children:[s.jsx(o,{itemID:n.id,filename:l,state:a}),s.jsx(r,{state:a,url:c,bytesReceived:u,bytesTotal:p,speed:f,timeRemaining:d}),s.jsx(i,{itemID:n.id,state:a})]})}function rd({bytesReceived:t=0,bytesTotal:n=0,...e}){const o=g.useCallback(()=>t&&n?Math.round(t/n*100):0,[t,n]);return s.jsx(dm,{value:o(),...e})}function Zm({className:t,itemID:n,filename:e,state:o,cancel:r,remove:i,...a}){const c=K("io-dm-item-header",t),{cancelItem:l,removeItem:u}=Pn(),p=g.useCallback(d=>{r?r(d):l(d)},[r,l]),f=g.useCallback(d=>{i?i(d):u(d)},[i,u]);return s.jsxs("div",{className:c,...a,children:[s.jsx(nn,{text:e,style:{textDecoration:o==="interrupted"||o==="cancelled"?"line-through":"none"}}),s.jsx(Ue,{icon:"close",onClick:()=>{o==="progressing"||o==="paused"?p(n):f(n)}})]})}function Km({className:t,state:n,url:e,bytesReceived:o=0,bytesTotal:r=0,speed:i=0,timeRemaining:a=0,...c}){const l=K("io-dm-item-body",t),u=d=>{const h=["Bytes","KB","MB","GB","TB"];if(d===0)return"0";const m=Math.floor(Math.log(d)/Math.log(1024));return m===0?`${d}${h[m]}`:`${(d/1024**m).toFixed(1)}${h[m]}`};return s.jsxs("div",{className:l,...c,children:[s.jsx("p",{className:"io-text-small",children:e}),(f=n,f==="cancelled"||f==="interrupted"||f==="completed"?null:s.jsx(rd,{variant:f==="paused"?"paused":"active",bytesReceived:o,bytesTotal:r})),s.jsx("p",{className:"io-text-default-lh16",children:n==="completed"?`${u(o??0)} - Done`:n==="cancelled"||n==="interrupted"?`${u(o??0)}/${u(r??0)} - Failed`:`${u(o??0)}/${u(r??0)} (${p=i,(p?`${(p/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(d=>{const h=Math.floor(d/3600),m=Math.floor(d%3600/60);let v="";return h>0&&(v+=`${h} hour${h>1?"s":""}, `),m>0&&(v+=`${m} min${m>1?"s":""}, `),((d=Math.floor(d%60))>0||v==="")&&(v+=`${d} sec${d!==1?"s":""}`),`${v.trim()} left`})(a)??0}`})]});var p,f}const qm={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function ta({className:t,variant:n,text:e}){const o=K("io-dm-item-status",`io-dm-item-status-${n}`,t);return s.jsxs("div",{className:o,children:[n&&s.jsx(et,{variant:qm[n],className:"icon-severity"}),e&&s.jsx("p",{className:"io-text-smaller",children:e})]})}function Jm({className:t,itemID:n,state:e,pauseResume:o,showInFolder:r,cancel:i,...a}){const c=K("io-dm-item-footer",t),{pauseResumeItem:l,showItemInFolder:u,cancelItem:p}=Pn(),f=g.useCallback(m=>{o?o(m):l(m)},[o,l]),d=g.useCallback(m=>{r?r(m):u(m)},[r,u]),h=g.useCallback(m=>{i?i(m):p(m)},[i,p]);return s.jsx("div",{className:c,...a,children:(()=>{switch(e){case"progressing":return s.jsxs(Re,{align:"right",children:[s.jsx(Re.Button,{variant:"primary",text:"Pause",onClick:()=>f(n)}),s.jsx(Re.Button,{variant:"link",text:"Cancel",onClick:()=>h(n)})]});case"paused":return s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Resume",onClick:()=>f(n)})});case"completed":return s.jsxs(s.Fragment,{children:[s.jsx(ta,{variant:"success",text:"Complete"}),s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Show in Folder",onClick:()=>d(n)})})]});case"cancelled":return s.jsx(s.Fragment,{children:s.jsx(ta,{variant:"warning",text:"Cancelled"})});case"interrupted":return s.jsxs(s.Fragment,{children:[s.jsx(ta,{variant:"critical",text:"Failed"}),s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Retry",onClick:()=>f(n)})})]});default:return null}})()})}function Xm({className:t,title:n="Settings",...e}){const o=K("io-dm-settings-panel",t),{configuration:{downloadFolder:r},hideSettings:i,setDownloadLocation:a,setDownloadLocationWithDialog:c,isDownloadLocationDialogVisible:l,downloadLocationList:u}=Pn();return s.jsxs(Ze,{className:o,...e,children:[s.jsxs(Ze.Header,{children:[s.jsx(Ze.Header.Title,{size:"large",text:n,tag:"h1"}),s.jsx(Ze.Header.ButtonGroup,{children:s.jsx(Ue,{variant:"circle",icon:"close",size:"32",onClick:()=>{i()},disabled:l})})]}),s.jsx(Ze.Body,{children:s.jsxs(Re,{children:[s.jsxs(ae,{variant:"light",disabled:l,children:[s.jsx(ae.Button,{children:s.jsx("span",{className:"io-dm-settings-panel-download-location",children:r??u[0]})}),u.length>1&&s.jsx(ae.Content,{children:s.jsx(ae.List,{children:u.map((p,f)=>!p||f===0||f>3?null:s.jsx(ae.Item,{onClick:()=>{a(p)},children:p},p))})})]}),s.jsx(Ge,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{c()},disabled:l})]})})]})}const id={Header:Fm,ItemSearch:Hm,HeaderButtons:Wm,SettingsButton:zm,MoreButton:$m,Body:Um,DownloadListEmpty:Vm,ItemGroup:Gm,Item:Ym,ItemProgress:rd,ItemHeader:Zm,ItemBody:Km,ItemFooter:Jm,Settings:Xm},ad=g.createContext(id),Qm=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...id,...n}),[n]);return s.jsx(ad.Provider,{value:e,children:t})});Qm.displayName="ComponentsStore";const ji=()=>g.useContext(ad);function Wa(t){if(t&&t.errorHandling&&typeof t.errorHandling!="function"&&t.errorHandling!=="log"&&t.errorHandling!=="silent"&&t.errorHandling!=="throw")throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof t.errorHandling+" was passed");var n=t&&typeof t.errorHandling=="function"&&t.errorHandling,e={};function o(r,i){var a=r instanceof Error?r:new Error(r);if(n)n(a);else{var c='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+a.stack;if(t)switch(t.errorHandling){case"log":return console.error(c);case"silent":return;case"throw":throw new Error(c)}console.error(c)}}return{add:function(r,i,a){var c=e[r];return c||(c=[],e[r]=c),c.push(i),a&&setTimeout(function(){a.forEach(function(l){var u;if(!((u=e[r])===null||u===void 0)&&u.includes(i))try{Array.isArray(l)?i.apply(void 0,l):i.apply(void 0,[l])}catch(p){o(p,r)}})},0),function(){var l=e[r];l&&(l=l.reduce(function(u,p,f){return p===i&&u.length===f||u.push(p),u},[]),l.length===0?delete e[r]:e[r]=l)}},execute:function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var c=e[r];if(!c||c.length===0)return[];var l=[];return c.forEach(function(u){try{var p=u.apply(void 0,i);l.push(p)}catch(f){l.push(void 0),o(f,r)}}),l},clear:function(){e={}},clearKey:function(r){e[r]&&delete e[r]}}}Wa.default=Wa;var eg=Rl(Wa);const tg=g.createContext({config:{env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},onThemeChanged:t=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:t=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),Xt=()=>g.useContext(tg);function ng({...t}){const{config:n,close:e}=Xt(),{applicationTitle:o}=n;return s.jsxs(Ft,{draggable:!0,...t,children:[s.jsx(Ft.Title,{tag:"h1",text:o?`Feedback Form - ${o}`:"Feedback Form",size:"large"}),s.jsx(Ft.ButtonGroup,{className:"non-draggable",children:s.jsx(Ft.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>e()})})]})}function og({className:t,handleSubmit:n,...e}){const o=K("io-panel-body",t),{config:r,submitFeedback:i}=Xt(),{IntroField:a,DescriptionField:c,TechInfoField:l,EnvInfoField:u,FileAttachmentsField:p,CategoryAttachmentsField:f,SettingsField:d,MailListField:h}=Oi(),m=n??i,v=`Your feedback will be submitted to the ${r.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return s.jsxs("form",{className:o,id:"feedback",onSubmit:y=>m(y),...e,children:[s.jsx(a,{children:s.jsx("p",{children:v})}),s.jsx(d,{}),s.jsx(h,{}),s.jsx(c,{}),s.jsx(l,{readOnly:!0}),s.jsx(u,{readOnly:!0}),r.attachmentsViewMode==="file"?s.jsx(p,{}):s.jsx(f,{})]})}function rg({...t}){const{FooterButtons:n}=Oi(),{openUrl:e,submitInProgress:o,submitStatus:r,jiraTicketURL:i}=Xt();return s.jsx(Vn,{...t,children:s.jsxs("div",o?{className:"flex ai-center jc-between",children:[s.jsx(Ke,{children:s.jsx("p",{children:r.title})}),s.jsx(um,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[s.jsxs(Ke,{children:[s.jsx("p",{className:r.type==="error"?"io-text-error":"",children:r.title}),i&&s.jsx("a",{href:i,onClick:a=>{a.preventDefault(),e(i)},children:i})]}),s.jsx(n,{})]})})}function ig({className:t,...n}){const{CloseButton:e}=Oi(),{close:o}=Xt();return s.jsx(Re,{className:t,...n,children:s.jsx(e,{onClick:()=>o()})})}function ag({className:t,...n}){const{SubmitButton:e,CancelButton:o,CloseButton:r}=Oi(),{close:i,submitCompleted:a}=Xt();return a?s.jsx(Re,{className:t,...n,children:s.jsx(r,{text:"Close",onClick:()=>i()})}):s.jsxs(Re,{className:t,...n,children:[s.jsx(e,{}),s.jsx(o,{onClick:()=>i()})]})}function sg({text:t="Submit",...n}){return s.jsx(Ge,{form:"feedback",type:"submit",variant:"primary",text:t,...n})}function cg({text:t="Cancel",...n}){return s.jsx(Ge,{variant:"link",text:t,...n})}function lg({...t}){return s.jsx(Ge,{variant:"primary",...t})}function ug({showField:t=!0,className:n,title:e,hint:o,children:r,...i}){return t?s.jsx(Ke,{className:n,title:e,hint:o,...i,children:r}):null}function dg({showField:t=!0,className:n,title:e="Description",hint:o,readOnly:r=!1,disabled:i,...a}){return t?s.jsx(Ke,{className:n,hint:o,title:"",...a,children:s.jsx(xi,{id:"description",name:"description",label:e,readOnly:r,disabled:i})}):null}function fg({showField:t,className:n,title:e="Technical Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...c}){const{config:l}=Xt(),u=t??l.errorMessage,p=r??l.errorMessage;return u&&p?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(xi,{id:"errorMessage",name:"errorMessage",label:e,value:p,readOnly:i,disabled:a})}):null}function pg({showField:t,className:n,title:e="Environment Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...c}){const{config:l}=Xt(),u=t??l.showEnvironmentInfo,p=r??l.environmentInfo;return u&&p?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(xi,{id:"environmentInfo",name:"environmentInfo",label:e,value:p,readOnly:i,disabled:a})}):null}function hg({showField:t=!0,className:n,title:e="Attachments",hint:o,readOnly:r=!1,disabled:i,attachments:a,selectedCategories:c,...l}){const u=K("io-block-list-gap",n),{config:p}=Xt(),f=a??p.attachments,d=c??p.selectedCategories,h=g.useCallback(m=>!!d&&d.indexOf(m)!==-1,[d]);return t?!f||f.length<=0?s.jsx(Ke,{title:"Attachments",children:s.jsx("p",{children:"No Attachments"})}):s.jsx(Ke,{className:u,title:e,hint:o,...l,children:s.jsx("div",{className:"file-attachments",children:f.map(m=>s.jsx(Ci,{id:m.id,name:m.id,label:m.name,readOnly:r,disabled:i,defaultChecked:h(m.category)},m.id))})}):null}function mg({showField:t=!0,className:n,title:e="Attachments",hint:o,readOnly:r=!1,disabled:i,categories:a,selectedCategories:c,...l}){const{config:u,attachmentCategories:p}=Xt(),f=a??p,d=c??u.selectedCategories,h=g.useCallback(m=>!!d&&d.indexOf(m)!==-1,[d]);return t?!f||f.length<=0?s.jsx("p",{children:"No Attachments"}):s.jsx(Ke,{className:n,title:e,hint:o,...l,children:s.jsx("div",{className:"category-attachments",children:f.map(m=>s.jsx(ft,{id:m,name:m,align:"right",label:m,readOnly:r,disabled:i,defaultChecked:h(m)},m))})}):null}function gg({className:t,title:n,hint:e,showField:o=!0,showJiraTicketField:r,jiraTicketLabel:i="Create Jira Ticket",showSendEmailField:a,sendEmailLabel:c="Send Email",readOnly:l=!1,disabled:u,...p}){const f=K("io-block-list-gap",t),{config:d,showMailingList:h,setShowMailingList:m}=Xt();if(!o)return null;const v=r??d.createJiraTicket,y=a??d.sendEmail;return s.jsxs(Ke,{className:f,hint:e,title:n,...p,children:[v&&s.jsx(ft,{id:"createJiraTicket",name:"createJiraTicket",label:i,align:"right",readOnly:l,disabled:u,defaultChecked:v}),y&&s.jsx(ft,{onChange:()=>{m(!h)},id:"sendEmail",name:"sendEmail",label:c,align:"right",readOnly:l,disabled:u,defaultChecked:y})]})}function vg({showField:t=!0,className:n,title:e="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:i,disabled:a,...c}){const{config:l,showMailingList:u}=Xt(),p=t??l.sendEmail,f=i??l.allowEditRecipients===!1;return p&&u?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(Qn,{id:"mailingList",name:"mailingList",label:e,placeholder:r,readOnly:f,disabled:a,defaultValue:l.mailingList??""})}):null}const sd={Header:ng,Body:og,Footer:rg,HeaderButtons:ig,FooterButtons:ag,SubmitButton:sg,CancelButton:cg,CloseButton:lg,IntroField:ug,DescriptionField:dg,TechInfoField:fg,EnvInfoField:pg,FileAttachmentsField:hg,CategoryAttachmentsField:mg,SettingsField:gg,MailListField:vg},cd=g.createContext(sd),yg=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...sd,...n}),[n]);return s.jsx(cd.Provider,{value:e,children:t})});function Oi(t){return{...g.useContext(cd),...t}}yg.displayName="ComponentsStore";function ld({className:t,title:n="General",...e}){const o=K("io-notifications-settings-panel-general",t),{AllowNotifications:r,ShowNotificationBadge:i,CloseNotificationOnClick:a,PanelAutoHide:c,HideToastsAfter:l}=oo(),u=Be();return s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[u&&s.jsx(r,{}),s.jsx(i,{}),u&&s.jsx(a,{}),u&&s.jsx(c,{}),u&&s.jsx(l,{})]})})}var tt=new class{constructor(){It(this,"subscribed",!1);It(this,"io");It(this,"registry",eg());It(this,"logger");It(this,"isPanelVisible");It(this,"notifications",[]);It(this,"bulkActionsSupported",!1)}init(t){var r,i,a,c;if(this.subscribed)return;this.subscribed=!0,this.io=t,this.logger=this.io.logger.subLogger("notifications");const n=this.io.appManager.myApplication,e=((i=(r=n==null?void 0:n.userProperties)==null?void 0:r.logger)==null?void 0:i.publishLevel)??"error",o=((c=(a=n==null?void 0:n.userProperties)==null?void 0:a.logger)==null?void 0:c.consoleLevel)??"info";this.logger.publishLevel(e),this.logger.consoleLevel(o),this.logger.info("===== IO Notifications v.0.7.2 ====="),this.getBulkActionsSupport(),this.subscribe()}onPanelVisibilityChanged(t){return this.registry.add("on-panel-visibility-changed",t)}onConfigurationChanged(t){return this.registry.add("on-configuration-changed",t)}onNotificationsChanged(t){return this.registry.add("on-notifications-changed",t)}onCounterChanged(t){return this.registry.add("on-counter-changed",t)}async getNotificationsList(){var n;const t=await((n=this.io)==null?void 0:n.notifications.list());if(!t)throw new Error("io.notifications.list is not supported in this environment.");return t.map(e=>this.attachHandlers(e))}async getConfiguration(){if(this.io)return await this.io.notifications.getConfiguration();throw new Error("io.notifications.getConfiguration is not supported in this environment.")}showPanel(){var t;if(this.isDesktopEnvironment())return(t=this.io)==null?void 0:t.notifications.panel.show()}hidePanel(){var t;if(this.isDesktopEnvironment())return(t=this.io)==null?void 0:t.notifications.panel.hide()}clearAll(){var t,n;return(t=this.logger)==null||t.trace("clearing all notifications"),(n=this.io)==null?void 0:n.notifications.clearAll()}clearAllOld(){var t,n;return(t=this.logger)==null||t.trace("clearing all old notifications"),(n=this.io)==null?void 0:n.notifications.clearOld()}clearMany(t){var n,e,o,r;return typeof((n=this.io)==null?void 0:n.notifications).clearMany=="function"?t.length<1?((e=this.logger)==null||e.trace("no ids provided to clear notifications"),Promise.resolve()):((o=this.logger)==null||o.trace(`clearing notifications with ids ${JSON.stringify(t.join(", "))}`),((r=this.io)==null?void 0:r.notifications).clearMany(t)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(t){var n,e;return(n=this.logger)==null||n.trace(`closing notification with id ${t}`),(e=this.io)==null?void 0:e.notifications.clear(t)}snooze(t,n){var e,o;return(e=this.logger)==null||e.trace(`snoozing notification with id ${t} for ${n}ms`),(o=this.io)==null?void 0:o.notifications.snooze(t,n)}snoozeMany(t,n){var e,o,r,i;return typeof((e=this.io)==null?void 0:e.notifications).snoozeMany=="function"?t.length<1?((o=this.logger)==null||o.trace("no ids provided to snooze notifications"),Promise.resolve()):((r=this.logger)==null||r.trace(`snoozing notifications with ids ${JSON.stringify(t.join(", "))} for ${n}ms`),((i=this.io)==null?void 0:i.notifications).snoozeMany(t,n)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(t,n){var e,o;return(e=this.logger)==null||e.trace(`setting state of ${t} to ${n}`),(o=this.io)==null?void 0:o.notifications.setState(t,n)}setStates(t,n){var e,o,r,i;return typeof((e=this.io)==null?void 0:e.notifications).setStates=="function"?t.length<1?((o=this.logger)==null||o.trace(`no ids provided to change state to ${n} for notifications`),Promise.resolve()):((r=this.logger)==null||r.trace(`setting state of ${JSON.stringify(t.join(", "))} to ${n}`),((i=this.io)==null?void 0:i.notifications).setStates(t,n)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){var n,e,o;const t=typeof((n=this.io)==null?void 0:n.notifications).clearMany=="function"&&typeof((e=this.io)==null?void 0:e.notifications).setStates=="function"&&typeof((o=this.io)==null?void 0:o.notifications).snoozeMany=="function";this.bulkActionsSupported=t}setFilter(t){var n,e;return(n=this.logger)==null||n.trace(`setting filter to ${JSON.stringify(t)}`),(e=this.io)==null?void 0:e.notifications.setFilter(t)}configure(t){var n;return(n=this.io)==null?void 0:n.notifications.configure(t)}subscribe(){var t,n,e,o,r,i,a;(t=this.io)==null||t.notifications.onRaised(c=>{var l;(l=this.logger)==null||l.trace(`received event indicating notification raise: ${JSON.stringify(c)}`),this.attachHandlers(c),this.notifications.unshift(c),this.registry.execute("on-notifications-changed",[...this.notifications])}),(n=this.io)==null||n.notifications.onStateChanged(({id:c},l)=>{var u;(u=this.logger)==null||u.trace(`received event for notification state is changed - "${c}" - "${l==null?void 0:l.toString()}"`),this.notifications=this.notifications.map(p=>{var f;return p.id===c?((f=this.logger)==null||f.trace(`${p.id} - the state is changed from "${p.state}" to "${l==null?void 0:l.toString()}"`),Object.assign(p,{state:l})):p}),this.registry.execute("on-notifications-changed",this.notifications)}),(e=this.io)!=null&&e.notifications&&"onDataChanged"in this.io.notifications&&typeof this.io.notifications.onDataChanged=="function"&&((o=this.io)==null||o.notifications.onDataChanged((c,l)=>{var p;const u=c.id;(p=this.logger)==null||p.trace(`received event for notification data is changed - "${u}" - "${JSON.stringify(l)}"`),this.notifications=this.notifications.map(f=>{var d;return f.id===u?((d=this.logger)==null||d.trace(`${f.id} - the data is changed from "${JSON.stringify(f.data)}" to "${JSON.stringify(l)}"`),Object.assign(f,{data:l})):f}),this.registry.execute("on-notifications-changed",this.notifications)})),(r=this.io)==null||r.notifications.onClosed(({id:c})=>{var l;(l=this.logger)==null||l.trace(`received event for notification is closed - "${c}".`),this.notifications=this.notifications.filter(u=>u.id!==c),this.registry.execute("on-notifications-changed",this.notifications)}),(i=this.io)==null||i.notifications.onConfigurationChanged(c=>{var l;(l=this.logger)==null||l.trace(`received event for configuration changed - ${JSON.stringify(c)}.`),this.registry.execute("on-configuration-changed",c)}),this.isDesktopEnvironment()&&((a=this.io)==null||a.notifications.panel.onVisibilityChanged(c=>{var l;(l=this.logger)==null||l.trace(`received event for panel visibility changed to "${c}".`),this.isPanelVisible=c,this.registry.execute("on-panel-visibility-changed",c)}))}isDesktopEnvironment(){return typeof window=="object"&&(!!window.iodesktop||!!window.glue42gd)}attachHandlers(t){var e;return(e=t.actions)==null||e.forEach(o=>{Object.assign(o,{onClick:async r=>{var i,a,c;try{(i=this.logger)==null||i.info(`${t.id}/${o.action} - was clicked.`),await((a=this.io)==null?void 0:a.notifications.click(t.id,o.action,r))}catch(l){(c=this.logger)==null||c.error("Error while clicking on action:",l)}}})}),Object.assign(t,{snooze:async(o=1e4)=>{var r,i;(r=this.logger)==null||r.trace(`${t.id} - request to change the state from ${t.state} to Snoozed with duration ${o}ms`),await((i=this.io)==null?void 0:i.notifications.snooze(t.id,o))},updateState:async o=>{var r,i;return(r=this.logger)==null||r.trace(`${t.id} - request to change the state from ${t.state} to ${o}`),(i=this.io)==null?void 0:i.notifications.setState(t.id,o)},updateData:async o=>{var r,i;(r=this.logger)==null||r.trace(`${t.id} - request to change the data to ${JSON.stringify(o)}`),(i=this.io)!=null&&i.notifications&&"updateData"in this.io.notifications&&typeof this.io.notifications.updateData=="function"?await this.io.notifications.updateData(t.id,o):console.log("'updateData' method is not supported")},onClick:async o=>{var r,i,a;try{(r=this.logger)==null||r.info(`${t.id} - was clicked.`),await((i=this.io)==null?void 0:i.notifications.click(t.id,void 0,o))}catch(c){(a=this.logger)==null||a.error(`Error while clicking on Notification: ${t.id}`,c)}},onShow:()=>{},close:async()=>{var o;return(o=this.logger)==null||o.info(`${t.id} - was closed.`),this.close(t.id)}})}};function vs(t){const n=g.useContext(De.IOConnectContext),e=n==null?void 0:n.appManager,o=Be(),[r,i]=g.useState([]),[a,c]=g.useState(0),l="Platform",u=g.useCallback((d="asc")=>{if(o===null)return[];const h=[...r].sort((m,v)=>{const y=(m.title??m.name).toLowerCase(),b=(v.title??v.name).toLowerCase();return d==="asc"?y.localeCompare(b):b.localeCompare(y)});if(!o){const m=h.findIndex(v=>v.name===l);if(m!==-1){const[v]=h.splice(m,1);h.unshift(v)}}return h},[r,o]),p=g.useMemo(()=>u("asc"),[u]),f=g.useMemo(()=>u("desc"),[u]);return g.useEffect(()=>{if(o===null||o)return;const d={title:"System",name:l,hidden:!1,userProperties:{hidden:!1}};i(h=>h.some(m=>m.name===d.name)?h:[...h,d])},[o]),g.useEffect(()=>{if(!e)return;const d=e.onAppAdded(v=>{i(y=>[...y,{title:v.title,name:v.name,hidden:v.hidden,userProperties:v.userProperties}])}),h=e.onAppRemoved(v=>{i(y=>y.filter(b=>b.name!==v.name))}),m=e.onAppChanged(v=>{i(y=>{const b=y.find(S=>S.name===v.name);return[...y.filter(S=>S.name!==v.name),{title:v.title,name:b==null?void 0:b.name,hidden:b==null?void 0:b.hidden,allowed:b==null?void 0:b.allowed,userProperties:b==null?void 0:b.userProperties}]})});return()=>{d(),h(),m()}},[e]),{apps:g.useMemo(()=>{if(!(t!=null&&t.sourceFilter)||!Array.isArray(r))return r;const{allowed:d=[],blocked:h=[]}=t.sourceFilter,m=d.includes("*"),v=h.includes("*");let y=0;const b=r.map(S=>{const k=m||d.includes(S.name),C=!v&&k;return C&&y++,{...S,allowed:C}});return c(y),b},[t,r]),allowedApps:a,sortedAppsAsc:p,sortedAppsDesc:f,sortAppsAlphabetically:u}}function ud(t,n,e){var r;return{notificationStacks:g.useMemo(()=>{var u,p,f,d;if(!n.toastStacking)return[];const i=(a=n.stackBy)==="application"?"source":a==="severity"?"severity":"source";var a;const c=t.filter(h=>h.state==="Active"),l=new Map;for(const h of c){const m=h[i]??"";if(h.source&&((p=(u=e==null?void 0:e.sourceFilter)==null?void 0:u.muted)!=null&&p.includes(h.source))||(d=(f=e==null?void 0:e.sourceFilter)==null?void 0:f.muted)!=null&&d.includes("*"))continue;l.has(m)||l.set(m,{key:m,items:[]});const v=l.get(m);v&&v.items.unshift(h)}return Array.from(l.values()).filter(h=>h.items.some(m=>m.state==="Active"||m.state==="Stale"))},[t,n.toastStacking,n.stackBy,(r=e==null?void 0:e.sourceFilter)==null?void 0:r.muted])}}function dd(t){const[n,e]=g.useState([]);return{selectedNotifications:n,selectNotification:(o,r)=>{const i=n;e(r?[...i,o]:i.filter(a=>a!==o))},selectAllNotifications:(o,r)=>{if(r){let i=[];switch(o){case"read":i=t.filter(a=>a.state==="Acknowledged"||a.state==="Seen").map(a=>a.id);break;case"unread":i=t.filter(a=>a.state==="Active"||a.state==="Stale").map(a=>a.id);break;case"snoozed":i=t.filter(a=>a.state==="Snoozed").map(a=>a.id);break;default:i=t.map(a=>a.id)}e(i)}else e([])}}}const fd="newest",bg="oldest",wg="severity",na=["None","Low","Medium","High","Critical"],Bc={key:fd,descending:!0},xg=new Set(["enabledNotifications","enabledToasts","toastStacking","stackBy","showNotificationBadge","toastExpiry","placement","snooze","closeNotificationOnClick"]),Hc=t=>{var n,e;return{enabledNotifications:t.enable,enabledToasts:t.enableToasts,toastStacking:((n=t.toasts)==null?void 0:n.mode)==="stacked",stackBy:(e=t.toasts)==null?void 0:e.stackBy,toastExpiry:t.toastExpiry,showNotificationBadge:t.showNotificationBadge,placement:t.placement,snooze:t.snooze,closeNotificationOnClick:t.closeNotificationOnClick}},Wc=t=>Array.from(t.reduce((n,e)=>n.set(e.id,e),new Map).values());function Cg(){const t=g.useContext(De.IOConnectContext),n=g.useMemo(()=>({autoHidePanel:!0,alwaysOnTop:!0,highlightNewFor:3e4,markAsReadAfter:6e4}),[]),{appPrefs:e,updatePrefs:o}=pm(),[r,i]=g.useState({}),[a,c]=g.useState({}),[l,u]=g.useState([]),[p,f]=g.useState(0),[d,h]=g.useState(!0),{apps:m,allowedApps:v}=vs(r),{notificationStacks:y}=ud(l,{toastStacking:a.toastStacking??!1,stackBy:a.stackBy??"source"},{sourceFilter:r.sourceFilter}),{selectedNotifications:b,selectNotification:S,selectAllNotifications:k}=dd(l);tt.init(t),g.useEffect(()=>{(async()=>{await(async()=>{try{const E=await tt.getConfiguration();i(E),c(P=>({...P,...Hc(E)}))}catch(E){console.error("Error fetching configuration:",E)}})(),await(async()=>{try{const E=await tt.getNotificationsList();u(Wc(E))}catch(E){console.error("Error fetching notifications:",E)}})()})().catch(E=>{console.error("Error in useNotifications fetch:",E)}),C()},[]),g.useEffect(()=>{c(E=>({...E,autoHidePanel:e.autoHidePanel??n.autoHidePanel,alwaysOnTop:e.alwaysOnTop??n.alwaysOnTop,highlightNewFor:e.highlightNewFor??n.highlightNewFor,markAsReadAfter:e.markAsReadAfter??n.markAsReadAfter}))},[e,n]),g.useEffect(()=>{const E=tt.onNotificationsChanged(z=>{u(Wc(z))}),P=tt.onConfigurationChanged(z=>{const q=Hc(z);i(B=>({...B,...z})),c(B=>({...B,...q}))}),H=tt.onCounterChanged(z=>{f(z)});return()=>{E(),P(),H()}},[]);const C=()=>{h(tt.bulkActionsSupported)},j=async E=>{await tt.setFilter(E)};return{close:E=>tt.close(E),clearAll:()=>tt.clearAll(),settings:a,hidePanel:async()=>{await tt.hidePanel()},showPanel:async()=>{await tt.showPanel()},saveFilter:j,clearAllOld:()=>tt.clearAllOld(),saveSetting:async E=>{const P=Object.keys(E)[0];if(!xg.has(P))return void o(E);const H=((z,q)=>{const B=(ve=>({enabledNotifications:Y=>({enable:Y}),enabledToasts:Y=>({enableToasts:Y}),toastStacking:Y=>{var de;return{toasts:{mode:Y?"stacked":"single",stackBy:(de=ve.toasts)==null?void 0:de.stackBy}}},stackBy:Y=>{var de;return{toasts:{mode:(de=ve.toasts)==null?void 0:de.mode,stackBy:Y}}},showNotificationBadge:Y=>({showNotificationBadge:Y}),toastExpiry:Y=>({toastExpiry:Y}),placement:Y=>({placement:Y}),snooze:Y=>({snooze:Y}),closeNotificationOnClick:Y=>({closeNotificationOnClick:Y})}))(q),A=Object.keys(z)[0],fe=z[A];return A&&fe!==void 0&&B[A]?B[A](fe):{}})(E,r);H&&await tt.configure(H)},allApps:m,saveAllFilter:async E=>{"subscribe"in E?await j({allowed:E.subscribe?["*"]:[],blocked:E.subscribe?[]:["*"]}):"mute"in E&&await j({muted:E.mute?["*"]:[]})},configuration:r,notifications:l,notificationStacks:y,notificationsCount:p,allApplications:r.allApplications??0,allowedApplications:v,isBulkActionsSupported:d,selectedNotifications:b,selectNotification:S,selectAllNotifications:k,clearMany:async E=>{await tt.clearMany(E)},snooze:async(E,P)=>{await tt.snooze(E,P)},snoozeMany:async(E,P)=>{await tt.snoozeMany(E,P)},setState:async(E,P)=>{await tt.setState(E,P)},setStates:async(E,P)=>{await tt.setStates(E,P)},setCount:E=>{f(E)},getNotificationsList:async()=>await tt.getNotificationsList()}}const pd=g.createContext({allApps:[],settings:{},configuration:{},notifications:[],notificationsCount:0,onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{},setCount:()=>{}}),Ee=()=>g.useContext(pd);function hd({label:t="Allow notifications",align:n="right",...e}){const{settings:o,saveSetting:r}=Ee(),i=Be(),a=g.useCallback(c=>{r({enabledNotifications:c.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:a,checked:o.enabledNotifications??!1,...e}):null}function md({label:t="Show notification badge",align:n="right",...e}){const{settings:o,saveSetting:r}=Ee(),i=Be()&&!o.enabledNotifications,a=g.useCallback(c=>{r({showNotificationBadge:c.target.checked})},[r]);return s.jsx(ft,{label:t,align:n,onChange:a,checked:o.showNotificationBadge??!1,disabled:i,...e})}function gd({label:t="Close notification on click",align:n="right",...e}){const{settings:o,saveSetting:r}=Ee(),i=Be(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({closeNotificationOnClick:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.closeNotificationOnClick??!1,disabled:a,...e}):null}function vd({label:t="Auto hide panel",align:n="right",...e}){const{settings:o,saveSetting:r}=Ee(),i=Be(),a=g.useCallback(c=>{r({autoHidePanel:c.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:a,checked:o.autoHidePanel??!1,...e}):null}function yd({label:t="Panel always on top",align:n="right",...e}){const{settings:o,saveSetting:r}=Ee(),i=g.useCallback(a=>{r({alwaysOnTop:a.target.checked})},[r]);return s.jsx(ft,{label:t,align:n,onChange:i,checked:o.alwaysOnTop??!1,...e})}const zc=(t,n)=>t?`${t} ${n}${t!==1?"s":""}`:"",oi=t=>{const n=Math.floor(t/60),e=t%60,o=zc(n,"minute"),r=zc(e,"second");return o+(o&&r?" ":"")+r};function bd({className:t,title:n="Hide toasts after",items:e=[15,30,45,60],...o}){const r=K("flex","jc-between","ai-center",t),{settings:i,saveSetting:a}=Ee(),c=Be(),l=c&&!i.enabledNotifications,u=g.useCallback((p=15e3)=>{i.toastExpiry!==p&&a({toastExpiry:1e3*p})},[i.toastExpiry,a]);return c?s.jsxs("div",{className:r,...o,children:[s.jsx("div",{className:"io-text-clipper "+(l?"io-text-disabled":""),children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",disabled:l,children:[s.jsx(ae.Button,{text:oi((i.toastExpiry??0)/1e3)}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:e.map(p=>s.jsx(ae.Item,{onClick:()=>{u(p)},children:oi(p)},p))})})]})]}):null}function wd({className:t,title:n="Highlight new for",...e}){const o=K("flex","jc-between","ai-center",t),{settings:r}=Ee(),i=Be()&&!r.enabledNotifications,a=["30 seconds","1 minute","5 minutes","Never"];return s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:K("io-text-clipper",{"io-text-disabled":i}),children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",disabled:i,children:[s.jsx(ae.Button,{text:a[0]}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:a.map(c=>s.jsx(ae.Item,{children:c},c))})})]})]})}function xd({className:t,title:n="Mark as read after",...e}){const o=K("flex","jc-between","ai-center",t),{settings:r}=Ee(),i=Be()&&!r.enabledNotifications,a=["1 minute","5 minutes","Never"];return s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:K("io-text-clipper",{"io-text-disabled":i}),children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",disabled:i,children:[s.jsx(ae.Button,{text:a[0]}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:a.map(c=>s.jsx(ae.Item,{children:c},c))})})]})]})}function Cd({className:t,title:n="Stacking",...e}){const o=K("io-notifications-settings-panel-stacking",t),{ToastStacking:r,ToastStackBy:i}=oo();return Be()?s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[s.jsx(r,{}),s.jsx(i,{})]})}):null}function kd({label:t="Allow toast stacking",align:n="right",...e}){const{settings:o,saveSetting:r}=Ee(),i=Be(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({toastStacking:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.toastStacking??!1,disabled:a,...e}):null}const ys=t=>t.replace(/(^|-)\w/g,n=>n.toUpperCase().replace("-"," "));function Sd({className:t,title:n="Group by",...e}){const o=K("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Ee(),a=Be(),c=a&&!r.enabledNotifications,l=g.useCallback(u=>{u||(u="severity"),r.stackBy!==u&&i({stackBy:u.toLowerCase()})},[r.stackBy,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:K("io-text-clipper",{"io-text-disabled":c}),children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",disabled:c,children:[s.jsx(ae.Button,{text:r.stackBy?ys(r.stackBy):"Severity"}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:["Severity","Application"].map(u=>s.jsx(ae.Item,{onClick:()=>{l(u)},children:u},u))})})]})]}):null}function Ed({className:t,title:n="Placement",...e}){const o=K("io-notifications-settings-panel-placement",t),{PlacementPanel:r,PlacementToasts:i}=oo();return Be()?s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[s.jsx(r,{}),s.jsx(i,{})]})}):null}function jd({className:t,title:n="Panel position",...e}){var l,u;const o=K("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Ee(),a=Be(),c=g.useCallback(p=>{var f;p||(p="right"),((f=r.placement)==null?void 0:f.panel)!==p&&i({placement:{...r.placement,panel:p.toLowerCase()}})},[r.placement,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:"io-text-clipper",children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",children:[s.jsx(ae.Button,{text:(l=r.placement)!=null&&l.panel?ys((u=r.placement)==null?void 0:u.panel):"Right"}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:["Right","Left"].map(p=>s.jsx(ae.Item,{onClick:()=>{c(p)},children:p},p))})})]})]}):null}function Od({className:t,title:n="Toasts position",...e}){var l,u;const o=K("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Ee(),a=Be(),c=g.useCallback(p=>{var d;if(p||(p="bottom-right"),((d=r.placement)==null?void 0:d.toasts)===p)return;const f=p.replace(/\s+/g,"-").toLowerCase();i({placement:{...r.placement,toasts:f}})},[r.placement,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:"io-text-clipper",children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",children:[s.jsx(ae.Button,{text:(l=r.placement)!=null&&l.toasts?ys((u=r.placement)==null?void 0:u.toasts):"Bottom Right"}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(p=>s.jsx(ae.Item,{onClick:()=>{c(p)},children:p},p))})})]})]}):null}function Nd({className:t,title:n="Snooze",...e}){var a;const o=K("io-notifications-settings-panel-snooze",t),{SnoozeDuration:r}=oo(),{settings:i}=Ee();return Be()&&((a=i.snooze)!=null&&a.enabled)?s.jsx("div",{className:o,...e,children:s.jsx(Ke,{title:n,children:s.jsx(r,{})})}):null}function Id({className:t,title:n="Default duration",items:e=[60,120,180,300],...o}){var p,f;const r=K("flex","jc-between","ai-center",t),{settings:i,saveSetting:a}=Ee(),c=Be(),l=c&&!i.enabledNotifications,u=g.useCallback((d=6e4)=>{var h;i.snooze&&((h=i.snooze)==null?void 0:h.duration)!==d&&a({snooze:{...i.snooze,duration:1e3*d}})},[i.snooze,a]);return c&&((p=i.snooze)!=null&&p.enabled)?s.jsxs("div",{className:r,...o,children:[s.jsx("div",{className:K("io-text-clipper",{"io-text-disabled":l}),children:s.jsx("span",{children:n})}),s.jsxs(ae,{variant:"light",disabled:l,children:[s.jsx(ae.Button,{text:oi((((f=i.snooze)==null?void 0:f.duration)??0)/1e3)}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",children:e.map(d=>s.jsx(ae.Item,{onClick:()=>{u(d)},children:oi(d)},d))})})]})]}):null}function Ad({className:t,title:n,...e}){const o=K("io-notifications-settings-panel-subscriptions",t),{SubscribeAll:r,SubscribeApp:i,SubscribeMuteAll:a,SubscribeMuteApp:c}=oo(),{sortAppsAlphabetically:l}=vs(),u=Be(),p=l(),f="io-notifications-subscriptions-grid "+(u?"with-three-columns":"with-two-columns");return s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n??(u?"Subscribe & Mute":"Subscribe"),children:[s.jsxs("div",{className:f,children:[s.jsx("p",{className:"io-text-section",children:"Sources"}),s.jsx("p",{className:"io-text-section",children:"Subscribe"}),u&&s.jsx("p",{className:"io-text-section",children:"Mute"})]}),s.jsxs("div",{className:f,children:[s.jsx("p",{children:"All Sources"}),s.jsx(r,{label:""}),u&&s.jsx(a,{label:""})]}),p.map(d=>{var h;return!d||d.hidden||(h=d==null?void 0:d.userProperties)!=null&&h.hidden?null:s.jsxs("div",{className:f,children:[s.jsx("p",{children:d.title??d.name}),s.jsx(i,{app:d,label:""}),u&&s.jsx(c,{app:d,label:""})]},d.name)})]})})}function Pd({label:t="All apps",align:n="right",...e}){var l,u,p,f;const{settings:o,configuration:r,saveAllFilter:i}=Ee(),a=Be()&&!o.enabledNotifications,c=g.useCallback(d=>{i({subscribe:d.target.checked})},[i]);return s.jsx(ft,{align:n,label:t,onChange:c,checked:(((u=(l=r.sourceFilter)==null?void 0:l.allowed)==null?void 0:u.includes("*"))&&((f=(p=r.sourceFilter)==null?void 0:p.blocked)==null?void 0:f.length)===0)??!1,disabled:a,...e})}function Td({label:t="App",align:n="right",app:e,...o}){var p,f,d,h,m,v;const{allApps:r,settings:i,configuration:a,saveFilter:c}=Ee(),l=Be()&&!i.enabledNotifications,u=g.useCallback((y,b)=>{var C,j,E,P,H,z;const S={...a.sourceFilter},k=(C=S.allowed)==null?void 0:C.indexOf("*");typeof k=="number"&&k>-1&&((j=S.allowed)==null||j.splice(k,1),r.forEach(q=>{var B;q.name!==b.name&&((B=S.allowed)==null||B.push(q.name))})),y?(S.allowed=[...new Set([...S.allowed??[],b.name])],S.blocked=(E=S.blocked)==null?void 0:E.filter(q=>q!==b.name)):(S.allowed=(P=S.allowed)==null?void 0:P.filter(q=>q!==b.name),S.blocked=[...new Set([...S.blocked??[],b.name])]),(H=S.allowed)!=null&&H.length&&((z=S.blocked)!=null&&z.includes("*"))&&S.blocked.splice(S.blocked.indexOf("*"),1),c(S)},[r,a.sourceFilter,c]);return s.jsx(ft,{id:e.name,label:t,align:n,onChange:y=>u(y.target.checked,e),checked:(((f=(p=a.sourceFilter)==null?void 0:p.allowed)==null?void 0:f.includes("*"))&&!((h=(d=a.sourceFilter)==null?void 0:d.blocked)!=null&&h.includes(e.name))||((v=(m=a.sourceFilter)==null?void 0:m.allowed)==null?void 0:v.includes(e.name)))??!1,disabled:l,...o})}function Dd({label:t="Mute all",align:n="right",...e}){var u,p,f,d;const{settings:o,configuration:r,saveAllFilter:i}=Ee(),a=Be(),c=a&&(!o.enabledNotifications||((p=(u=r.sourceFilter)==null?void 0:u.allowed)==null?void 0:p.indexOf("*"))===-1),l=g.useCallback(h=>{i({mute:h.target.checked})},[i]);return a?s.jsx(ft,{align:n,label:t,onChange:l,checked:((d=(f=r.sourceFilter)==null?void 0:f.muted)==null?void 0:d.includes("*"))??!1,disabled:c??!1,...e}):null}function Md({label:t="App",align:n="right",app:e,...o}){var f,d,h,m,v,y,b,S,k,C,j,E,P,H,z,q;const{allApps:r,settings:i,configuration:a,saveFilter:c}=Ee(),l=Be(),u=l&&(!i.enabledNotifications||((d=(f=a.sourceFilter)==null?void 0:f.blocked)==null?void 0:d.includes("*"))||((m=(h=a.sourceFilter)==null?void 0:h.blocked)==null?void 0:m.includes(e.name))||((y=(v=a.sourceFilter)==null?void 0:v.allowed)==null?void 0:y.length)===0||((S=(b=a.sourceFilter)==null?void 0:b.allowed)==null?void 0:S.indexOf(e.name))===-1&&((C=(k=a.sourceFilter)==null?void 0:k.allowed)==null?void 0:C.indexOf("*"))===-1&&((E=(j=a.sourceFilter)==null?void 0:j.blocked)==null?void 0:E.length)===0),p=g.useCallback((B,A)=>{var Y,de,he,Oe;const fe={...a.sourceFilter},ve=(Y=fe==null?void 0:fe.muted)==null?void 0:Y.indexOf("*");typeof ve=="number"&&ve>-1&&((de=fe.muted)==null||de.splice(ve,1),r.forEach(ce=>{var W;ce.name===A.name||ce.hidden||((W=fe.muted)==null||W.push(ce.name))})),B?(he=fe.muted)==null||he.push(A.name):fe.muted=(Oe=fe.muted)==null?void 0:Oe.filter(ce=>ce!==A.name),c(fe)},[r,a.sourceFilter,c]);return!l||e.hidden?null:s.jsx(ft,{id:e.name,label:t,align:n,onChange:B=>p(B.target.checked,e),checked:(((H=(P=a.sourceFilter)==null?void 0:P.muted)==null?void 0:H.includes("*"))||((q=(z=a.sourceFilter)==null?void 0:z.muted)==null?void 0:q.includes(e.name)))??!1,disabled:u??!1,...o})}const _d={Body:t=>{const{General:n,Placement:e,Stacking:o,Snooze:r,Subscriptions:i}=oo();return s.jsxs(So,{...t,children:[s.jsx(n,{}),s.jsx(e,{}),s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{})]})},General:ld,AllowNotifications:hd,ShowNotificationBadge:md,CloseNotificationOnClick:gd,PanelAutoHide:vd,PanelAlwaysOnTop:yd,HideToastsAfter:bd,MarkAsNew:wd,MarkAsRead:xd,Stacking:Cd,ToastStacking:kd,ToastStackBy:Sd,Placement:Ed,PlacementPanel:jd,PlacementToasts:Od,Snooze:Nd,SnoozeDuration:Id,Subscriptions:Ad,SubscribeAll:Pd,SubscribeApp:Td,SubscribeMuteAll:Dd,SubscribeMuteApp:Md},Ld=g.createContext(_d),bs=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({..._d,...n}),[n]);return s.jsx(Ld.Provider,{value:e,children:t})});bs.displayName="NotificationsSettingsPanelComponentsStoreProvider";const oo=()=>g.useContext(Ld),kg=({className:t,onClose:n,title:e="Notification Settings",...o})=>{const{Body:r}=oo();return s.jsxs(Ze,{className:K("io-notifications-settings-panel",t),...o,children:[s.jsxs(Ze.Header,{children:[s.jsx(Ze.Header.Title,{size:"large",text:e,tag:"h1"}),s.jsx(Ze.Header.ButtonGroup,{children:s.jsx(Ze.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),s.jsx(r,{})]})},Rd=({components:t,...n})=>s.jsx(bs,{components:t,children:s.jsx(kg,{...n})});function Sg({isOpen:t,onClose:n,container:e}){return t?Un.createPortal(s.jsx(Rd,{onClose:n}),e??document.querySelector("#root")??document.body):null}const Fd=g.createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),Et=()=>g.useContext(Fd);function Bd({title:t,onClose:n,onOpenSettings:e,...o}){const{HeaderCaptionTitle:r,HeaderCaptionCount:i,HeaderCaptionButtonSettings:a,HeaderCaptionButtonClose:c,HeaderActions:l,HeaderBulkActions:u,HeaderSearch:p}=to(),{isBulkActionsSupported:f,notificationsCount:d}=Ee(),{isBulkActionsVisible:h}=Et(),m=Be();return s.jsxs(Cn,{...o,children:[s.jsxs("div",{className:"io-panel-header-caption",children:[s.jsx(r,{title:t}),s.jsx(i,{}),s.jsxs(Cn.ButtonGroup,{children:[m&&s.jsx(a,{onClick:e}),s.jsx(c,{onClick:n})]})]}),f?s.jsxs("div",{className:`io-panel-header-actions-wrapper ${h&&d>0?"io-panel-header-bulk-actions-opened":""} `,children:[s.jsx(l,{}),s.jsx(u,{})]}):s.jsx(l,{}),s.jsx(p,{})]})}function Hd({text:t="Notifications",counter:n,...e}){const{notificationsCount:o}=Ee();return s.jsx(nn,{text:t,size:"large",...e,children:(n??!0)&&s.jsxs("span",{children:["(",o,")"]})})}const Wd=t=>[...t].sort((n,e)=>(e.timestamp||0)-(n.timestamp||0)),zd=t=>[...t].sort((n,e)=>(n.timestamp||0)-(e.timestamp||0)),$d=(t,n)=>{const e=na[0];return[...t].sort((o,r)=>{const i=na.indexOf(o.severity||e),a=na.indexOf(r.severity||e);return(n?-1:1)*(i-a)})},Eg={[fd]:Wd,[bg]:zd,[wg]:$d};function Ud({...t}){const[n,e]=g.useState([]),{NotificationsList:o,Notification:r}=to(),{notifications:i,setCount:a,notificationsCount:c}=Ee(),{sortNotificationsBy:l,viewNotificationsBy:u,searchQuery:p}=Et(),f=g.useRef(null),d=Pu(p),h=g.useMemo(()=>((v,y)=>{if(!v)return[];switch(y){case"all":default:return v;case"unread":return v.filter(b=>b.state==="Active"||b.state==="Stale");case"read":return v.filter(b=>b.state==="Acknowledged"||b.state==="Seen");case"snoozed":return v.filter(b=>b.state==="Snoozed")}})(i,u).filter(v=>{var y,b;return v.title.toLowerCase().includes(d.toLowerCase())||((y=v.source)==null?void 0:y.toLowerCase().includes(d.toLowerCase()))||((b=v.body)==null?void 0:b.toLowerCase().includes(d.toLowerCase()))}),[d,i,u]);return g.useEffect(()=>{switch(l){case"newest":e(Wd(h));break;case"oldest":e(zd(h));break;case"severity":e($d(h,!0));break;default:e(h)}a(h.length)},[h,l,a]),g.useEffect(()=>{var m;f.current&&((m=f.current)==null||m.scrollTo({top:0,behavior:"smooth"}))},[d,c,l,u]),s.jsx(So,{ref:f,...t,children:s.jsx(o,{notifications:n,Notification:r})})}function Vd({...t}){const{FooterButtons:n}=to();return s.jsx(po,{...t,children:s.jsx(n,{})})}function Gd({className:t,...n}){const{FooterButtonClearAll:e,FooterButtonClearAllOld:o}=to(),{notifications:r}=Ee(),[i,a]=g.useState(!1);return g.useEffect(()=>{r.filter(c=>c.state==="Stale"||c.state==="Acknowledged").length>0?a(!0):a(!1)},[r]),s.jsxs(Re,{className:t,align:"right",...n,children:[s.jsx(o,{disabled:!i}),s.jsx(e,{disabled:r.length<=0})]})}function Yd({text:t="Clear All",...n}){const{clearAll:e}=Ee();return s.jsx(Ge,{text:t,onClick:()=>{e()},...n})}function Zd({text:t="Clear Old",...n}){const{clearAllOld:e}=Ee();return s.jsx(Ge,{text:t,onClick:()=>{e()},...n})}function Kd({className:t,notification:n,...e}){const o=K("io-notification-header",t),{HeaderCount:r,HeaderBadge:i,HeaderTitle:a,HeaderTimestamp:c,HeaderButtonSnooze:l,HeaderButtonClose:u}=Ni();return s.jsxs("div",{className:o,...e,children:[s.jsx(i,{notification:n}),s.jsx(r,{notification:n}),s.jsx(a,{notification:n}),s.jsx(c,{notification:n}),s.jsxs(Re,{children:[s.jsx(l,{notification:n}),s.jsx(u,{notification:n})]})]})}function qd({notification:t,...n}){const{settings:e,notificationStacks:o}=Ee(),{isPanelVisible:r}=Et(),{toastStacking:i,stackBy:a}=e,c=a==="application"?"source":a??"source";let l;if(i){const u=o.find(p=>p.key===t[c]);l=(u==null?void 0:u.items.length)??0}return i&&!r&&l&&l>1?s.jsx(Bl,{...n,children:l<10?l:"9+"}):null}function Jd({className:t,notification:n,...e}){if(!(n!=null&&n.severity)||n.severity==="None")return null;const o=K("io-notification-header-badge",t);return s.jsxs("div",{className:o,...e,children:[s.jsx(et,{variant:((r="None")=>{switch(r.toLowerCase()){case"low":case"medium":case"none":default:return"circle-info";case"high":return"triangle-exclamation";case"critical":return"ban"}})(n.severity),size:"12"}),n.severity]})}function Xd({className:t,state:n,severity:e="None",icon:o,...r}){const i=K("io-notification-header-icon",t),{isPanelVisible:a}=Et();return s.jsxs("div",{className:i,...r,children:[o&&s.jsx("span",{className:"io-notification-header-icon-image",children:s.jsx("img",{src:o,alt:`io-notification-header-icon-${o}`})}),s.jsx("span",{className:`io-notification-header-icon-badge color-${e.toLowerCase()}`,children:a&&n!=="Acknowledged"&&"New"})]})}function Qd({className:t,notification:{appTitle:n},...e}){const o=K("io-notification-header-title",t);return s.jsx("div",{className:o,...e,children:n})}function ef({className:t,notification:{timestamp:n,state:e,snooze:o},...r}){const i=K("io-notification-timestamp",t);return s.jsx("small",o&&e==="Snoozed"?{className:i,...r,children:"Snoozed"}:{className:i,...r,children:od(n??0)??"Just Now"})}function tf({notification:{id:t,state:n},...e}){var a,c;const{settings:o,snooze:r}=Ee(),i=g.useCallback(l=>{var u;l.stopPropagation(),r&&r(t,((u=o.snooze)==null?void 0:u.duration)??0)},[t,r,(a=o.snooze)==null?void 0:a.duration]);return r&&n!=="Snoozed"&&((c=o.snooze)!=null&&c.enabled)?s.jsx(Ge,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:i,...e}):null}function nf({notification:{id:t,updateState:n},...e}){const o=Be(),{onClose:r}=Ee(),{isPanelVisible:i}=Et(),a=g.useCallback(c=>{c.stopPropagation(),!o||i?r(t):n("Acknowledged").catch(console.error)},[o,t,r,i,n]);return s.jsx(Ue,{icon:"close",iconSize:"10",size:"24",tabIndex:-1,onClick:a,...e})}function of({className:t,notification:n,...e}){const o=K("io-notification-body",t),r=Be(),{BodyIcon:i,BodyTitle:a,BodyDescription:c}=Ni(),{id:l,icon:u,title:p,body:f,onClick:d,updateState:h}=n,{settings:m,onClose:v}=Ee(),{isPanelVisible:y}=Et(),b=g.useCallback(async()=>{if(!d)return;if(!r)return void v(l);const S=!(m!=null&&m.toastStacking)&&null,k=y?(m==null?void 0:m.closeNotificationOnClick)??!0:S;k!==null?await d({close:k}).catch(console.error):(await d({close:!1}).catch(console.error),await h("Acknowledged").catch(console.error))},[r,l,y,d,v,h,m==null?void 0:m.closeNotificationOnClick,m==null?void 0:m.toastStacking]);return s.jsxs("div",{className:o,role:"button",tabIndex:0,onKeyDown:async S=>{(k=>k.key==="Enter"||k.key===" ")(S)&&await b()},onClick:b,...e,children:[s.jsx(i,{icon:u}),s.jsxs("div",{className:"io-notification-body-content",children:[s.jsx(a,{text:p}),s.jsx(c,{text:f})]})]})}function rf({className:t,icon:n,altText:e="notification icon",...o}){if(!n)return null;const r=K("io-notification-body-icon",t);return s.jsx("div",{className:r,...o,children:s.jsx("img",{src:n,alt:e})})}function af({text:t,...n}){return s.jsx(nn,{text:t,...n})}function sf({className:t,text:n,...e}){const o=K("io-notification-body-description",t);return s.jsx("p",{className:o,...e,children:n})}function cf({className:t,notification:n}){const e=K("io-notification-footer",t),{FooterButton:o}=Ni(),r=g.useMemo(()=>function(a){const c=[],l={};if(!a)return;a.forEach(p=>{var m;const{displayId:f,displayPath:d}=p,h={...p,children:[]};if(d&&d.length>0){let v;d.forEach((y,b)=>{var S;b===0?v=l[y]:v&&(v=(S=v.children)==null?void 0:S.find(k=>k.displayId===y))}),v&&((m=v.children)==null||m.push(h))}else f?(c.push(h),l[f]=h):c.push(h);f&&(l[f]=h)});const u=p=>{p.forEach(f=>{f.children&&f.children.length===0?delete f.children:f.children&&u(f.children)})};return u(c),c}(n.actions),[n.actions]),i=(a,c)=>a.children?s.jsx(Jt,{text:a.title,children:a.children.map(i)},`${a.title}-${c}`):((l,u)=>s.jsx(Jt.Item,{children:s.jsx(o,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:l,notificationId:n.id})},`${l.title}-${u}`))(a,c);return s.jsx("div",{className:e,children:s.jsx(Re,{align:"right",children:r==null?void 0:r.map((a,c)=>a.children?s.jsxs(Re,{variant:"append",children:[s.jsx(o,{notificationAction:a,variant:c===0?"primary":"default",notificationId:n.id}),s.jsx(Jt,{variant:c===0?"primary":"default",icon:"ellipsis",children:a.children.map(i)})]},`${a.title}-${c}`):s.jsx(o,{notificationAction:a,variant:c===0?"primary":"link",notificationId:n.id},`${a.title}-${c}`))})})}function lf({notificationAction:t,...n}){const e=g.useCallback(o=>{o.stopPropagation(),t.onClick({close:!0})},[t]);return s.jsx(Ge,{text:t.title,onClick:e,...n})}const uf={Header:Kd,HeaderCount:qd,HeaderBadge:Jd,HeaderIcon:Xd,HeaderTitle:Qd,HeaderTimestamp:ef,HeaderButtonSnooze:tf,HeaderButtonClose:nf,Body:of,BodyIcon:rf,BodyTitle:af,BodyDescription:sf,Footer:cf,FooterButton:lf},df=g.createContext(uf),ff=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...uf,...n}),[n]);return s.jsx(df.Provider,{value:e,children:t})});function Ni(t){return{...g.useContext(df),...t}}function jg({className:t,notification:n,...e}){const{Header:o,Body:r,Footer:i}=Ni(),{severity:a}=n,c=K("io-notification",`severity-${(a==null?void 0:a.toLowerCase())??"none"}`,n.state!=="Acknowledged"&&"state-new",t);return s.jsxs("div",{className:c,...e,children:[s.jsx(o,{notification:n}),s.jsx(r,{notification:n}),s.jsx(i,{notification:n})]})}function Ii({components:t,notification:n,...e}){return s.jsx(ff,{components:t,children:s.jsx(jg,{notification:n,...e})})}function pf({className:t,notifications:n,...e}){const[o,r]=g.useState(!1),i=n.length>=3?"large":"normal",a=n.length===2?"small":i,c=n[0].severity,l=K("io-notification-stack",o&&"io-notification-stack-open",a!=="normal"&&[`io-notification-stack-${a}`],c&&c!=="None"&&[`io-notification-stack-${c.toLowerCase()}`],t),u=g.useCallback(()=>{r(!0)},[]),p=g.useCallback(f=>{f.stopPropagation(),n.forEach(d=>{d.close()})},[n]);return s.jsxs("div",{className:l,onClick:u,...e,children:[o&&a!=="normal"&&s.jsx("div",{className:"io-notification-stack-btn",children:s.jsx(Ge,{icon:"close",onClick:f=>p(f),children:s.jsx("span",{className:"io-btn-text",children:"Clear All"})})}),n.map(f=>s.jsx(Ii,{notification:f},f.id))]})}function Og({...t}){const{notificationStacks:n}=Ee();return s.jsx(s.Fragment,{children:n.map(e=>s.jsx(pf,{notifications:e.items,...t},e.key))})}ff.displayName="ComponentsStoreProvider";const Ng=({notification:t,Notification:n,...e})=>{var h;const{configuration:o,isBulkActionsSupported:r,selectedNotifications:i,selectNotification:a}=Ee(),{isPanelVisible:c,isBulkActionsVisible:l}=Et(),u=((h=o.sourceFilter)==null?void 0:h.muted)??[],p=t.source&&u.includes(t.source)||u.includes("*");if(!c&&p)return null;const f=c&&r&&l,d=i.includes(t.id);return f?s.jsxs("div",{className:K("io-notification-list-bulk-action-item",{selected:d}),children:[s.jsx(Ci,{checked:d,onChange:m=>a(t.id,m.target.checked)}),s.jsx(n,{notification:t,...e})]}):s.jsx(n,{notification:t,...e})};function ws({className:t,Notification:n,notifications:e=[],noNotificationText:o="No notifications to display",...r}){const i=K("io-notification-list",t),{settings:a}=Ee(),{isPanelVisible:c}=Et(),{toastStacking:l}=a,u=l&&!c,p=e.length>0;return s.jsxs("div",{className:i,...r,children:[u&&s.jsx(Og,{}),!u&&(p?e.map(f=>s.jsx(Ng,{notification:f,Notification:n,...r},f.id)):s.jsx("div",{className:"flex jc-center mt-8",children:o}))]})}const hf={Header:Bd,HeaderCaptionTitle:Hd,HeaderCaptionCount:function({variant:t="primary",...n}){const{notificationsCount:e=0}=Ee();return e===0?null:s.jsx(Bl,{variant:t,...n,children:e>99?"99+":e})},HeaderCaptionButtonSettings:function({icon:t="cog",size:n="32",variant:e="circle",...o}){return Be()?s.jsx(Ue,{icon:t,size:n,variant:e,...o}):null},HeaderCaptionButtonClose:function({icon:t="close",size:n="32",variant:e="circle",onClick:o,...r}){const{hidePanel:i}=Ee(),a=Be();return s.jsx(Ue,{icon:t,size:n,variant:e,onClick:c=>{o?o(c):a&&i()},...r})},HeaderActions:function({className:t,...n}){const e=K("io-panel-header-actions",t),{HeaderActionSort:o,HeaderActionView:r,HeaderActionClear:i,HeaderActionEdit:a}=to();return s.jsxs("div",{className:e,...n,children:[s.jsxs(Re,{children:[s.jsx(o,{}),s.jsx(r,{})]}),s.jsxs(Re,{children:[s.jsx(i,{}),s.jsx(a,{})]})]})},HeaderActionSort:function({text:t="Sort by",...n}){const{sortNotificationsBy:e,setSortBy:o}=Et(),{onNotificationsSort:r}=(()=>{const{notifications:i}=Ee(),[a,c]=g.useState(Bc),{key:l,descending:u}=a,p=g.useMemo(()=>Eg[l](i,u),[i,l,u]);return{onNotificationsSort:g.useCallback(d=>{c(h=>({key:d,descending:h.key!==d?Bc.descending:!h.descending}))},[]),sortedNotifications:p}})();return s.jsxs(ae,{variant:"light",...n,children:[s.jsxs(ae.Button,{variant:"link",children:[t," ",s.jsx("strong",{children:e})]}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Severity"].map(i=>s.jsx(ae.Item,{isSelected:e===i.toLowerCase(),onClick:()=>{o(i.toLowerCase()),r(i.toLowerCase())},children:i},i))})})]})},HeaderActionView:function({text:t="View",...n}){var a;const{settings:e}=Ee(),{viewNotificationsBy:o,setViewBy:r}=Et(),i=(a=e.snooze)!=null&&a.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return s.jsxs(ae,{variant:"light",...n,children:[s.jsxs(ae.Button,{variant:"link",children:[t," ",s.jsx("strong",{children:o})]}),s.jsx(ae.Content,{children:s.jsx(ae.List,{variant:"single",checkIcon:"check",children:i.map(c=>s.jsx(ae.Item,{isSelected:o===c.toLowerCase(),onClick:()=>r(c.toLowerCase()),children:c},c))})})]})},HeaderActionClear:function({text:t="Clear All",...n}){const{clearAll:e,notificationsCount:o}=Ee();return s.jsx(Ge,{variant:"link",text:t,onClick:e,disabled:o===0,...n})},HeaderActionEdit:function({tooltip:t="Bulk Edit",...n}){const{isBulkActionsSupported:e,notificationsCount:o}=Ee(),{showBulkActions:r}=Et();return e?s.jsx(Ue,{icon:"pen-to-square",title:t,size:"32",onClick:r,disabled:o===0,...n}):null},HeaderBulkActions:function({className:t,...n}){const e=K("io-panel-header-bulk-actions",t),{HeaderBulkActionSelect:o,HeaderBulkActionSelectDropdown:r,HeaderBulkActionMarkAsRead:i,HeaderBulkActionMarkAsUnread:a,HeaderBulkActionSnooze:c,HeaderBulkActionClear:l,HeaderBulkActionClose:u}=to(),{isBulkActionsSupported:p}=Ee();return p?s.jsx("div",{className:e,...n,children:s.jsxs(Re,{children:[s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{}),s.jsx(a,{}),s.jsx(c,{}),s.jsx(l,{}),s.jsx(u,{})]})}):null},HeaderBulkActionSelect:function({...t}){const{isBulkActionsSupported:n,selectedNotifications:e,selectAllNotifications:o,notificationsCount:r}=Ee();return n?s.jsx(Ci,{checked:r===e.length&&r>0,onChange:i=>o("all",i.target.checked),disabled:r===0,...t}):null},HeaderBulkActionSelectDropdown:function({...t}){const{isBulkActionsSupported:n,selectAllNotifications:e,notificationsCount:o}=Ee();return n?s.jsxs(ae,{variant:"light",...t,children:[s.jsx(ae.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:o===0}),s.jsx(zl,{children:s.jsxs(ae.List,{variant:"single",checkIcon:"check",children:[s.jsx(ae.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(r=>s.jsx(ae.Item,{onClick:()=>e(r.toLowerCase(),!0),children:r},r))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:t="envelope-open",size:n="32",variant:e="circle",tooltip:o="Mark as read",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:c,notificationsCount:l}=Ee(),u=g.useCallback(()=>{c(a,"Seen")},[a,c]);return i?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:t="envelope",size:n="32",variant:e="circle",tooltip:o="Mark as unread",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:c,notificationsCount:l}=Ee(),u=g.useCallback(()=>{c(a,"Active")},[a,c]);return i?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionSnooze:function({icon:t="snooze",size:n="32",variant:e="circle",tooltip:o="Snooze",...r}){var f,d;const{isBulkActionsSupported:i,selectedNotifications:a,snoozeMany:c,settings:l,notificationsCount:u}=Ee(),p=g.useCallback(()=>{var h;c(a,((h=l.snooze)==null?void 0:h.duration)??0)},[a,c,(f=l.snooze)==null?void 0:f.duration]);return i&&((d=l.snooze)!=null&&d.enabled)?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:p,disabled:u===0,...r}):null},HeaderBulkActionClear:function({icon:t="trash",size:n="32",variant:e="circle",tooltip:o="Clear",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,clearMany:c,notificationsCount:l}=Ee(),u=g.useCallback(()=>{c(a)},[a,c]);return i?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionClose:function({text:t="Done",variant:n="primary",...e}){const{isBulkActionsSupported:o,notificationsCount:r}=Ee(),{hideBulkActions:i}=Et();return o?s.jsx(Ge,{variant:n,text:t,onClick:i,disabled:r===0,...e}):null},HeaderSearch:function({className:t,icon:n="search",placeholder:e="Search",...o}){const r=K("io-panel-header-search",t),{notificationsCount:i}=Ee(),{searchQuery:a,setSearch:c}=Et(),l=g.useRef(null);return s.jsxs("div",{className:r,children:[s.jsx(Qn,{ref:l,value:a,iconPrepend:n,placeholder:e,onChange:u=>c(u.target.value),...o}),a.length>0&&s.jsx("p",{className:"io-panel-header-search-count",children:`${i} results`})]})},Body:Ud,Footer:Vd,FooterButtons:Gd,FooterButtonClearAll:Yd,FooterButtonClearAllOld:Zd,Notification:Ii,NotificationsList:ws},mf=g.createContext(hf),gf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...hf,...n}),[n]);return s.jsx(mf.Provider,{value:e,children:t})});function to(t){return{...g.useContext(mf),...t}}function vf(){var r,i;const t=g.useContext(De.IOConnectContext),{settings:n}=Ee(),e=Be(),o=g.useCallback(async()=>{var l;const a=t.windows.my();if(!t||!a||!e)return;const c=a.placementSettings;await a.place({...c,horizontalAlignment:(l=n.placement)==null?void 0:l.panel})},[t,e,(r=n.placement)==null?void 0:r.panel]);g.useEffect(()=>{var a;t&&((a=n.placement)!=null&&a.panel)&&e&&o().catch(console.error)},[t,e,o,(i=n.placement)==null?void 0:i.panel])}function Ig({className:t,onClose:n,title:e="Notifications",...o}){var d,h;const{Header:r,Body:i}=to(),{settings:a}=Ee(),{isPanelVisible:c}=Et(),[l,u]=g.useState(!1),p=Be(),f=K("io-notifications-panel",((d=a.placement)==null?void 0:d.panel)==="left"&&"io-panel-left",((h=a.placement)==null?void 0:h.panel)==="right"&&"io-panel-right",t);return vf(),g.useEffect(()=>{c||u(!1)},[c]),s.jsxs(s.Fragment,{children:[s.jsxs(Ze,{className:f,...o,children:[s.jsx(r,{title:e,onClose:n,onOpenSettings:()=>u(!0)}),s.jsx(i,{})]}),p&&c&&s.jsx(Sg,{isOpen:l,onClose:()=>u(!1)})]})}gf.displayName="ComponentsStoreProvider";const yf={Body:function({className:t,notifications:n,maxToasts:e=1,...o}){const r=K("io-toasts-body",t),{NotificationsList:i,Notification:a}=xf(),[c,l]=g.useState([]);return g.useEffect(()=>{const u=e<0?n.length:e,p=n.filter(f=>f.state==="Active").slice(0,u);for(const f of p)f.onShow();l(p)},[n,e]),s.jsx("div",{className:r,...o,children:s.jsx(i,{Notification:a,notifications:c,noNotificationText:""})})},Notification:Ii,NotificationsList:ws},bf=g.createContext(yf),wf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...yf,...n}),[n]);return s.jsx(bf.Provider,{value:e,children:t})});function xf(t){return{...g.useContext(bf),...t}}function Cf(){var o,r;const t=g.useContext(De.IOConnectContext),{settings:n}=Ee(),e=g.useCallback(async()=>{var c,l;const i=t.windows.my();if(!t||!i)return;const a=i.placementSettings;await i.place({...a,horizontalAlignment:((c=n.placement)==null?void 0:c.toasts)==="top-right"||((l=n.placement)==null?void 0:l.toasts)==="bottom-right"?"right":"left"})},[t,(o=n.placement)==null?void 0:o.toasts]);g.useEffect(()=>{var i;t&&((i=n.placement)!=null&&i.toasts)&&e().catch(console.error)},[t,e,(r=n.placement)==null?void 0:r.toasts])}function Ag({className:t,maxToasts:n=10,...e}){var u,p,f,d,h,m,v,y;const{Header:o,Body:r,Footer:i}=xf(),{notifications:a,settings:c}=Ee(),l=K("io-toasts",(((u=c.placement)==null?void 0:u.toasts)==="top-left"||((p=c.placement)==null?void 0:p.toasts)==="top-right")&&"io-toasts-top",(((f=c.placement)==null?void 0:f.toasts)==="top-right"||((d=c.placement)==null?void 0:d.toasts)==="bottom-right")&&"io-toasts-right",(((h=c.placement)==null?void 0:h.toasts)==="bottom-left"||((m=c.placement)==null?void 0:m.toasts)==="bottom-right")&&"io-toasts-bottom",(((v=c.placement)==null?void 0:v.toasts)==="top-left"||((y=c.placement)==null?void 0:y.toasts)==="bottom-left")&&"io-toasts-left",t);return Cf(),s.jsxs("div",{className:l,...e,children:[o&&s.jsx(o,{}),s.jsx(r,{notifications:a,maxToasts:n}),i&&s.jsx(i,{})]})}wf.displayName="ComponentsStoreProvider";var kf=Object.freeze({__proto__:null,Notification:Ii,NotificationBody:of,NotificationBodyDescription:sf,NotificationBodyIcon:rf,NotificationBodyTitle:af,NotificationFooter:cf,NotificationFooterButton:lf,NotificationHeader:Kd,NotificationHeaderBadge:Jd,NotificationHeaderButtonClose:nf,NotificationHeaderButtonSnooze:tf,NotificationHeaderCount:qd,NotificationHeaderIcon:Xd,NotificationHeaderTimestamp:ef,NotificationHeaderTitle:Qd,NotificationStack:pf,NotificationsList:ws,NotificationsPanelProvider:({children:t})=>{const{searchQuery:n,setSearch:e,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:c,isBulkActionsVisible:l,showBulkActions:u,hideBulkActions:p}=function(){const d=g.useContext(De.IOConnectContext),[h,m]=g.useState(!1),[v,y]=g.useState("newest"),[b,S]=g.useState("all"),[k,C]=g.useState(""),[j,E]=g.useState(!1),P=Be(),{isBulkActionsSupported:H}=Ee();return g.useEffect(()=>{const z=tt.onPanelVisibilityChanged(q=>m(q));return()=>{z()}},[]),g.useEffect(()=>{P!==null&&P&&(async()=>{const z=await d.notifications.panel.isVisible();m(z)})()},[d.notifications.panel,P]),g.useEffect(()=>{h||(E(!1),S("all"))},[h]),{isPanelVisible:h,sortNotificationsBy:v,setSortBy:z=>{y(z)},viewNotificationsBy:b,setViewBy:z=>{S(z)},searchQuery:k,setSearch:z=>{C(z)},isBulkActionsVisible:j,showBulkActions:()=>{H&&E(!0)},hideBulkActions:()=>{H&&E(!1)}}}(),f=g.useMemo(()=>({searchQuery:n,setSearch:e,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:c,isBulkActionsVisible:l,showBulkActions:u,hideBulkActions:p}),[n,e,o,r,i,a,c,l,u,p]);return s.jsx(Fd.Provider,{value:f,children:t})},NotificationsProvider:({children:t})=>{const{notifications:n,notificationStacks:e,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:c,allowedApplications:l,clearAll:u,clearAllOld:p,close:f,hidePanel:d,showPanel:h,saveSetting:m,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:b,selectedNotifications:S,selectNotification:k,selectAllNotifications:C,clearMany:j,snooze:E,snoozeMany:P,setState:H,setStates:z,setCount:q}=Cg(),B=g.useMemo(()=>({notifications:n,notificationStacks:e,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:c,allowedApplications:l,clearAll:u,clearAllOld:p,onClose:f,hidePanel:d,showPanel:h,saveSetting:m,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:b,selectedNotifications:S,selectNotification:k,selectAllNotifications:C,clearMany:j,snooze:E,snoozeMany:P,setState:H,setStates:z,setCount:q}),[n,e,o,r,i,a,c,l,u,p,f,d,h,m,v,y,b,S,k,C,j,E,P,H,z,q]);return s.jsx(pd.Provider,{value:B,children:t})},Panel:function({components:t,settings:n,...e}){return s.jsx(bs,{components:n,children:s.jsx(gf,{components:t,children:s.jsx(Ig,{...e})})})},PanelBody:Ud,PanelFooter:Vd,PanelFooterButtonClearAll:Yd,PanelFooterButtonClearAllOld:Zd,PanelFooterButtons:Gd,PanelHeader:Bd,PanelHeaderCaptionTitle:Hd,SettingsAllowNotifications:hd,SettingsCloseNotificationOnClick:gd,SettingsGeneral:ld,SettingsHideToastsAfter:bd,SettingsMarkAsNew:wd,SettingsMarkAsRead:xd,SettingsPanel:Rd,SettingsPanelAlwaysOnTop:yd,SettingsPanelAutoHide:vd,SettingsPlacement:Ed,SettingsPlacementPanel:jd,SettingsPlacementToasts:Od,SettingsShowNotificationBadge:md,SettingsSnooze:Nd,SettingsSnoozeDuration:Id,SettingsStacking:Cd,SettingsSubscribeAll:Pd,SettingsSubscribeApp:Td,SettingsSubscribeMuteAll:Dd,SettingsSubscribeMuteApp:Md,SettingsSubscriptions:Ad,SettingsToastStackBy:Sd,SettingsToastStacking:kd,Toasts:function({components:t,...n}){return s.jsx(wf,{components:t,children:s.jsx(Ag,{...n})})},useAddRemoveApps:vs,useHidePanelOnFocusLost:function(t=!0){const n=g.useContext(De.IOConnectContext),e=Be();return g.useEffect(()=>{var r;if(!n||!t||e===null||!e)return;const o=(r=n.windows.my())==null?void 0:r.onFocusChanged(i=>{i.isFocused||n.notifications.panel.hide().catch(a=>{console.error("Error hiding panel:",a)})});return()=>o==null?void 0:o()},[n,e,t]),n},useHidePanelOnKeyUp:function(t="Escape"){const{hidePanel:n}=Ee();hm(t,n)},useNotificationStacking:ud,useNotificationsContext:Ee,useNotificationsPanelContext:Et,usePanelWindowPlacement:vf,useSelectNotifications:dd,useShowHidePanelWindow:function(t=!0){const n=g.useContext(De.IOConnectContext),e=n==null?void 0:n.windows.my(),o=Be(),{isPanelVisible:r}=Et();return g.useEffect(()=>{n&&e&&o&&(r?e.show().then(()=>{t&&e.focus().catch(i=>{console.error("Error focusing window:",i)})}).catch(i=>console.error("Error showing window:",i)):e.hide().catch(i=>console.error("Error hiding window:",i)))},[n,e,o,r,t]),{myWindow:e}},useToastsWindowPlacement:Cf});const Pg=t=>{const{General:n,Layouts:e,Downloads:o,System:r}=mr();return s.jsxs(So,{...t,children:[s.jsx(n,{}),s.jsx(e,{}),s.jsx(o,{}),s.jsx(r,{})]})},Tg=({className:t,title:n="General",...e})=>{const{Theme:o,PinnedPosition:r,MinimizeToTray:i,ShowTutorialOnStartup:a}=mr();return s.jsxs(Ke,{className:K("io-block io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{}),s.jsx(a,{})]})},$c=(t="dark")=>{switch(t){case"dark":return"Dark";case"light":return"Light";default:return t}},xs=({className:t,title:n="Theme",...e})=>{const{currentTheme:o,selectTheme:r}=(()=>{const a=g.useContext(De.IOConnectContext),[c,l]=g.useState(null),u=g.useCallback(p=>{var f;return(f=a==null?void 0:a.themes)==null?void 0:f.select(p)},[a]);return g.useEffect(()=>{var d,h;if(!a)return;let p=!1;const f=m=>{p||l(m)};return(d=a.themes)==null||d.onChanged(f),(h=a.themes)==null||h.getCurrent().then(f).catch(console.warn),()=>{p=!0}},[a]),{currentTheme:c,selectTheme:u}})(),i=(()=>{const a=g.useContext(De.IOConnectContext),[c,l]=g.useState([]);return g.useEffect(()=>{var u;a&&((u=a.themes)==null||u.list().then(l).catch(console.warn))},[a]),c})();return s.jsxs("div",{className:K("flex jc-between ai-center",t),...e,children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsxs(ae,{variant:"light",children:[s.jsx(ae.Button,{text:$c(o==null?void 0:o.name)}),s.jsx(ae.Content,{children:s.jsx(ae.List,{children:i.map(({name:a})=>s.jsx(ae.Item,{onClick:()=>r(a),children:$c(a)},a))})})]})]})},Dg=({prefKey:t,options:n,disabled:e,...o})=>{const{isLoading:r,value:i="Select option",update:a}=Ht({prefKey:t});return s.jsxs(ae,{variant:"light",disabled:r||e,...o,children:[s.jsx(ae.Button,{children:i}),s.jsx(ae.Content,{children:s.jsx(ae.List,{children:n.map(c=>s.jsx(ae.Item,{onClick:()=>(async l=>{if(l!==i)try{await a(l)}catch(u){console.error("Failed to update platform preference:",u)}})(c),children:c},c))})})]})},Mg=({className:t,label:n="Pinned position",...e})=>s.jsx(Ke,{className:K("io-block-list-gap",t),...e,children:s.jsxs("div",{className:"flex jc-between ai-center",children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsx(Dg,{className:t,prefKey:Tu,options:["Left","Right"],...e})]})}),hn=({prefKey:t,...n})=>{const{isLoading:e,value:o=!1,update:r}=Ht({prefKey:t});return s.jsx(ft,{checked:o,disabled:e,onChange:i=>r(i.target.checked),...n})},_g=({align:t="right",label:n="Allow docking",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Du,...e}),Lg=({align:t="right",label:n="Minimize to tray",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Mu,...e}),Rg=({align:t="right",label:n="Auto-close on starting apps and workspaces",...e})=>s.jsx(hn,{align:t,label:n,prefKey:_u,disabled:!0,...e}),Fg=({align:t="right",label:n="Show tutorial on startup",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Lu,...e}),Bg=({className:t,title:n="Layouts",...e})=>{const{LayoutsSaveCurrentOnExit:o,LayoutsShowDeletePrompt:r,LayoutsShowUnsavedChangesPrompt:i}=mr();return s.jsxs(Ke,{className:K("io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(i,{}),s.jsx(r,{})]})},Hg=({align:t="right",label:n="Restore last saved on startup",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Ru,...e}),Wg=({align:t="right",label:n="Save current on exit",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Fu,...e}),Cs=({align:t="right",label:n="Show prompt for unsaved changes",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Bu,...e}),ks=({align:t="right",label:n="Show prompt for deleting",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Hu,...e}),zg=({className:t,title:n="Downloads",...e})=>{const{DownloadsLocation:o}=mr();return s.jsx(Ke,{className:K("io-block-list-gap",t),title:n,...e,children:s.jsx(o,{})})},$g=({align:t="right",label:n="Ask where to save each file before downloading",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Wu,...e}),Ug=({className:t,label:n="Location",...e})=>{const{configuration:{downloadFolder:o},setDownloadLocationWithDialog:r,isDownloadLocationDialogVisible:i,downloadLocationList:a}=Pn();return s.jsxs(Ke,{className:K("io-block-list-gap",t),...e,children:[s.jsxs("div",{className:"flex jc-between ai-center",children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsx(Ge,{text:"Change",onClick:r,disabled:i})]}),s.jsx("p",{children:o??(a==null?void 0:a[0])??"Not set"})]})},Vg=({className:t,title:n="System",...e})=>{const{SystemRestartSection:o,SystemShutdownSection:r}=mr();return s.jsxs(Ke,{className:K("io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(r,{})]})};var oa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],bo={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return typeof console<"u"&&console.warn(t)},getWeek:function(t){var n=new Date(t.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var e=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},sr={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var n=t%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Tt=function(t,n){return n===void 0&&(n=2),("000"+t).slice(-1*n)},Ut=function(t){return t===!0?1:0};function Uc(t,n){var e;return function(){var o=this,r=arguments;clearTimeout(e),e=setTimeout(function(){return t.apply(o,r)},n)}}var ra=function(t){return t instanceof Array?t:[t]};function Ot(t,n,e){if(e===!0)return t.classList.add(n);t.classList.remove(n)}function He(t,n,e){var o=window.document.createElement(t);return n=n||"",e=e||"",o.className=n,e!==void 0&&(o.textContent=e),o}function Ar(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Sf(t,n){return n(t)?t:t.parentNode?Sf(t.parentNode,n):void 0}function Pr(t,n){var e=He("div","numInputWrapper"),o=He("input","numInput "+t),r=He("span","arrowUp"),i=He("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?o.type="number":(o.type="text",o.pattern="\\d*"),n!==void 0)for(var a in n)o.setAttribute(a,n[a]);return e.appendChild(o),e.appendChild(r),e.appendChild(i),e}function Lt(t){try{return typeof t.composedPath=="function"?t.composedPath()[0]:t.target}catch{return t.target}}var ia=function(){},ri=function(t,n,e){return e.months[n?"shorthand":"longhand"][t]},Gg={D:ia,F:function(t,n,e){t.setMonth(e.months.longhand.indexOf(n))},G:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},H:function(t,n){t.setHours(parseFloat(n))},J:function(t,n){t.setDate(parseFloat(n))},K:function(t,n,e){t.setHours(t.getHours()%12+12*Ut(new RegExp(e.amPM[1],"i").test(n)))},M:function(t,n,e){t.setMonth(e.months.shorthand.indexOf(n))},S:function(t,n){t.setSeconds(parseFloat(n))},U:function(t,n){return new Date(1e3*parseFloat(n))},W:function(t,n,e){var o=parseInt(n),r=new Date(t.getFullYear(),0,2+7*(o-1),0,0,0,0);return r.setDate(r.getDate()-r.getDay()+e.firstDayOfWeek),r},Y:function(t,n){t.setFullYear(parseFloat(n))},Z:function(t,n){return new Date(n)},d:function(t,n){t.setDate(parseFloat(n))},h:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},i:function(t,n){t.setMinutes(parseFloat(n))},j:function(t,n){t.setDate(parseFloat(n))},l:ia,m:function(t,n){t.setMonth(parseFloat(n)-1)},n:function(t,n){t.setMonth(parseFloat(n)-1)},s:function(t,n){t.setSeconds(parseFloat(n))},u:function(t,n){return new Date(parseFloat(n))},w:ia,y:function(t,n){t.setFullYear(2e3+parseFloat(n))}},zn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Qo={Z:function(t){return t.toISOString()},D:function(t,n,e){return n.weekdays.shorthand[Qo.w(t,n,e)]},F:function(t,n,e){return ri(Qo.n(t,n,e)-1,!1,n)},G:function(t,n,e){return Tt(Qo.h(t,n,e))},H:function(t){return Tt(t.getHours())},J:function(t,n){return n.ordinal!==void 0?t.getDate()+n.ordinal(t.getDate()):t.getDate()},K:function(t,n){return n.amPM[Ut(t.getHours()>11)]},M:function(t,n){return ri(t.getMonth(),!0,n)},S:function(t){return Tt(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,n,e){return e.getWeek(t)},Y:function(t){return Tt(t.getFullYear(),4)},d:function(t){return Tt(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return Tt(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,n){return n.weekdays.longhand[t.getDay()]},m:function(t){return Tt(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},Ef=function(t){var n=t.config,e=n===void 0?bo:n,o=t.l10n,r=o===void 0?sr:o,i=t.isMobile,a=i!==void 0&&i;return function(c,l,u){var p=u||r;return e.formatDate===void 0||a?l.split("").map(function(f,d,h){return Qo[f]&&h[d-1]!=="\\"?Qo[f](c,p,e):f!=="\\"?f:""}).join(""):e.formatDate(c,l,p)}},za=function(t){var n=t.config,e=n===void 0?bo:n,o=t.l10n,r=o===void 0?sr:o;return function(i,a,c,l){if(i===0||i){var u,p=l||r,f=i;if(i instanceof Date)u=new Date(i.getTime());else if(typeof i!="string"&&i.toFixed!==void 0)u=new Date(i);else if(typeof i=="string"){var d=a||(e||bo).dateFormat,h=String(i).trim();if(h==="today")u=new Date,c=!0;else if(e&&e.parseDate)u=e.parseDate(i,d);else if(/Z$/.test(h)||/GMT$/.test(h))u=new Date(i);else{for(var m=void 0,v=[],y=0,b=0,S="";y<d.length;y++){var k=d[y],C=k==="\\",j=d[y-1]==="\\"||C;if(zn[k]&&!j){S+=zn[k];var E=new RegExp(S).exec(i);E&&(m=!0)&&v[k!=="Y"?"push":"unshift"]({fn:Gg[k],val:E[++b]})}else C||(S+=".")}u=e&&e.noCalendar?new Date(new Date().setHours(0,0,0,0)):new Date(new Date().getFullYear(),0,1,0,0,0,0),v.forEach(function(P){var H=P.fn,z=P.val;return u=H(u,z,p)||u}),u=m?u:void 0}}if(u instanceof Date&&!isNaN(u.getTime()))return c===!0&&u.setHours(0,0,0,0),u;e.errorHandler(new Error("Invalid date provided: "+f))}}};function Rt(t,n,e){return e===void 0&&(e=!0),e!==!1?new Date(t.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):t.getTime()-n.getTime()}var Yg=function(t,n,e){return t>Math.min(n,e)&&t<Math.max(n,e)},aa=function(t,n,e){return 3600*t+60*n+e},Zg=function(t){var n=Math.floor(t/3600),e=(t-3600*n)/60;return[n,e,t-3600*n-60*e]},Kg={DAY:864e5};function sa(t){var n=t.defaultHour,e=t.defaultMinute,o=t.defaultSeconds;if(t.minDate!==void 0){var r=t.minDate.getHours(),i=t.minDate.getMinutes(),a=t.minDate.getSeconds();n<r&&(n=r),n===r&&e<i&&(e=i),n===r&&e===i&&o<a&&(o=t.minDate.getSeconds())}if(t.maxDate!==void 0){var c=t.maxDate.getHours(),l=t.maxDate.getMinutes();(n=Math.min(n,c))===c&&(e=Math.min(l,e)),n===c&&e===l&&(o=t.maxDate.getSeconds())}return{hours:n,minutes:e,seconds:o}}typeof Object.assign!="function"&&(Object.assign=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];if(!t)throw TypeError("Cannot convert undefined or null to object");for(var o=function(a){a&&Object.keys(a).forEach(function(c){return t[c]=a[c]})},r=0,i=n;r<i.length;r++)o(i[r]);return t});var Ct=function(){return Ct=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ct.apply(this,arguments)},Vc=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var o=Array(t),r=0;for(n=0;n<e;n++)for(var i=arguments[n],a=0,c=i.length;a<c;a++,r++)o[r]=i[a];return o},qg=300;function Jg(t,n){var e={config:Ct(Ct({},bo),nt.defaultConfig),l10n:sr};function o(){var x;return((x=e.calendarContainer)===null||x===void 0?void 0:x.getRootNode()).activeElement||document.activeElement}function r(x){return x.bind(e)}function i(){var x=e.config;x.weekNumbers===!1&&x.showMonths===1||x.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var w=(e.days.offsetWidth+1)*x.showMonths;e.daysContainer.style.width=w+"px",e.calendarContainer.style.width=w+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function a(x){if(e.selectedDates.length===0){var w=e.config.minDate===void 0||Rt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),O=sa(e.config);w.setHours(O.hours,O.minutes,O.seconds,w.getMilliseconds()),e.selectedDates=[w],e.latestSelectedDateObj=w}x!==void 0&&x.type!=="blur"&&function(R){R.preventDefault();var ne=R.type==="keydown",J=Lt(R),$=J;e.amPM!==void 0&&J===e.amPM&&(e.amPM.textContent=e.l10n.amPM[Ut(e.amPM.textContent===e.l10n.amPM[0])]);var F=parseFloat($.getAttribute("min")),Z=parseFloat($.getAttribute("max")),le=parseFloat($.getAttribute("step")),ie=parseInt($.value,10),oe=R.delta||(ne?R.which===38?1:-1:0),ee=ie+le*oe;if($.value!==void 0&&$.value.length===2){var ye=$===e.hourElement,Ae=$===e.minuteElement;ee<F?(ee=Z+ee+Ut(!ye)+(Ut(ye)&&Ut(!e.amPM)),Ae&&v(void 0,-1,e.hourElement)):ee>Z&&(ee=$===e.hourElement?ee-Z-Ut(!e.amPM):F,Ae&&v(void 0,1,e.hourElement)),e.amPM&&ye&&(le===1?ee+ie===23:Math.abs(ee-ie)>le)&&(e.amPM.textContent=e.l10n.amPM[Ut(e.amPM.textContent===e.l10n.amPM[0])]),$.value=Tt(ee)}}(x);var N=e._input.value;c(),Pe(),e._input.value!==N&&e._debouncedChange()}function c(){if(e.hourElement!==void 0&&e.minuteElement!==void 0){var x,w,O=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,N=(parseInt(e.minuteElement.value,10)||0)%60,R=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(x=O,w=e.amPM.textContent,O=x%12+12*Ut(w===e.l10n.amPM[1]));var ne=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Rt(e.latestSelectedDateObj,e.config.minDate,!0)===0,J=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Rt(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var $=aa(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),F=aa(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),Z=aa(O,N,R);if(Z>F&&Z<$){var le=Zg($);O=le[0],N=le[1],R=le[2]}}else{if(J){var ie=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;(O=Math.min(O,ie.getHours()))===ie.getHours()&&(N=Math.min(N,ie.getMinutes())),N===ie.getMinutes()&&(R=Math.min(R,ie.getSeconds()))}if(ne){var oe=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;(O=Math.max(O,oe.getHours()))===oe.getHours()&&N<oe.getMinutes()&&(N=oe.getMinutes()),N===oe.getMinutes()&&(R=Math.max(R,oe.getSeconds()))}}u(O,N,R)}}function l(x){var w=x||e.latestSelectedDateObj;w&&w instanceof Date&&u(w.getHours(),w.getMinutes(),w.getSeconds())}function u(x,w,O){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(x%24,w,O||0,0),e.hourElement&&e.minuteElement&&!e.isMobile&&(e.hourElement.value=Tt(e.config.time_24hr?x:(12+x)%12+12*Ut(x%12==0)),e.minuteElement.value=Tt(w),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[Ut(x>=12)]),e.secondElement!==void 0&&(e.secondElement.value=Tt(O)))}function p(x){var w=Lt(x),O=parseInt(w.value)+(x.delta||0);(O/1e3>1||x.key==="Enter"&&!/[^\d]/.test(O.toString()))&&ve(O)}function f(x,w,O,N){return w instanceof Array?w.forEach(function(R){return f(x,R,O,N)}):x instanceof Array?x.forEach(function(R){return f(R,w,O,N)}):(x.addEventListener(w,O,N),void e._handlers.push({remove:function(){return x.removeEventListener(w,O,N)}}))}function d(){I("onChange")}function h(x,w){var O=x!==void 0?e.parseDate(x):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),N=e.currentYear,R=e.currentMonth;try{O!==void 0&&(e.currentYear=O.getFullYear(),e.currentMonth=O.getMonth())}catch(ne){ne.message="Invalid date supplied: "+O,e.config.errorHandler(ne)}w&&e.currentYear!==N&&(I("onYearChange"),E()),!w||e.currentYear===N&&e.currentMonth===R||I("onMonthChange"),e.redraw()}function m(x){var w=Lt(x);~w.className.indexOf("arrow")&&v(x,w.classList.contains("arrowUp")?1:-1)}function v(x,w,O){var N=x&&Lt(x),R=O||N&&N.parentNode&&N.parentNode.firstChild,ne=ke("increment");ne.delta=w,R&&R.dispatchEvent(ne)}function y(x,w,O,N){var R=Y(w,!0),ne=He("span",x,w.getDate().toString());return ne.dateObj=w,ne.$i=N,ne.setAttribute("aria-label",e.formatDate(w,e.config.ariaDateFormat)),x.indexOf("hidden")===-1&&Rt(w,e.now)===0&&(e.todayDateElem=ne,ne.classList.add("today"),ne.setAttribute("aria-current","date")),R?(ne.tabIndex=-1,xe(w)&&(ne.classList.add("selected"),e.selectedDateElem=ne,e.config.mode==="range"&&(Ot(ne,"startRange",e.selectedDates[0]&&Rt(w,e.selectedDates[0],!0)===0),Ot(ne,"endRange",e.selectedDates[1]&&Rt(w,e.selectedDates[1],!0)===0),x==="nextMonthDay"&&ne.classList.add("inRange")))):ne.classList.add("flatpickr-disabled"),e.config.mode==="range"&&function(J){return!(e.config.mode!=="range"||e.selectedDates.length<2)&&Rt(J,e.selectedDates[0])>=0&&Rt(J,e.selectedDates[1])<=0}(w)&&!xe(w)&&ne.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&x!=="prevMonthDay"&&N%7==6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(w)+"</span>"),I("onDayCreate",ne),ne}function b(x){x.focus(),e.config.mode==="range"&&ce(x)}function S(x){for(var w=x>0?0:e.config.showMonths-1,O=x>0?e.config.showMonths:-1,N=w;N!=O;N+=x)for(var R=e.daysContainer.children[N],ne=x>0?0:R.children.length-1,J=x>0?R.children.length:-1,$=ne;$!=J;$+=x){var F=R.children[$];if(F.className.indexOf("hidden")===-1&&Y(F.dateObj))return F}}function k(x,w){var O=o(),N=de(O||document.body),R=x!==void 0?x:N?O:e.selectedDateElem!==void 0&&de(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&de(e.todayDateElem)?e.todayDateElem:S(w>0?1:-1);R===void 0?e._input.focus():N?function(ne,J){for(var $=ne.className.indexOf("Month")===-1?ne.dateObj.getMonth():e.currentMonth,F=J>0?e.config.showMonths:-1,Z=J>0?1:-1,le=$-e.currentMonth;le!=F;le+=Z)for(var ie=e.daysContainer.children[le],oe=$-e.currentMonth===le?ne.$i+J:J<0?ie.children.length-1:0,ee=ie.children.length,ye=oe;ye>=0&&ye<ee&&ye!=(J>0?ee:-1);ye+=Z){var Ae=ie.children[ye];if(Ae.className.indexOf("hidden")===-1&&Y(Ae.dateObj)&&Math.abs(ne.$i-ye)>=Math.abs(J))return b(Ae)}e.changeMonth(Z),k(S(Z),0)}(R,w):b(R)}function C(x,w){for(var O=(new Date(x,w,1).getDay()-e.l10n.firstDayOfWeek+7)%7,N=e.utils.getDaysInMonth((w-1+12)%12,x),R=e.utils.getDaysInMonth(w,x),ne=window.document.createDocumentFragment(),J=e.config.showMonths>1,$=J?"prevMonthDay hidden":"prevMonthDay",F=J?"nextMonthDay hidden":"nextMonthDay",Z=N+1-O,le=0;Z<=N;Z++,le++)ne.appendChild(y("flatpickr-day "+$,new Date(x,w-1,Z),0,le));for(Z=1;Z<=R;Z++,le++)ne.appendChild(y("flatpickr-day",new Date(x,w,Z),0,le));for(var ie=R+1;ie<=42-O&&(e.config.showMonths===1||le%7!=0);ie++,le++)ne.appendChild(y("flatpickr-day "+F,new Date(x,w+1,ie%R),0,le));var oe=He("div","dayContainer");return oe.appendChild(ne),oe}function j(){if(e.daysContainer!==void 0){Ar(e.daysContainer),e.weekNumbers&&Ar(e.weekNumbers);for(var x=document.createDocumentFragment(),w=0;w<e.config.showMonths;w++){var O=new Date(e.currentYear,e.currentMonth,1);O.setMonth(e.currentMonth+w),x.appendChild(C(O.getFullYear(),O.getMonth()))}e.daysContainer.appendChild(x),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&ce()}}function E(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var x=function(N){return!(e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&N<e.config.minDate.getMonth())&&!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&N>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var w=0;w<12;w++)if(x(w)){var O=He("option","flatpickr-monthDropdown-month");O.value=new Date(e.currentYear,w).getMonth().toString(),O.textContent=ri(w,e.config.shorthandCurrentMonth,e.l10n),O.tabIndex=-1,e.currentMonth===w&&(O.selected=!0),e.monthsDropdownContainer.appendChild(O)}}}function P(){var x,w=He("div","flatpickr-month"),O=window.document.createDocumentFragment();e.config.showMonths>1||e.config.monthSelectorType==="static"?x=He("span","cur-month"):(e.monthsDropdownContainer=He("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),f(e.monthsDropdownContainer,"change",function(J){var $=Lt(J),F=parseInt($.value,10);e.changeMonth(F-e.currentMonth),I("onMonthChange")}),E(),x=e.monthsDropdownContainer);var N=Pr("cur-year",{tabindex:"-1"}),R=N.getElementsByTagName("input")[0];R.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&R.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(R.setAttribute("max",e.config.maxDate.getFullYear().toString()),R.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var ne=He("div","flatpickr-current-month");return ne.appendChild(x),ne.appendChild(N),O.appendChild(ne),w.appendChild(O),{container:w,yearElement:R,monthElement:x}}function H(){Ar(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var x=e.config.showMonths;x--;){var w=P();e.yearElements.push(w.yearElement),e.monthElements.push(w.monthElement),e.monthNav.appendChild(w.container)}e.monthNav.appendChild(e.nextMonthNav)}function z(){e.weekdayContainer?Ar(e.weekdayContainer):e.weekdayContainer=He("div","flatpickr-weekdays");for(var x=e.config.showMonths;x--;){var w=He("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(w)}return q(),e.weekdayContainer}function q(){if(e.weekdayContainer){var x=e.l10n.firstDayOfWeek,w=Vc(e.l10n.weekdays.shorthand);x>0&&x<w.length&&(w=Vc(w.splice(x,w.length),w.splice(0,x)));for(var O=e.config.showMonths;O--;)e.weekdayContainer.children[O].innerHTML=`
8
+ */var Xr=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),uu=typeof Element>"u",ko=uu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Br=!uu&&Element.prototype.getRootNode?function(t){var n;return t==null||(n=t.getRootNode)===null||n===void 0?void 0:n.call(t)}:function(t){return t==null?void 0:t.ownerDocument},Qr=function t(n,e){var o;e===void 0&&(e=!0);var r=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert");return r===""||r==="true"||e&&n&&t(n.parentNode)},Eh=function t(n,e,o){for(var r=[],i=Array.from(n);i.length;){var a=i.shift();if(!Qr(a,!1))if(a.tagName==="SLOT"){var c=a.assignedElements(),l=t(c.length?c:a.children,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:a,candidates:l})}else{ko.call(a,Xr)&&o.filter(a)&&(e||!n.includes(a))&&r.push(a);var u=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),f=!Qr(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(u&&f){var p=t(u===!0?a.children:u.children,!0,o);o.flatten?r.push.apply(r,p):r.push({scopeParent:a,candidates:p})}else i.unshift.apply(i,a.children)}}return r},du=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},fu=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(n){var e,o=n==null||(e=n.getAttribute)===null||e===void 0?void 0:e.call(n,"contenteditable");return o===""||o==="true"}(t))&&!du(t)?0:t.tabIndex},jh=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},pu=function(t){return t.tagName==="INPUT"},Oh=function(t){return function(n){return pu(n)&&n.type==="radio"}(t)&&!function(n){if(!n.name)return!0;var e,o=n.form||Br(n),r=function(a){return o.querySelectorAll('input[type="radio"][name="'+a+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")e=r(window.CSS.escape(n.name));else try{e=r(n.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=function(a,c){for(var l=0;l<a.length;l++)if(a[l].checked&&a[l].form===c)return a[l]}(e,n.form);return!i||i===n}(t)},cc=function(t){var n=t.getBoundingClientRect(),e=n.width,o=n.height;return e===0&&o===0},Nh=function(t,n){var e=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=ko.call(t,"details>summary:first-of-type")?t.parentElement:t;if(ko.call(r,"details:not([open]) *"))return!0;if(e&&e!=="full"&&e!=="legacy-full"){if(e==="non-zero-area")return cc(t)}else{if(typeof o=="function"){for(var i=t;t;){var a=t.parentElement,c=Br(t);if(a&&!a.shadowRoot&&o(a)===!0)return cc(t);t=t.assignedSlot?t.assignedSlot:a||c===t.ownerDocument?a:c.host}t=i}if(function(l){var u,f,p,d,h=l&&Br(l),m=(u=h)===null||u===void 0?void 0:u.host,v=!1;if(h&&h!==l)for(v=!!((f=m)!==null&&f!==void 0&&(p=f.ownerDocument)!==null&&p!==void 0&&p.contains(m)||l!=null&&(d=l.ownerDocument)!==null&&d!==void 0&&d.contains(l));!v&&m;){var y,b,S;v=!((b=m=(y=h=Br(m))===null||y===void 0?void 0:y.host)===null||b===void 0||(S=b.ownerDocument)===null||S===void 0||!S.contains(m))}return v}(t))return!t.getClientRects().length;if(e!=="legacy-full")return!0}return!1},Ih=function(t,n){return!(n.disabled||Qr(n)||function(e){return pu(e)&&e.type==="hidden"}(n)||Nh(n,t)||function(e){return e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"})}(n)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var o=e.parentElement;o;){if(o.tagName==="FIELDSET"&&o.disabled){for(var r=0;r<o.children.length;r++){var i=o.children.item(r);if(i.tagName==="LEGEND")return!!ko.call(o,"fieldset[disabled] *")||!i.contains(e)}return!0}o=o.parentElement}return!1}(n))},Ea=function(t,n){return!(Oh(n)||fu(n)<0||!Ih(t,n))},Ah=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ph=function t(n){var e=[],o=[];return n.forEach(function(r,i){var a=!!r.scopeParent,c=a?r.scopeParent:r,l=function(f,p){var d=fu(f);return d<0&&p&&!du(f)?0:d}(c,a),u=a?t(r.candidates):c;l===0?a?e.push.apply(e,u):e.push(c):o.push({documentOrder:i,tabIndex:l,item:r,isScope:a,content:u})}),o.sort(jh).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(e)},ds=function(t,n){var e;return e=(n=n||{}).getShadowRoot?Eh([t],n.includeContainer,{filter:Ea.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Ah}):function(o,r,i){if(Qr(o))return[];var a=Array.prototype.slice.apply(o.querySelectorAll(Xr));return r&&ko.call(o,Xr)&&a.unshift(o),a.filter(i)}(t,n.includeContainer,Ea.bind(null,n)),Ph(e)},Th=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ko.call(t,Xr)!==!1&&Ea(n,t)};function lc(t,n,e){let{reference:o,floating:r}=t;const i=yi(n),a=lu(n),c=cu(a),l=Kn(n),u=i==="y",f=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let h;switch(l){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:p};break;case"left":h={x:o.x-r.width,y:p};break;default:h={x:o.x,y:o.y}}switch(qr(n)){case"start":h[a]-=d*(e&&u?-1:1);break;case"end":h[a]+=d*(e&&u?-1:1)}return h}async function hu(t,n){var e;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:a,elements:c,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:d=!1,padding:h=0}=vi(n,t),m=function(E){return typeof E!="number"?function(O){return{top:0,right:0,bottom:0,left:0,...O}}(E):{top:E,right:E,bottom:E,left:E}}(h),v=c[d?p==="floating"?"reference":"floating":p],y=Jr(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(v)))==null||e?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:l})),b=p==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),w=await(i.isElement==null?void 0:i.isElement(S))&&await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1},x=Jr(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:S,strategy:l}):b);return{top:(y.top-x.top+m.top)/w.y,bottom:(x.bottom-y.bottom+m.bottom)/w.y,left:(y.left-x.left+m.left)/w.x,right:(x.right-y.right+m.right)/w.x}}function mu(t){const n=Vt(t);let e=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=dt(t),i=r?t.offsetWidth:e,a=r?t.offsetHeight:o,c=Kr(e)!==i||Kr(o)!==a;return c&&(e=i,o=a),{width:e,height:o,$:c}}function fs(t){return Ye(t)?t:t.contextElement}function yo(t){const n=fs(t);if(!dt(n))return In(1);const e=n.getBoundingClientRect(),{width:o,height:r,$:i}=mu(n);let a=(i?Kr(e.width):e.width)/o,c=(i?Kr(e.height):e.height)/r;return a&&Number.isFinite(a)||(a=1),c&&Number.isFinite(c)||(c=1),{x:a,y:c}}const Dh=In(0);function gu(t){const n=Bt(t);return mi()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:Dh}function Xn(t,n,e,o){n===void 0&&(n=!1),e===void 0&&(e=!1);const r=t.getBoundingClientRect(),i=fs(t);let a=In(1);n&&(o?Ye(o)&&(a=yo(o)):a=yo(t));const c=function(d,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==Bt(d))&&h}(i,e,o)?gu(i):In(0);let l=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,f=r.width/a.x,p=r.height/a.y;if(i){const d=Bt(i),h=o&&Ye(o)?Bt(o):o;let m=d,v=m.frameElement;for(;v&&o&&h!==m;){const y=yo(v),b=v.getBoundingClientRect(),S=Vt(v),w=b.left+(v.clientLeft+parseFloat(S.paddingLeft))*y.x,x=b.top+(v.clientTop+parseFloat(S.paddingTop))*y.y;l*=y.x,u*=y.y,f*=y.x,p*=y.y,l+=w,u+=x,m=Bt(v),v=m.frameElement}}return Jr({width:f,height:p,x:l,y:u})}const Mh=[":popover-open",":modal"];function ja(t){return Mh.some(n=>{try{return t.matches(n)}catch{return!1}})}function vu(t){return Xn(fn(t)).left+gi(t).scrollLeft}function uc(t,n,e){let o;if(n==="viewport")o=function(r,i){const a=Bt(r),c=fn(r),l=a.visualViewport;let u=c.clientWidth,f=c.clientHeight,p=0,d=0;if(l){u=l.width,f=l.height;const h=mi();(!h||h&&i==="fixed")&&(p=l.offsetLeft,d=l.offsetTop)}return{width:u,height:f,x:p,y:d}}(t,e);else if(n==="document")o=function(r){const i=fn(r),a=gi(r),c=r.ownerDocument.body,l=Zn(i.scrollWidth,i.clientWidth,c.scrollWidth,c.clientWidth),u=Zn(i.scrollHeight,i.clientHeight,c.scrollHeight,c.clientHeight);let f=-a.scrollLeft+vu(r);const p=-a.scrollTop;return Vt(c).direction==="rtl"&&(f+=Zn(i.clientWidth,c.clientWidth)-l),{width:l,height:u,x:f,y:p}}(fn(t));else if(Ye(n))o=function(r,i){const a=Xn(r,!0,i==="fixed"),c=a.top+r.clientTop,l=a.left+r.clientLeft,u=dt(r)?yo(r):In(1);return{width:r.clientWidth*u.x,height:r.clientHeight*u.y,x:l*u.x,y:c*u.y}}(n,e);else{const r=gu(t);o={...n,x:n.x-r.x,y:n.y-r.y}}return Jr(o)}function yu(t,n){const e=dn(t);return!(e===n||!Ye(e)||En(e))&&(Vt(e).position==="fixed"||yu(e,n))}function _h(t,n,e){const o=dt(n),r=fn(n),i=e==="fixed",a=Xn(t,!0,i,n);let c={scrollLeft:0,scrollTop:0};const l=In(0);if(o||!o&&!i)if((Nn(n)!=="body"||or(r))&&(c=gi(n)),o){const u=Xn(n,!0,i,n);l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}else r&&(l.x=vu(r));return{x:a.left+c.scrollLeft-l.x,y:a.top+c.scrollTop-l.y,width:a.width,height:a.height}}function Ui(t){return Vt(t).position==="static"}function dc(t,n){return dt(t)&&Vt(t).position!=="fixed"?n?n(t):t.offsetParent:null}function fc(t,n){const e=Bt(t);if(ja(t))return e;if(!dt(t)){let r=dn(t);for(;r&&!En(r);){if(Ye(r)&&!Ui(r))return r;r=dn(r)}return e}let o=dc(t,n);for(;o&&wh(o)&&Ui(o);)o=dc(o,n);return o&&En(o)&&Ui(o)&&!Ca(o)?e:o||function(r){let i=dn(r);for(;dt(i)&&!En(i);){if(Ca(i))return i;if(xh(i))return null;i=dn(i)}return null}(t)||e}const Lh={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:n,rect:e,offsetParent:o,strategy:r}=t;const i=r==="fixed",a=fn(o),c=!!n&&ja(n.floating);if(o===a||c&&i)return e;let l={scrollLeft:0,scrollTop:0},u=In(1);const f=In(0),p=dt(o);if((p||!p&&!i)&&((Nn(o)!=="body"||or(a))&&(l=gi(o)),dt(o))){const d=Xn(o);u=yo(o),f.x=d.x+o.clientLeft,f.y=d.y+o.clientTop}return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+f.x,y:e.y*u.y-l.scrollTop*u.y+f.y}},getDocumentElement:fn,getClippingRect:function(t){let{element:n,boundary:e,rootBoundary:o,strategy:r}=t;const i=[...e==="clippingAncestors"?ja(n)?[]:function(l,u){const f=u.get(l);if(f)return f;let p=jn(l,[],!1).filter(v=>Ye(v)&&Nn(v)!=="body"),d=null;const h=Vt(l).position==="fixed";let m=h?dn(l):l;for(;Ye(m)&&!En(m);){const v=Vt(m),y=Ca(m);y||v.position!=="fixed"||(d=null),(h?!y&&!d:!y&&v.position==="static"&&d&&["absolute","fixed"].includes(d.position)||or(m)&&!y&&yu(l,m))?p=p.filter(b=>b!==m):d=v,m=dn(m)}return u.set(l,p),p}(n,this._c):[].concat(e),o],a=i[0],c=i.reduce((l,u)=>{const f=uc(n,u,r);return l.top=Zn(f.top,l.top),l.right=Zr(f.right,l.right),l.bottom=Zr(f.bottom,l.bottom),l.left=Zn(f.left,l.left),l},uc(n,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:fc,getElementRects:async function(t){const n=this.getOffsetParent||fc,e=this.getDimensions,o=await e(t.floating);return{reference:_h(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:n,height:e}=mu(t);return{width:n,height:e}},getScale:yo,isElement:Ye,isRTL:function(t){return Vt(t).direction==="rtl"}};function Rh(t,n,e,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=fs(t),f=r||i?[...u?jn(u):[],...jn(n)]:[];f.forEach(y=>{r&&y.addEventListener("scroll",e,{passive:!0}),i&&y.addEventListener("resize",e)});const p=u&&c?function(y,b){let S,w=null;const x=fn(y);function E(){var O;clearTimeout(S),(O=w)==null||O.disconnect(),w=null}return function O(M,B){M===void 0&&(M=!1),B===void 0&&(B=1),E();const{left:$,top:Z,width:_,height:I}=y.getBoundingClientRect();if(M||b(),!_||!I)return;const he={rootMargin:-go(Z)+"px "+-go(x.clientWidth-($+_))+"px "+-go(x.clientHeight-(Z+I))+"px "+-go($)+"px",threshold:Zn(0,Zr(1,B))||1};let ye=!0;function ne(ge){const de=ge[0].intersectionRatio;if(de!==B){if(!ye)return O();de?O(!1,de):S=setTimeout(()=>{O(!1,1e-7)},1e3)}ye=!1}try{w=new IntersectionObserver(ne,{...he,root:x.ownerDocument})}catch{w=new IntersectionObserver(ne,he)}w.observe(y)}(!0),E}(u,e):null;let d,h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&m&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(n)})),e()}),u&&!l&&m.observe(u),m.observe(n));let v=l?Xn(t):null;return l&&function y(){const b=Xn(t);!v||b.x===v.x&&b.y===v.y&&b.width===v.width&&b.height===v.height||e(),v=b,d=requestAnimationFrame(y)}(),e(),()=>{var y;f.forEach(b=>{r&&b.removeEventListener("scroll",e),i&&b.removeEventListener("resize",e)}),p==null||p(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const Fh=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var e,o;const{x:r,y:i,placement:a,middlewareData:c}=n,l=await async function(u,f){const{placement:p,platform:d,elements:h}=u,m=await(d.isRTL==null?void 0:d.isRTL(h.floating)),v=Kn(p),y=qr(p),b=yi(p)==="y",S=["left","top"].includes(v)?-1:1,w=m&&b?-1:1,x=vi(f,u);let{mainAxis:E,crossAxis:O,alignmentAxis:M}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...x};return y&&typeof M=="number"&&(O=y==="end"?-1*M:M),b?{x:O*w,y:E*S}:{x:E*S,y:O*w}}(n,t);return a===((e=c.offset)==null?void 0:e.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},Bh=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:e,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:b,y:S}=y;return{x:b,y:S}}},...l}=vi(t,n),u={x:e,y:o},f=await hu(n,l),p=yi(Kn(r)),d=su(p);let h=u[d],m=u[p];if(i){const y=d==="y"?"bottom":"right";h=sc(h+f[d==="y"?"top":"left"],h,h-f[y])}if(a){const y=p==="y"?"bottom":"right";m=sc(m+f[p==="y"?"top":"left"],m,m-f[y])}const v=c.fn({...n,[d]:h,[p]:m});return{...v,data:{x:v.x-e,y:v.y-o}}}}},Hh=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var e,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:c,platform:l,elements:u}=n,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...y}=vi(t,n);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const b=Kn(r),S=Kn(c)===c,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=d||(S||!v?[Cr(c)]:function(I){const he=Cr(I);return[$i(I),he,$i(he)]}(c));d||m==="none"||x.push(...function(I,he,ye,ne){const ge=qr(I);let de=function(Oe,se,W){const X=["left","right"],fe=["right","left"],ue=["top","bottom"],V=["bottom","top"];switch(Oe){case"top":case"bottom":return W?se?fe:X:se?X:fe;case"left":case"right":return se?ue:V;default:return[]}}(Kn(I),ye==="start",ne);return ge&&(de=de.map(Oe=>Oe+"-"+ge),he&&(de=de.concat(de.map($i)))),de}(c,v,m,w));const E=[c,...x],O=await hu(n,y),M=[];let B=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&M.push(O[b]),p){const I=function(he,ye,ne){ne===void 0&&(ne=!1);const ge=qr(he),de=lu(he),Oe=cu(de);let se=de==="x"?ge===(ne?"end":"start")?"right":"left":ge==="start"?"bottom":"top";return ye.reference[Oe]>ye.floating[Oe]&&(se=Cr(se)),[se,Cr(se)]}(r,a,w);M.push(O[I[0]],O[I[1]])}if(B=[...B,{placement:r,overflows:M}],!M.every(I=>I<=0)){var $,Z;const I=((($=i.flip)==null?void 0:$.index)||0)+1,he=E[I];if(he)return{data:{index:I,overflows:B},reset:{placement:he}};let ye=(Z=B.filter(ne=>ne.overflows[0]<=0).sort((ne,ge)=>ne.overflows[1]-ge.overflows[1])[0])==null?void 0:Z.placement;if(!ye)switch(h){case"bestFit":{var _;const ne=(_=B.map(ge=>[ge.placement,ge.overflows.filter(de=>de>0).reduce((de,Oe)=>de+Oe,0)]).sort((ge,de)=>ge[1]-de[1])[0])==null?void 0:_[0];ne&&(ye=ne);break}case"initialPlacement":ye=c}if(r!==ye)return{reset:{placement:ye}}}return{}}}},Wh=(t,n,e)=>{const o=new Map,r={platform:Lh,...e},i={...r.platform,_c:o};return(async(a,c,l)=>{const{placement:u="bottom",strategy:f="absolute",middleware:p=[],platform:d}=l,h=p.filter(Boolean),m=await(d.isRTL==null?void 0:d.isRTL(c));let v=await d.getElementRects({reference:a,floating:c,strategy:f}),{x:y,y:b}=lc(v,u,m),S=u,w={},x=0;for(let E=0;E<h.length;E++){const{name:O,fn:M}=h[E],{x:B,y:$,data:Z,reset:_}=await M({x:y,y:b,initialPlacement:u,placement:S,strategy:f,middlewareData:w,rects:v,platform:d,elements:{reference:a,floating:c}});y=B??y,b=$??b,w={...w,[O]:{...w[O],...Z}},_&&x<=50&&(x++,typeof _=="object"&&(_.placement&&(S=_.placement),_.rects&&(v=_.rects===!0?await d.getElementRects({reference:a,floating:c,strategy:f}):_.rects),{x:y,y:b}=lc(v,S,m)),E=-1)}return{x:y,y:b,placement:S,strategy:f,middlewareData:w}})(t,n,{...r,platform:i})};var Hr=typeof document<"u"?g.useLayoutEffect:g.useEffect;function ei(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="function"&&t.toString()===n.toString())return!0;let e,o,r;if(t&&n&&typeof t=="object"){if(Array.isArray(t)){if(e=t.length,e!==n.length)return!1;for(o=e;o--!=0;)if(!ei(t[o],n[o]))return!1;return!0}if(r=Object.keys(t),e=r.length,e!==Object.keys(n).length)return!1;for(o=e;o--!=0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=e;o--!=0;){const i=r[o];if((i!=="_owner"||!t.$$typeof)&&!ei(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}function bu(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function pc(t,n){const e=bu(t);return Math.round(n*e)/e}function Vi(t){const n=D.useRef(t);return Hr(()=>{n.current=t}),n}const zh=(t,n)=>({...Bh(t),options:[t,n]}),$h=(t,n)=>({...Hh(t),options:[t,n]});function wu(t){return D.useMemo(()=>t.every(n=>n==null)?null:n=>{t.forEach(e=>{typeof e=="function"?e(n):e!=null&&(e.current=n)})},t)}const xu={...D},Uh=xu.useInsertionEffect||(t=>t());function Pt(t){const n=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Uh(()=>{n.current=t}),D.useCallback(function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return n.current==null?void 0:n.current(...o)},[])}const ps="ArrowUp",Xo="ArrowDown",wn="ArrowLeft",xn="ArrowRight";function kr(t,n,e){return Math.floor(t/n)!==e}function Ro(t,n){return n<0||n>=t.current.length}function Gi(t,n){return xt(t,{disabledIndices:n})}function hc(t,n){return xt(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}function xt(t,n){let{startingIndex:e=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n;const a=t.current;let c=e;do c+=o?-i:i;while(c>=0&&c<=a.length-1&&Wr(a,c,r));return c}function Vh(t,n,e,o,r){if(t===-1)return-1;const i=e.indexOf(t),a=n[t];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return e.lastIndexOf(t)}}function Gh(t,n){return n.flatMap((e,o)=>t.includes(e)?[o]:[])}function Wr(t,n,e){if(e)return e.includes(n);const o=t[n];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}var Je=typeof document<"u"?g.useLayoutEffect:g.useEffect;function Yh(t,n){const e=t.compareDocumentPosition(n);return e&Node.DOCUMENT_POSITION_FOLLOWING||e&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:e&Node.DOCUMENT_POSITION_PRECEDING||e&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Cu=D.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Zh(t){const{children:n,elementsRef:e,labelsRef:o}=t,[r,i]=D.useState(()=>new Map),a=D.useCallback(l=>{i(u=>new Map(u).set(l,null))},[]),c=D.useCallback(l=>{i(u=>{const f=new Map(u);return f.delete(l),f})},[]);return Je(()=>{const l=new Map(r);Array.from(l.keys()).sort(Yh).forEach((u,f)=>{l.set(u,f)}),function(u,f){if(u.size!==f.size)return!1;for(const[p,d]of u.entries())if(d!==f.get(p))return!1;return!0}(r,l)||i(l)},[r]),D.createElement(Cu.Provider,{value:D.useMemo(()=>({register:a,unregister:c,map:r,elementsRef:e,labelsRef:o}),[a,c,r,e,o])},n)}function ku(t){t===void 0&&(t={});const{label:n}=t,{register:e,unregister:o,map:r,elementsRef:i,labelsRef:a}=D.useContext(Cu),[c,l]=D.useState(null),u=D.useRef(null),f=D.useCallback(p=>{if(u.current=p,c!==null&&(i.current[c]=p,a)){var d;const h=n!==void 0;a.current[c]=h?n:(d=p==null?void 0:p.textContent)!=null?d:null}},[c,i,a,n]);return Je(()=>{const p=u.current;if(p)return e(p),()=>{o(p)}},[e,o]),Je(()=>{const p=u.current?r.get(u.current):null;p!=null&&l(p)},[r]),D.useMemo(()=>({ref:f,index:c??-1}),[c,f])}function ti(){return ti=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},ti.apply(this,arguments)}let mc=!1,Kh=0;const gc=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Kh++,Oa=xu.useId||function(){const[t,n]=D.useState(()=>mc?gc():void 0);return Je(()=>{t==null&&n(gc())},[]),D.useEffect(()=>{mc=!0},[]),t};let rr;function Yi(){for(var t,n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];const r="Floating UI: "+e.join(" ");var i;(t=rr)!=null&&t.has(r)||((i=rr)==null||i.add(r),console.warn(r))}function Su(){const t=new Map;return{emit(n,e){var o;(o=t.get(n))==null||o.forEach(r=>r(e))},on(n,e){t.set(n,[...t.get(n)||[],e])},off(n,e){var o;t.set(n,((o=t.get(n))==null?void 0:o.filter(r=>r!==e))||[])}}}process.env.NODE_ENV!=="production"&&(rr=new Set);const Eu=D.createContext(null),ju=D.createContext(null),kn=()=>{var t;return((t=D.useContext(Eu))==null?void 0:t.id)||null},Sn=()=>D.useContext(ju);function qh(t){const{children:n,id:e}=t,o=kn();return D.createElement(Eu.Provider,{value:D.useMemo(()=>({id:e,parentId:o}),[e,o])},n)}function Jh(t){const{children:n}=t,e=D.useRef([]),o=D.useCallback(a=>{e.current=[...e.current,a]},[]),r=D.useCallback(a=>{e.current=e.current.filter(c=>c!==a)},[]),i=D.useState(()=>Su())[0];return D.createElement(ju.Provider,{value:D.useMemo(()=>({nodesRef:e,addNode:o,removeNode:r,events:i}),[o,r,i])},n)}function ir(t){return"data-floating-ui-"+t}function qt(t){const n=g.useRef(t);return Je(()=>{n.current=t}),n}const vc=ir("safe-polygon");function Zi(t,n,e){return e&&!Yo(e)?0:typeof t=="number"?t:t==null?void 0:t[n]}let yc=0;function yn(t,n){n===void 0&&(n={});const{preventScroll:e=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(yc);const i=()=>t==null?void 0:t.focus({preventScroll:e});r?i():yc=requestAnimationFrame(i)}function qn(t,n){let e=t.filter(r=>{var i;return r.parentId===n&&((i=r.context)==null?void 0:i.open)}),o=e;for(;o.length;)o=t.filter(r=>{var i;return(i=o)==null?void 0:i.some(a=>{var c;return r.parentId===a.id&&((c=r.context)==null?void 0:c.open)})}),e=e.concat(o);return e}let io=new WeakMap,Sr=new WeakSet,Er={},Ki=0;const Ou=t=>t&&(t.host||Ou(t.parentNode)),Xh=(t,n)=>n.map(e=>{if(t.contains(e))return e;const o=Ou(e);return t.contains(o)?o:null}).filter(e=>e!=null);function bc(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);const o=kt(t[0]).body;return function(r,i,a,c){const l="data-floating-ui-inert",u=c?"inert":a?"aria-hidden":null,f=Xh(i,r),p=new Set,d=new Set(f),h=[];Er[l]||(Er[l]=new WeakMap);const m=Er[l];return f.forEach(function v(y){y&&!p.has(y)&&(p.add(y),y.parentNode&&v(y.parentNode))}),function v(y){y&&!d.has(y)&&[].forEach.call(y.children,b=>{if(Nn(b)!=="script")if(p.has(b))v(b);else{const S=u?b.getAttribute(u):null,w=S!==null&&S!=="false",x=(io.get(b)||0)+1,E=(m.get(b)||0)+1;io.set(b,x),m.set(b,E),h.push(b),x===1&&w&&Sr.add(b),E===1&&b.setAttribute(l,""),!w&&u&&b.setAttribute(u,"true")}})}(i),p.clear(),Ki++,()=>{h.forEach(v=>{const y=(io.get(v)||0)-1,b=(m.get(v)||0)-1;io.set(v,y),m.set(v,b),y||(!Sr.has(v)&&u&&v.removeAttribute(u),Sr.delete(v)),b||v.removeAttribute(l)}),Ki--,Ki||(io=new WeakMap,io=new WeakMap,Sr=new WeakSet,Er={})}}(t.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,n,e)}const ni=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function wc(t,n){const e=ds(t,ni());n==="prev"&&e.reverse();const o=e.indexOf(un(kt(t)));return e.slice(o+1)[0]}function xc(t,n){const e=n||t.currentTarget,o=t.relatedTarget;return!o||!vt(e,o)}const hs={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Cc(t){t.key==="Tab"&&(t.target,clearTimeout(void 0))}const kc=D.forwardRef(function(t,n){const[e,o]=D.useState();Je(()=>(iu()&&o("button"),document.addEventListener("keydown",Cc),()=>{document.removeEventListener("keydown",Cc)}),[]);const r={ref:n,tabIndex:0,role:e,"aria-hidden":!e||void 0,[ir("focus-guard")]:"",style:hs};return D.createElement("span",ti({},t,r))}),Qh=D.createContext(null),Na="data-floating-ui-focusable";function Nu(t){return t?t.hasAttribute(Na)?t:t.querySelector("["+Na+"]")||t:null}const em=20;let _n=[];function qi(t){_n=_n.filter(e=>e.isConnected);let n=t;if(n&&Nn(n)!=="body"){if(!Th(n,ni())){const e=ds(n,ni())[0];e&&(n=e)}_n.push(n),_n.length>em&&(_n=_n.slice(-20))}}function Sc(){return _n.slice().reverse().find(t=>t.isConnected)}const tm=D.forwardRef(function(t,n){return D.createElement("button",ti({},t,{type:"button",ref:n,tabIndex:-1,style:hs}))});function nm(t){const{context:n,children:e,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:p=!0}=t,{open:d,refs:h,nodeId:m,onOpenChange:v,events:y,dataRef:b,floatingId:S,elements:{domReference:w,floating:x}}=n,E=typeof a=="number"&&a<0,O=Sa(w)&&E,M=typeof HTMLElement>"u"||!("inert"in HTMLElement.prototype)||i,B=qt(r),$=qt(a),Z=qt(c),_=Sn(),I=D.useContext(Qh),he=D.useRef(null),ye=D.useRef(null),ne=D.useRef(!1),ge=D.useRef(!1),de=D.useRef(-1),Oe=I!=null,se=Nu(x),W=Pt(function(V){return V===void 0&&(V=se),V?ds(V,ni()):[]}),X=Pt(V=>{const T=W(V);return B.current.map(P=>w&&P==="reference"?w:se&&P==="floating"?se:T).filter(Boolean).flat()});function fe(V){return!o&&f&&u?D.createElement(tm,{ref:V==="start"?he:ye,onClick:T=>v(!1,T.nativeEvent)},typeof f=="string"?f:"Dismiss"):null}D.useEffect(()=>{if(o||!u)return;function V(P){if(P.key==="Tab"){vt(se,un(kt(se)))&&W().length===0&&!O&&Nt(P);const R=X(),G=bn(P);B.current[0]==="reference"&&G===w&&(Nt(P),P.shiftKey?yn(R[R.length-1]):yn(R[1])),B.current[1]==="floating"&&G===se&&P.shiftKey&&(Nt(P),yn(R[0]))}}const T=kt(se);return T.addEventListener("keydown",V),()=>{T.removeEventListener("keydown",V)}},[o,w,se,u,B,O,W,X]),D.useEffect(()=>{if(!o&&x)return x.addEventListener("focusin",V),()=>{x.removeEventListener("focusin",V)};function V(T){const P=bn(T),R=W().indexOf(P);R!==-1&&(de.current=R)}},[o,x,W]),D.useEffect(()=>{if(!o&&p)return x&&dt(w)?(w.addEventListener("focusout",T),w.addEventListener("pointerdown",V),x.addEventListener("focusout",T),()=>{w.removeEventListener("focusout",T),w.removeEventListener("pointerdown",V),x.removeEventListener("focusout",T)}):void 0;function V(){ge.current=!0,setTimeout(()=>{ge.current=!1})}function T(P){const R=P.relatedTarget;queueMicrotask(()=>{const G=!(vt(w,R)||vt(x,R)||vt(R,x)||vt(I==null?void 0:I.portalNode,R)||R!=null&&R.hasAttribute(ir("focus-guard"))||_&&(qn(_.nodesRef.current,m).find(U=>{var re,ee;return vt((re=U.context)==null?void 0:re.elements.floating,R)||vt((ee=U.context)==null?void 0:ee.elements.domReference,R)})||function(U,re){var ee;let A=[],ke=(ee=U.find(xe=>xe.id===re))==null?void 0:ee.parentId;for(;ke;){const xe=U.find(_e=>_e.id===ke);ke=xe==null?void 0:xe.parentId,xe&&(A=A.concat(xe))}return A}(_.nodesRef.current,m).find(U=>{var re,ee;return((re=U.context)==null?void 0:re.elements.floating)===R||((ee=U.context)==null?void 0:ee.elements.domReference)===R})));if(l&&G&&un(kt(se))===kt(se).body){dt(se)&&se.focus();const U=de.current,re=W(),ee=re[U]||re[re.length-1]||se;dt(ee)&&ee.focus()}!O&&u||!R||!G||ge.current||R===Sc()||(ne.current=!0,v(!1,P,"focus-out"))})}},[o,w,x,se,u,m,_,I,v,p,l,W,O]),D.useEffect(()=>{var V;if(o)return;const T=Array.from((I==null||(V=I.portalNode)==null?void 0:V.querySelectorAll("["+ir("portal")+"]"))||[]);if(x){const P=[x,...T,he.current,ye.current,B.current.includes("reference")||O?w:null].filter(G=>G!=null),R=u||O?bc(P,M,!M):bc(P);return()=>{R()}}},[o,w,x,u,B,I,O,M]),Je(()=>{if(o||!dt(se))return;const V=un(kt(se));queueMicrotask(()=>{const T=X(se),P=$.current,R=(typeof P=="number"?T[P]:P.current)||se,G=vt(se,V);E||G||!d||yn(R,{preventScroll:R===se})})},[o,d,se,E,X,$]),Je(()=>{if(o||!se)return;let V=!1;const T=kt(se),P=un(T);let R=b.current.openEvent;function G(re){let{open:ee,reason:A,event:ke,nested:xe}=re;ee&&(R=ke),A==="escape-key"&&h.domReference.current&&qi(h.domReference.current),A==="hover"&&ke.type==="mouseleave"&&(ne.current=!0),A==="outside-press"&&(xe?(ne.current=!1,V=!0):ne.current=!(ou(ke)||ru(ke)))}qi(P),y.on("openchange",G);const U=T.createElement("span");return U.setAttribute("tabindex","-1"),U.setAttribute("aria-hidden","true"),Object.assign(U.style,hs),Oe&&w&&w.insertAdjacentElement("afterend",U),()=>{y.off("openchange",G);const re=un(T),ee=vt(x,re)||_&&qn(_.nodesRef.current,m).some(ke=>{var xe;return vt((xe=ke.context)==null?void 0:xe.elements.floating,re)});(ee||R&&["click","mousedown"].includes(R.type))&&h.domReference.current&&qi(h.domReference.current);const A=typeof Z.current=="boolean"?Sc()||U:Z.current.current||U;queueMicrotask(()=>{Z.current&&!ne.current&&dt(A)&&(A===re||re===T.body||ee)&&A.focus({preventScroll:V}),U.remove()})}},[o,x,se,Z,b,h,y,_,m,Oe,w]),D.useEffect(()=>{queueMicrotask(()=>{ne.current=!1})},[o]),Je(()=>{if(!o&&I)return I.setFocusManagerState({modal:u,closeOnFocusOut:p,open:d,onOpenChange:v,refs:h}),()=>{I.setFocusManagerState(null)}},[o,I,u,d,v,h,p]),Je(()=>{if(o||!se||typeof MutationObserver!="function"||E)return;const V=()=>{const P=se.getAttribute("tabindex"),R=W(),G=un(kt(x)),U=R.indexOf(G);U!==-1&&(de.current=U),B.current.includes("floating")||G!==h.domReference.current&&R.length===0?P!=="0"&&se.setAttribute("tabindex","0"):P!=="-1"&&se.setAttribute("tabindex","-1")};V();const T=new MutationObserver(V);return T.observe(se,{childList:!0,subtree:!0,attributes:!0}),()=>{T.disconnect()}},[o,x,se,h,B,W,E]);const ue=!o&&M&&(!u||!O)&&(Oe||u);return D.createElement(D.Fragment,null,ue&&D.createElement(kc,{"data-type":"inside",ref:I==null?void 0:I.beforeInsideRef,onFocus:V=>{if(u){const P=X();yn(r[0]==="reference"?P[0]:P[P.length-1])}else if(I!=null&&I.preserveTabOrder&&I.portalNode)if(ne.current=!1,xc(V,I.portalNode)){const P=wc(document.body,"next")||w;P==null||P.focus()}else{var T;(T=I.beforeOutsideRef.current)==null||T.focus()}}}),!O&&fe("start"),e,fe("end"),ue&&D.createElement(kc,{"data-type":"inside",ref:I==null?void 0:I.afterInsideRef,onFocus:V=>{if(u)yn(X()[0]);else if(I!=null&&I.preserveTabOrder&&I.portalNode)if(p&&(ne.current=!0),xc(V,I.portalNode)){const P=wc(document.body,"prev")||w;P==null||P.focus()}else{var T;(T=I.afterOutsideRef.current)==null||T.focus()}}}))}function Ec(t){return dt(t.target)&&t.target.tagName==="BUTTON"}function jc(t){return au(t)}const om={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},rm={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Oc=t=>{var n,e;return{escapeKey:typeof t=="boolean"?t:(n=t==null?void 0:t.escapeKey)!=null&&n,outsidePress:typeof t=="boolean"?t:(e=t==null?void 0:t.outsidePress)==null||e}};function im(t){const{open:n=!1,onOpenChange:e,elements:o}=t,r=Oa(),i=D.useRef({}),[a]=D.useState(()=>Su()),c=kn()!=null;if(process.env.NODE_ENV!=="production"){const h=o.reference;h&&!Ye(h)&&function(){for(var m,v=arguments.length,y=new Array(v),b=0;b<v;b++)y[b]=arguments[b];const S="Floating UI: "+y.join(" ");var w;(m=rr)!=null&&m.has(S)||((w=rr)==null||w.add(S),console.error(S))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=D.useState(o.reference),f=Pt((h,m,v)=>{i.current.openEvent=h?m:void 0,a.emit("openchange",{open:h,event:m,reason:v,nested:c}),e==null||e(h,m,v)}),p=D.useMemo(()=>({setPositionReference:u}),[]),d=D.useMemo(()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference}),[l,o.reference,o.floating]);return D.useMemo(()=>({dataRef:i,open:n,onOpenChange:f,elements:d,events:a,floatingId:r,refs:p}),[n,f,d,a,r,p])}function am(t){t===void 0&&(t={});const{nodeId:n}=t,e=im({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||e,r=o.elements,[i,a]=D.useState(null),[c,l]=D.useState(null),u=(r==null?void 0:r.domReference)||i,f=D.useRef(null),p=Sn();Je(()=>{u&&(f.current=u)},[u]);const d=function(S){S===void 0&&(S={});const{placement:w="bottom",strategy:x="absolute",middleware:E=[],platform:O,elements:{reference:M,floating:B}={},transform:$=!0,whileElementsMounted:Z,open:_}=S,[I,he]=D.useState({x:0,y:0,strategy:x,placement:w,middlewareData:{},isPositioned:!1}),[ye,ne]=D.useState(E);ei(ye,E)||ne(E);const[ge,de]=D.useState(null),[Oe,se]=D.useState(null),W=D.useCallback(Ie=>{Ie!==V.current&&(V.current=Ie,de(Ie))},[]),X=D.useCallback(Ie=>{Ie!==T.current&&(T.current=Ie,se(Ie))},[]),fe=M||ge,ue=B||Oe,V=D.useRef(null),T=D.useRef(null),P=D.useRef(I),R=Z!=null,G=Vi(Z),U=Vi(O),re=Vi(_),ee=D.useCallback(()=>{if(!V.current||!T.current)return;const Ie={placement:w,strategy:x,middleware:ye};U.current&&(Ie.platform=U.current),Wh(V.current,T.current,Ie).then(Pe=>{const me={...Pe,isPositioned:re.current!==!1};A.current&&!ei(P.current,me)&&(P.current=me,Rl.flushSync(()=>{he(me)}))})},[ye,w,x,U,re]);Hr(()=>{_===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,he(Ie=>({...Ie,isPositioned:!1})))},[_]);const A=D.useRef(!1);Hr(()=>(A.current=!0,()=>{A.current=!1}),[]),Hr(()=>{if(fe&&(V.current=fe),ue&&(T.current=ue),fe&&ue){if(G.current)return G.current(fe,ue,ee);ee()}},[fe,ue,ee,G,R]);const ke=D.useMemo(()=>({reference:V,floating:T,setReference:W,setFloating:X}),[W,X]),xe=D.useMemo(()=>({reference:fe,floating:ue}),[fe,ue]),_e=D.useMemo(()=>{const Ie={position:x,left:0,top:0};if(!xe.floating)return Ie;const Pe=pc(xe.floating,I.x),me=pc(xe.floating,I.y);return $?{...Ie,transform:"translate("+Pe+"px, "+me+"px)",...bu(xe.floating)>=1.5&&{willChange:"transform"}}:{position:x,left:Pe,top:me}},[x,$,xe.floating,I.x,I.y]);return D.useMemo(()=>({...I,update:ee,refs:ke,elements:xe,floatingStyles:_e}),[I,ee,ke,xe,_e])}({...t,elements:{...r,...c&&{reference:c}}}),h=D.useCallback(S=>{const w=Ye(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;l(w),d.refs.setReference(w)},[d.refs]),m=D.useCallback(S=>{(Ye(S)||S===null)&&(f.current=S,a(S)),(Ye(d.refs.reference.current)||d.refs.reference.current===null||S!==null&&!Ye(S))&&d.refs.setReference(S)},[d.refs]),v=D.useMemo(()=>({...d.refs,setReference:m,setPositionReference:h,domReference:f}),[d.refs,m,h]),y=D.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),b=D.useMemo(()=>({...d,...o,refs:v,elements:y,nodeId:n}),[d,v,y,n,o]);return Je(()=>{o.dataRef.current.floatingContext=b;const S=p==null?void 0:p.nodesRef.current.find(w=>w.id===n);S&&(S.context=b)}),D.useMemo(()=>({...d,context:b,refs:v,elements:y}),[d,v,y,b])}const Nc="active",Ic="selected";function Ji(t,n,e){const o=new Map,r=e==="item";let i=t;if(r&&t){const{[Nc]:a,[Ic]:c,...l}=t;i=l}return{...e==="floating"&&{tabIndex:-1,[Na]:""},...i,...n.map(a=>{const c=a?a[e]:null;return typeof c=="function"?t?c(t):null:c}).concat(t).reduce((a,c)=>(c&&Object.entries(c).forEach(l=>{let[u,f]=l;var p;r&&[Nc,Ic].includes(u)||(u.indexOf("on")===0?(o.has(u)||o.set(u,[]),typeof f=="function"&&((p=o.get(u))==null||p.push(f),a[u]=function(){for(var d,h=arguments.length,m=new Array(h),v=0;v<h;v++)m[v]=arguments[v];return(d=o.get(u))==null?void 0:d.map(y=>y(...m)).find(y=>y!==void 0)})):a[u]=f)}),a),{})}}let Ac=!1;function bi(t,n,e){switch(t){case"vertical":return n;case"horizontal":return e;default:return n||e}}function Pc(t,n){return bi(n,t===ps||t===Xo,t===wn||t===xn)}function Xi(t,n,e){return bi(n,t===Xo,e?t===wn:t===xn)||t==="Enter"||t===" "||t===""}function Tc(t,n,e){return bi(n,e?t===xn:t===wn,t===ps)}function sm(t,n){const{open:e,onOpenChange:o,elements:r}=t,{listRef:i,activeIndex:a,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:f=!1,loop:p=!1,nested:d=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:b=!0,disabledIndices:S,orientation:w="vertical",cols:x=1,scrollItemIntoView:E=!0,virtualItemRef:O,itemSizes:M,dense:B=!1}=n;process.env.NODE_ENV!=="production"&&(f&&(p||Yi("`useListNavigation` looping must be enabled to allow escaping."),m||Yi("`useListNavigation` must be virtual to allow escaping.")),w==="vertical"&&x>1&&Yi("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const $=qt(Nu(r.floating)),Z=kn(),_=Sn(),I=Pt(c),he=Sa(r.domReference),ye=D.useRef(v),ne=D.useRef(u??-1),ge=D.useRef(null),de=D.useRef(!0),Oe=D.useRef(I),se=D.useRef(!!r.floating),W=D.useRef(e),X=D.useRef(!1),fe=D.useRef(!1),ue=qt(S),V=qt(e),T=qt(E),P=qt(u),[R,G]=D.useState(),[U,re]=D.useState(),ee=Pt(function(me,k,C){function j(F){m?(G(F.id),_==null||_.events.emit("virtualfocus",F),O&&(O.current=F)):yn(F,{preventScroll:!0,sync:!(!tu().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!iu())&&(Ac||X.current)})}C===void 0&&(C=!1);const N=me.current[k.current];N&&j(N),requestAnimationFrame(()=>{const F=me.current[k.current]||N;if(!F)return;N||j(F);const te=T.current;te&&ke&&(C||!de.current)&&(F.scrollIntoView==null||F.scrollIntoView(typeof te=="boolean"?{block:"nearest",inline:"nearest"}:te))})});Je(()=>{document.createElement("div").focus({get preventScroll(){return Ac=!0,!1}})},[]),Je(()=>{l&&(e&&r.floating?ye.current&&u!=null&&(fe.current=!0,ne.current=u,I(u)):se.current&&(ne.current=-1,Oe.current(null)))},[l,e,r.floating,u,I]),Je(()=>{if(l&&e&&r.floating)if(a==null){if(X.current=!1,P.current!=null)return;if(se.current&&(ne.current=-1,ee(i,ne)),(!W.current||!se.current)&&ye.current&&(ge.current!=null||ye.current===!0&&ge.current==null)){let me=0;const k=()=>{i.current[0]==null?(me<2&&(me?requestAnimationFrame:queueMicrotask)(k),me++):(ne.current=ge.current==null||Xi(ge.current,w,h)||d?Gi(i,ue.current):hc(i,ue.current),ge.current=null,I(ne.current))};k()}}else Ro(i,a)||(ne.current=a,ee(i,ne,fe.current),fe.current=!1)},[l,e,r.floating,a,P,d,i,w,h,I,ee,ue]),Je(()=>{var me;if(!l||r.floating||!_||m||!se.current)return;const k=_.nodesRef.current,C=(me=k.find(F=>F.id===Z))==null||(me=me.context)==null?void 0:me.elements.floating,j=un(kt(r.floating)),N=k.some(F=>F.context&&vt(F.context.elements.floating,j));C&&!N&&de.current&&C.focus({preventScroll:!0})},[l,r.floating,_,Z,m]),Je(()=>{if(l&&_&&m&&!Z)return _.events.on("virtualfocus",me),()=>{_.events.off("virtualfocus",me)};function me(k){re(k.id),O&&(O.current=k)}},[l,_,m,Z,O]),Je(()=>{Oe.current=I,se.current=!!r.floating}),Je(()=>{e||(ge.current=null)},[e]),Je(()=>{W.current=e},[e]);const A=a!=null,ke=D.useMemo(()=>{function me(k){if(!e)return;const C=i.current.indexOf(k);C!==-1&&I(C)}return{onFocus(k){let{currentTarget:C}=k;me(C)},onClick:k=>{let{currentTarget:C}=k;return C.focus({preventScroll:!0})},...y&&{onMouseMove(k){let{currentTarget:C}=k;me(C)},onPointerLeave(k){let{pointerType:C}=k;de.current&&C!=="touch"&&(ne.current=-1,ee(i,ne),I(null),m||yn($.current,{preventScroll:!0}))}}}},[e,$,ee,y,i,I,m]),xe=Pt(me=>{if(de.current=!1,X.current=!0,me.which===229||!V.current&&me.currentTarget===$.current)return;if(d&&Tc(me.key,w,h))return Nt(me),o(!1,me.nativeEvent,"list-navigation"),void(dt(r.domReference)&&(m?_==null||_.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const k=ne.current,C=Gi(i,S),j=hc(i,S);if(he||(me.key==="Home"&&(Nt(me),ne.current=C,I(ne.current)),me.key==="End"&&(Nt(me),ne.current=j,I(ne.current))),x>1){const N=M||Array.from({length:i.current.length},()=>({width:1,height:1})),F=function(H,Y,ce){const ie=[];let oe=0;return H.forEach((Q,ve)=>{let{width:Ae,height:Ve}=Q;if(Ae>Y&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+ve+" is greater than grid columns");let Ee=!1;for(ce&&(oe=0);!Ee;){const Se=[];for(let Ce=0;Ce<Ae;Ce++)for(let le=0;le<Ve;le++)Se.push(oe+Ce+le*Y);oe%Y+Ae<=Y&&Se.every(Ce=>ie[Ce]==null)?(Se.forEach(Ce=>{ie[Ce]=ve}),Ee=!0):oe++}}),[...ie]}(N,x,B),te=F.findIndex(H=>H!=null&&!Wr(i.current,H,S)),K=F.reduce((H,Y,ce)=>Y==null||Wr(i.current,Y,S)?H:ce,-1),z=F[function(H,Y){let{event:ce,orientation:ie,loop:oe,rtl:Q,cols:ve,disabledIndices:Ae,minIndex:Ve,maxIndex:Ee,prevIndex:Se,stopEvent:Ce=!1}=Y,le=Se;if(ce.key===ps){if(Ce&&Nt(ce),Se===-1)le=Ee;else if(le=xt(H,{startingIndex:le,amount:ve,decrement:!0,disabledIndices:Ae}),oe&&(Se-ve<Ve||le<0)){const be=Se%ve,Te=Ee%ve,Ne=Ee-(Te-be);le=Te===be?Ee:Te>be?Ne:Ne-ve}Ro(H,le)&&(le=Se)}if(ce.key===Xo&&(Ce&&Nt(ce),Se===-1?le=Ve:(le=xt(H,{startingIndex:Se,amount:ve,disabledIndices:Ae}),oe&&Se+ve>Ee&&(le=xt(H,{startingIndex:Se%ve-ve,amount:ve,disabledIndices:Ae}))),Ro(H,le)&&(le=Se)),ie==="both"){const be=go(Se/ve);ce.key===(Q?wn:xn)&&(Ce&&Nt(ce),Se%ve!=ve-1?(le=xt(H,{startingIndex:Se,disabledIndices:Ae}),oe&&kr(le,ve,be)&&(le=xt(H,{startingIndex:Se-Se%ve-1,disabledIndices:Ae}))):oe&&(le=xt(H,{startingIndex:Se-Se%ve-1,disabledIndices:Ae})),kr(le,ve,be)&&(le=Se)),ce.key===(Q?xn:wn)&&(Ce&&Nt(ce),Se%ve!=0?(le=xt(H,{startingIndex:Se,decrement:!0,disabledIndices:Ae}),oe&&kr(le,ve,be)&&(le=xt(H,{startingIndex:Se+(ve-Se%ve),decrement:!0,disabledIndices:Ae}))):oe&&(le=xt(H,{startingIndex:Se+(ve-Se%ve),decrement:!0,disabledIndices:Ae})),kr(le,ve,be)&&(le=Se));const Te=go(Ee/ve)===be;Ro(H,le)&&(le=oe&&Te?ce.key===(Q?xn:wn)?Ee:xt(H,{startingIndex:Se-Se%ve-1,disabledIndices:Ae}):Se)}return le}({current:F.map(H=>H!=null?i.current[H]:null)},{event:me,orientation:w,loop:p,rtl:h,cols:x,disabledIndices:Gh([...S||i.current.map((H,Y)=>Wr(i.current,Y)?Y:void 0),void 0],F),minIndex:te,maxIndex:K,prevIndex:Vh(ne.current>j?C:ne.current,N,F,x,me.key===Xo?"bl":me.key===(h?wn:xn)?"tr":"tl"),stopEvent:!0})];if(z!=null&&(ne.current=z,I(ne.current)),w==="both")return}if(Pc(me.key,w)){if(Nt(me),e&&!m&&un(me.currentTarget.ownerDocument)===me.currentTarget)return ne.current=Xi(me.key,w,h)?C:j,void I(ne.current);Xi(me.key,w,h)?ne.current=p?k>=j?f&&k!==i.current.length?-1:C:xt(i,{startingIndex:k,disabledIndices:S}):Math.min(j,xt(i,{startingIndex:k,disabledIndices:S})):ne.current=p?k<=C?f&&k!==-1?i.current.length:j:xt(i,{startingIndex:k,decrement:!0,disabledIndices:S}):Math.max(C,xt(i,{startingIndex:k,decrement:!0,disabledIndices:S})),Ro(i,ne.current)?I(null):I(ne.current)}}),_e=D.useMemo(()=>m&&e&&A&&{"aria-activedescendant":U||R},[m,e,A,U,R]),Ie=D.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...!Sa(r.domReference)&&_e,onKeyDown:xe,onPointerMove(){de.current=!0}}),[_e,xe,r.domReference,w]),Pe=D.useMemo(()=>{function me(k){v==="auto"&&ou(k.nativeEvent)&&(ye.current=!0)}return{..._e,onKeyDown(k){de.current=!1;const C=k.key.startsWith("Arrow"),j=["Home","End"].includes(k.key),N=C||j,F=function(ie,oe,Q){return bi(oe,Q?ie===wn:ie===xn,ie===Xo)}(k.key,w,h),te=Tc(k.key,w,h),K=Pc(k.key,w),z=(d?F:K)||k.key==="Enter"||k.key.trim()==="";if(m&&e){const ie=_==null?void 0:_.nodesRef.current.find(Q=>Q.parentId==null),oe=_&&ie?function(Q,ve){let Ae,Ve=-1;return function Ee(Se,Ce){Ce>Ve&&(Ae=Se,Ve=Ce),qn(Q,Se).forEach(le=>{Ee(le.id,Ce+1)})}(ve,0),Q.find(Ee=>Ee.id===Ae)}(_.nodesRef.current,ie.id):null;if(N&&oe&&O){const Q=new KeyboardEvent("keydown",{key:k.key,bubbles:!0});if(F||te){var H,Y;const ve=((H=oe.context)==null?void 0:H.elements.domReference)===k.currentTarget,Ae=te&&!ve?(Y=oe.context)==null?void 0:Y.elements.domReference:F?i.current.find(Ve=>(Ve==null?void 0:Ve.id)===R):null;Ae&&(Nt(k),Ae.dispatchEvent(Q),re(void 0))}var ce;if((K||j)&&oe.context&&oe.context.open&&oe.parentId&&k.currentTarget!==oe.context.elements.domReference)return Nt(k),void((ce=oe.context.elements.domReference)==null||ce.dispatchEvent(Q))}return xe(k)}(e||b||!C)&&(z&&(ge.current=d&&K?null:k.key),d?F&&(Nt(k),e?(ne.current=Gi(i,ue.current),I(ne.current)):o(!0,k.nativeEvent,"list-navigation")):K&&(u!=null&&(ne.current=u),Nt(k),!e&&b?o(!0,k.nativeEvent,"list-navigation"):xe(k),e&&I(ne.current)))},onFocus(){e&&!m&&I(null)},onPointerDown:function(k){ye.current=v,v==="auto"&&ru(k.nativeEvent)&&(ye.current=!0)},onMouseDown:me,onClick:me}},[R,_e,xe,ue,v,i,d,I,o,e,b,w,h,u,_,m,O]);return D.useMemo(()=>l?{reference:Pe,floating:Ie,item:ke}:{},[l,Pe,Ie,ke])}const cm=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Dc(t,n){const[e,o]=t;let r=!1;const i=n.length;for(let a=0,c=i-1;a<i;c=a++){const[l,u]=n[a]||[0,0],[f,p]=n[c]||[0,0];u>=o!=p>=o&&e<=(f-l)*(o-u)/(p-u)+l&&(r=!r)}return r}function lm(t){t===void 0&&(t={});const{buffer:n=.5,blockPointerEvents:e=!1,requireIntent:o=!0}=t;let r,i=!1,a=null,c=null,l=performance.now();const u=f=>{let{x:p,y:d,placement:h,elements:m,onClose:v,nodeId:y,tree:b}=f;return function(S){function w(){clearTimeout(r),v()}if(clearTimeout(r),!m.domReference||!m.floating||h==null||p==null||d==null)return;const{clientX:x,clientY:E}=S,O=[x,E],M=bn(S),B=S.type==="mouseleave",$=vt(m.floating,M),Z=vt(m.domReference,M),_=m.domReference.getBoundingClientRect(),I=m.floating.getBoundingClientRect(),he=h.split("-")[0],ye=p>I.right-I.width/2,ne=d>I.bottom-I.height/2,ge=function(V,T){return V[0]>=T.x&&V[0]<=T.x+T.width&&V[1]>=T.y&&V[1]<=T.y+T.height}(O,_),de=I.width>_.width,Oe=I.height>_.height,se=(de?_:I).left,W=(de?_:I).right,X=(Oe?_:I).top,fe=(Oe?_:I).bottom;if($&&(i=!0,!B))return;if(Z&&(i=!1),Z&&!B)return void(i=!0);if(B&&Ye(S.relatedTarget)&&vt(m.floating,S.relatedTarget)||b&&qn(b.nodesRef.current,y).some(V=>{let{context:T}=V;return T==null?void 0:T.open}))return;if(he==="top"&&d>=_.bottom-1||he==="bottom"&&d<=_.top+1||he==="left"&&p>=_.right-1||he==="right"&&p<=_.left+1)return w();let ue=[];switch(he){case"top":ue=[[se,_.top+1],[se,I.bottom-1],[W,I.bottom-1],[W,_.top+1]];break;case"bottom":ue=[[se,I.top+1],[se,_.bottom-1],[W,_.bottom-1],[W,I.top+1]];break;case"left":ue=[[I.right-1,fe],[I.right-1,X],[_.left+1,X],[_.left+1,fe]];break;case"right":ue=[[_.right-1,fe],[_.right-1,X],[I.left+1,X],[I.left+1,fe]]}if(!Dc([x,E],ue)){if(i&&!ge)return w();if(!B&&o){const V=function(T,P){const R=performance.now(),G=R-l;if(a===null||c===null||G===0)return a=T,c=P,l=R,null;const U=T-a,re=P-c,ee=Math.sqrt(U*U+re*re);return a=T,c=P,l=R,ee/G}(S.clientX,S.clientY);if(V!==null&&V<.1)return w()}Dc([x,E],function(V){let[T,P]=V;switch(he){case"top":return[[de?T+n/2:ye?T+4*n:T-4*n,P+n+1],[de?T-n/2:ye?T+4*n:T-4*n,P+n+1],[I.left,ye||de?I.bottom-n:I.top],[I.right,ye?de?I.bottom-n:I.top:I.bottom-n]];case"bottom":return[[de?T+n/2:ye?T+4*n:T-4*n,P-n],[de?T-n/2:ye?T+4*n:T-4*n,P-n],[I.left,ye||de?I.top+n:I.bottom],[I.right,ye?de?I.top+n:I.bottom:I.top+n]];case"left":{const R=[T+n+1,Oe?P+n/2:ne?P+4*n:P-4*n],G=[T+n+1,Oe?P-n/2:ne?P+4*n:P-4*n];return[[ne||Oe?I.right-n:I.left,I.top],[ne?Oe?I.right-n:I.left:I.right-n,I.bottom],R,G]}case"right":return[[T-n,Oe?P+n/2:ne?P+4*n:P-4*n],[T-n,Oe?P-n/2:ne?P+4*n:P-4*n],[ne||Oe?I.left+n:I.right,I.top],[ne?Oe?I.left+n:I.right:I.left+n,I.bottom]]}}([p,d]))?!i&&o&&(r=window.setTimeout(w,40)):w()}}};return u.__options={blockPointerEvents:e},u}const Ia=g.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),Iu=g.forwardRef(({className:t,disabled:n,children:e,...o},r)=>{const i=g.useContext(Ia),a=ku(),c=Sn(),l=a.index===i.activeIndex,u=q("io-dropdown-menu-item",n&&"io-dropdown-menu-item-disabled",t);return s.jsx("div",{ref:wu([a.ref,r]),role:"menuitem",className:u,tabIndex:l?0:-1,...o,...i.getItemProps({onClick(f){var p;(p=o.onClick)==null||p.call(o,f),i.setIsOpen(!1),c==null||c.events.emit("click")},onFocus(f){var p;(p=o.onFocus)==null||p.call(o,f),i.setHasFocusInside(!0)}}),children:e})});Iu.displayName="DropdownMenuItem";const Aa=g.forwardRef(({className:t,variant:n="default",icon:e,iconRight:o,text:r="",disabled:i,children:a,...c},l)=>{const[u,f]=g.useState(!1),[p,d]=g.useState(!1),[h,m]=g.useState(null),v=g.useRef([]),y=g.useRef([]),b=g.useContext(Ia),S=Sn(),w=function(T){const P=Oa(),R=Sn(),G=kn();return Je(()=>{const U={id:P,parentId:G};return R==null||R.addNode(U),()=>{R==null||R.removeNode(U)}},[R,P,G]),P}(),x=kn(),E=ku(),O=x!=null,{floatingStyles:M,refs:B,context:$}=am({nodeId:w,open:u,onOpenChange:f,placement:O?"right-start":"bottom-start",middleware:[(Z={mainAxis:O?0:4,alignmentAxis:O?-4:0},{...Fh(Z),options:[Z,_]}),$h(),zh()],whileElementsMounted:Rh});var Z,_;const I=function(T,P){P===void 0&&(P={});const{open:R,onOpenChange:G,dataRef:U,events:re,elements:ee}=T,{enabled:A=!0,delay:ke=0,handleClose:xe=null,mouseOnly:_e=!1,restMs:Ie=0,move:Pe=!0}=P,me=Sn(),k=kn(),C=qt(xe),j=qt(ke),N=qt(R),F=D.useRef(),te=D.useRef(-1),K=D.useRef(),z=D.useRef(-1),H=D.useRef(!0),Y=D.useRef(!1),ce=D.useRef(()=>{}),ie=D.useRef(!1),oe=D.useCallback(()=>{var Ce;const le=(Ce=U.current.openEvent)==null?void 0:Ce.type;return(le==null?void 0:le.includes("mouse"))&&le!=="mousedown"},[U]);D.useEffect(()=>{if(A)return re.on("openchange",Ce),()=>{re.off("openchange",Ce)};function Ce(le){let{open:be}=le;be||(clearTimeout(te.current),clearTimeout(z.current),H.current=!0,ie.current=!1)}},[A,re]),D.useEffect(()=>{if(!A||!C.current||!R)return;function Ce(be){oe()&&G(!1,be,"hover")}const le=kt(ee.floating).documentElement;return le.addEventListener("mouseleave",Ce),()=>{le.removeEventListener("mouseleave",Ce)}},[ee.floating,R,G,A,C,oe]);const Q=D.useCallback(function(Ce,le,be){le===void 0&&(le=!0),be===void 0&&(be="hover");const Te=Zi(j.current,"close",F.current);Te&&!K.current?(clearTimeout(te.current),te.current=window.setTimeout(()=>G(!1,Ce,be),Te)):le&&(clearTimeout(te.current),G(!1,Ce,be))},[j,G]),ve=Pt(()=>{ce.current(),K.current=void 0}),Ae=Pt(()=>{if(Y.current){const Ce=kt(ee.floating).body;Ce.style.pointerEvents="",Ce.removeAttribute(vc),Y.current=!1}}),Ve=Pt(()=>!!U.current.openEvent&&["click","mousedown"].includes(U.current.openEvent.type));D.useEffect(()=>{if(A&&Ye(ee.domReference)){var Ce;const Ne=ee.domReference;return R&&Ne.addEventListener("mouseleave",Te),(Ce=ee.floating)==null||Ce.addEventListener("mouseleave",Te),Pe&&Ne.addEventListener("mousemove",le,{once:!0}),Ne.addEventListener("mouseenter",le),Ne.addEventListener("mouseleave",be),()=>{var qe;R&&Ne.removeEventListener("mouseleave",Te),(qe=ee.floating)==null||qe.removeEventListener("mouseleave",Te),Pe&&Ne.removeEventListener("mousemove",le),Ne.removeEventListener("mouseenter",le),Ne.removeEventListener("mouseleave",be)}}function le(Ne){if(clearTimeout(te.current),H.current=!1,_e&&!Yo(F.current)||Ie>0&&!Zi(j.current,"open"))return;const qe=Zi(j.current,"open",F.current);qe?te.current=window.setTimeout(()=>{N.current||G(!0,Ne,"hover")},qe):R||G(!0,Ne,"hover")}function be(Ne){if(Ve())return;ce.current();const qe=kt(ee.floating);if(clearTimeout(z.current),ie.current=!1,C.current&&U.current.floatingContext){R||clearTimeout(te.current),K.current=C.current({...U.current.floatingContext,tree:me,x:Ne.clientX,y:Ne.clientY,onClose(){Ae(),ve(),Ve()||Q(Ne,!0,"safe-polygon")}});const Kt=K.current;return qe.addEventListener("mousemove",Kt),void(ce.current=()=>{qe.removeEventListener("mousemove",Kt)})}(F.current!=="touch"||!vt(ee.floating,Ne.relatedTarget))&&Q(Ne)}function Te(Ne){Ve()||U.current.floatingContext&&(C.current==null||C.current({...U.current.floatingContext,tree:me,x:Ne.clientX,y:Ne.clientY,onClose(){Ae(),ve(),Ve()||Q(Ne)}})(Ne))}},[ee,A,T,_e,Ie,Pe,Q,ve,Ae,G,R,N,me,j,C,U,Ve]),Je(()=>{var Ce;if(A&&R&&(Ce=C.current)!=null&&Ce.__options.blockPointerEvents&&oe()){Y.current=!0;const be=ee.floating;if(Ye(ee.domReference)&&be){var le;const Te=kt(ee.floating).body;Te.setAttribute(vc,"");const Ne=ee.domReference,qe=me==null||(le=me.nodesRef.current.find(Kt=>Kt.id===k))==null||(le=le.context)==null?void 0:le.elements.floating;return qe&&(qe.style.pointerEvents=""),Te.style.pointerEvents="none",Ne.style.pointerEvents="auto",be.style.pointerEvents="auto",()=>{Te.style.pointerEvents="",Ne.style.pointerEvents="",be.style.pointerEvents=""}}}},[A,R,k,ee,me,C,oe]),Je(()=>{R||(F.current=void 0,ie.current=!1,ve(),Ae())},[R,ve,Ae]),D.useEffect(()=>()=>{ve(),clearTimeout(te.current),clearTimeout(z.current),Ae()},[A,ee.domReference,ve,Ae]);const Ee=D.useMemo(()=>{function Ce(le){F.current=le.pointerType}return{onPointerDown:Ce,onPointerEnter:Ce,onMouseMove(le){const{nativeEvent:be}=le;function Te(){H.current||N.current||G(!0,be,"hover")}_e&&!Yo(F.current)||R||Ie===0||ie.current&&le.movementX**2+le.movementY**2<2||(clearTimeout(z.current),F.current==="touch"?Te():(ie.current=!0,z.current=window.setTimeout(Te,Ie)))}}},[_e,G,R,N,Ie]),Se=D.useMemo(()=>({onMouseEnter(){clearTimeout(te.current)},onMouseLeave(Ce){Ve()||Q(Ce.nativeEvent,!1)}}),[Q,Ve]);return D.useMemo(()=>A?{reference:Ee,floating:Se}:{},[A,Ee,Se])}($,{enabled:O,delay:{open:75},handleClose:lm({blockPointerEvents:!0})}),he=function(T,P){P===void 0&&(P={});const{open:R,onOpenChange:G,dataRef:U,elements:{domReference:re}}=T,{enabled:ee=!0,event:A="click",toggle:ke=!0,ignoreMouse:xe=!1,keyboardHandlers:_e=!0,stickIfOpen:Ie=!0}=P,Pe=D.useRef(),me=D.useRef(!1),k=D.useMemo(()=>({onPointerDown(C){Pe.current=C.pointerType},onMouseDown(C){const j=Pe.current;C.button===0&&A!=="click"&&(Yo(j,!0)&&xe||(!R||!ke||U.current.openEvent&&Ie&&U.current.openEvent.type!=="mousedown"?(C.preventDefault(),G(!0,C.nativeEvent,"click")):G(!1,C.nativeEvent,"click")))},onClick(C){const j=Pe.current;A==="mousedown"&&Pe.current?Pe.current=void 0:Yo(j,!0)&&xe||(!R||!ke||U.current.openEvent&&Ie&&U.current.openEvent.type!=="click"?G(!0,C.nativeEvent,"click"):G(!1,C.nativeEvent,"click"))},onKeyDown(C){Pe.current=void 0,C.defaultPrevented||!_e||Ec(C)||(C.key!==" "||jc(re)||(C.preventDefault(),me.current=!0),C.key==="Enter"&&G(!R||!ke,C.nativeEvent,"click"))},onKeyUp(C){C.defaultPrevented||!_e||Ec(C)||jc(re)||C.key===" "&&me.current&&(me.current=!1,G(!R||!ke,C.nativeEvent,"click"))}}),[U,re,A,xe,_e,G,R,Ie,ke]);return D.useMemo(()=>ee?{reference:k}:{},[ee,k])}($,{event:"mousedown",toggle:!O,ignoreMouse:O}),ye=function(T,P){var R;P===void 0&&(P={});const{open:G,floatingId:U}=T,{enabled:re=!0,role:ee="dialog"}=P,A=(R=cm.get(ee))!=null?R:ee,ke=Oa(),xe=kn()!=null,_e=D.useMemo(()=>A==="tooltip"||ee==="label"?{["aria-"+(ee==="label"?"labelledby":"describedby")]:G?U:void 0}:{"aria-expanded":G?"true":"false","aria-haspopup":A==="alertdialog"?"dialog":A,"aria-controls":G?U:void 0,...A==="listbox"&&{role:"combobox"},...A==="menu"&&{id:ke},...A==="menu"&&xe&&{role:"menuitem"},...ee==="select"&&{"aria-autocomplete":"none"},...ee==="combobox"&&{"aria-autocomplete":"list"}},[A,U,xe,G,ke,ee]),Ie=D.useMemo(()=>{const me={id:U,...A&&{role:A}};return A==="tooltip"||ee==="label"?me:{...me,...A==="menu"&&{"aria-labelledby":ke}}},[A,U,ke,ee]),Pe=D.useCallback(me=>{let{active:k,selected:C}=me;const j={role:"option",...k&&{id:U+"-option"}};switch(ee){case"select":return{...j,"aria-selected":k&&C};case"combobox":return{...j,...k&&{"aria-selected":!0}}}return{}},[U,ee]);return D.useMemo(()=>re?{reference:_e,floating:Ie,item:Pe}:{},[re,_e,Ie,Pe])}($,{role:"menu"}),ne=function(T,P){P===void 0&&(P={});const{open:R,onOpenChange:G,elements:U,dataRef:re}=T,{enabled:ee=!0,escapeKey:A=!0,outsidePress:ke=!0,outsidePressEvent:xe="pointerdown",referencePress:_e=!1,referencePressEvent:Ie="pointerdown",ancestorScroll:Pe=!1,bubbles:me,capture:k}=P,C=Sn(),j=Pt(typeof ke=="function"?ke:()=>!1),N=typeof ke=="function"?j:ke,F=D.useRef(!1),te=D.useRef(!1),{escapeKey:K,outsidePress:z}=Oc(me),{escapeKey:H,outsidePress:Y}=Oc(k),ce=D.useRef(!1),ie=Pt(Ee=>{var Se;if(!R||!ee||!A||Ee.key!=="Escape"||ce.current)return;const Ce=(Se=re.current.floatingContext)==null?void 0:Se.nodeId,le=C?qn(C.nodesRef.current,Ce):[];if(!K&&(Ee.stopPropagation(),le.length>0)){let be=!0;if(le.forEach(Te=>{var Ne;(Ne=Te.context)==null||!Ne.open||Te.context.dataRef.current.__escapeKeyBubbles||(be=!1)}),!be)return}G(!1,function(be){return"nativeEvent"in be}(Ee)?Ee.nativeEvent:Ee,"escape-key")}),oe=Pt(Ee=>{var Se;const Ce=()=>{var le;ie(Ee),(le=bn(Ee))==null||le.removeEventListener("keydown",Ce)};(Se=bn(Ee))==null||Se.addEventListener("keydown",Ce)}),Q=Pt(Ee=>{var Se;const Ce=F.current;F.current=!1;const le=te.current;if(te.current=!1,xe==="click"&&le||Ce||typeof N=="function"&&!N(Ee))return;const be=bn(Ee),Te="["+ir("inert")+"]",Ne=kt(U.floating).querySelectorAll(Te);let qe=Ye(be)?be:null;for(;qe&&!En(qe);){const $t=dn(qe);if(En($t)||!Ye($t))break;qe=$t}if(Ne.length&&Ye(be)&&!be.matches("html,body")&&!vt(be,U.floating)&&Array.from(Ne).every($t=>!vt(qe,$t)))return;if(dt(be)&&Ve){const $t=be.clientWidth>0&&be.scrollWidth>be.clientWidth,vn=be.clientHeight>0&&be.scrollHeight>be.clientHeight;let _o=vn&&Ee.offsetX>be.clientWidth;if(vn&&Vt(be).direction==="rtl"&&(_o=Ee.offsetX<=be.offsetWidth-be.clientWidth),_o||$t&&Ee.offsetY>be.clientHeight)return}const Kt=(Se=re.current.floatingContext)==null?void 0:Se.nodeId,ic=C&&qn(C.nodesRef.current,Kt).some($t=>{var vn;return zi(Ee,(vn=$t.context)==null?void 0:vn.elements.floating)});if(zi(Ee,U.floating)||zi(Ee,U.domReference)||ic)return;const ac=C?qn(C.nodesRef.current,Kt):[];if(ac.length>0){let $t=!0;if(ac.forEach(vn=>{var _o;(_o=vn.context)==null||!_o.open||vn.context.dataRef.current.__outsidePressBubbles||($t=!1)}),!$t)return}G(!1,Ee,"outside-press")}),ve=Pt(Ee=>{var Se;const Ce=()=>{var le;Q(Ee),(le=bn(Ee))==null||le.removeEventListener(xe,Ce)};(Se=bn(Ee))==null||Se.addEventListener(xe,Ce)});D.useEffect(()=>{if(!R||!ee)return;re.current.__escapeKeyBubbles=K,re.current.__outsidePressBubbles=z;let Ee=-1;function Se(Ne){G(!1,Ne,"ancestor-scroll")}function Ce(){window.clearTimeout(Ee),ce.current=!0}function le(){Ee=window.setTimeout(()=>{ce.current=!1},mi()?5:0)}const be=kt(U.floating);A&&(be.addEventListener("keydown",H?oe:ie,H),be.addEventListener("compositionstart",Ce),be.addEventListener("compositionend",le)),N&&be.addEventListener(xe,Y?ve:Q,Y);let Te=[];return Pe&&(Ye(U.domReference)&&(Te=jn(U.domReference)),Ye(U.floating)&&(Te=Te.concat(jn(U.floating))),!Ye(U.reference)&&U.reference&&U.reference.contextElement&&(Te=Te.concat(jn(U.reference.contextElement)))),Te=Te.filter(Ne=>{var qe;return Ne!==((qe=be.defaultView)==null?void 0:qe.visualViewport)}),Te.forEach(Ne=>{Ne.addEventListener("scroll",Se,{passive:!0})}),()=>{A&&(be.removeEventListener("keydown",H?oe:ie,H),be.removeEventListener("compositionstart",Ce),be.removeEventListener("compositionend",le)),N&&be.removeEventListener(xe,Y?ve:Q,Y),Te.forEach(Ne=>{Ne.removeEventListener("scroll",Se)}),window.clearTimeout(Ee)}},[re,U,A,N,xe,R,G,Pe,ee,K,z,ie,H,oe,Q,Y,ve]),D.useEffect(()=>{F.current=!1},[N,xe]);const Ae=D.useMemo(()=>({onKeyDown:ie,[om[Ie]]:Ee=>{_e&&G(!1,Ee.nativeEvent,"reference-press")}}),[ie,G,_e,Ie]),Ve=D.useMemo(()=>({onKeyDown:ie,onMouseDown(){te.current=!0},onMouseUp(){te.current=!0},[rm[xe]]:()=>{F.current=!0}}),[ie,xe]);return D.useMemo(()=>ee?{reference:Ae,floating:Ve}:{},[ee,Ae,Ve])}($,{bubbles:!0}),ge=sm($,{listRef:v,activeIndex:h,nested:O,onNavigate:m}),{getReferenceProps:de,getFloatingProps:Oe,getItemProps:se}=function(T){T===void 0&&(T=[]);const P=T.map(A=>A==null?void 0:A.reference),R=T.map(A=>A==null?void 0:A.floating),G=T.map(A=>A==null?void 0:A.item),U=D.useCallback(A=>Ji(A,T,"reference"),P),re=D.useCallback(A=>Ji(A,T,"floating"),R),ee=D.useCallback(A=>Ji(A,T,"item"),G);return D.useMemo(()=>({getReferenceProps:U,getFloatingProps:re,getItemProps:ee}),[U,re,ee])}([I,he,ye,ne,ge]);g.useEffect(()=>{if(S)return S.events.on("click",T),S.events.on("menuopen",P),()=>{S.events.off("click",T),S.events.off("menuopen",P)};function T(){f(!1)}function P(R){R.nodeId!==w&&R.parentId===x&&f(!1)}},[S,w,x]),g.useEffect(()=>{u&&S&&S.events.emit("menuopen",{parentId:x,nodeId:w})},[S,u,w,x]);const W={activeIndex:h,setActiveIndex:m,getItemProps:se,setHasFocusInside:d,isOpen:u,setIsOpen:f},X=g.useMemo(()=>W,[h,m,se,d,u]),fe=q("io-dropdown-menu-button",O&&"io-dropdown-menu-item",u&&!O&&"active",t),ue=wu([B.setReference,E.ref,l]),V=b.activeIndex===E.index?0:-1;return s.jsxs(qh,{id:w,children:[s.jsx(Ge,{className:fe,ref:ue,variant:O?"link":n,tabIndex:O?V:void 0,role:O?"menuitem":void 0,"data-open":u?"":void 0,"data-nested":O?"":void 0,"data-focus-inside":p?"":void 0,text:r,icon:O?"chevron-right":e,iconSize:"10",iconRight:!!O||o,disabled:i,...de(b.getItemProps({onFocus(T){var P;(P=c.onFocus)==null||P.call(c,T),d(!1),b.setHasFocusInside(!0)},...c}))}),s.jsx(Ia.Provider,{value:X,children:s.jsx(Zh,{elementsRef:v,labelsRef:y,children:u&&s.jsx(nm,{context:$,modal:!1,initialFocus:O?-1:0,returnFocus:!O,children:s.jsx("div",{ref:B.setFloating,className:"io-dropdown-menu",style:M,...Oe(),children:a})})})})]})});Aa.displayName="DropdownMenu";const Jt=g.forwardRef(({...t},n)=>kn()===null?s.jsx(Jh,{children:s.jsx(Aa,{ref:n,...t})}):s.jsx(Aa,{ref:n,...t}));function Au({className:t,variant:n="default",size:e="16",src:o,alt:r,...i}){const a=q("io-image-icon",n==="grayscale"&&[`io-image-icon-${n}`],e&&[`io-image-icon-${e}`],t);return s.jsx("img",{className:a,style:{width:`${e}px`,filter:n==="grayscale"?"grayscale(100%)":"none"},src:o,alt:r,...i})}function um({className:t,size:n="large",variant:e="default",align:o="up",text:r,...i}){const a=q("io-loader",{[`io-loader-${e}`]:e!=="default"},n==="normal"&&"io-loader-md",n==="small"&&"io-loader-sm",o&&[`direction-${o}`],t);return s.jsxs("div",{className:a,...i,children:[s.jsx("div",{className:"io-loader-icon"}),r&&s.jsx("div",{className:"io-loader-text",children:r})]})}function Cn({className:t,children:n,...e}){const o=q("io-panel-header",t);return s.jsx(Ft,{className:o,...e,children:n})}Jt.displayName="DropdownMenu",Jt.Item=Iu,Jt.Separator=hr,Cn.Title=nn,Cn.ButtonGroup=Re,Cn.Button=Ge,Cn.ButtonIcon=Ue,Cn.Dropdown=pe;const So=g.forwardRef(({className:t,children:n,...e},o)=>{const r=q("io-panel-body",t);return s.jsx("div",{className:r,ref:o,...e,children:n})});function po({className:t,...n}){const e=q("io-panel-footer",t);return s.jsx(Vn,{className:e,...n})}function Ze({className:t,children:n,...e}){const o=q("io-panel",t);return s.jsx("div",{className:o,...e,children:n})}function Pu({className:t,variant:n="default",children:e,...o}){const r=q("io-pill",n!=="default"&&[`io-pill-${n}`],t);return s.jsx("div",{className:r,...o,children:e})}function dm({className:t,variant:n="active",value:e=0,...o}){const r=q("io-progress",n,t);return s.jsx("div",{className:r,...o,children:s.jsx("div",{className:"io-progress-bar",style:{width:`${e<0?0:e>100?100:e}%`}})})}function wi({text:t="Label",...n}){return s.jsx("label",{...n,children:t})}So.displayName="PanelBody",po.ButtonGroup=Re,po.Button=Ge,po.ButtonIcon=Ue,po.Dropdown=pe,Ze.Header=Cn,Ze.Body=So,Ze.Footer=po,Pu.Icon=et;const Qn=g.forwardRef(({id:t="input",className:n,type:e="text",name:o="input",align:r="up",label:i,iconPrepend:a,iconPrependOnClick:c,iconAppend:l,iconAppendOnClick:u,placeholder:f,disabled:p,readOnly:d,errorMessage:h,errorDataTestId:m,...v},y)=>{const b=q("io-control-input",a&&"io-control-leading-icon",l&&"io-control-trailing-icon",p&&"io-control-disabled",d&&"io-control-readonly",h&&"io-control-error",r&&[`direction-${r}`],n),S=g.useCallback(x=>{p?x.preventDefault():c&&c(x)},[c,p]),w=g.useCallback(x=>{p?x.preventDefault():u&&u(x)},[u,p]);return s.jsxs("div",{className:b,children:[i&&s.jsx(wi,{htmlFor:t,text:i}),a&&s.jsx(et,{variant:a,onClick:x=>S(x)}),s.jsx("input",{id:t,className:"io-input",ref:y,type:e,name:o,tabIndex:0,placeholder:f??(()=>{switch(e){case"email":return"Enter your email here...";case"number":return"Enter number here...";case"password":return"Enter your password here...";case"tel":return"Enter your phone number here...";case"file":return"Select a file...";default:return"Enter text here..."}})(),disabled:p,readOnly:d,...v}),l&&s.jsx(et,{variant:l,onClick:x=>w(x)}),h&&s.jsxs("div",{"data-testid":m,children:[s.jsx(et,{variant:"close"}),h]})]})});Qn.displayName="Input";const xi=g.forwardRef(({id:t="textarea",className:n,name:e="textarea",align:o="up",label:r,rows:i=4,placeholder:a="Enter text here...",disabled:c,readOnly:l,...u},f)=>{const p=q("io-control-textarea",c&&"io-control-disabled",l&&"io-control-readonly",o&&[`direction-${o}`],n);return s.jsxs("div",{className:p,children:[r&&s.jsx(wi,{htmlFor:t,text:r}),s.jsx("textarea",{id:t,className:"io-textarea",ref:f,name:e,tabIndex:0,placeholder:a,disabled:c,readOnly:l,rows:i,...u})]})});xi.displayName="Textarea";const Ci=g.forwardRef(({id:t="checkbox",className:n,name:e="checkbox",align:o="left",label:r,checked:i,disabled:a,...c},l)=>{const u=q("io-control-checkbox",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsxs("div",{className:u,children:[s.jsx("input",{type:"checkbox",id:t,className:"io-checkbox",ref:l,name:e,tabIndex:0,checked:i,disabled:a,...c}),r&&s.jsx(wi,{htmlFor:t,text:r})]})});Ci.displayName="Checkbox";const fm=g.forwardRef(({id:t="radio",className:n,name:e="radio",align:o="left",label:r,checked:i,disabled:a,...c},l)=>{const u=q("io-control-radio",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsxs("div",{className:u,children:[s.jsx("input",{type:"radio",id:t,className:"io-radio",ref:l,name:e,tabIndex:0,checked:i,disabled:a,...c}),r&&s.jsx(wi,{htmlFor:t,text:r})]})});fm.displayName="Radio";const ft=g.forwardRef(({id:t="toggle",className:n,name:e="toggle",align:o="left",label:r="Toggle",checked:i,disabled:a,...c},l)=>{const u=q("io-control-toggle",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsx("div",{className:u,children:s.jsxs("label",{className:"io-toggle",children:[s.jsx("input",{type:"checkbox",id:t,className:"io-checkbox",ref:l,name:e,checked:i,disabled:a,...c}),s.jsx("span",{className:"slider"}),r]})})});function Tu(t,n=500){const[e,o]=g.useState(t);return g.useEffect(()=>{const r=setTimeout(()=>{o(t)},n);return()=>clearTimeout(r)},[t,n]),e}function pm(t,n){g.useEffect(()=>{const e=o=>{o.code===t&&n()};return document.addEventListener("keyup",e),()=>document.removeEventListener("keyup",e)},[t,n])}ft.displayName="Toggle";const ki=()=>window.glue42gd!==void 0||window.iodesktop!==void 0;function He(){return g.useMemo(()=>typeof window=="object"&&ki(),[])}g.createContext({theme:"dark"});const Mc="io-connect-platform",Hn="___platform_prefs___",Pa="_launchpad_isPinned",Du="_launchpad_pinnedPosition",Mu="_launchpad_allowDocking",_u="_launchpad_minimizeToTray",Lu="_launchpad_autoCloseStartingAppsAndWorkspaces",Ru="_launchpad_showTutorialOnStartup",Fu="_layouts_restoreLastSaved",Bu="_layouts_saveCurrentOnExit",Hu="_layouts_showUnsavedChangesPrompt",Wu="_layouts_showDeletePrompt",zu="_downloads_askForEachDownload",hm={_launchpad_collapsedSections:[],_launchpad_favorites:[],_launchpad_isLayoutsPanelOpen:!1,_launchpad_isCollapsed:!1,[Pa]:!1,[Du]:"Left",[Mu]:!0,[_u]:!1,[Lu]:!0,[Ru]:!0,[Fu]:!0,[Bu]:!0,[Hu]:!0,[Wu]:!0,[zu]:!0,_downloads_location:"",_system_scheduleRestart:!1,_system_scheduleRestartTime:"12:00 AM",_system_scheduleRestartFrequency:"daily",_system_scheduleRestartDay:"Monday",_system_scheduleShutdown:!1,_system_scheduleShutdownTime:"12:00 AM",_system_scheduleShutdownFrequency:"daily",_system_scheduleShutdownDay:"Monday"},Wn=t=>typeof t=="string"?t:t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):JSON.stringify(t),ms={SUCCESS:"success",WARNING:"warning"},mm={success:5e3,warning:1e4};var ht=function(t){return{ok:!0,result:t}},it=function(t){return{ok:!1,error:t}},_c=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:ht(t(n.result,e.result))},Qi=function(t,n){return n.ok===!0?n:it(t(n.error))},Ta=function(){return Ta=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ta.apply(this,arguments)};function Da(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!Da(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!Da(t[o[e]],n[o[e]]))return!1;return!0}}var Zo=function(t){return Array.isArray(t)},jr=function(t){return typeof t=="object"&&t!==null&&!Zo(t)},an=function(t,n){return"expected "+t+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}}(n)},Fo=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Bo=function(t,n){var e=n.at,o=function(r,i){var a={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&i.indexOf(c)<0&&(a[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(c=Object.getOwnPropertySymbols(r);l<c.length;l++)i.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(r,c[l])&&(a[c[l]]=r[c[l]])}return a}(n,["at"]);return Ta({at:t+(e||"")},o)},ct=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return Qi(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return(r=e.run(o)).ok===!0?Promise.resolve(r.result):Promise.reject(r.error);var r},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(e.run(o))},this.map=function(o){return new t(function(r){return function(i,a){return a.ok===!0?ht(i(a.result)):a}(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?ht(n):it({message:an("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?ht(n):it({message:an("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?ht(n):it({message:an("a boolean",n)})})},t.constant=function(n){return new t(function(e){return Da(e,n)?ht(n):it({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(jr(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok!==!0)return e[r]===void 0?it({message:"the key '"+r+"' is required but was not present"}):it(Bo("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return ht(o)}return jr(e)?ht(e):it({message:an("an object",e)})})},t.array=function(n){return new t(function(e){return Zo(e)&&n?e.reduce(function(o,r,i){return _c(function(a,c){return a.concat([c])},o,function(a,c){return Qi(function(l){return Bo("["+c+"]",l)},n.decode(a))}(r,i))},ht([])):Zo(e)?ht(e):it({message:an("an array",e)})})},t.tuple=function(n){return new t(function(e){if(Zo(e)){if(e.length!==n.length)return it({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(!i.ok)return it(Bo("["+r+"]",i.error));o[r]=i.result}return ht(o)}return it({message:an("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return _c(Object.assign,a,c.decode(i))},ht({}))})},t.anyJson=function(){return new t(function(n){return ht(n)})},t.unknownJson=function(){return new t(function(n){return ht(n)})},t.dict=function(n){return new t(function(e){if(jr(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok!==!0)return it(Bo("."+r,i.error));o[r]=i.result}return ht(o)}return it({message:an("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?ht(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return it({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return ht(function(r,i){return i.ok===!0?i.result:r}(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return it({at:Fo(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!jr(r))return it({at:Fo(n.slice(0,i+1)),message:an("an object",r)});if(typeof n[i]=="number"&&!Zo(r))return it({at:Fo(n.slice(0,i+1)),message:an("an array",r)});r=r[n[i]]}return Qi(function(a){return r===void 0?{at:Fo(n),message:"path does not exist"}:Bo(Fo(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return ht(n)})},t.fail=function(n){return new t(function(e){return it({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),$u=ct.string;ct.number;var At=ct.boolean,Uu=ct.anyJson;ct.unknownJson;var L=ct.constant,Vu=ct.object,Ma=ct.array;ct.tuple,ct.dict;var $e=ct.optional,Si=ct.oneOf;ct.union,ct.intersection,ct.withDefault,ct.valueAt,ct.succeed,ct.fail,ct.lazy;const Lc=["name","title","version","customProperties","icon","caption","type"],gm=["appId","name","type","details","version","title","tooltip","lang","description","categories","icons","screenshots","contactEmail","moreInfo","publisher","customConfig","hostManifests","interop","localizedVersions"];var mt=function(t){return{ok:!0,result:t}},at=function(t){return{ok:!1,error:t}},Rc=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:mt(t(n.result,e.result))},ea=function(t,n){return n.ok===!0?n:at(t(n.error))},_a=function(){return _a=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},_a.apply(this,arguments)};function La(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!La(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!La(t[o[e]],n[o[e]]))return!1;return!0}}var Ko=function(t){return Array.isArray(t)},Or=function(t){return typeof t=="object"&&t!==null&&!Ko(t)},sn=function(t,n){return"expected "+t+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}}(n)},Ho=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Wo=function(t,n){var e=n.at,o=function(r,i){var a={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&i.indexOf(c)<0&&(a[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(c=Object.getOwnPropertySymbols(r);l<c.length;l++)i.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(r,c[l])&&(a[c[l]]=r[c[l]])}return a}(n,["at"]);return _a({at:t+(e||"")},o)},lt=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ea(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return(r=e.run(o)).ok===!0?Promise.resolve(r.result):Promise.reject(r.error);var r},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(e.run(o))},this.map=function(o){return new t(function(r){return function(i,a){return a.ok===!0?mt(i(a.result)):a}(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?mt(n):at({message:sn("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?mt(n):at({message:sn("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?mt(n):at({message:sn("a boolean",n)})})},t.constant=function(n){return new t(function(e){return La(e,n)?mt(n):at({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Or(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok!==!0)return e[r]===void 0?at({message:"the key '"+r+"' is required but was not present"}):at(Wo("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return mt(o)}return Or(e)?mt(e):at({message:sn("an object",e)})})},t.array=function(n){return new t(function(e){return Ko(e)&&n?e.reduce(function(o,r,i){return Rc(function(a,c){return a.concat([c])},o,function(a,c){return ea(function(l){return Wo("["+c+"]",l)},n.decode(a))}(r,i))},mt([])):Ko(e)?mt(e):at({message:sn("an array",e)})})},t.tuple=function(n){return new t(function(e){if(Ko(e)){if(e.length!==n.length)return at({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(!i.ok)return at(Wo("["+r+"]",i.error));o[r]=i.result}return mt(o)}return at({message:sn("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return Rc(Object.assign,a,c.decode(i))},mt({}))})},t.anyJson=function(){return new t(function(n){return mt(n)})},t.unknownJson=function(){return new t(function(n){return mt(n)})},t.dict=function(n){return new t(function(e){if(Or(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok!==!0)return at(Wo("."+r,i.error));o[r]=i.result}return mt(o)}return at({message:sn("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?mt(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return at({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return mt(function(r,i){return i.ok===!0?i.result:r}(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return at({at:Ho(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Or(r))return at({at:Ho(n.slice(0,i+1)),message:sn("an object",r)});if(typeof n[i]=="number"&&!Ko(r))return at({at:Ho(n.slice(0,i+1)),message:sn("an array",r)});r=r[n[i]]}return ea(function(a){return r===void 0?{at:Ho(n),message:"path does not exist"}:Wo(Ho(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return mt(n)})},t.fail=function(n){return new t(function(e){return at({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),ar=lt.string,Ra=lt.number,vm=lt.boolean,eo=lt.anyJson;lt.unknownJson;var zo=lt.constant,bt=lt.object,rt=lt.array;lt.tuple;var Fa=lt.dict,ae=lt.optional,Gu=lt.oneOf;lt.union,lt.intersection,lt.withDefault,lt.valueAt,lt.succeed,lt.fail,lt.lazy;const we=ar().where(t=>t.length>0,"Expected a non-empty string"),Ba=Ra().where(t=>t>=0,"Expected a non-negative number"),Yu=bt({name:we,displayName:ae(ar()),contexts:ae(rt(ar())),customConfig:ae(bt())}),ym=Gu(zo("web"),zo("native"),zo("citrix"),zo("onlineNative"),zo("other")),Zu=bt({url:we}),Ku=bt({src:we,size:ae(we),type:ae(we)}),qu=bt({src:we,size:ae(we),type:ae(we),label:ae(we)}),bm=bt({contexts:rt(we),displayName:ae(we),resultType:ae(we),customConfig:ae(eo())}),wm=bt({listensFor:ae(Fa(bm)),raises:ae(Fa(rt(we)))}),xm=bt({broadcasts:ae(rt(we)),listensFor:ae(rt(we))}),Cm=bt({name:we,description:ae(we),broadcasts:ae(rt(we)),listensFor:ae(rt(we))}),Ju=bt({intents:ae(wm),userChannels:ae(xm),appChannels:ae(rt(Cm))}),km=bt({url:ae(we),top:ae(Ra()),left:ae(Ra()),width:ae(Ba),height:ae(Ba)}),Sm=bt({name:ae(we),type:ae(we.where(t=>t==="window","Expected a value of window")),title:ae(we),version:ae(we),customProperties:ae(eo()),icon:ae(ar()),caption:ae(ar()),details:ae(km),intents:ae(rt(Yu)),hidden:ae(vm())}),Xu=bt({name:we,appId:we,title:ae(we),version:ae(we),manifest:we,manifestType:we,tooltip:ae(we),description:ae(we),contactEmail:ae(we),supportEmail:ae(we),publisher:ae(we),images:ae(rt(bt({url:ae(we)}))),icons:ae(rt(bt({icon:ae(we)}))),customConfig:eo(),intents:ae(rt(Yu))}),Em=bt({appId:ae(we),name:ae(we),details:ae(Zu),version:ae(we),title:ae(we),tooltip:ae(we),lang:ae(we),description:ae(we),categories:ae(rt(we)),icons:ae(rt(Ku)),screenshots:ae(rt(qu)),contactEmail:ae(we),supportEmail:ae(we),moreInfo:ae(we),publisher:ae(we),customConfig:ae(rt(eo())),hostManifests:ae(eo()),interop:ae(Ju)}),Qu=bt({appId:we,name:ae(we),type:ym,details:Zu,version:ae(we),title:ae(we),tooltip:ae(we),lang:ae(we),description:ae(we),categories:ae(rt(we)),icons:ae(rt(Ku)),screenshots:ae(rt(qu)),contactEmail:ae(we),supportEmail:ae(we),moreInfo:ae(we),publisher:ae(we),customConfig:ae(rt(eo())),hostManifests:ae(eo()),interop:ae(Ju),localizedVersions:ae(Fa(Em))}),zr=Gu(Xu,Qu),Nr=t=>`${t.kind} at ${t.at}: ${JSON.stringify(t.input)}. Reason - ${t.message}`;class jm{constructor(){It(this,"fdc3ToDesktopDefinitionType",{web:"window",native:"exe",citrix:"citrix",onlineNative:"clickonce",other:"window"})}toApi(){return{isFdc3Definition:this.isFdc3Definition.bind(this),parseToBrowserBaseAppData:this.parseToBrowserBaseAppData.bind(this),parseToDesktopAppConfig:this.parseToDesktopAppConfig.bind(this)}}isFdc3Definition(n){const e=zr.run(n);return e.ok?n.appId&&n.details?{isFdc3:!0,version:"2.0"}:n.manifest?{isFdc3:!0,version:"1.2"}:{isFdc3:!1,reason:"The passed definition is not FDC3"}:{isFdc3:!1,reason:Nr(e.error)}}parseToBrowserBaseAppData(n){var f,p;const{isFdc3:e,version:o}=this.isFdc3Definition(n);if(!e)throw new Error("The passed definition is not FDC3");const r=zr.run(n);if(!r.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Nr(r.error)}`);const i=this.getUserPropertiesFromDefinition(n,o),a={url:this.getUrl(n,o)},c={name:n.appId,type:"window",createOptions:a,userProperties:{...i,intents:o==="1.2"?i.intents:this.getIntentsFromV2AppDefinition(n),details:a},title:n.title,version:n.version,icon:this.getIconFromDefinition(n,o),caption:n.description,fdc3:o==="2.0"?{...n,definitionVersion:"2.0"}:void 0},l=((f=n.hostManifests)==null?void 0:f.ioConnect)||((p=n.hostManifests)==null?void 0:p.Glue42);if(!l)return c;const u=Sm.run(l);if(!u.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Nr(u.error)}`);return Object.keys(u.result).length?this.mergeBaseAppDataWithGlueManifest(c,u.result):c}parseToDesktopAppConfig(n){var l,u,f;const{isFdc3:e,version:o}=this.isFdc3Definition(n);if(!e)throw new Error("The passed definition is not FDC3");const r=zr.run(n);if(!r.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Nr(r.error)}`);if(o==="1.2"){const p=n;return{name:p.appId,type:"window",details:{url:this.getUrl(n,o)},version:p.version,title:p.title,tooltip:p.tooltip,caption:p.description,icon:(l=p.icons)==null?void 0:l[0].icon,intents:p.intents,customProperties:{manifestType:p.manifestType,images:p.images,contactEmail:p.contactEmail,supportEmail:p.supportEmail,publisher:p.publisher,icons:p.icons,customConfig:p.customConfig}}}const i=n,a={name:i.appId,type:this.fdc3ToDesktopDefinitionType[i.type],details:i.details,version:i.version,title:i.title,tooltip:i.tooltip,caption:i.description,icon:this.getIconFromDefinition(i,"2.0"),intents:this.getIntentsFromV2AppDefinition(i),fdc3:{...i,definitionVersion:"2.0"}},c=((u=n.hostManifests)==null?void 0:u.ioConnect)||((f=n.hostManifests)==null?void 0:f.Glue42);if(!c)return a;if(typeof c!="object"||Array.isArray(c))throw new Error(`Invalid '${n.hostManifests.ioConnect?"hostManifests.ioConnect":"hostManifests['Glue42']"}' key`);return this.mergeDesktopConfigWithGlueManifest(a,c)}getUserPropertiesFromDefinition(n,e){return Object.fromEntries(e==="1.2"?Object.entries(n).filter(([o])=>!Lc.includes(o)):Object.entries(n).filter(([o])=>!Lc.includes(o)&&!gm.includes(o)))}getUrl(n,e){var r,i;let o;if(e==="1.2"){const a=JSON.parse(n.manifest);o=((r=a.details)==null?void 0:r.url)||a.url}else o=(i=n.details)==null?void 0:i.url;if(!o||typeof o!="string")throw new Error(`Invalid FDC3 ${e} definition. Provide valid 'url' under '${e==="1.2"?"manifest":"details"}' key`);return o}getIntentsFromV2AppDefinition(n){var o,r;const e=(r=(o=n.interop)==null?void 0:o.intents)==null?void 0:r.listensFor;if(e)return Object.entries(e).map(i=>{const[a,c]=i;return{name:a,...c}})}getIconFromDefinition(n,e){var o,r,i,a;return e==="1.2"?((r=(o=n.icons)==null?void 0:o.find(c=>c.icon))==null?void 0:r.icon)||void 0:((a=(i=n.icons)==null?void 0:i.find(c=>c.src))==null?void 0:a.src)||void 0}mergeBaseAppDataWithGlueManifest(n,e){let o=n;if(e.customProperties&&(o.userProperties={...n.userProperties,...e.customProperties}),e.details){const r={...n.createOptions,...e.details};o.createOptions=r,o.userProperties.details=r}return Array.isArray(e.intents)&&(o.userProperties.intents=(o.userProperties.intents||[]).concat(e.intents)),o={...o,...e},delete o.details,delete o.intents,o}mergeDesktopConfigWithGlueManifest(n,e){const o=Object.assign({},n,e,{details:{...n.details,...e.details}});return Array.isArray(e.intents)&&(o.intents=(n.intents||[]).concat(e.intents)),o}}const Om={common:{nonEmptyStringDecoder:we,nonNegativeNumberDecoder:Ba},fdc3:{allDefinitionsDecoder:zr,v1DefinitionDecoder:Xu,v2DefinitionDecoder:Qu}};var Ha;(function(t){t.USER_CANCELLED="User Closed Intents Resolver UI without choosing a handler",t.CALLER_NOT_DEFINED="Caller Id is not defined",t.TIMEOUT_HIT="Timeout hit",t.INTENT_NOT_FOUND="Cannot find Intent",t.HANDLER_NOT_FOUND="Cannot find Intent Handler",t.TARGET_INSTANCE_UNAVAILABLE="Cannot start Target Instance",t.INTENT_DELIVERY_FAILED="Target Instance did not add a listener",t.RESOLVER_UNAVAILABLE="Intents Resolver UI unavailable",t.RESOLVER_TIMEOUT="User did not choose a handler",t.INVALID_RESOLVER_RESPONSE="Intents Resolver UI returned invalid response",t.INTENT_HANDLER_REJECTION="Intent Handler function processing the raised intent threw an error or rejected the promise it returned"})(Ha||(Ha={}));const gs=new class{constructor(){It(this,"_fdc3");It(this,"_decoders",Om);It(this,"_errors",{intents:Ha})}get fdc3(){return this._fdc3||(this._fdc3=new jm().toApi()),this._fdc3}get decoders(){return this._decoders}get errors(){return this._errors}};gs.fdc3;const Nm=gs.decoders;gs.errors;const Gn=Nm.common.nonEmptyStringDecoder,Im=Si(L("add"),L("align-bottom"),L("align-bottom-solid"),L("align-left"),L("align-left-bottom"),L("align-left-bottom-solid"),L("align-left-solid"),L("align-left-top"),L("align-left-top-solid"),L("align-right"),L("align-right-bottom"),L("align-right-bottom-solid"),L("align-right-solid"),L("align-right-top"),L("align-right-top-solid"),L("align-top"),L("align-top-solid"),L("always-on-top"),L("always-on-top-on"),L("application"),L("arrow-down-long"),L("arrow-down-to-bracket"),L("arrow-left-long"),L("arrow-right-from-bracket"),L("arrow-right-long"),L("arrow-right"),L("arrow-up"),L("arrow-up-long"),L("ban"),L("bell"),L("bell-solid"),L("bookmark"),L("bullseye-pointer"),L("certificate"),L("check"),L("check-light"),L("check-solid"),L("chevron-down"),L("chevron-left"),L("chevron-right"),L("chevron-up"),L("circle-info"),L("circle-xmark"),L("circle-xmark-full"),L("clock"),L("clock-rotate-left"),L("clone"),L("close"),L("cog"),L("cog-solid"),L("collapse"),L("copy"),L("download"),L("delete-left"),L("dev-tools"),L("ellipsis"),L("ellipsis-vertical"),L("expand"),L("envelope"),L("envelope-open"),L("exclamation-mark"),L("expand"),L("feedback"),L("filter"),L("floppy"),L("floppy-disk-pen"),L("folder"),L("folder-open"),L("globe"),L("group"),L("hidden"),L("home"),L("house"),L("info"),L("keyboard"),L("layout"),L("link"),L("list-ul"),L("lock"),L("logo"),L("minimize"),L("minimize-down"),L("paper-plane-top"),L("paperclip"),L("pause"),L("pen-line"),L("pen-to-square"),L("pin"),L("play"),L("pop-in"),L("pop-in-widget"),L("pop-out"),L("power-off"),L("publish"),L("refresh"),L("resize"),L("restore"),L("rotate-right"),L("search"),L("search-filled"),L("sliders"),L("snooze"),L("spinner"),L("square"),L("square-arrow-down"),L("square-arrow-up"),L("star"),L("star-full"),L("sticky-off"),L("sticky-off-hover"),L("sticky-on"),L("sticky-on-hover"),L("subscribe"),L("system-close"),L("system-maximize"),L("system-minimize"),L("thumbs-down"),L("thumbs-up"),L("trash"),L("trash-can"),L("triangle-exclamation"),L("unlock"),L("unpin"),L("up-to-line"),L("user"),L("user-gear"),L("visible"),L("workspace")),Am=Vu({id:Gn,title:Gn,description:$e($u()),icon:$e(Im),iconSrc:$e(Gn),contextMenuActions:$e(Ma(Uu())),type:Gn}),Pm=Si(L("Left"),L("Right")),Fc=Si(L("daily"),L("weekly")),Bc=Si(L("Sunday"),L("Monday"),L("Tuesday"),L("Wednesday"),L("Thursday"),L("Friday"),L("Saturday")),$r=Vu({customPrefs:$e(Uu()),_launchpad_collapsedSections:$e(Ma(Gn)),_launchpad_favorites:$e(Ma(Am)),_launchpad_isLayoutsPanelOpen:$e(At()),_launchpad_isCollapsed:$e(At()),_launchpad_isPinned:$e(At()),_launchpad_pinnedPosition:$e(Pm),_launchpad_allowDocking:$e(At()),_launchpad_minimizeToTray:$e(At()),_launchpad_autoCloseStartingAppsAndWorkspaces:$e(At()),_launchpad_showTutorialOnStartup:$e(At()),_layouts_restoreLastSaved:$e(At()),_layouts_saveCurrentOnExit:$e(At()),_layouts_showUnsavedChangesPrompt:$e(At()),_layouts_showDeletePrompt:$e(At()),_downloads_askForEachDownload:$e(At()),_downloads_location:$e($u()),_system_scheduleRestart:$e(At()),_system_scheduleRestartTime:$e(Gn),_system_scheduleRestartFrequency:$e(Fc),_system_scheduleRestartDay:$e(Bc),_system_scheduleShutdown:$e(At()),_system_scheduleShutdownTime:$e(Gn),_system_scheduleShutdownFrequency:$e(Fc),_system_scheduleShutdownDay:$e(Bc)}),ed=async t=>{const{io:n,variant:e,text:o,error:r}=t,i=Wn(r);try{if(e===ms.WARNING&&n.logger.warn(i?`${o} ${i}`:o),!("modals"in n)||!n.modals)throw new Error("Modals are not enabled.");const a={text:o,variant:e,ttl:mm[e]};await n.modals.alerts.request(a)}catch(a){console.warn("Failed to request alert. ",{error:a})}},vs=g.createContext(void 0),Ei=({children:t,launchpadMode:n})=>{const[e,o]=g.useState(),[r,i]=g.useState(!1),[a,c]=g.useState(),l=g.useContext(De.IOConnectContext),u=g.useMemo(()=>({prefs:e,isInitialSetupCompleted:r,initialSetupError:a}),[e,r,a]);return g.useEffect(()=>{if(!l)return;let f=!1;const p=l.contexts.subscribe(Hn,d=>{if(f)return;const h=$r.run(d);if(!h.ok)return void l.logger.warn(`The received data for context ${Hn} is with an invalid shape: ${Wn(h.error.message)}`);const m=h.result;o(m),l.prefs.updateFor(Mc,m).catch(v=>{l.logger.warn(`Failed to update platform prefs. Error: ${Wn(v)}`)})});return()=>{f=!0,p.then(d=>{d()})}},[l]),g.useEffect(()=>{l&&(async()=>{var f;try{const p=await l.contexts.get(Hn),d=$r.run(p);if(!d.ok)throw new Error(`The data in context ${Hn} is with an invalid shape: ${Wn(d.error.message)}`);const h=d.result;if(Object.keys(h).length>0)return;const m=((f=await l.prefs.get(Mc))==null?void 0:f.data)??{},v=$r.run(m);if(!v.ok)throw new Error(`The stored platform prefs in io.prefs are with an invalid shape: ${Wn(v.error.message)}`);const y={[Pa]:n==="pinned"||(m[Pa]??!1)},b={...hm,...v.result,...y};await l.contexts.set(Hn,b)}catch(p){c({message:Wn(p)}),await ed({io:l,variant:ms.WARNING,text:"Initial platform prefs setup failed.",error:p})}finally{i(!0)}})().catch(console.error)},[l,n]),s.jsx(vs.Provider,{value:u,children:t})};function td(){const t=g.useContext(vs);if(t===void 0)throw new Error("usePlatformPrefs must be used within a PlatformPrefsProvider");return t}function Ht({prefKey:t}){var p;const n=g.useContext(De.IOConnectContext),e=g.useContext(vs),o=(p=e==null?void 0:e.prefs)==null?void 0:p[t],r=(e==null?void 0:e.isInitialSetupCompleted)??!1,[i,a]=g.useState(!r),[c,l]=g.useState(),u=g.useRef(0);g.useEffect(()=>{r&&u.current===0&&a(!1)},[r]);const f=g.useCallback(async d=>{if(!n)return;const h=++u.current;a(!0),l(void 0);const m=async y=>{y&&await ed({io:n,variant:ms.WARNING,text:`Failed to update prefKey "${t}".`,error:y}),h===u.current&&(a(!1),y&&l({message:Wn(y)}))};let v;if(d instanceof Function)try{v=d((await n.contexts.get(Hn))[t])}catch(y){return m(y)}else v=d;try{const y=$r.runWithException({[t]:v});await n.contexts.update(Hn,y)}catch(y){return m(y)}await m()},[n,t]);if(e===void 0)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return{error:c,isLoading:i,update:f,value:o}}const Ir={dark:"var(--io-neutrals-0)",light:"var(--io-neutrals-900)"};function nd(t){var r;let n,e,o;if(t.startsWith("#")){let i=t.slice(1);i.length===3&&(i=i.split("").map(a=>a+a).join("")),n=parseInt(i.substring(0,2),16),e=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16)}else{if(!t.startsWith("rgb")){const i=document.createElement("canvas").getContext("2d");return i?(i.fillStyle=t,nd(i.fillStyle)):Ir.light}{const i=(r=t.match(/\d+/g))==null?void 0:r.map(Number);if(!i||i.length<3)return Ir.light;[n,e,o]=i}}return(.2126*n+.7152*e+.0722*o)/255>.5?Ir.light:Ir.dark}function Tm({className:t,channel:n,...e}){const o=q("io-channel-badge",t),r=g.useMemo(()=>nd(n.color),[n.color]);return s.jsx("div",{className:o,style:{color:r,backgroundColor:n.color},...e,children:s.jsx("span",{className:"io-channel-badge-label",children:n.label})})}function Dm(){return s.jsx(et,{variant:"check"})}function Mm({channel:t,handleChannelRestricted:n,lockedChannelRestriction:e}){return s.jsxs(s.Fragment,{children:[s.jsx("div",{children:t.isSelected&&s.jsx("span",{children:"Active"})}),s.jsx("div",{role:"button",onClick:o=>o.stopPropagation(),onKeyDown:o=>{o.key!=="Enter"&&o.key!==" "||o.stopPropagation()},tabIndex:0,children:s.jsx(ft,{label:"Publish",checked:t.write,onChange:()=>{n({...t,write:!t.write})},disabled:!t.isSelected||(e==null?void 0:e.write)})}),s.jsx("div",{role:"button",onClick:o=>o.stopPropagation(),onKeyDown:o=>{o.key!=="Enter"&&o.key!==" "||o.stopPropagation()},tabIndex:0,children:s.jsx(ft,{label:"Subscribe",checked:t.read,onChange:()=>{n({...t,read:!t.read})},disabled:!t.isSelected||(e==null?void 0:e.read)})})]})}const od=g.createContext({});function _m({channel:t,isSelected:n,onChannelSelect:e,onChannelRestrict:o,...r}){const{variant:i,selectedChannels:a,lockedChannelRestrictions:c}=g.useContext(od),l=n||t.isSelected||(a==null?void 0:a.includes(t)),u=c==null?void 0:c.find(d=>d.name===t.name),f=g.useCallback(()=>e==null?void 0:e({...t,isSelected:!l}),[t,e,l]),p=g.useCallback(d=>{o==null||o(d)},[o]);return s.jsx(pi,{prepend:s.jsx(Tm,{channel:t}),append:i==="single"||i==="multi"?l&&s.jsx(Dm,{}):s.jsx(Mm,{channel:t,handleChannelRestricted:p,lockedChannelRestriction:u}),isSelected:l,onClick:f,...r,children:t.name},t.name)}const Lm=g.forwardRef(({className:t,variant:n="single",variantToggle:e=!1,channels:o=[],lockedChannelRestrictions:r=[],onVariantChange:i,onChannelSelect:a,onChannelRestrict:c,...l},u)=>{const f=q("io-list-channels",(n==="directionalSingle"||n==="directionalMulti")&&"io-list-channels-directional",t),p=g.useMemo(()=>({variant:n,selectedChannels:o.filter(d=>d.isSelected),lockedChannelRestrictions:r,onVariantChange:i,onChannelSelect:a,onChannelRestrict:c}),[o,n,r,i,a,c]);return s.jsx(od.Provider,{value:p,children:s.jsx("div",{className:f,ref:u,children:s.jsxs(ut,{...l,children:[s.jsx(ut.ItemTitle,{append:e&&s.jsx(ft,{label:"Directional",align:"right",onChange:d=>i&&i(d.target.checked),checked:n==="directionalSingle"||n==="directionalMulti"}),children:{single:"Select Channel",directionalSingle:"Select Directional Channel",multi:"Select Channels",directionalMulti:"Select Directional Channels"}[n]}),o==null?void 0:o.map(d=>s.jsx(_m,{channel:d,isSelected:d.isSelected,onChannelSelect:a,onChannelRestrict:c},d.name))]})})})});Lm.displayName="ChannelSelector";g.createContext({config:{message:""},theme:"dark",setResult:()=>{}});function Rm({title:t="Downloads"}){const{ItemSearch:n,HeaderButtons:e}=ji();return s.jsxs("div",{className:"io-dm-header",children:[s.jsxs(Ft,{children:[s.jsx(Ft.Title,{tag:"h1",text:t,size:"large"}),s.jsx(e,{})]}),s.jsx(n,{})]})}const Fm=g.createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),Pn=()=>g.useContext(Fm);function Bm({className:t,icon:n="search",placeholder:e="Search",...o}){const r=q("io-header-search",t),i=g.useRef(null),{searchQuery:a,setSearch:c,itemsCount:l}=Pn();return s.jsxs("div",{className:r,children:[s.jsx(Qn,{ref:i,value:a,iconPrepend:n,placeholder:e,onChange:u=>c(u.target.value),...o}),a.length>0&&s.jsx("p",{className:"io-header-search-count",children:`${l} results`})]})}function Hm({className:t,...n}){const{SettingsButton:e,MoreButton:o}=ji();return s.jsxs(Re,{className:t,align:"right",...n,children:[s.jsx(e,{}),s.jsx(o,{})]})}function Wm({icon:t="cog",...n}){const{showSettings:e}=Pn();return s.jsx(Ue,{icon:t,variant:"circle",size:"32",onClick:e,...n})}function zm({icon:t="ellipsis",...n}){const{items:e,clearItems:o}=Pn(),r=e.length===0;return s.jsxs(pe,{variant:"light",...n,children:[s.jsx(pe.ButtonIcon,{icon:t,variant:"circle",size:"32"}),s.jsx(pe.Content,{children:s.jsx(pe.List,{children:s.jsx(pe.Item,{disabled:r,onClick:i=>(a=>{r?a.stopPropagation():o()})(i),children:"Clear All"})})})]})}function ao(t,n=!1,e=!1,o=!1){const r=t.getDate(),i=["January","February","March","April","May","June","July","August","September","October","November","December"][t.getMonth()],a=t.getFullYear(),c=t.getHours(),l=t.getMinutes();let u="";return u=l<10?`0${l}`:`${l}`,n?n==="Today"?e?"Today":`Today at ${c}:${u}`:n==="Yesterday"?e?"Yesterday":`Yesterday at ${c}:${u}`:`${c}:${u}`:o?e?`${i} ${r}`:`${i} ${r} at ${c}:${u}`:e?`${i} ${r}, ${a}`:`${i} ${r}, ${a} at ${c}:${u}`}function rd(t,n={showTime:!0}){const e=new Date(1e3*t),o=new Date,r=Math.round((o-e)/1e3),i=Math.round(r/60),a=o.toDateString()===e.toDateString(),c=new Date(o.setDate(o.getDate()-1)).toDateString()===e.toDateString(),l=o.getFullYear()===e.getFullYear();return n.showTime?r<5?"Just Now":r<60?`${r} seconds ago`:r<90?"about a minute ago":i<60?`${i} minutes ago`:a?ao(e,"Today",!1,!0):c?ao(e,"Yesterday",!1,!0):l?ao(e,!1,!1,!0):ao(e):a?"Today":c?"Yesterday":l?ao(e,!1,!0,!0):ao(e,!1,!0)}function $m({className:t,...n}){const e=q("io-dm-body",t),{DownloadListEmpty:o,ItemGroup:r,Item:i}=ji(),{items:a,searchQuery:c,setCount:l,sortItems:u}=Pn(),f=u(a),p=Tu(c),d=g.useMemo(()=>f.filter(v=>v.displayInfo.filename.toLowerCase().includes(p.toLowerCase())||v.displayInfo.url.toLowerCase().includes(p.toLowerCase())),[f,p]),h=g.useMemo(()=>d.map(v=>({...v,displayInfo:{...v.displayInfo,startTime:rd(v.displayInfo.startTime,{showTime:!1})}})),[d]),m=g.useMemo(()=>Object.values(h.reduce((v={},y)=>{var b;return v[y.displayInfo.startTime]=((b=v[y.displayInfo.startTime])==null?void 0:b.concat([]))??[],v[y.displayInfo.startTime].push(y),v},{})),[h]);return g.useEffect(()=>{l(d.length)},[d,l]),s.jsx("div",{className:e,...n,children:m&&m.length!==0?m.map(v=>s.jsx(r,{title:String(v[0].displayInfo.startTime)??null,children:v.map(y=>s.jsx(i,{item:y},y.id))},v[0].id??"")):s.jsx(o,{})})}function Um({className:t,icon:n="download",text:e="No downloads to display.",...o}){const r=q("io-dm-no-items",t);return s.jsxs("div",{className:r,...o,children:[s.jsx(et,{variant:n}),s.jsx("p",{children:e})]})}function Vm({className:t,title:n,children:e,...o}){const r=q("io-dm-item-group",t);return s.jsxs("div",{className:r,...o,children:[n&&s.jsx("p",{children:n}),e]})}function Gm({className:t,item:n,...e}){const{ItemHeader:o,ItemBody:r,ItemFooter:i}=ji(),{state:a,url:c,filename:l,receivedBytes:u,totalBytes:f,speed:p,timeRemaining:d}=n.displayInfo;if(!n)return s.jsx(s.Fragment,{});const h=q("io-dm-item",n.displayInfo.state&&[a],t);return s.jsxs("div",{className:h,...e,children:[s.jsx(o,{itemID:n.id,filename:l,state:a}),s.jsx(r,{state:a,url:c,bytesReceived:u,bytesTotal:f,speed:p,timeRemaining:d}),s.jsx(i,{itemID:n.id,state:a})]})}function id({bytesReceived:t=0,bytesTotal:n=0,...e}){const o=g.useCallback(()=>t&&n?Math.round(t/n*100):0,[t,n]);return s.jsx(dm,{value:o(),...e})}function Ym({className:t,itemID:n,filename:e,state:o,cancel:r,remove:i,...a}){const c=q("io-dm-item-header",t),{cancelItem:l,removeItem:u}=Pn(),f=g.useCallback(d=>{r?r(d):l(d)},[r,l]),p=g.useCallback(d=>{i?i(d):u(d)},[i,u]);return s.jsxs("div",{className:c,...a,children:[s.jsx(nn,{text:e,style:{textDecoration:o==="interrupted"||o==="cancelled"?"line-through":"none"}}),s.jsx(Ue,{icon:"close",onClick:()=>{o==="progressing"||o==="paused"?f(n):p(n)}})]})}function Zm({className:t,state:n,url:e,bytesReceived:o=0,bytesTotal:r=0,speed:i=0,timeRemaining:a=0,...c}){const l=q("io-dm-item-body",t),u=d=>{const h=["Bytes","KB","MB","GB","TB"];if(d===0)return"0";const m=Math.floor(Math.log(d)/Math.log(1024));return m===0?`${d}${h[m]}`:`${(d/1024**m).toFixed(1)}${h[m]}`};return s.jsxs("div",{className:l,...c,children:[s.jsx("p",{className:"io-text-small",children:e}),(p=n,p==="cancelled"||p==="interrupted"||p==="completed"?null:s.jsx(id,{variant:p==="paused"?"paused":"active",bytesReceived:o,bytesTotal:r})),s.jsx("p",{className:"io-text-default-lh16",children:n==="completed"?`${u(o??0)} - Done`:n==="cancelled"||n==="interrupted"?`${u(o??0)}/${u(r??0)} - Failed`:`${u(o??0)}/${u(r??0)} (${f=i,(f?`${(f/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(d=>{const h=Math.floor(d/3600),m=Math.floor(d%3600/60);let v="";return h>0&&(v+=`${h} hour${h>1?"s":""}, `),m>0&&(v+=`${m} min${m>1?"s":""}, `),((d=Math.floor(d%60))>0||v==="")&&(v+=`${d} sec${d!==1?"s":""}`),`${v.trim()} left`})(a)??0}`})]});var f,p}const Km={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function ta({className:t,variant:n,text:e}){const o=q("io-dm-item-status",`io-dm-item-status-${n}`,t);return s.jsxs("div",{className:o,children:[n&&s.jsx(et,{variant:Km[n],className:"icon-severity"}),e&&s.jsx("p",{className:"io-text-smaller",children:e})]})}function qm({className:t,itemID:n,state:e,pauseResume:o,showInFolder:r,cancel:i,...a}){const c=q("io-dm-item-footer",t),{pauseResumeItem:l,showItemInFolder:u,cancelItem:f}=Pn(),p=g.useCallback(m=>{o?o(m):l(m)},[o,l]),d=g.useCallback(m=>{r?r(m):u(m)},[r,u]),h=g.useCallback(m=>{i?i(m):f(m)},[i,f]);return s.jsx("div",{className:c,...a,children:(()=>{switch(e){case"progressing":return s.jsxs(Re,{align:"right",children:[s.jsx(Re.Button,{variant:"primary",text:"Pause",onClick:()=>p(n)}),s.jsx(Re.Button,{variant:"link",text:"Cancel",onClick:()=>h(n)})]});case"paused":return s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Resume",onClick:()=>p(n)})});case"completed":return s.jsxs(s.Fragment,{children:[s.jsx(ta,{variant:"success",text:"Complete"}),s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Show in Folder",onClick:()=>d(n)})})]});case"cancelled":return s.jsx(s.Fragment,{children:s.jsx(ta,{variant:"warning",text:"Cancelled"})});case"interrupted":return s.jsxs(s.Fragment,{children:[s.jsx(ta,{variant:"critical",text:"Failed"}),s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Retry",onClick:()=>p(n)})})]});default:return null}})()})}function Jm({className:t,title:n="Settings",...e}){const o=q("io-dm-settings-panel",t),{configuration:{downloadFolder:r},hideSettings:i,setDownloadLocation:a,setDownloadLocationWithDialog:c,isDownloadLocationDialogVisible:l,downloadLocationList:u}=Pn();return s.jsxs(Ze,{className:o,...e,children:[s.jsxs(Ze.Header,{children:[s.jsx(Ze.Header.Title,{size:"large",text:n,tag:"h1"}),s.jsx(Ze.Header.ButtonGroup,{children:s.jsx(Ue,{variant:"circle",icon:"close",size:"32",onClick:()=>{i()},disabled:l})})]}),s.jsx(Ze.Body,{children:s.jsxs(Re,{children:[s.jsxs(pe,{variant:"light",disabled:l,children:[s.jsx(pe.Button,{children:s.jsx("span",{className:"io-dm-settings-panel-download-location",children:r??u[0]})}),u.length>1&&s.jsx(pe.Content,{children:s.jsx(pe.List,{children:u.map((f,p)=>!f||p===0||p>3?null:s.jsx(pe.Item,{onClick:()=>{a(f)},children:f},f))})})]}),s.jsx(Ge,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{c()},disabled:l})]})})]})}const ad={Header:Rm,ItemSearch:Bm,HeaderButtons:Hm,SettingsButton:Wm,MoreButton:zm,Body:$m,DownloadListEmpty:Um,ItemGroup:Vm,Item:Gm,ItemProgress:id,ItemHeader:Ym,ItemBody:Zm,ItemFooter:qm,Settings:Jm},sd=g.createContext(ad),Xm=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...ad,...n}),[n]);return s.jsx(sd.Provider,{value:e,children:t})});Xm.displayName="ComponentsStore";const ji=()=>g.useContext(sd);function Wa(t){if(t&&t.errorHandling&&typeof t.errorHandling!="function"&&t.errorHandling!=="log"&&t.errorHandling!=="silent"&&t.errorHandling!=="throw")throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof t.errorHandling+" was passed");var n=t&&typeof t.errorHandling=="function"&&t.errorHandling,e={};function o(r,i){var a=r instanceof Error?r:new Error(r);if(n)n(a);else{var c='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+a.stack;if(t)switch(t.errorHandling){case"log":return console.error(c);case"silent":return;case"throw":throw new Error(c)}console.error(c)}}return{add:function(r,i,a){var c=e[r];return c||(c=[],e[r]=c),c.push(i),a&&setTimeout(function(){a.forEach(function(l){var u;if(!((u=e[r])===null||u===void 0)&&u.includes(i))try{Array.isArray(l)?i.apply(void 0,l):i.apply(void 0,[l])}catch(f){o(f,r)}})},0),function(){var l=e[r];l&&(l=l.reduce(function(u,f,p){return f===i&&u.length===p||u.push(f),u},[]),l.length===0?delete e[r]:e[r]=l)}},execute:function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var c=e[r];if(!c||c.length===0)return[];var l=[];return c.forEach(function(u){try{var f=u.apply(void 0,i);l.push(f)}catch(p){l.push(void 0),o(p,r)}}),l},clear:function(){e={}},clearKey:function(r){e[r]&&delete e[r]}}}Wa.default=Wa;var Qm=Fl(Wa);const eg=g.createContext({config:{env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},onThemeChanged:t=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:t=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),Xt=()=>g.useContext(eg);function tg({...t}){const{config:n,close:e}=Xt(),{applicationTitle:o}=n;return s.jsxs(Ft,{draggable:!0,...t,children:[s.jsx(Ft.Title,{tag:"h1",text:o?`Feedback Form - ${o}`:"Feedback Form",size:"large"}),s.jsx(Ft.ButtonGroup,{className:"non-draggable",children:s.jsx(Ft.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>e()})})]})}function ng({className:t,handleSubmit:n,...e}){const o=q("io-panel-body",t),{config:r,submitFeedback:i}=Xt(),{IntroField:a,DescriptionField:c,TechInfoField:l,EnvInfoField:u,FileAttachmentsField:f,CategoryAttachmentsField:p,SettingsField:d,MailListField:h}=Oi(),m=n??i,v=`Your feedback will be submitted to the ${r.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return s.jsxs("form",{className:o,id:"feedback",onSubmit:y=>m(y),...e,children:[s.jsx(a,{children:s.jsx("p",{children:v})}),s.jsx(d,{}),s.jsx(h,{}),s.jsx(c,{}),s.jsx(l,{readOnly:!0}),s.jsx(u,{readOnly:!0}),r.attachmentsViewMode==="file"?s.jsx(f,{}):s.jsx(p,{})]})}function og({...t}){const{FooterButtons:n}=Oi(),{openUrl:e,submitInProgress:o,submitStatus:r,jiraTicketURL:i}=Xt();return s.jsx(Vn,{...t,children:s.jsxs("div",o?{className:"flex ai-center jc-between",children:[s.jsx(Ke,{children:s.jsx("p",{children:r.title})}),s.jsx(um,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[s.jsxs(Ke,{children:[s.jsx("p",{className:r.type==="error"?"io-text-error":"",children:r.title}),i&&s.jsx("a",{href:i,onClick:a=>{a.preventDefault(),e(i)},children:i})]}),s.jsx(n,{})]})})}function rg({className:t,...n}){const{CloseButton:e}=Oi(),{close:o}=Xt();return s.jsx(Re,{className:t,...n,children:s.jsx(e,{onClick:()=>o()})})}function ig({className:t,...n}){const{SubmitButton:e,CancelButton:o,CloseButton:r}=Oi(),{close:i,submitCompleted:a}=Xt();return a?s.jsx(Re,{className:t,...n,children:s.jsx(r,{text:"Close",onClick:()=>i()})}):s.jsxs(Re,{className:t,...n,children:[s.jsx(e,{}),s.jsx(o,{onClick:()=>i()})]})}function ag({text:t="Submit",...n}){return s.jsx(Ge,{form:"feedback",type:"submit",variant:"primary",text:t,...n})}function sg({text:t="Cancel",...n}){return s.jsx(Ge,{variant:"link",text:t,...n})}function cg({...t}){return s.jsx(Ge,{variant:"primary",...t})}function lg({showField:t=!0,className:n,title:e,hint:o,children:r,...i}){return t?s.jsx(Ke,{className:n,title:e,hint:o,...i,children:r}):null}function ug({showField:t=!0,className:n,title:e="Description",hint:o,readOnly:r=!1,disabled:i,...a}){return t?s.jsx(Ke,{className:n,hint:o,title:"",...a,children:s.jsx(xi,{id:"description",name:"description",label:e,readOnly:r,disabled:i})}):null}function dg({showField:t,className:n,title:e="Technical Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...c}){const{config:l}=Xt(),u=t??l.errorMessage,f=r??l.errorMessage;return u&&f?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(xi,{id:"errorMessage",name:"errorMessage",label:e,value:f,readOnly:i,disabled:a})}):null}function fg({showField:t,className:n,title:e="Environment Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...c}){const{config:l}=Xt(),u=t??l.showEnvironmentInfo,f=r??l.environmentInfo;return u&&f?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(xi,{id:"environmentInfo",name:"environmentInfo",label:e,value:f,readOnly:i,disabled:a})}):null}function pg({showField:t=!0,className:n,title:e="Attachments",hint:o,readOnly:r=!1,disabled:i,attachments:a,selectedCategories:c,...l}){const u=q("io-block-list-gap",n),{config:f}=Xt(),p=a??f.attachments,d=c??f.selectedCategories,h=g.useCallback(m=>!!d&&d.indexOf(m)!==-1,[d]);return t?!p||p.length<=0?s.jsx(Ke,{title:"Attachments",children:s.jsx("p",{children:"No Attachments"})}):s.jsx(Ke,{className:u,title:e,hint:o,...l,children:s.jsx("div",{className:"file-attachments",children:p.map(m=>s.jsx(Ci,{id:m.id,name:m.id,label:m.name,readOnly:r,disabled:i,defaultChecked:h(m.category)},m.id))})}):null}function hg({showField:t=!0,className:n,title:e="Attachments",hint:o,readOnly:r=!1,disabled:i,categories:a,selectedCategories:c,...l}){const{config:u,attachmentCategories:f}=Xt(),p=a??f,d=c??u.selectedCategories,h=g.useCallback(m=>!!d&&d.indexOf(m)!==-1,[d]);return t?!p||p.length<=0?s.jsx("p",{children:"No Attachments"}):s.jsx(Ke,{className:n,title:e,hint:o,...l,children:s.jsx("div",{className:"category-attachments",children:p.map(m=>s.jsx(ft,{id:m,name:m,align:"right",label:m,readOnly:r,disabled:i,defaultChecked:h(m)},m))})}):null}function mg({className:t,title:n,hint:e,showField:o=!0,showJiraTicketField:r,jiraTicketLabel:i="Create Jira Ticket",showSendEmailField:a,sendEmailLabel:c="Send Email",readOnly:l=!1,disabled:u,...f}){const p=q("io-block-list-gap",t),{config:d,showMailingList:h,setShowMailingList:m}=Xt();if(!o)return null;const v=r??d.createJiraTicket,y=a??d.sendEmail;return s.jsxs(Ke,{className:p,hint:e,title:n,...f,children:[v&&s.jsx(ft,{id:"createJiraTicket",name:"createJiraTicket",label:i,align:"right",readOnly:l,disabled:u,defaultChecked:v}),y&&s.jsx(ft,{onChange:()=>{m(!h)},id:"sendEmail",name:"sendEmail",label:c,align:"right",readOnly:l,disabled:u,defaultChecked:y})]})}function gg({showField:t=!0,className:n,title:e="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:i,disabled:a,...c}){const{config:l,showMailingList:u}=Xt(),f=t??l.sendEmail,p=i??l.allowEditRecipients===!1;return f&&u?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(Qn,{id:"mailingList",name:"mailingList",label:e,placeholder:r,readOnly:p,disabled:a,defaultValue:l.mailingList??""})}):null}const cd={Header:tg,Body:ng,Footer:og,HeaderButtons:rg,FooterButtons:ig,SubmitButton:ag,CancelButton:sg,CloseButton:cg,IntroField:lg,DescriptionField:ug,TechInfoField:dg,EnvInfoField:fg,FileAttachmentsField:pg,CategoryAttachmentsField:hg,SettingsField:mg,MailListField:gg},ld=g.createContext(cd),vg=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...cd,...n}),[n]);return s.jsx(ld.Provider,{value:e,children:t})});function Oi(t){return{...g.useContext(ld),...t}}vg.displayName="ComponentsStore";function ud({className:t,title:n="General",...e}){const o=q("io-notifications-settings-panel-general",t),{AllowNotifications:r,AllowNotificationToasts:i,ShowNotificationBadge:a,CloseNotificationOnClick:c,PanelAutoHide:l,HideToastsAfter:u}=oo(),f=He();return s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[f&&s.jsx(r,{}),f&&s.jsx(i,{}),s.jsx(a,{}),f&&s.jsx(l,{}),f&&s.jsx(c,{}),f&&s.jsx(u,{})]})})}var tt=new class{constructor(){It(this,"subscribed",!1);It(this,"io");It(this,"registry",Qm());It(this,"logger");It(this,"isPanelVisible");It(this,"notifications",[]);It(this,"bulkActionsSupported",!1)}init(t){var r,i,a,c;if(this.subscribed)return;this.subscribed=!0,this.io=t,this.logger=this.io.logger.subLogger("notifications");const n=this.io.appManager.myApplication,e=((i=(r=n==null?void 0:n.userProperties)==null?void 0:r.logger)==null?void 0:i.publishLevel)??"error",o=((c=(a=n==null?void 0:n.userProperties)==null?void 0:a.logger)==null?void 0:c.consoleLevel)??"info";this.logger.publishLevel(e),this.logger.consoleLevel(o),this.logger.info("===== IO Notifications v.0.7.3 ====="),this.getBulkActionsSupport(),this.subscribe()}onPanelVisibilityChanged(t){return this.registry.add("on-panel-visibility-changed",t)}onConfigurationChanged(t){return this.registry.add("on-configuration-changed",t)}onNotificationsChanged(t){return this.registry.add("on-notifications-changed",t)}onCounterChanged(t){return this.registry.add("on-counter-changed",t)}async getNotificationsList(){var n;const t=await((n=this.io)==null?void 0:n.notifications.list());if(!t)throw new Error("io.notifications.list is not supported in this environment.");return t.map(e=>this.attachHandlers(e))}async getConfiguration(){if(this.io)return await this.io.notifications.getConfiguration();throw new Error("io.notifications.getConfiguration is not supported in this environment.")}showPanel(){var t;if(this.isDesktopEnvironment())return(t=this.io)==null?void 0:t.notifications.panel.show()}hidePanel(){var t;if(this.isDesktopEnvironment())return(t=this.io)==null?void 0:t.notifications.panel.hide()}clearAll(){var t,n;return(t=this.logger)==null||t.trace("clearing all notifications"),(n=this.io)==null?void 0:n.notifications.clearAll()}clearAllOld(){var t,n;return(t=this.logger)==null||t.trace("clearing all old notifications"),(n=this.io)==null?void 0:n.notifications.clearOld()}clearMany(t){var n,e,o,r;return typeof((n=this.io)==null?void 0:n.notifications).clearMany=="function"?t.length<1?((e=this.logger)==null||e.trace("no ids provided to clear notifications"),Promise.resolve()):((o=this.logger)==null||o.trace(`clearing notifications with ids ${JSON.stringify(t.join(", "))}`),((r=this.io)==null?void 0:r.notifications).clearMany(t)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(t){var n,e;return(n=this.logger)==null||n.trace(`closing notification with id ${t}`),(e=this.io)==null?void 0:e.notifications.clear(t)}snooze(t,n){var e,o;return(e=this.logger)==null||e.trace(`snoozing notification with id ${t} for ${n}ms`),(o=this.io)==null?void 0:o.notifications.snooze(t,n)}snoozeMany(t,n){var e,o,r,i;return typeof((e=this.io)==null?void 0:e.notifications).snoozeMany=="function"?t.length<1?((o=this.logger)==null||o.trace("no ids provided to snooze notifications"),Promise.resolve()):((r=this.logger)==null||r.trace(`snoozing notifications with ids ${JSON.stringify(t.join(", "))} for ${n}ms`),((i=this.io)==null?void 0:i.notifications).snoozeMany(t,n)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(t,n){var e,o;return(e=this.logger)==null||e.trace(`setting state of ${t} to ${n}`),(o=this.io)==null?void 0:o.notifications.setState(t,n)}setStates(t,n){var e,o,r,i;return typeof((e=this.io)==null?void 0:e.notifications).setStates=="function"?t.length<1?((o=this.logger)==null||o.trace(`no ids provided to change state to ${n} for notifications`),Promise.resolve()):((r=this.logger)==null||r.trace(`setting state of ${JSON.stringify(t.join(", "))} to ${n}`),((i=this.io)==null?void 0:i.notifications).setStates(t,n)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){var n,e,o;const t=typeof((n=this.io)==null?void 0:n.notifications).clearMany=="function"&&typeof((e=this.io)==null?void 0:e.notifications).setStates=="function"&&typeof((o=this.io)==null?void 0:o.notifications).snoozeMany=="function";this.bulkActionsSupported=t}setFilter(t){var n,e;return(n=this.logger)==null||n.trace(`setting filter to ${JSON.stringify(t)}`),(e=this.io)==null?void 0:e.notifications.setFilter(t)}configure(t){var n;return(n=this.io)==null?void 0:n.notifications.configure(t)}subscribe(){var t,n,e,o,r,i,a;(t=this.io)==null||t.notifications.onRaised(c=>{var l;(l=this.logger)==null||l.trace(`received event indicating notification raise: ${JSON.stringify(c)}`),this.attachHandlers(c),this.notifications.unshift(c),this.registry.execute("on-notifications-changed",[...this.notifications])}),(n=this.io)==null||n.notifications.onStateChanged(({id:c},l)=>{var u;(u=this.logger)==null||u.trace(`received event for notification state is changed - "${c}" - "${l==null?void 0:l.toString()}"`),this.notifications=this.notifications.map(f=>{var p;return f.id===c?((p=this.logger)==null||p.trace(`${f.id} - the state is changed from "${f.state}" to "${l==null?void 0:l.toString()}"`),Object.assign(f,{state:l})):f}),this.registry.execute("on-notifications-changed",this.notifications)}),(e=this.io)!=null&&e.notifications&&"onDataChanged"in this.io.notifications&&typeof this.io.notifications.onDataChanged=="function"&&((o=this.io)==null||o.notifications.onDataChanged((c,l)=>{var f;const u=c.id;(f=this.logger)==null||f.trace(`received event for notification data is changed - "${u}" - "${JSON.stringify(l)}"`),this.notifications=this.notifications.map(p=>{var d;return p.id===u?((d=this.logger)==null||d.trace(`${p.id} - the data is changed from "${JSON.stringify(p.data)}" to "${JSON.stringify(l)}"`),Object.assign(p,{data:l})):p}),this.registry.execute("on-notifications-changed",this.notifications)})),(r=this.io)==null||r.notifications.onClosed(({id:c})=>{var l;(l=this.logger)==null||l.trace(`received event for notification is closed - "${c}".`),this.notifications=this.notifications.filter(u=>u.id!==c),this.registry.execute("on-notifications-changed",this.notifications)}),(i=this.io)==null||i.notifications.onConfigurationChanged(c=>{var l;(l=this.logger)==null||l.trace(`received event for configuration changed - ${JSON.stringify(c)}.`),this.registry.execute("on-configuration-changed",c)}),this.isDesktopEnvironment()&&((a=this.io)==null||a.notifications.panel.onVisibilityChanged(c=>{var l;(l=this.logger)==null||l.trace(`received event for panel visibility changed to "${c}".`),this.isPanelVisible=c,this.registry.execute("on-panel-visibility-changed",c)}))}isDesktopEnvironment(){return typeof window=="object"&&(!!window.iodesktop||!!window.glue42gd)}attachHandlers(t){var e;return(e=t.actions)==null||e.forEach(o=>{Object.assign(o,{onClick:async r=>{var i,a,c;try{(i=this.logger)==null||i.info(`${t.id}/${o.action} - was clicked.`),await((a=this.io)==null?void 0:a.notifications.click(t.id,o.action,r))}catch(l){(c=this.logger)==null||c.error("Error while clicking on action:",l)}}})}),Object.assign(t,{snooze:async(o=1e4)=>{var r,i;(r=this.logger)==null||r.trace(`${t.id} - request to change the state from ${t.state} to Snoozed with duration ${o}ms`),await((i=this.io)==null?void 0:i.notifications.snooze(t.id,o))},updateState:async o=>{var r,i;return(r=this.logger)==null||r.trace(`${t.id} - request to change the state from ${t.state} to ${o}`),(i=this.io)==null?void 0:i.notifications.setState(t.id,o)},updateData:async o=>{var r,i;(r=this.logger)==null||r.trace(`${t.id} - request to change the data to ${JSON.stringify(o)}`),(i=this.io)!=null&&i.notifications&&"updateData"in this.io.notifications&&typeof this.io.notifications.updateData=="function"?await this.io.notifications.updateData(t.id,o):console.log("'updateData' method is not supported")},onClick:async o=>{var r,i,a;try{(r=this.logger)==null||r.info(`${t.id} - was clicked.`),await((i=this.io)==null?void 0:i.notifications.click(t.id,void 0,o))}catch(c){(a=this.logger)==null||a.error(`Error while clicking on Notification: ${t.id}`,c)}},onShow:()=>{},close:async()=>{var o;return(o=this.logger)==null||o.info(`${t.id} - was closed.`),this.close(t.id)}})}};function ys(t){const n=g.useContext(De.IOConnectContext),e=n==null?void 0:n.appManager,o=He(),[r,i]=g.useState([]),[a,c]=g.useState(0),l="Platform",u=g.useCallback((d="asc")=>{if(o===null)return[];const h=[...r].sort((m,v)=>{const y=(m.title??m.name).toLowerCase(),b=(v.title??v.name).toLowerCase();return d==="asc"?y.localeCompare(b):b.localeCompare(y)});if(!o){const m=h.findIndex(v=>v.name===l);if(m!==-1){const[v]=h.splice(m,1);h.unshift(v)}}return h},[r,o]),f=g.useMemo(()=>u("asc"),[u]),p=g.useMemo(()=>u("desc"),[u]);return g.useEffect(()=>{if(o===null||o)return;const d={title:"System",name:l,hidden:!1,userProperties:{hidden:!1}};i(h=>h.some(m=>m.name===d.name)?h:[...h,d])},[o]),g.useEffect(()=>{if(!e)return;const d=e.onAppAdded(v=>{i(y=>[...y,{title:v.title,name:v.name,hidden:v.hidden,userProperties:v.userProperties}])}),h=e.onAppRemoved(v=>{i(y=>y.filter(b=>b.name!==v.name))}),m=e.onAppChanged(v=>{i(y=>{const b=y.find(S=>S.name===v.name);return[...y.filter(S=>S.name!==v.name),{title:v.title,name:b==null?void 0:b.name,hidden:b==null?void 0:b.hidden,allowed:b==null?void 0:b.allowed,userProperties:b==null?void 0:b.userProperties}]})});return()=>{d(),h(),m()}},[e]),{apps:g.useMemo(()=>{if(!(t!=null&&t.sourceFilter)||!Array.isArray(r))return r;const{allowed:d=[],blocked:h=[]}=t.sourceFilter,m=d.includes("*"),v=h.includes("*");let y=0;const b=r.map(S=>{const w=m||d.includes(S.name),x=!v&&w;return x&&y++,{...S,allowed:x}});return c(y),b},[t,r]),allowedApps:a,sortedAppsAsc:f,sortedAppsDesc:p,sortAppsAlphabetically:u}}function dd(t,n,e){var r;return{notificationStacks:g.useMemo(()=>{var u,f,p,d;if(!n.toastStacking)return[];const i=(a=n.stackBy)==="application"?"source":a==="severity"?"severity":"source";var a;const c=t.filter(h=>h.state==="Active"),l=new Map;for(const h of c){const m=h[i]??"";if(h.source&&((f=(u=e==null?void 0:e.sourceFilter)==null?void 0:u.muted)!=null&&f.includes(h.source))||(d=(p=e==null?void 0:e.sourceFilter)==null?void 0:p.muted)!=null&&d.includes("*"))continue;l.has(m)||l.set(m,{key:m,items:[]});const v=l.get(m);v&&v.items.unshift(h)}return Array.from(l.values()).filter(h=>h.items.some(m=>m.state==="Active"||m.state==="Stale"))},[t,n.toastStacking,n.stackBy,(r=e==null?void 0:e.sourceFilter)==null?void 0:r.muted])}}function fd(t){const[n,e]=g.useState([]);return{selectedNotifications:n,selectNotification:(o,r)=>{const i=n;e(r?[...i,o]:i.filter(a=>a!==o))},selectAllNotifications:(o,r)=>{if(r){let i=[];switch(o){case"read":i=t.filter(a=>a.state==="Acknowledged"||a.state==="Seen").map(a=>a.id);break;case"unread":i=t.filter(a=>a.state==="Active"||a.state==="Stale").map(a=>a.id);break;case"snoozed":i=t.filter(a=>a.state==="Snoozed").map(a=>a.id);break;default:i=t.map(a=>a.id)}e(i)}else e([])}}}const Hc=t=>{var n,e;return{enabledNotifications:t.enable,enabledToasts:t.enableToasts,toastStacking:((n=t.toasts)==null?void 0:n.mode)==="stacked",stackBy:(e=t.toasts)==null?void 0:e.stackBy,toastExpiry:t.toastExpiry,showNotificationBadge:t.showNotificationBadge,placement:t.placement,snooze:t.snooze,closeNotificationOnClick:t.closeNotificationOnClick,autoHidePanel:t.autoHidePanel}},Wc=t=>Array.from(t.reduce((n,e)=>n.set(e.id,e),new Map).values());function yg(){const t=g.useContext(De.IOConnectContext),[n,e]=g.useState({}),[o,r]=g.useState({}),[i,a]=g.useState([]),[c,l]=g.useState(0),[u,f]=g.useState(!0),{apps:p,allowedApps:d}=ys(n),{notificationStacks:h}=dd(i,{toastStacking:o.toastStacking??!1,stackBy:o.stackBy??"source"},{sourceFilter:n.sourceFilter}),{selectedNotifications:m,selectNotification:v,selectAllNotifications:y}=fd(i);tt.init(t),g.useEffect(()=>{(async()=>{await(async()=>{try{const w=await tt.getConfiguration();e(w),r(x=>({...x,...Hc(w)}))}catch(w){console.error("Error fetching configuration:",w)}})(),await(async()=>{try{const w=await tt.getNotificationsList();a(Wc(w))}catch(w){console.error("Error fetching notifications:",w)}})()})().catch(w=>{console.error("Error in useNotifications fetch:",w)}),b()},[]),g.useEffect(()=>{const w=tt.onNotificationsChanged(O=>{a(Wc(O))}),x=tt.onConfigurationChanged(O=>{const M=Hc(O);e(B=>({...B,...O})),r(B=>({...B,...M}))}),E=tt.onCounterChanged(O=>{l(O)});return()=>{w(),x(),E()}},[]);const b=()=>{f(tt.bulkActionsSupported)},S=async w=>{await tt.setFilter(w)};return{close:w=>tt.close(w),clearAll:()=>tt.clearAll(),settings:o,hidePanel:async()=>{await tt.hidePanel()},showPanel:async()=>{await tt.showPanel()},saveFilter:S,clearAllOld:()=>tt.clearAllOld(),saveSetting:async w=>{const x=((E,O)=>{const M=(Z=>({enabledNotifications:_=>({enable:_}),enabledToasts:_=>({enableToasts:_}),toastStacking:_=>{var I;return{toasts:{mode:_?"stacked":"single",stackBy:(I=Z.toasts)==null?void 0:I.stackBy}}},stackBy:_=>{var I;return{toasts:{mode:(I=Z.toasts)==null?void 0:I.mode,stackBy:_}}},showNotificationBadge:_=>({showNotificationBadge:_}),toastExpiry:_=>({toastExpiry:_}),placement:_=>({placement:_}),snooze:_=>({snooze:_}),closeNotificationOnClick:_=>({closeNotificationOnClick:_}),autoHidePanel:_=>({autoHidePanel:_})}))(O),B=Object.keys(E)[0],$=E[B];return B&&$!==void 0&&M[B]?M[B]($):{}})(w,n);x&&await tt.configure(x)},allApps:p,saveAllFilter:async w=>{"subscribe"in w?await S({allowed:w.subscribe?["*"]:[],blocked:w.subscribe?[]:["*"]}):"mute"in w&&await S({muted:w.mute?["*"]:[]})},configuration:n,notifications:i,notificationStacks:h,notificationsCount:c,allApplications:n.allApplications??0,allowedApplications:d,isBulkActionsSupported:u,selectedNotifications:m,selectNotification:v,selectAllNotifications:y,clearMany:async w=>{await tt.clearMany(w)},snooze:async(w,x)=>{await tt.snooze(w,x)},snoozeMany:async(w,x)=>{await tt.snoozeMany(w,x)},setState:async(w,x)=>{await tt.setState(w,x)},setStates:async(w,x)=>{await tt.setStates(w,x)},setCount:w=>{l(w)},getNotificationsList:async()=>await tt.getNotificationsList()}}const pd=g.createContext({allApps:[],settings:{},configuration:{},notifications:[],notificationsCount:0,onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{},setCount:()=>{}}),je=()=>g.useContext(pd);function hd({label:t="Allow notifications",align:n="right",...e}){const{settings:o,saveSetting:r}=je(),i=He(),a=g.useCallback(c=>{r({enabledNotifications:c.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:a,checked:o.enabledNotifications??!1,...e}):null}function md({label:t="Allow notification toasts",align:n="right",...e}){const{settings:o,saveSetting:r}=je(),i=He(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({enabledToasts:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.enabledToasts??!1,disabled:a,...e}):null}function gd({label:t="Show notification badge",align:n="right",...e}){const{settings:o,saveSetting:r}=je(),i=He()&&!o.enabledNotifications,a=g.useCallback(c=>{r({showNotificationBadge:c.target.checked})},[r]);return s.jsx(ft,{label:t,align:n,onChange:a,checked:o.showNotificationBadge??!1,disabled:i,...e})}function vd({label:t="Close notification on click",align:n="right",...e}){const{settings:o,saveSetting:r}=je(),i=He(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({closeNotificationOnClick:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.closeNotificationOnClick??!1,disabled:a,...e}):null}function yd({label:t="Auto hide panel",align:n="right",...e}){const{settings:o,saveSetting:r}=je(),i=He(),a=g.useCallback(c=>{r({autoHidePanel:c.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:a,checked:o.autoHidePanel??!1,...e}):null}const zc=(t,n)=>t?`${t} ${n}${t!==1?"s":""}`:"",oi=t=>{const n=Math.floor(t/60),e=t%60,o=zc(n,"minute"),r=zc(e,"second");return o+(o&&r?" ":"")+r};function bd({className:t,title:n="Hide toasts after",items:e=[15,30,45,60],...o}){const r=q("flex","jc-between","ai-center",t),{settings:i,saveSetting:a}=je(),c=He(),l=c&&!i.enabledNotifications,u=g.useCallback((f=15e3)=>{i.toastExpiry!==f&&a({toastExpiry:1e3*f})},[i.toastExpiry,a]);return c?s.jsxs("div",{className:r,...o,children:[s.jsx("div",{className:"io-text-clipper "+(l?"io-text-disabled":""),children:s.jsx("span",{children:n})}),s.jsxs(pe,{variant:"light",disabled:l,children:[s.jsx(pe.Button,{text:oi((i.toastExpiry??0)/1e3)}),s.jsx(pe.Content,{children:s.jsx(pe.List,{variant:"single",children:e.map(f=>s.jsx(pe.Item,{onClick:()=>{u(f)},children:oi(f)},f))})})]})]}):null}function wd({className:t,title:n="Stacking",...e}){const o=q("io-notifications-settings-panel-stacking",t),{ToastStacking:r,ToastStackBy:i}=oo();return He()?s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[s.jsx(r,{}),s.jsx(i,{})]})}):null}function xd({label:t="Allow toast stacking",align:n="right",...e}){const{settings:o,saveSetting:r}=je(),i=He(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({toastStacking:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.toastStacking??!1,disabled:a,...e}):null}const za={application:"Application",severity:"Priority"},bg=Object.fromEntries(Object.entries(za).map(([t,n])=>[n,t]));function Cd({className:t,title:n="Group by",...e}){const o=q("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=je(),a=He(),c=a&&!r.enabledNotifications,l=g.useCallback((f="severity")=>{r.stackBy!==f&&i({stackBy:f.toLowerCase()})},[r.stackBy,i]);if(!a)return null;const u=Object.values(za);return s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:q("io-text-clipper",{"io-text-disabled":c}),children:s.jsx("span",{children:n})}),s.jsxs(pe,{variant:"light",disabled:c,children:[s.jsx(pe.Button,{text:za[r.stackBy??"severity"]}),s.jsx(pe.Content,{children:s.jsx(pe.List,{variant:"single",children:u.map(f=>s.jsx(pe.Item,{onClick:()=>{const p=bg[f];l(p)},children:f},f))})})]})]})}function kd({className:t,title:n="Placement",...e}){const o=q("io-notifications-settings-panel-placement",t),{PlacementPanel:r,PlacementToasts:i}=oo();return He()?s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[s.jsx(r,{}),s.jsx(i,{})]})}):null}const Sd=t=>t.replace(/(^|-)\w/g,n=>n.toUpperCase().replace("-"," "));function Ed({className:t,title:n="Panel position",...e}){var l,u;const o=q("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=je(),a=He(),c=g.useCallback(f=>{var p;f||(f="right"),((p=r.placement)==null?void 0:p.panel)!==f&&i({placement:{...r.placement,panel:f.toLowerCase()}})},[r.placement,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:"io-text-clipper",children:s.jsx("span",{children:n})}),s.jsxs(pe,{variant:"light",children:[s.jsx(pe.Button,{text:(l=r.placement)!=null&&l.panel?Sd((u=r.placement)==null?void 0:u.panel):"Right"}),s.jsx(pe.Content,{children:s.jsx(pe.List,{variant:"single",children:["Right","Left"].map(f=>s.jsx(pe.Item,{onClick:()=>{c(f)},children:f},f))})})]})]}):null}function jd({className:t,title:n="Toasts position",...e}){var l,u;const o=q("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=je(),a=He(),c=g.useCallback(f=>{var d;if(f||(f="bottom-right"),((d=r.placement)==null?void 0:d.toasts)===f)return;const p=f.replace(/\s+/g,"-").toLowerCase();i({placement:{...r.placement,toasts:p}})},[r.placement,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:"io-text-clipper",children:s.jsx("span",{children:n})}),s.jsxs(pe,{variant:"light",children:[s.jsx(pe.Button,{text:(l=r.placement)!=null&&l.toasts?Sd((u=r.placement)==null?void 0:u.toasts):"Bottom Right"}),s.jsx(pe.Content,{children:s.jsx(pe.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(f=>s.jsx(pe.Item,{onClick:()=>{c(f)},children:f},f))})})]})]}):null}function Od({className:t,title:n="Snooze",...e}){var a;const o=q("io-notifications-settings-panel-snooze",t),{SnoozeDuration:r}=oo(),{settings:i}=je();return He()&&((a=i.snooze)!=null&&a.enabled)?s.jsx("div",{className:o,...e,children:s.jsx(Ke,{title:n,children:s.jsx(r,{})})}):null}function Nd({className:t,title:n="Default duration",items:e=[60,120,180,300],...o}){var f,p;const r=q("flex","jc-between","ai-center",t),{settings:i,saveSetting:a}=je(),c=He(),l=c&&!i.enabledNotifications,u=g.useCallback((d=6e4)=>{var h;i.snooze&&((h=i.snooze)==null?void 0:h.duration)!==d&&a({snooze:{...i.snooze,duration:1e3*d}})},[i.snooze,a]);return c&&((f=i.snooze)!=null&&f.enabled)?s.jsxs("div",{className:r,...o,children:[s.jsx("div",{className:q("io-text-clipper",{"io-text-disabled":l}),children:s.jsx("span",{children:n})}),s.jsxs(pe,{variant:"light",disabled:l,children:[s.jsx(pe.Button,{text:oi((((p=i.snooze)==null?void 0:p.duration)??0)/1e3)}),s.jsx(pe.Content,{children:s.jsx(pe.List,{variant:"single",children:e.map(d=>s.jsx(pe.Item,{onClick:()=>{u(d)},children:oi(d)},d))})})]})]}):null}function Id({className:t,title:n,...e}){const o=q("io-notifications-settings-panel-subscriptions",t),{SubscribeAll:r,SubscribeApp:i,SubscribeMuteAll:a,SubscribeMuteApp:c}=oo(),{sortAppsAlphabetically:l}=ys(),u=He(),f=l(),p="io-notifications-subscriptions-grid "+(u?"with-three-columns":"with-two-columns");return s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n??(u?"Subscribe & Mute":"Subscribe"),children:[s.jsxs("div",{className:p,children:[s.jsx("p",{className:"io-text-section",children:"Sources"}),s.jsx("p",{className:"io-text-section",children:"Subscribe"}),u&&s.jsx("p",{className:"io-text-section",children:"Mute"})]}),s.jsxs("div",{className:p,children:[s.jsx("p",{children:"All Sources"}),s.jsx(r,{label:""}),u&&s.jsx(a,{label:""})]}),f.map(d=>{var h;return!d||d.hidden||(h=d==null?void 0:d.userProperties)!=null&&h.hidden?null:s.jsxs("div",{className:p,children:[s.jsx("p",{children:d.title??d.name}),s.jsx(i,{app:d,label:""}),u&&s.jsx(c,{app:d,label:""})]},d.name)})]})})}function Ad({label:t="All apps",align:n="right",...e}){var l,u,f,p;const{settings:o,configuration:r,saveAllFilter:i}=je(),a=He()&&!o.enabledNotifications,c=g.useCallback(d=>{i({subscribe:d.target.checked})},[i]);return s.jsx(ft,{align:n,label:t,onChange:c,checked:(((u=(l=r.sourceFilter)==null?void 0:l.allowed)==null?void 0:u.includes("*"))&&((p=(f=r.sourceFilter)==null?void 0:f.blocked)==null?void 0:p.length)===0)??!1,disabled:a,...e})}function Pd({label:t="App",align:n="right",app:e,...o}){var f,p,d,h,m,v;const{allApps:r,settings:i,configuration:a,saveFilter:c}=je(),l=He()&&!i.enabledNotifications,u=g.useCallback((y,b)=>{var x,E,O,M,B,$;const S={...a.sourceFilter},w=(x=S.allowed)==null?void 0:x.indexOf("*");typeof w=="number"&&w>-1&&((E=S.allowed)==null||E.splice(w,1),r.forEach(Z=>{var _;Z.name!==b.name&&((_=S.allowed)==null||_.push(Z.name))})),y?(S.allowed=[...new Set([...S.allowed??[],b.name])],S.blocked=(O=S.blocked)==null?void 0:O.filter(Z=>Z!==b.name)):(S.allowed=(M=S.allowed)==null?void 0:M.filter(Z=>Z!==b.name),S.blocked=[...new Set([...S.blocked??[],b.name])]),(B=S.allowed)!=null&&B.length&&(($=S.blocked)!=null&&$.includes("*"))&&S.blocked.splice(S.blocked.indexOf("*"),1),c(S)},[r,a.sourceFilter,c]);return s.jsx(ft,{id:e.name,label:t,align:n,onChange:y=>u(y.target.checked,e),checked:(((p=(f=a.sourceFilter)==null?void 0:f.allowed)==null?void 0:p.includes("*"))&&!((h=(d=a.sourceFilter)==null?void 0:d.blocked)!=null&&h.includes(e.name))||((v=(m=a.sourceFilter)==null?void 0:m.allowed)==null?void 0:v.includes(e.name)))??!1,disabled:l,...o})}function Td({label:t="Mute all",align:n="right",...e}){var u,f,p,d;const{settings:o,configuration:r,saveAllFilter:i}=je(),a=He(),c=a&&(!o.enabledNotifications||((f=(u=r.sourceFilter)==null?void 0:u.allowed)==null?void 0:f.indexOf("*"))===-1),l=g.useCallback(h=>{i({mute:h.target.checked})},[i]);return a?s.jsx(ft,{align:n,label:t,onChange:l,checked:((d=(p=r.sourceFilter)==null?void 0:p.muted)==null?void 0:d.includes("*"))??!1,disabled:c??!1,...e}):null}function Dd({label:t="App",align:n="right",app:e,...o}){var p,d,h,m,v,y,b,S,w,x,E,O,M,B,$,Z;const{allApps:r,settings:i,configuration:a,saveFilter:c}=je(),l=He(),u=l&&(!i.enabledNotifications||((d=(p=a.sourceFilter)==null?void 0:p.blocked)==null?void 0:d.includes("*"))||((m=(h=a.sourceFilter)==null?void 0:h.blocked)==null?void 0:m.includes(e.name))||((y=(v=a.sourceFilter)==null?void 0:v.allowed)==null?void 0:y.length)===0||((S=(b=a.sourceFilter)==null?void 0:b.allowed)==null?void 0:S.indexOf(e.name))===-1&&((x=(w=a.sourceFilter)==null?void 0:w.allowed)==null?void 0:x.indexOf("*"))===-1&&((O=(E=a.sourceFilter)==null?void 0:E.blocked)==null?void 0:O.length)===0),f=g.useCallback((_,I)=>{var ne,ge,de,Oe;const he={...a.sourceFilter},ye=(ne=he==null?void 0:he.muted)==null?void 0:ne.indexOf("*");typeof ye=="number"&&ye>-1&&((ge=he.muted)==null||ge.splice(ye,1),r.forEach(se=>{var W;se.name===I.name||se.hidden||((W=he.muted)==null||W.push(se.name))})),_?(de=he.muted)==null||de.push(I.name):he.muted=(Oe=he.muted)==null?void 0:Oe.filter(se=>se!==I.name),c(he)},[r,a.sourceFilter,c]);return!l||e.hidden?null:s.jsx(ft,{id:e.name,label:t,align:n,onChange:_=>f(_.target.checked,e),checked:(((B=(M=a.sourceFilter)==null?void 0:M.muted)==null?void 0:B.includes("*"))||((Z=($=a.sourceFilter)==null?void 0:$.muted)==null?void 0:Z.includes(e.name)))??!1,disabled:u??!1,...o})}const Md={Body:t=>{const{General:n,Placement:e,Stacking:o,Snooze:r,Subscriptions:i}=oo();return s.jsxs(So,{...t,children:[s.jsx(n,{}),s.jsx(o,{}),s.jsx(e,{}),s.jsx(r,{}),s.jsx(i,{})]})},General:ud,AllowNotifications:hd,AllowNotificationToasts:md,ShowNotificationBadge:gd,CloseNotificationOnClick:vd,PanelAutoHide:yd,HideToastsAfter:bd,Stacking:wd,ToastStacking:xd,ToastStackBy:Cd,Placement:kd,PlacementPanel:Ed,PlacementToasts:jd,Snooze:Od,SnoozeDuration:Nd,Subscriptions:Id,SubscribeAll:Ad,SubscribeApp:Pd,SubscribeMuteAll:Td,SubscribeMuteApp:Dd},_d=g.createContext(Md),bs=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Md,...n}),[n]);return s.jsx(_d.Provider,{value:e,children:t})});bs.displayName="NotificationsSettingsPanelComponentsStoreProvider";const oo=()=>g.useContext(_d),wg=({className:t,onClose:n,title:e="Notification Settings",...o})=>{const{Body:r}=oo();return s.jsxs(Ze,{className:q("io-notifications-settings-panel",t),...o,children:[s.jsxs(Ze.Header,{children:[s.jsx(Ze.Header.Title,{size:"large",text:e,tag:"h1"}),s.jsx(Ze.Header.ButtonGroup,{children:s.jsx(Ze.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),s.jsx(r,{})]})},Ld=({components:t,...n})=>s.jsx(bs,{components:t,children:s.jsx(wg,{...n})});function xg({isOpen:t,onClose:n,container:e}){return t?Un.createPortal(s.jsx(Ld,{onClose:n}),e??document.querySelector("#root")??document.body):null}const Rd=g.createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),Et=()=>g.useContext(Rd);function Fd({title:t,onClose:n,onOpenSettings:e,...o}){const{HeaderCaptionTitle:r,HeaderCaptionCount:i,HeaderCaptionButtonSettings:a,HeaderCaptionButtonClose:c,HeaderActions:l,HeaderBulkActions:u,HeaderSearch:f}=to(),{isBulkActionsSupported:p,notificationsCount:d}=je(),{isBulkActionsVisible:h}=Et(),m=He();return s.jsxs(Cn,{...o,children:[s.jsxs("div",{className:"io-panel-header-caption",children:[s.jsx(r,{title:t}),s.jsx(i,{}),s.jsxs(Cn.ButtonGroup,{children:[m&&s.jsx(a,{onClick:e}),s.jsx(c,{onClick:n})]})]}),p?s.jsxs("div",{className:`io-panel-header-actions-wrapper ${h&&d>0?"io-panel-header-bulk-actions-opened":""} `,children:[s.jsx(l,{}),s.jsx(u,{})]}):s.jsx(l,{}),s.jsx(f,{})]})}function Bd({text:t="Notifications",counter:n,...e}){const{notificationsCount:o}=je();return s.jsx(nn,{text:t,size:"large",...e,children:(n??!0)&&s.jsxs("span",{children:["(",o,")"]})})}const Hd="newest",na=["None","Low","Medium","High","Critical"],$c={key:Hd,descending:!0},Wd=t=>[...t].sort((n,e)=>(e.timestamp||0)-(n.timestamp||0)),zd=t=>[...t].sort((n,e)=>(n.timestamp||0)-(e.timestamp||0)),$d=(t,n)=>{const e=na[0];return[...t].sort((o,r)=>{const i=na.indexOf(o.severity||e),a=na.indexOf(r.severity||e);return(n?-1:1)*(i-a)})},Cg={[Hd]:Wd,oldest:zd,severity:$d},kg={severity:"Priority",newest:"Newest",oldest:"Oldest"};function Ud({...t}){const[n,e]=g.useState([]),{NotificationsList:o,Notification:r}=to(),{notifications:i,setCount:a,notificationsCount:c}=je(),{sortNotificationsBy:l,viewNotificationsBy:u,searchQuery:f}=Et(),p=g.useRef(null),d=Tu(f),h=g.useMemo(()=>((v,y)=>{if(!v)return[];switch(y){case"all":default:return v;case"unread":return v.filter(b=>b.state==="Active"||b.state==="Stale");case"read":return v.filter(b=>b.state==="Acknowledged"||b.state==="Seen");case"snoozed":return v.filter(b=>b.state==="Snoozed")}})(i,u).filter(v=>{var y,b;return v.title.toLowerCase().includes(d.toLowerCase())||((y=v.source)==null?void 0:y.toLowerCase().includes(d.toLowerCase()))||((b=v.body)==null?void 0:b.toLowerCase().includes(d.toLowerCase()))}),[d,i,u]);return g.useEffect(()=>{switch(l){case"newest":e(Wd(h));break;case"oldest":e(zd(h));break;case"severity":e($d(h,!0));break;default:e(h)}a(h.length)},[h,l,a]),g.useEffect(()=>{var m;p.current&&((m=p.current)==null||m.scrollTo({top:0,behavior:"smooth"}))},[d,c,l,u]),s.jsx(So,{ref:p,...t,children:s.jsx(o,{notifications:n,Notification:r})})}function Vd({...t}){const{FooterButtons:n}=to();return s.jsx(po,{...t,children:s.jsx(n,{})})}function Gd({className:t,...n}){const{FooterButtonClearAll:e,FooterButtonClearAllOld:o}=to(),{notifications:r}=je(),[i,a]=g.useState(!1);return g.useEffect(()=>{r.filter(c=>c.state==="Stale"||c.state==="Acknowledged").length>0?a(!0):a(!1)},[r]),s.jsxs(Re,{className:t,align:"right",...n,children:[s.jsx(o,{disabled:!i}),s.jsx(e,{disabled:r.length<=0})]})}function Yd({text:t="Clear All",...n}){const{clearAll:e}=je();return s.jsx(Ge,{text:t,onClick:()=>{e()},...n})}function Zd({text:t="Clear Old",...n}){const{clearAllOld:e}=je();return s.jsx(Ge,{text:t,onClick:()=>{e()},...n})}function ws(t){const n=He(),{onClose:e,settings:o}=je(),{isPanelVisible:r}=Et(),{id:i,onClick:a,updateState:c}=t,l=g.useCallback(async()=>{if(!a)return;if(!n){try{await a({close:!0})}catch(d){console.error(d)}return void e(i)}const f=(o==null?void 0:o.toastStacking)??!1;let p;p=r?(o==null?void 0:o.closeNotificationOnClick)??!0:!f&&null;try{p!==null?await a({close:p}):(await a({close:!1}),await c("Acknowledged"))}catch(d){console.error(d)}},[n,i,r,a,e,c,o==null?void 0:o.closeNotificationOnClick,o==null?void 0:o.toastStacking]),u=g.useCallback(async f=>{const p=f.target;p.closest("button")||p.closest("[role='button']")||p.closest("a")||p.closest(".io-dropdown-menu")||await l()},[l]);return{handleClick:l,handleWrapperClick:u}}function Kd({className:t,notification:n,onClick:e,...o}){const r=q("io-notification-header",t),{HeaderCount:i,HeaderBadge:a,HeaderTitle:c,HeaderTimestamp:l,HeaderButtonSnooze:u,HeaderButtonClose:f}=Ni(),{handleWrapperClick:p}=ws(n);return s.jsxs("div",{className:r,onClick:async d=>{await p(d),e==null||e(d)},...o,children:[s.jsx(a,{notification:n}),s.jsx(i,{notification:n}),s.jsx(c,{notification:n}),s.jsx(l,{notification:n}),s.jsxs(Re,{children:[s.jsx(u,{notification:n}),s.jsx(f,{notification:n})]})]})}function qd({notification:t,...n}){const{settings:e,notificationStacks:o}=je(),{isPanelVisible:r}=Et(),{toastStacking:i,stackBy:a}=e,c=a==="application"?"source":a??"source";let l;if(i){const u=o.find(f=>f.key===t[c]);l=(u==null?void 0:u.items.length)??0}return i&&!r&&l&&l>1?s.jsx(Hl,{...n,children:l<10?l:"9+"}):null}function Jd({className:t,notification:n,...e}){if(!(n!=null&&n.severity)||n.severity==="None")return null;const o=q("io-notification-header-badge",t);return s.jsxs("div",{className:o,...e,children:[s.jsx(et,{variant:((r="None")=>{switch(r.toLowerCase()){case"low":case"medium":case"none":default:return"circle-info";case"high":return"triangle-exclamation";case"critical":return"ban"}})(n.severity),size:"12"}),n.severity]})}function Xd({className:t,state:n,severity:e="None",icon:o,...r}){const i=q("io-notification-header-icon",t),{isPanelVisible:a}=Et();return s.jsxs("div",{className:i,...r,children:[o&&s.jsx("span",{className:"io-notification-header-icon-image",children:s.jsx("img",{src:o,alt:`io-notification-header-icon-${o}`})}),s.jsx("span",{className:`io-notification-header-icon-badge color-${e.toLowerCase()}`,children:a&&n!=="Acknowledged"&&"New"})]})}function Qd({className:t,notification:{appTitle:n},...e}){const o=q("io-notification-header-title",t);return s.jsx("div",{className:o,...e,children:n})}function ef({className:t,notification:{timestamp:n,state:e,snooze:o},...r}){const i=q("io-notification-timestamp",t);return s.jsx("small",o&&e==="Snoozed"?{className:i,...r,children:"Snoozed"}:{className:i,...r,children:rd(n??0)??"Just Now"})}function tf({notification:{id:t,state:n},...e}){var a,c;const{settings:o,snooze:r}=je(),i=g.useCallback(l=>{var u;l.stopPropagation(),r&&r(t,((u=o.snooze)==null?void 0:u.duration)??0)},[t,r,(a=o.snooze)==null?void 0:a.duration]);return r&&n!=="Snoozed"&&((c=o.snooze)!=null&&c.enabled)?s.jsx(Ge,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:i,...e}):null}function nf({notification:{id:t,updateState:n},...e}){const o=He(),{onClose:r}=je(),{isPanelVisible:i}=Et(),a=g.useCallback(c=>{c.stopPropagation(),!o||i?r(t):n("Acknowledged").catch(console.error)},[o,t,r,i,n]);return s.jsx(Ue,{icon:"close",iconSize:"10",size:"24",tabIndex:-1,onClick:a,...e})}function of({className:t,notification:n,...e}){const o=q("io-notification-body",t),{BodyIcon:r,BodyTitle:i,BodyDescription:a}=Ni(),{icon:c,title:l,body:u}=n,{handleClick:f}=ws(n);return s.jsxs("div",{className:o,role:"button",tabIndex:0,onKeyDown:async p=>{(d=>d.key==="Enter"||d.key===" ")(p)&&await f()},onClick:f,...e,children:[s.jsx(r,{icon:c}),s.jsxs("div",{className:"io-notification-body-content",children:[s.jsx(i,{text:l}),s.jsx(a,{text:u})]})]})}function rf({className:t,icon:n,altText:e="notification icon",...o}){if(!n)return null;const r=q("io-notification-body-icon",t);return s.jsx("div",{className:r,...o,children:s.jsx("img",{src:n,alt:e})})}function af({text:t,...n}){return s.jsx(nn,{text:t,...n})}function sf({className:t,text:n,...e}){const o=q("io-notification-body-description",t);return s.jsx("p",{className:o,...e,children:n})}function cf({className:t,notification:n}){const e=q("io-notification-footer",t),{FooterButton:o}=Ni(),{handleWrapperClick:r}=ws(n),i=g.useMemo(()=>function(c){const l=[],u={};if(!c)return;c.forEach(p=>{var v;const{displayId:d,displayPath:h}=p,m={...p,children:[]};if(h&&h.length>0){let y;h.forEach((b,S)=>{var w;S===0?y=u[b]:y&&(y=(w=y.children)==null?void 0:w.find(x=>x.displayId===b))}),y&&((v=y.children)==null||v.push(m))}else d?(l.push(m),u[d]=m):l.push(m);d&&(u[d]=m)});const f=p=>{p.forEach(d=>{var h;((h=d.children)==null?void 0:h.length)===0?delete d.children:d.children&&f(d.children)})};return f(l),l}(n.actions),[n.actions]),a=(c,l)=>c.children?s.jsx(Jt,{text:c.title,children:c.children.map(a)},`${c.title}-${l}`):((u,f)=>s.jsx(Jt.Item,{children:s.jsx(o,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:u})},`${u.title}-${f}`))(c,l);return s.jsx("div",{className:e,onClick:r,children:s.jsx(Re,{align:"right",children:i==null?void 0:i.map((c,l)=>c.children?s.jsxs(Re,{variant:"append",children:[s.jsx(o,{notificationAction:c,variant:l===0?"primary":"default"}),s.jsx(Jt,{variant:l===0?"primary":"default",icon:"ellipsis",children:c.children.map(a)})]},`${c.title}-${l}`):s.jsx(o,{notificationAction:c,variant:l===0?"primary":"link"},`${c.title}-${l}`))})})}function lf({notificationAction:t,...n}){const e=g.useCallback(o=>{o.stopPropagation(),t.onClick({close:!0})},[t]);return s.jsx(Ge,{text:t.title,onClick:e,...n})}const uf={Header:Kd,HeaderCount:qd,HeaderBadge:Jd,HeaderIcon:Xd,HeaderTitle:Qd,HeaderTimestamp:ef,HeaderButtonSnooze:tf,HeaderButtonClose:nf,Body:of,BodyIcon:rf,BodyTitle:af,BodyDescription:sf,Footer:cf,FooterButton:lf},df=g.createContext(uf),ff=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...uf,...n}),[n]);return s.jsx(df.Provider,{value:e,children:t})});function Ni(t){return{...g.useContext(df),...t}}function Sg({className:t,notification:n,...e}){const{Header:o,Body:r,Footer:i}=Ni(),{severity:a}=n,c=q("io-notification",`severity-${(a==null?void 0:a.toLowerCase())??"none"}`,n.state!=="Acknowledged"&&"state-new",t);return s.jsxs("div",{className:c,...e,children:[s.jsx(o,{notification:n}),s.jsx(r,{notification:n}),s.jsx(i,{notification:n})]})}function Ii({components:t,notification:n,...e}){return s.jsx(ff,{components:t,children:s.jsx(Sg,{notification:n,...e})})}function pf({className:t,notifications:n,...e}){const[o,r]=g.useState(!1),i=n.length>=3?"large":"normal",a=n.length===2?"small":i,c=n[0].severity,l=q("io-notification-stack",o&&"io-notification-stack-open",a!=="normal"&&[`io-notification-stack-${a}`],c&&c!=="None"&&[`io-notification-stack-${c.toLowerCase()}`],t),u=g.useCallback(()=>{r(!0)},[]),f=g.useCallback(p=>{p.stopPropagation(),n.forEach(d=>{d.close()})},[n]);return s.jsxs("div",{className:l,onClick:u,...e,children:[o&&a!=="normal"&&s.jsx("div",{className:"io-notification-stack-btn",children:s.jsx(Ge,{icon:"close",onClick:p=>f(p),children:s.jsx("span",{className:"io-btn-text",children:"Clear All"})})}),n.map(p=>s.jsx(Ii,{notification:p},p.id))]})}function Eg({...t}){const{notificationStacks:n}=je();return s.jsx(s.Fragment,{children:n.map(e=>s.jsx(pf,{notifications:e.items,...t},e.key))})}ff.displayName="ComponentsStoreProvider";const jg=({notification:t,Notification:n,...e})=>{var h;const{configuration:o,isBulkActionsSupported:r,selectedNotifications:i,selectNotification:a}=je(),{isPanelVisible:c,isBulkActionsVisible:l}=Et(),u=((h=o.sourceFilter)==null?void 0:h.muted)??[],f=t.source&&u.includes(t.source)||u.includes("*");if(!c&&f)return null;const p=c&&r&&l,d=i.includes(t.id);return p?s.jsxs("div",{className:q("io-notification-list-bulk-action-item",{selected:d}),children:[s.jsx(Ci,{checked:d,onChange:m=>a(t.id,m.target.checked)}),s.jsx(n,{notification:t,...e})]}):s.jsx(n,{notification:t,...e})};function xs({className:t,Notification:n,notifications:e=[],noNotificationText:o="No notifications to display",...r}){const i=q("io-notification-list",t),{settings:a}=je(),{isPanelVisible:c}=Et(),{toastStacking:l}=a,u=l&&!c,f=e.length>0;return s.jsxs("div",{className:i,...r,children:[u&&s.jsx(Eg,{}),!u&&(f?e.map(p=>s.jsx(jg,{notification:p,Notification:n,...r},p.id)):s.jsx("div",{className:"flex jc-center mt-8",children:o}))]})}const hf={Header:Fd,HeaderCaptionTitle:Bd,HeaderCaptionCount:function({variant:t="primary",...n}){const{notificationsCount:e=0}=je();return e===0?null:s.jsx(Hl,{variant:t,...n,children:e>99?"99+":e})},HeaderCaptionButtonSettings:function({icon:t="cog",size:n="32",variant:e="circle",...o}){return He()?s.jsx(Ue,{icon:t,size:n,variant:e,...o}):null},HeaderCaptionButtonClose:function({icon:t="close",size:n="32",variant:e="circle",onClick:o,...r}){const{hidePanel:i}=je(),a=He();return s.jsx(Ue,{icon:t,size:n,variant:e,onClick:c=>{o?o(c):a&&i()},...r})},HeaderActions:function({className:t,...n}){const e=q("io-panel-header-actions",t),{HeaderActionSort:o,HeaderActionView:r,HeaderActionClear:i,HeaderActionEdit:a}=to();return s.jsxs("div",{className:e,...n,children:[s.jsxs(Re,{children:[s.jsx(o,{}),s.jsx(r,{})]}),s.jsxs(Re,{children:[s.jsx(i,{}),s.jsx(a,{})]})]})},HeaderActionSort:function({text:t="Sort by",...n}){const{sortNotificationsBy:e,setSortBy:o}=Et(),{onNotificationsSort:r}=(()=>{const{notifications:i}=je(),[a,c]=g.useState($c),{key:l,descending:u}=a,f=g.useMemo(()=>Cg[l](i,u),[i,l,u]);return{onNotificationsSort:g.useCallback(d=>{c(h=>({key:d,descending:h.key!==d?$c.descending:!h.descending}))},[]),sortedNotifications:f}})();return s.jsxs(pe,{variant:"light",...n,children:[s.jsxs(pe.Button,{variant:"link",children:[t," ",s.jsx("strong",{children:kg[e].toLowerCase()})]}),s.jsx(pe.Content,{children:s.jsx(pe.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Priority"].map(i=>{const a=i==="Priority"?"severity":i.toLowerCase();return s.jsx(pe.Item,{isSelected:e===a,onClick:()=>{o(a),r(a)},children:i},i)})})})]})},HeaderActionView:function({text:t="View",...n}){var a;const{settings:e}=je(),{viewNotificationsBy:o,setViewBy:r}=Et(),i=(a=e.snooze)!=null&&a.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return s.jsxs(pe,{variant:"light",...n,children:[s.jsxs(pe.Button,{variant:"link",children:[t," ",s.jsx("strong",{children:o})]}),s.jsx(pe.Content,{children:s.jsx(pe.List,{variant:"single",checkIcon:"check",children:i.map(c=>s.jsx(pe.Item,{isSelected:o===c.toLowerCase(),onClick:()=>r(c.toLowerCase()),children:c},c))})})]})},HeaderActionClear:function({text:t="Clear All",...n}){const{clearAll:e,notificationsCount:o}=je();return s.jsx(Ge,{variant:"link",text:t,onClick:e,disabled:o===0,...n})},HeaderActionEdit:function({tooltip:t="Bulk Edit",...n}){const{isBulkActionsSupported:e,notificationsCount:o}=je(),{showBulkActions:r}=Et();return e?s.jsx(Ue,{icon:"pen-to-square",title:t,size:"32",onClick:r,disabled:o===0,...n}):null},HeaderBulkActions:function({className:t,...n}){const e=q("io-panel-header-bulk-actions",t),{HeaderBulkActionSelect:o,HeaderBulkActionSelectDropdown:r,HeaderBulkActionMarkAsRead:i,HeaderBulkActionMarkAsUnread:a,HeaderBulkActionSnooze:c,HeaderBulkActionClear:l,HeaderBulkActionClose:u}=to(),{isBulkActionsSupported:f}=je();return f?s.jsx("div",{className:e,...n,children:s.jsxs(Re,{children:[s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{}),s.jsx(a,{}),s.jsx(c,{}),s.jsx(l,{}),s.jsx(u,{})]})}):null},HeaderBulkActionSelect:function({...t}){const{isBulkActionsSupported:n,selectedNotifications:e,selectAllNotifications:o,notificationsCount:r}=je();return n?s.jsx(Ci,{checked:r===e.length&&r>0,onChange:i=>o("all",i.target.checked),disabled:r===0,...t}):null},HeaderBulkActionSelectDropdown:function({...t}){const{isBulkActionsSupported:n,selectAllNotifications:e,notificationsCount:o}=je();return n?s.jsxs(pe,{variant:"light",...t,children:[s.jsx(pe.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:o===0}),s.jsx($l,{children:s.jsxs(pe.List,{variant:"single",checkIcon:"check",children:[s.jsx(pe.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(r=>s.jsx(pe.Item,{onClick:()=>e(r.toLowerCase(),!0),children:r},r))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:t="envelope-open",size:n="32",variant:e="circle",tooltip:o="Mark as read",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:c,notificationsCount:l}=je(),u=g.useCallback(()=>{c(a,"Seen")},[a,c]);return i?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:t="envelope",size:n="32",variant:e="circle",tooltip:o="Mark as unread",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:c,notificationsCount:l}=je(),u=g.useCallback(()=>{c(a,"Active")},[a,c]);return i?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionSnooze:function({icon:t="snooze",size:n="32",variant:e="circle",tooltip:o="Snooze",...r}){var p,d;const{isBulkActionsSupported:i,selectedNotifications:a,snoozeMany:c,settings:l,notificationsCount:u}=je(),f=g.useCallback(()=>{var h;c(a,((h=l.snooze)==null?void 0:h.duration)??0)},[a,c,(p=l.snooze)==null?void 0:p.duration]);return i&&((d=l.snooze)!=null&&d.enabled)?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:f,disabled:u===0,...r}):null},HeaderBulkActionClear:function({icon:t="trash",size:n="32",variant:e="circle",tooltip:o="Clear",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,clearMany:c,notificationsCount:l}=je(),u=g.useCallback(()=>{c(a)},[a,c]);return i?s.jsx(Ue,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionClose:function({text:t="Done",variant:n="primary",...e}){const{isBulkActionsSupported:o,notificationsCount:r}=je(),{hideBulkActions:i}=Et();return o?s.jsx(Ge,{variant:n,text:t,onClick:i,disabled:r===0,...e}):null},HeaderSearch:function({className:t,icon:n="search",placeholder:e="Search",...o}){const r=q("io-panel-header-search",t),{notificationsCount:i}=je(),{searchQuery:a,setSearch:c}=Et(),l=g.useRef(null);return s.jsxs("div",{className:r,children:[s.jsx(Qn,{ref:l,value:a,iconPrepend:n,placeholder:e,onChange:u=>c(u.target.value),...o}),a.length>0&&s.jsx("p",{className:"io-panel-header-search-count",children:`${i} results`})]})},Body:Ud,Footer:Vd,FooterButtons:Gd,FooterButtonClearAll:Yd,FooterButtonClearAllOld:Zd,Notification:Ii,NotificationsList:xs},mf=g.createContext(hf),gf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...hf,...n}),[n]);return s.jsx(mf.Provider,{value:e,children:t})});function to(t){return{...g.useContext(mf),...t}}function vf(){var r,i;const t=g.useContext(De.IOConnectContext),{settings:n}=je(),e=He(),o=g.useCallback(async()=>{var l;const a=t.windows.my();if(!t||!a||!e)return;const c=a.placementSettings;await a.place({...c,horizontalAlignment:(l=n.placement)==null?void 0:l.panel})},[t,e,(r=n.placement)==null?void 0:r.panel]);g.useEffect(()=>{var a;t&&((a=n.placement)!=null&&a.panel)&&e&&o().catch(console.error)},[t,e,o,(i=n.placement)==null?void 0:i.panel])}function Og({className:t,onClose:n,title:e="Notifications",...o}){var d,h;const{Header:r,Body:i}=to(),{settings:a}=je(),{isPanelVisible:c}=Et(),[l,u]=g.useState(!1),f=He(),p=q("io-notifications-panel",((d=a.placement)==null?void 0:d.panel)==="left"&&"io-panel-left",((h=a.placement)==null?void 0:h.panel)==="right"&&"io-panel-right",t);return vf(),g.useEffect(()=>{c||u(!1)},[c]),s.jsxs(s.Fragment,{children:[s.jsxs(Ze,{className:p,...o,children:[s.jsx(r,{title:e,onClose:n,onOpenSettings:()=>u(!0)}),s.jsx(i,{})]}),f&&c&&s.jsx(xg,{isOpen:l,onClose:()=>u(!1)})]})}gf.displayName="ComponentsStoreProvider";const yf={Body:function({className:t,notifications:n,maxToasts:e=1,...o}){const r=q("io-toasts-body",t),{NotificationsList:i,Notification:a}=xf(),[c,l]=g.useState([]);return g.useEffect(()=>{const u=e<0?n.length:e,f=n.filter(p=>p.state==="Active").slice(0,u);for(const p of f)p.onShow();l(f)},[n,e]),s.jsx("div",{className:r,...o,children:s.jsx(i,{Notification:a,notifications:c,noNotificationText:""})})},Notification:Ii,NotificationsList:xs},bf=g.createContext(yf),wf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...yf,...n}),[n]);return s.jsx(bf.Provider,{value:e,children:t})});function xf(t){return{...g.useContext(bf),...t}}function Cf(){var o,r;const t=g.useContext(De.IOConnectContext),{settings:n}=je(),e=g.useCallback(async()=>{var c,l;const i=t.windows.my();if(!t||!i)return;const a=i.placementSettings;await i.place({...a,horizontalAlignment:((c=n.placement)==null?void 0:c.toasts)==="top-right"||((l=n.placement)==null?void 0:l.toasts)==="bottom-right"?"right":"left"})},[t,(o=n.placement)==null?void 0:o.toasts]);g.useEffect(()=>{var i;t&&((i=n.placement)!=null&&i.toasts)&&e().catch(console.error)},[t,e,(r=n.placement)==null?void 0:r.toasts])}function Ng({className:t,maxToasts:n=10,...e}){var u,f,p,d,h,m,v,y;const{Header:o,Body:r,Footer:i}=xf(),{notifications:a,settings:c}=je(),l=q("io-toasts",(((u=c.placement)==null?void 0:u.toasts)==="top-left"||((f=c.placement)==null?void 0:f.toasts)==="top-right")&&"io-toasts-top",(((p=c.placement)==null?void 0:p.toasts)==="top-right"||((d=c.placement)==null?void 0:d.toasts)==="bottom-right")&&"io-toasts-right",(((h=c.placement)==null?void 0:h.toasts)==="bottom-left"||((m=c.placement)==null?void 0:m.toasts)==="bottom-right")&&"io-toasts-bottom",(((v=c.placement)==null?void 0:v.toasts)==="top-left"||((y=c.placement)==null?void 0:y.toasts)==="bottom-left")&&"io-toasts-left",t);return Cf(),s.jsxs("div",{className:l,...e,children:[o&&s.jsx(o,{}),s.jsx(r,{notifications:a,maxToasts:n}),i&&s.jsx(i,{})]})}wf.displayName="ComponentsStoreProvider";var kf=Object.freeze({__proto__:null,Notification:Ii,NotificationBody:of,NotificationBodyDescription:sf,NotificationBodyIcon:rf,NotificationBodyTitle:af,NotificationFooter:cf,NotificationFooterButton:lf,NotificationHeader:Kd,NotificationHeaderBadge:Jd,NotificationHeaderButtonClose:nf,NotificationHeaderButtonSnooze:tf,NotificationHeaderCount:qd,NotificationHeaderIcon:Xd,NotificationHeaderTimestamp:ef,NotificationHeaderTitle:Qd,NotificationStack:pf,NotificationsList:xs,NotificationsPanelProvider:({children:t})=>{const{searchQuery:n,setSearch:e,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:c,isBulkActionsVisible:l,showBulkActions:u,hideBulkActions:f}=function(){const d=g.useContext(De.IOConnectContext),[h,m]=g.useState(!1),[v,y]=g.useState("newest"),[b,S]=g.useState("all"),[w,x]=g.useState(""),[E,O]=g.useState(!1),M=He(),{isBulkActionsSupported:B}=je();return g.useEffect(()=>{const $=tt.onPanelVisibilityChanged(Z=>m(Z));return()=>{$()}},[]),g.useEffect(()=>{M!==null&&M&&(async()=>{const $=await d.notifications.panel.isVisible();m($)})()},[d.notifications.panel,M]),g.useEffect(()=>{h||(O(!1),S("all"))},[h]),{isPanelVisible:h,sortNotificationsBy:v,setSortBy:$=>{y($)},viewNotificationsBy:b,setViewBy:$=>{S($)},searchQuery:w,setSearch:$=>{x($)},isBulkActionsVisible:E,showBulkActions:()=>{B&&O(!0)},hideBulkActions:()=>{B&&O(!1)}}}(),p=g.useMemo(()=>({searchQuery:n,setSearch:e,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:c,isBulkActionsVisible:l,showBulkActions:u,hideBulkActions:f}),[n,e,o,r,i,a,c,l,u,f]);return s.jsx(Rd.Provider,{value:p,children:t})},NotificationsProvider:({children:t})=>{const{notifications:n,notificationStacks:e,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:c,allowedApplications:l,clearAll:u,clearAllOld:f,close:p,hidePanel:d,showPanel:h,saveSetting:m,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:b,selectedNotifications:S,selectNotification:w,selectAllNotifications:x,clearMany:E,snooze:O,snoozeMany:M,setState:B,setStates:$,setCount:Z}=yg(),_=g.useMemo(()=>({notifications:n,notificationStacks:e,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:c,allowedApplications:l,clearAll:u,clearAllOld:f,onClose:p,hidePanel:d,showPanel:h,saveSetting:m,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:b,selectedNotifications:S,selectNotification:w,selectAllNotifications:x,clearMany:E,snooze:O,snoozeMany:M,setState:B,setStates:$,setCount:Z}),[n,e,o,r,i,a,c,l,u,f,p,d,h,m,v,y,b,S,w,x,E,O,M,B,$,Z]);return s.jsx(pd.Provider,{value:_,children:t})},Panel:function({components:t,settings:n,...e}){return s.jsx(bs,{components:n,children:s.jsx(gf,{components:t,children:s.jsx(Og,{...e})})})},PanelBody:Ud,PanelFooter:Vd,PanelFooterButtonClearAll:Yd,PanelFooterButtonClearAllOld:Zd,PanelFooterButtons:Gd,PanelHeader:Fd,PanelHeaderCaptionTitle:Bd,SettingsAllowNotificationToasts:md,SettingsAllowNotifications:hd,SettingsCloseNotificationOnClick:vd,SettingsGeneral:ud,SettingsHideToastsAfter:bd,SettingsPanel:Ld,SettingsPanelAutoHide:yd,SettingsPlacement:kd,SettingsPlacementPanel:Ed,SettingsPlacementToasts:jd,SettingsShowNotificationBadge:gd,SettingsSnooze:Od,SettingsSnoozeDuration:Nd,SettingsStacking:wd,SettingsSubscribeAll:Ad,SettingsSubscribeApp:Pd,SettingsSubscribeMuteAll:Td,SettingsSubscribeMuteApp:Dd,SettingsSubscriptions:Id,SettingsToastStackBy:Cd,SettingsToastStacking:xd,Toasts:function({components:t,...n}){return s.jsx(wf,{components:t,children:s.jsx(Ng,{...n})})},useAddRemoveApps:ys,useHidePanelOnFocusLost:function(t=!0){const n=g.useContext(De.IOConnectContext),e=He();return g.useEffect(()=>{var r;if(!n||!t||e===null||!e)return;const o=(r=n.windows.my())==null?void 0:r.onFocusChanged(i=>{i.isFocused||n.notifications.panel.hide().catch(a=>{console.error("Error hiding panel:",a)})});return()=>o==null?void 0:o()},[n,e,t]),n},useHidePanelOnKeyUp:function(t="Escape"){const{hidePanel:n}=je();pm(t,n)},useNotificationStacking:dd,useNotificationsContext:je,useNotificationsPanelContext:Et,usePanelWindowPlacement:vf,useSelectNotifications:fd,useShowHidePanelWindow:function(t=!0){const n=g.useContext(De.IOConnectContext),e=n==null?void 0:n.windows.my(),o=He(),{isPanelVisible:r}=Et();return g.useEffect(()=>{n&&e&&o&&(r?e.show().then(()=>{t&&e.focus().catch(i=>{console.error("Error focusing window:",i)})}).catch(i=>console.error("Error showing window:",i)):e.hide().catch(i=>console.error("Error hiding window:",i)))},[n,e,o,r,t]),{myWindow:e}},useToastsWindowPlacement:Cf});const Ig=t=>{const{General:n,Layouts:e,Downloads:o,System:r}=mr();return s.jsxs(So,{...t,children:[s.jsx(n,{}),s.jsx(e,{}),s.jsx(o,{}),s.jsx(r,{})]})},Ag=({className:t,title:n="General",...e})=>{const{Theme:o,PinnedPosition:r,MinimizeToTray:i,ShowTutorialOnStartup:a}=mr();return s.jsxs(Ke,{className:q("io-block io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{}),s.jsx(a,{})]})},Uc=(t="dark")=>{switch(t){case"dark":return"Dark";case"light":return"Light";default:return t}},Cs=({className:t,title:n="Theme",...e})=>{const{currentTheme:o,selectTheme:r}=(()=>{const a=g.useContext(De.IOConnectContext),[c,l]=g.useState(null),u=g.useCallback(f=>{var p;return(p=a==null?void 0:a.themes)==null?void 0:p.select(f)},[a]);return g.useEffect(()=>{var d,h;if(!a)return;let f=!1;const p=m=>{f||l(m)};return(d=a.themes)==null||d.onChanged(p),(h=a.themes)==null||h.getCurrent().then(p).catch(console.warn),()=>{f=!0}},[a]),{currentTheme:c,selectTheme:u}})(),i=(()=>{const a=g.useContext(De.IOConnectContext),[c,l]=g.useState([]);return g.useEffect(()=>{var u;a&&((u=a.themes)==null||u.list().then(l).catch(console.warn))},[a]),c})();return s.jsxs("div",{className:q("flex jc-between ai-center",t),...e,children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsxs(pe,{variant:"light",children:[s.jsx(pe.Button,{text:Uc(o==null?void 0:o.name)}),s.jsx(pe.Content,{children:s.jsx(pe.List,{children:i.map(({name:a})=>s.jsx(pe.Item,{onClick:()=>r(a),children:Uc(a)},a))})})]})]})},Pg=({prefKey:t,options:n,disabled:e,...o})=>{const{isLoading:r,value:i="Select option",update:a}=Ht({prefKey:t});return s.jsxs(pe,{variant:"light",disabled:r||e,...o,children:[s.jsx(pe.Button,{children:i}),s.jsx(pe.Content,{children:s.jsx(pe.List,{children:n.map(c=>s.jsx(pe.Item,{onClick:()=>(async l=>{if(l!==i)try{await a(l)}catch(u){console.error("Failed to update platform preference:",u)}})(c),children:c},c))})})]})},Tg=({className:t,label:n="Pinned position",...e})=>s.jsx(Ke,{className:q("io-block-list-gap",t),...e,children:s.jsxs("div",{className:"flex jc-between ai-center",children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsx(Pg,{className:t,prefKey:Du,options:["Left","Right"],...e})]})}),hn=({prefKey:t,...n})=>{const{isLoading:e,value:o=!1,update:r}=Ht({prefKey:t});return s.jsx(ft,{checked:o,disabled:e,onChange:i=>r(i.target.checked),...n})},Dg=({align:t="right",label:n="Allow docking",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Mu,...e}),Mg=({align:t="right",label:n="Minimize to tray",...e})=>s.jsx(hn,{align:t,label:n,prefKey:_u,...e}),_g=({align:t="right",label:n="Auto-close on starting apps and workspaces",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Lu,disabled:!0,...e}),Lg=({align:t="right",label:n="Show tutorial on startup",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Ru,...e}),Rg=({className:t,title:n="Layouts",...e})=>{const{LayoutsSaveCurrentOnExit:o,LayoutsShowDeletePrompt:r,LayoutsShowUnsavedChangesPrompt:i}=mr();return s.jsxs(Ke,{className:q("io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(i,{}),s.jsx(r,{})]})},Fg=({align:t="right",label:n="Restore last saved on startup",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Fu,...e}),Bg=({align:t="right",label:n="Save current on exit",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Bu,...e}),ks=({align:t="right",label:n="Show prompt for unsaved changes",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Hu,...e}),Ss=({align:t="right",label:n="Show prompt for deleting",...e})=>s.jsx(hn,{align:t,label:n,prefKey:Wu,...e}),Hg=({className:t,title:n="Downloads",...e})=>{const{DownloadsLocation:o}=mr();return s.jsx(Ke,{className:q("io-block-list-gap",t),title:n,...e,children:s.jsx(o,{})})},Wg=({align:t="right",label:n="Ask where to save each file before downloading",...e})=>s.jsx(hn,{align:t,label:n,prefKey:zu,...e}),zg=({className:t,label:n="Location",...e})=>{const{configuration:{downloadFolder:o},setDownloadLocationWithDialog:r,isDownloadLocationDialogVisible:i,downloadLocationList:a}=Pn();return s.jsxs(Ke,{className:q("io-block-list-gap",t),...e,children:[s.jsxs("div",{className:"flex jc-between ai-center",children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsx(Ge,{text:"Change",onClick:r,disabled:i})]}),s.jsx("p",{children:o??(a==null?void 0:a[0])??"Not set"})]})},$g=({className:t,title:n="System",...e})=>{const{SystemRestartSection:o,SystemShutdownSection:r}=mr();return s.jsxs(Ke,{className:q("io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(r,{})]})};var oa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],bo={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return typeof console<"u"&&console.warn(t)},getWeek:function(t){var n=new Date(t.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var e=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},sr={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var n=t%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Tt=function(t,n){return n===void 0&&(n=2),("000"+t).slice(-1*n)},Ut=function(t){return t===!0?1:0};function Vc(t,n){var e;return function(){var o=this,r=arguments;clearTimeout(e),e=setTimeout(function(){return t.apply(o,r)},n)}}var ra=function(t){return t instanceof Array?t:[t]};function Ot(t,n,e){if(e===!0)return t.classList.add(n);t.classList.remove(n)}function Be(t,n,e){var o=window.document.createElement(t);return n=n||"",e=e||"",o.className=n,e!==void 0&&(o.textContent=e),o}function Ar(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Sf(t,n){return n(t)?t:t.parentNode?Sf(t.parentNode,n):void 0}function Pr(t,n){var e=Be("div","numInputWrapper"),o=Be("input","numInput "+t),r=Be("span","arrowUp"),i=Be("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?o.type="number":(o.type="text",o.pattern="\\d*"),n!==void 0)for(var a in n)o.setAttribute(a,n[a]);return e.appendChild(o),e.appendChild(r),e.appendChild(i),e}function Lt(t){try{return typeof t.composedPath=="function"?t.composedPath()[0]:t.target}catch{return t.target}}var ia=function(){},ri=function(t,n,e){return e.months[n?"shorthand":"longhand"][t]},Ug={D:ia,F:function(t,n,e){t.setMonth(e.months.longhand.indexOf(n))},G:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},H:function(t,n){t.setHours(parseFloat(n))},J:function(t,n){t.setDate(parseFloat(n))},K:function(t,n,e){t.setHours(t.getHours()%12+12*Ut(new RegExp(e.amPM[1],"i").test(n)))},M:function(t,n,e){t.setMonth(e.months.shorthand.indexOf(n))},S:function(t,n){t.setSeconds(parseFloat(n))},U:function(t,n){return new Date(1e3*parseFloat(n))},W:function(t,n,e){var o=parseInt(n),r=new Date(t.getFullYear(),0,2+7*(o-1),0,0,0,0);return r.setDate(r.getDate()-r.getDay()+e.firstDayOfWeek),r},Y:function(t,n){t.setFullYear(parseFloat(n))},Z:function(t,n){return new Date(n)},d:function(t,n){t.setDate(parseFloat(n))},h:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},i:function(t,n){t.setMinutes(parseFloat(n))},j:function(t,n){t.setDate(parseFloat(n))},l:ia,m:function(t,n){t.setMonth(parseFloat(n)-1)},n:function(t,n){t.setMonth(parseFloat(n)-1)},s:function(t,n){t.setSeconds(parseFloat(n))},u:function(t,n){return new Date(parseFloat(n))},w:ia,y:function(t,n){t.setFullYear(2e3+parseFloat(n))}},zn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Qo={Z:function(t){return t.toISOString()},D:function(t,n,e){return n.weekdays.shorthand[Qo.w(t,n,e)]},F:function(t,n,e){return ri(Qo.n(t,n,e)-1,!1,n)},G:function(t,n,e){return Tt(Qo.h(t,n,e))},H:function(t){return Tt(t.getHours())},J:function(t,n){return n.ordinal!==void 0?t.getDate()+n.ordinal(t.getDate()):t.getDate()},K:function(t,n){return n.amPM[Ut(t.getHours()>11)]},M:function(t,n){return ri(t.getMonth(),!0,n)},S:function(t){return Tt(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,n,e){return e.getWeek(t)},Y:function(t){return Tt(t.getFullYear(),4)},d:function(t){return Tt(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return Tt(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,n){return n.weekdays.longhand[t.getDay()]},m:function(t){return Tt(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},Ef=function(t){var n=t.config,e=n===void 0?bo:n,o=t.l10n,r=o===void 0?sr:o,i=t.isMobile,a=i!==void 0&&i;return function(c,l,u){var f=u||r;return e.formatDate===void 0||a?l.split("").map(function(p,d,h){return Qo[p]&&h[d-1]!=="\\"?Qo[p](c,f,e):p!=="\\"?p:""}).join(""):e.formatDate(c,l,f)}},$a=function(t){var n=t.config,e=n===void 0?bo:n,o=t.l10n,r=o===void 0?sr:o;return function(i,a,c,l){if(i===0||i){var u,f=l||r,p=i;if(i instanceof Date)u=new Date(i.getTime());else if(typeof i!="string"&&i.toFixed!==void 0)u=new Date(i);else if(typeof i=="string"){var d=a||(e||bo).dateFormat,h=String(i).trim();if(h==="today")u=new Date,c=!0;else if(e&&e.parseDate)u=e.parseDate(i,d);else if(/Z$/.test(h)||/GMT$/.test(h))u=new Date(i);else{for(var m=void 0,v=[],y=0,b=0,S="";y<d.length;y++){var w=d[y],x=w==="\\",E=d[y-1]==="\\"||x;if(zn[w]&&!E){S+=zn[w];var O=new RegExp(S).exec(i);O&&(m=!0)&&v[w!=="Y"?"push":"unshift"]({fn:Ug[w],val:O[++b]})}else x||(S+=".")}u=e&&e.noCalendar?new Date(new Date().setHours(0,0,0,0)):new Date(new Date().getFullYear(),0,1,0,0,0,0),v.forEach(function(M){var B=M.fn,$=M.val;return u=B(u,$,f)||u}),u=m?u:void 0}}if(u instanceof Date&&!isNaN(u.getTime()))return c===!0&&u.setHours(0,0,0,0),u;e.errorHandler(new Error("Invalid date provided: "+p))}}};function Rt(t,n,e){return e===void 0&&(e=!0),e!==!1?new Date(t.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):t.getTime()-n.getTime()}var Vg=function(t,n,e){return t>Math.min(n,e)&&t<Math.max(n,e)},aa=function(t,n,e){return 3600*t+60*n+e},Gg=function(t){var n=Math.floor(t/3600),e=(t-3600*n)/60;return[n,e,t-3600*n-60*e]},Yg={DAY:864e5};function sa(t){var n=t.defaultHour,e=t.defaultMinute,o=t.defaultSeconds;if(t.minDate!==void 0){var r=t.minDate.getHours(),i=t.minDate.getMinutes(),a=t.minDate.getSeconds();n<r&&(n=r),n===r&&e<i&&(e=i),n===r&&e===i&&o<a&&(o=t.minDate.getSeconds())}if(t.maxDate!==void 0){var c=t.maxDate.getHours(),l=t.maxDate.getMinutes();(n=Math.min(n,c))===c&&(e=Math.min(l,e)),n===c&&e===l&&(o=t.maxDate.getSeconds())}return{hours:n,minutes:e,seconds:o}}typeof Object.assign!="function"&&(Object.assign=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];if(!t)throw TypeError("Cannot convert undefined or null to object");for(var o=function(a){a&&Object.keys(a).forEach(function(c){return t[c]=a[c]})},r=0,i=n;r<i.length;r++)o(i[r]);return t});var Ct=function(){return Ct=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ct.apply(this,arguments)},Gc=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var o=Array(t),r=0;for(n=0;n<e;n++)for(var i=arguments[n],a=0,c=i.length;a<c;a++,r++)o[r]=i[a];return o},Zg=300;function Kg(t,n){var e={config:Ct(Ct({},bo),nt.defaultConfig),l10n:sr};function o(){var k;return((k=e.calendarContainer)===null||k===void 0?void 0:k.getRootNode()).activeElement||document.activeElement}function r(k){return k.bind(e)}function i(){var k=e.config;k.weekNumbers===!1&&k.showMonths===1||k.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var C=(e.days.offsetWidth+1)*k.showMonths;e.daysContainer.style.width=C+"px",e.calendarContainer.style.width=C+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function a(k){if(e.selectedDates.length===0){var C=e.config.minDate===void 0||Rt(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),j=sa(e.config);C.setHours(j.hours,j.minutes,j.seconds,C.getMilliseconds()),e.selectedDates=[C],e.latestSelectedDateObj=C}k!==void 0&&k.type!=="blur"&&function(F){F.preventDefault();var te=F.type==="keydown",K=Lt(F),z=K;e.amPM!==void 0&&K===e.amPM&&(e.amPM.textContent=e.l10n.amPM[Ut(e.amPM.textContent===e.l10n.amPM[0])]);var H=parseFloat(z.getAttribute("min")),Y=parseFloat(z.getAttribute("max")),ce=parseFloat(z.getAttribute("step")),ie=parseInt(z.value,10),oe=F.delta||(te?F.which===38?1:-1:0),Q=ie+ce*oe;if(z.value!==void 0&&z.value.length===2){var ve=z===e.hourElement,Ae=z===e.minuteElement;Q<H?(Q=Y+Q+Ut(!ve)+(Ut(ve)&&Ut(!e.amPM)),Ae&&v(void 0,-1,e.hourElement)):Q>Y&&(Q=z===e.hourElement?Q-Y-Ut(!e.amPM):H,Ae&&v(void 0,1,e.hourElement)),e.amPM&&ve&&(ce===1?Q+ie===23:Math.abs(Q-ie)>ce)&&(e.amPM.textContent=e.l10n.amPM[Ut(e.amPM.textContent===e.l10n.amPM[0])]),z.value=Tt(Q)}}(k);var N=e._input.value;c(),Pe(),e._input.value!==N&&e._debouncedChange()}function c(){if(e.hourElement!==void 0&&e.minuteElement!==void 0){var k,C,j=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,N=(parseInt(e.minuteElement.value,10)||0)%60,F=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(k=j,C=e.amPM.textContent,j=k%12+12*Ut(C===e.l10n.amPM[1]));var te=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Rt(e.latestSelectedDateObj,e.config.minDate,!0)===0,K=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Rt(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var z=aa(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),H=aa(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),Y=aa(j,N,F);if(Y>H&&Y<z){var ce=Gg(z);j=ce[0],N=ce[1],F=ce[2]}}else{if(K){var ie=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;(j=Math.min(j,ie.getHours()))===ie.getHours()&&(N=Math.min(N,ie.getMinutes())),N===ie.getMinutes()&&(F=Math.min(F,ie.getSeconds()))}if(te){var oe=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;(j=Math.max(j,oe.getHours()))===oe.getHours()&&N<oe.getMinutes()&&(N=oe.getMinutes()),N===oe.getMinutes()&&(F=Math.max(F,oe.getSeconds()))}}u(j,N,F)}}function l(k){var C=k||e.latestSelectedDateObj;C&&C instanceof Date&&u(C.getHours(),C.getMinutes(),C.getSeconds())}function u(k,C,j){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(k%24,C,j||0,0),e.hourElement&&e.minuteElement&&!e.isMobile&&(e.hourElement.value=Tt(e.config.time_24hr?k:(12+k)%12+12*Ut(k%12==0)),e.minuteElement.value=Tt(C),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[Ut(k>=12)]),e.secondElement!==void 0&&(e.secondElement.value=Tt(j)))}function f(k){var C=Lt(k),j=parseInt(C.value)+(k.delta||0);(j/1e3>1||k.key==="Enter"&&!/[^\d]/.test(j.toString()))&&ye(j)}function p(k,C,j,N){return C instanceof Array?C.forEach(function(F){return p(k,F,j,N)}):k instanceof Array?k.forEach(function(F){return p(F,C,j,N)}):(k.addEventListener(C,j,N),void e._handlers.push({remove:function(){return k.removeEventListener(C,j,N)}}))}function d(){A("onChange")}function h(k,C){var j=k!==void 0?e.parseDate(k):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),N=e.currentYear,F=e.currentMonth;try{j!==void 0&&(e.currentYear=j.getFullYear(),e.currentMonth=j.getMonth())}catch(te){te.message="Invalid date supplied: "+j,e.config.errorHandler(te)}C&&e.currentYear!==N&&(A("onYearChange"),O()),!C||e.currentYear===N&&e.currentMonth===F||A("onMonthChange"),e.redraw()}function m(k){var C=Lt(k);~C.className.indexOf("arrow")&&v(k,C.classList.contains("arrowUp")?1:-1)}function v(k,C,j){var N=k&&Lt(k),F=j||N&&N.parentNode&&N.parentNode.firstChild,te=ke("increment");te.delta=C,F&&F.dispatchEvent(te)}function y(k,C,j,N){var F=ne(C,!0),te=Be("span",k,C.getDate().toString());return te.dateObj=C,te.$i=N,te.setAttribute("aria-label",e.formatDate(C,e.config.ariaDateFormat)),k.indexOf("hidden")===-1&&Rt(C,e.now)===0&&(e.todayDateElem=te,te.classList.add("today"),te.setAttribute("aria-current","date")),F?(te.tabIndex=-1,xe(C)&&(te.classList.add("selected"),e.selectedDateElem=te,e.config.mode==="range"&&(Ot(te,"startRange",e.selectedDates[0]&&Rt(C,e.selectedDates[0],!0)===0),Ot(te,"endRange",e.selectedDates[1]&&Rt(C,e.selectedDates[1],!0)===0),k==="nextMonthDay"&&te.classList.add("inRange")))):te.classList.add("flatpickr-disabled"),e.config.mode==="range"&&function(K){return!(e.config.mode!=="range"||e.selectedDates.length<2)&&Rt(K,e.selectedDates[0])>=0&&Rt(K,e.selectedDates[1])<=0}(C)&&!xe(C)&&te.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&k!=="prevMonthDay"&&N%7==6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(C)+"</span>"),A("onDayCreate",te),te}function b(k){k.focus(),e.config.mode==="range"&&se(k)}function S(k){for(var C=k>0?0:e.config.showMonths-1,j=k>0?e.config.showMonths:-1,N=C;N!=j;N+=k)for(var F=e.daysContainer.children[N],te=k>0?0:F.children.length-1,K=k>0?F.children.length:-1,z=te;z!=K;z+=k){var H=F.children[z];if(H.className.indexOf("hidden")===-1&&ne(H.dateObj))return H}}function w(k,C){var j=o(),N=ge(j||document.body),F=k!==void 0?k:N?j:e.selectedDateElem!==void 0&&ge(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&ge(e.todayDateElem)?e.todayDateElem:S(C>0?1:-1);F===void 0?e._input.focus():N?function(te,K){for(var z=te.className.indexOf("Month")===-1?te.dateObj.getMonth():e.currentMonth,H=K>0?e.config.showMonths:-1,Y=K>0?1:-1,ce=z-e.currentMonth;ce!=H;ce+=Y)for(var ie=e.daysContainer.children[ce],oe=z-e.currentMonth===ce?te.$i+K:K<0?ie.children.length-1:0,Q=ie.children.length,ve=oe;ve>=0&&ve<Q&&ve!=(K>0?Q:-1);ve+=Y){var Ae=ie.children[ve];if(Ae.className.indexOf("hidden")===-1&&ne(Ae.dateObj)&&Math.abs(te.$i-ve)>=Math.abs(K))return b(Ae)}e.changeMonth(Y),w(S(Y),0)}(F,C):b(F)}function x(k,C){for(var j=(new Date(k,C,1).getDay()-e.l10n.firstDayOfWeek+7)%7,N=e.utils.getDaysInMonth((C-1+12)%12,k),F=e.utils.getDaysInMonth(C,k),te=window.document.createDocumentFragment(),K=e.config.showMonths>1,z=K?"prevMonthDay hidden":"prevMonthDay",H=K?"nextMonthDay hidden":"nextMonthDay",Y=N+1-j,ce=0;Y<=N;Y++,ce++)te.appendChild(y("flatpickr-day "+z,new Date(k,C-1,Y),0,ce));for(Y=1;Y<=F;Y++,ce++)te.appendChild(y("flatpickr-day",new Date(k,C,Y),0,ce));for(var ie=F+1;ie<=42-j&&(e.config.showMonths===1||ce%7!=0);ie++,ce++)te.appendChild(y("flatpickr-day "+H,new Date(k,C+1,ie%F),0,ce));var oe=Be("div","dayContainer");return oe.appendChild(te),oe}function E(){if(e.daysContainer!==void 0){Ar(e.daysContainer),e.weekNumbers&&Ar(e.weekNumbers);for(var k=document.createDocumentFragment(),C=0;C<e.config.showMonths;C++){var j=new Date(e.currentYear,e.currentMonth,1);j.setMonth(e.currentMonth+C),k.appendChild(x(j.getFullYear(),j.getMonth()))}e.daysContainer.appendChild(k),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&se()}}function O(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var k=function(N){return!(e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&N<e.config.minDate.getMonth())&&!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&N>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var C=0;C<12;C++)if(k(C)){var j=Be("option","flatpickr-monthDropdown-month");j.value=new Date(e.currentYear,C).getMonth().toString(),j.textContent=ri(C,e.config.shorthandCurrentMonth,e.l10n),j.tabIndex=-1,e.currentMonth===C&&(j.selected=!0),e.monthsDropdownContainer.appendChild(j)}}}function M(){var k,C=Be("div","flatpickr-month"),j=window.document.createDocumentFragment();e.config.showMonths>1||e.config.monthSelectorType==="static"?k=Be("span","cur-month"):(e.monthsDropdownContainer=Be("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),p(e.monthsDropdownContainer,"change",function(K){var z=Lt(K),H=parseInt(z.value,10);e.changeMonth(H-e.currentMonth),A("onMonthChange")}),O(),k=e.monthsDropdownContainer);var N=Pr("cur-year",{tabindex:"-1"}),F=N.getElementsByTagName("input")[0];F.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&F.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(F.setAttribute("max",e.config.maxDate.getFullYear().toString()),F.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var te=Be("div","flatpickr-current-month");return te.appendChild(k),te.appendChild(N),j.appendChild(te),C.appendChild(j),{container:C,yearElement:F,monthElement:k}}function B(){Ar(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var k=e.config.showMonths;k--;){var C=M();e.yearElements.push(C.yearElement),e.monthElements.push(C.monthElement),e.monthNav.appendChild(C.container)}e.monthNav.appendChild(e.nextMonthNav)}function $(){e.weekdayContainer?Ar(e.weekdayContainer):e.weekdayContainer=Be("div","flatpickr-weekdays");for(var k=e.config.showMonths;k--;){var C=Be("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(C)}return Z(),e.weekdayContainer}function Z(){if(e.weekdayContainer){var k=e.l10n.firstDayOfWeek,C=Gc(e.l10n.weekdays.shorthand);k>0&&k<C.length&&(C=Gc(C.splice(k,C.length),C.splice(0,k)));for(var j=e.config.showMonths;j--;)e.weekdayContainer.children[j].innerHTML=`
9
9
  <span class='flatpickr-weekday'>
10
- `+w.join("</span><span class='flatpickr-weekday'>")+`
10
+ `+C.join("</span><span class='flatpickr-weekday'>")+`
11
11
  </span>
12
- `}}function B(x,w){w===void 0&&(w=!0);var O=w?x:x-e.currentMonth;O<0&&e._hidePrevMonthArrow===!0||O>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=O,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,I("onYearChange"),E()),j(),I("onMonthChange"),_e())}function A(x){return e.calendarContainer.contains(x)}function fe(x){if(e.isOpen&&!e.config.inline){var w=Lt(x),O=A(w),N=!(w===e.input||w===e.altInput||e.element.contains(w)||x.path&&x.path.indexOf&&(~x.path.indexOf(e.input)||~x.path.indexOf(e.altInput)))&&!O&&!A(x.relatedTarget),R=!e.config.ignoredFocusElements.some(function(ne){return ne.contains(w)});N&&R&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&a(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function ve(x){if(!(!x||e.config.minDate&&x<e.config.minDate.getFullYear()||e.config.maxDate&&x>e.config.maxDate.getFullYear())){var w=x,O=e.currentYear!==w;e.currentYear=w||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),O&&(e.redraw(),I("onYearChange"),E())}}function Y(x,w){var O;w===void 0&&(w=!0);var N=e.parseDate(x,void 0,w);if(e.config.minDate&&N&&Rt(N,e.config.minDate,w!==void 0?w:!e.minDateHasTime)<0||e.config.maxDate&&N&&Rt(N,e.config.maxDate,w!==void 0?w:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(N===void 0)return!1;for(var R=!!e.config.enable,ne=(O=e.config.enable)!==null&&O!==void 0?O:e.config.disable,J=0,$=void 0;J<ne.length;J++){if(typeof($=ne[J])=="function"&&$(N)||$ instanceof Date&&N!==void 0&&$.getTime()===N.getTime())return R;if(typeof $=="string"){var F=e.parseDate($,void 0,!0);return F&&F.getTime()===N.getTime()?R:!R}if(typeof $=="object"&&N!==void 0&&$.from&&$.to&&N.getTime()>=$.from.getTime()&&N.getTime()<=$.to.getTime())return R}return!R}function de(x){return e.daysContainer!==void 0&&x.className.indexOf("hidden")===-1&&x.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(x)}function he(x){var w=x.target===e._input,O=e._input.value.trimEnd()!==Ie();!w||!O||x.relatedTarget&&A(x.relatedTarget)||e.setDate(e._input.value,!0,x.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function Oe(x){var w=Lt(x),O=e.config.wrap?t.contains(w):w===e._input,N=e.config.allowInput,R=e.isOpen&&(!N||!O),ne=e.config.inline&&O&&!N;if(x.keyCode===13&&O){if(N)return e.setDate(e._input.value,!0,w===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),w.blur();e.open()}else if(A(w)||R||ne){var J=!!e.timeContainer&&e.timeContainer.contains(w);switch(x.keyCode){case 13:J?(x.preventDefault(),a(),T()):L(x);break;case 27:x.preventDefault(),T();break;case 8:case 46:O&&!e.config.allowInput&&(x.preventDefault(),e.clear());break;case 37:case 39:if(J||O)e.hourElement&&e.hourElement.focus();else{x.preventDefault();var $=o();if(e.daysContainer!==void 0&&(N===!1||$&&de($))){var F=x.keyCode===39?1:-1;x.ctrlKey?(x.stopPropagation(),B(F),k(S(1),0)):k(void 0,F)}}break;case 38:case 40:x.preventDefault();var Z=x.keyCode===40?1:-1;e.daysContainer&&w.$i!==void 0||w===e.input||w===e.altInput?x.ctrlKey?(x.stopPropagation(),ve(e.currentYear-Z),k(S(1),0)):J||k(void 0,7*Z):w===e.currentYearElement?ve(e.currentYear-Z):e.config.enableTime&&(!J&&e.hourElement&&e.hourElement.focus(),a(x),e._debouncedChange());break;case 9:if(J){var le=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(ee){return ee}),ie=le.indexOf(w);if(ie!==-1){var oe=le[ie+(x.shiftKey?-1:1)];x.preventDefault(),(oe||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(w)&&x.shiftKey&&(x.preventDefault(),e._input.focus())}}if(e.amPM!==void 0&&w===e.amPM)switch(x.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],c(),Pe();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],c(),Pe()}(O||A(w))&&I("onKeyDown",x)}function ce(x,w){if(w===void 0&&(w="flatpickr-day"),e.selectedDates.length===1&&(!x||x.classList.contains(w)&&!x.classList.contains("flatpickr-disabled"))){for(var O=x?x.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),N=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),R=Math.min(O,e.selectedDates[0].getTime()),ne=Math.max(O,e.selectedDates[0].getTime()),J=!1,$=0,F=0,Z=R;Z<ne;Z+=Kg.DAY)Y(new Date(Z),!0)||(J=J||Z>R&&Z<ne,Z<N&&(!$||Z>$)?$=Z:Z>N&&(!F||Z<F)&&(F=Z));Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+w)).forEach(function(le){var ie=le.dateObj.getTime(),oe=$>0&&ie<$||F>0&&ie>F;if(oe)return le.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(ee){le.classList.remove(ee)});J&&!oe||(["startRange","inRange","endRange","notAllowed"].forEach(function(ee){le.classList.remove(ee)}),x!==void 0&&(x.classList.add(O<=e.selectedDates[0].getTime()?"startRange":"endRange"),N<O&&ie===N?le.classList.add("startRange"):N>O&&ie===N&&le.classList.add("endRange"),ie>=$&&(F===0||ie<=F)&&Yg(ie,N,O)&&le.classList.add("inRange")))})}}function W(){!e.isOpen||e.config.static||e.config.inline||V()}function Q(x){return function(w){var O=e.config["_"+x+"Date"]=e.parseDate(w,e.config.dateFormat),N=e.config["_"+(x==="min"?"max":"min")+"Date"];O!==void 0&&(e[x==="min"?"minDateHasTime":"maxDateHasTime"]=O.getHours()>0||O.getMinutes()>0||O.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(R){return Y(R)}),e.selectedDates.length||x!=="min"||l(O),Pe()),e.daysContainer&&(D(),O!==void 0?e.currentYearElement[x]=O.getFullYear().toString():e.currentYearElement.removeAttribute(x),e.currentYearElement.disabled=!!N&&O!==void 0&&N.getFullYear()===O.getFullYear())}}function me(){return e.config.wrap?t.querySelector("[data-input]"):t}function pe(){typeof e.config.locale!="object"&&nt.l10ns[e.config.locale]===void 0&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=Ct(Ct({},nt.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?nt.l10ns[e.config.locale]:void 0),zn.D="("+e.l10n.weekdays.shorthand.join("|")+")",zn.l="("+e.l10n.weekdays.longhand.join("|")+")",zn.M="("+e.l10n.months.shorthand.join("|")+")",zn.F="("+e.l10n.months.longhand.join("|")+")",zn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")",Ct(Ct({},n),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr===void 0&&nt.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Ef(e),e.parseDate=za({config:e.config,l10n:e.l10n})}function V(x){if(typeof e.config.position!="function"){if(e.calendarContainer!==void 0){I("onPreCalendarPosition");var w=x||e._positionElement,O=Array.prototype.reduce.call(e.calendarContainer.children,function(Te,Ne){return Te+Ne.offsetHeight},0),N=e.calendarContainer.offsetWidth,R=e.config.position.split(" "),ne=R[0],J=R.length>1?R[1]:null,$=w.getBoundingClientRect(),F=window.innerHeight-$.bottom,Z=ne==="above"||ne!=="below"&&F<O&&$.top>O,le=window.pageYOffset+$.top+(Z?-O-2:w.offsetHeight+2);if(Ot(e.calendarContainer,"arrowTop",!Z),Ot(e.calendarContainer,"arrowBottom",Z),!e.config.inline){var ie=window.pageXOffset+$.left,oe=!1,ee=!1;J==="center"?(ie-=(N-$.width)/2,oe=!0):J==="right"&&(ie-=N-$.width,ee=!0),Ot(e.calendarContainer,"arrowLeft",!oe&&!ee),Ot(e.calendarContainer,"arrowCenter",oe),Ot(e.calendarContainer,"arrowRight",ee);var ye=window.document.body.offsetWidth-(window.pageXOffset+$.right),Ae=ie+N>window.document.body.offsetWidth,Ve=ye+N>window.document.body.offsetWidth;if(Ot(e.calendarContainer,"rightMost",Ae),!e.config.static)if(e.calendarContainer.style.top=le+"px",Ae)if(Ve){var je=function(){for(var Te=null,Ne=0;Ne<document.styleSheets.length;Ne++){var qe=document.styleSheets[Ne];if(qe.cssRules){try{qe.cssRules}catch{continue}Te=qe;break}}return Te??(Kt=document.createElement("style"),document.head.appendChild(Kt),Kt.sheet);var Kt}();if(je===void 0)return;var Se=window.document.body.offsetWidth,Ce=Math.max(0,Se/2-N/2),ue=je.cssRules.length,be="{left:"+$.left+"px;right:auto;}";Ot(e.calendarContainer,"rightMost",!1),Ot(e.calendarContainer,"centerMost",!0),je.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+be,ue),e.calendarContainer.style.left=Ce+"px",e.calendarContainer.style.right="auto"}else e.calendarContainer.style.left="auto",e.calendarContainer.style.right=ye+"px";else e.calendarContainer.style.left=ie+"px",e.calendarContainer.style.right="auto"}}}else e.config.position(e,x)}function D(){e.config.noCalendar||e.isMobile||(E(),_e(),j())}function T(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function L(x){x.preventDefault(),x.stopPropagation();var w=Sf(Lt(x),function(Z){return Z.classList&&Z.classList.contains("flatpickr-day")&&!Z.classList.contains("flatpickr-disabled")&&!Z.classList.contains("notAllowed")});if(w!==void 0){var O=w,N=e.latestSelectedDateObj=new Date(O.dateObj.getTime()),R=(N.getMonth()<e.currentMonth||N.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=O,e.config.mode==="single")e.selectedDates=[N];else if(e.config.mode==="multiple"){var ne=xe(N);ne?e.selectedDates.splice(parseInt(ne),1):e.selectedDates.push(N)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=N,e.selectedDates.push(N),Rt(N,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(Z,le){return Z.getTime()-le.getTime()}));if(c(),R){var J=e.currentYear!==N.getFullYear();e.currentYear=N.getFullYear(),e.currentMonth=N.getMonth(),J&&(I("onYearChange"),E()),I("onMonthChange")}if(_e(),j(),Pe(),R||e.config.mode==="range"||e.config.showMonths!==1?e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus():b(O),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var $=e.config.mode==="single"&&!e.config.enableTime,F=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;($||F)&&T()}d()}}e.parseDate=za({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=f,e._setHoursFromDate=l,e._positionCalendar=V,e.changeMonth=B,e.changeYear=ve,e.clear=function(x,w){if(x===void 0&&(x=!0),w===void 0&&(w=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,w===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var O=sa(e.config);u(O.hours,O.minutes,O.seconds)}e.redraw(),x&&I("onChange")},e.close=function(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),I("onClose")},e.onMouseOver=ce,e._createElement=He,e.createDay=y,e.destroy=function(){e.config!==void 0&&I("onDestroy");for(var x=e._handlers.length;x--;)e._handlers[x].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var w=e.calendarContainer.parentNode;if(w.lastChild&&w.removeChild(w.lastChild),w.parentNode){for(;w.firstChild;)w.parentNode.insertBefore(w.firstChild,w);w.parentNode.removeChild(w)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(O){try{delete e[O]}catch{}})},e.isEnabled=Y,e.jumpToDate=h,e.updateValue=Pe,e.open=function(x,w){if(w===void 0&&(w=e._positionElement),e.isMobile===!0){if(x){x.preventDefault();var O=Lt(x);O&&O.blur()}return e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),void I("onOpen")}if(!(e._input.disabled||e.config.inline)){var N=e.isOpen;e.isOpen=!0,N||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),I("onOpen"),V(w)),e.config.enableTime===!0&&e.config.noCalendar===!0&&(e.config.allowInput!==!1||x!==void 0&&e.timeContainer.contains(x.relatedTarget)||setTimeout(function(){return e.hourElement.select()},50))}},e.redraw=D,e.set=function(x,w){if(x!==null&&typeof x=="object")for(var O in Object.assign(e.config,x),x)G[O]!==void 0&&G[O].forEach(function(N){return N()});else e.config[x]=w,G[x]!==void 0?G[x].forEach(function(N){return N()}):oa.indexOf(x)>-1&&(e.config[x]=ra(w));e.redraw(),Pe(!0)},e.setDate=function(x,w,O){if(w===void 0&&(w=!1),O===void 0&&(O=e.config.dateFormat),x!==0&&!x||x instanceof Array&&x.length===0)return e.clear(w);U(x,O),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),h(void 0,w),l(),e.selectedDates.length===0&&e.clear(!1),Pe(w),w&&I("onChange")},e.toggle=function(x){if(e.isOpen===!0)return e.close();e.open(x)};var G={locale:[pe,q],showMonths:[H,i,z],minDate:[h],maxDate:[h],positionElement:[te],clickOpens:[function(){e.config.clickOpens===!0?(f(e._input,"focus",e.open),f(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function U(x,w){var O=[];if(x instanceof Array)O=x.map(function(N){return e.parseDate(N,w)});else if(x instanceof Date||typeof x=="number")O=[e.parseDate(x,w)];else if(typeof x=="string")switch(e.config.mode){case"single":case"time":O=[e.parseDate(x,w)];break;case"multiple":O=x.split(e.config.conjunction).map(function(N){return e.parseDate(N,w)});break;case"range":O=x.split(e.l10n.rangeSeparator).map(function(N){return e.parseDate(N,w)})}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(x)));e.selectedDates=e.config.allowInvalidPreload?O:O.filter(function(N){return N instanceof Date&&Y(N,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(N,R){return N.getTime()-R.getTime()})}function re(x){return x.slice().map(function(w){return typeof w=="string"||typeof w=="number"||w instanceof Date?e.parseDate(w,void 0,!0):w&&typeof w=="object"&&w.from&&w.to?{from:e.parseDate(w.from,void 0),to:e.parseDate(w.to,void 0)}:w}).filter(function(w){return w})}function te(){e._positionElement=e.config.positionElement||e._input}function I(x,w){if(e.config!==void 0){var O=e.config[x];if(O!==void 0&&O.length>0)for(var N=0;O[N]&&N<O.length;N++)O[N](e.selectedDates,e.input.value,e,w);x==="onChange"&&(e.input.dispatchEvent(ke("change")),e.input.dispatchEvent(ke("input")))}}function ke(x){var w=document.createEvent("Event");return w.initEvent(x,!0,!0),w}function xe(x){for(var w=0;w<e.selectedDates.length;w++){var O=e.selectedDates[w];if(O instanceof Date&&Rt(O,x)===0)return""+w}return!1}function _e(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(x,w){var O=new Date(e.currentYear,e.currentMonth,1);O.setMonth(e.currentMonth+w),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[w].textContent=ri(O.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=O.getMonth().toString(),x.value=O.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Ie(x){var w=x||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(O){return e.formatDate(O,w)}).filter(function(O,N,R){return e.config.mode!=="range"||e.config.enableTime||R.indexOf(O)===N}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function Pe(x){x===void 0&&(x=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Ie(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=Ie(e.config.altFormat)),x!==!1&&I("onValueUpdate")}function ge(x){var w=Lt(x),O=e.prevMonthNav.contains(w),N=e.nextMonthNav.contains(w);O||N?B(O?-1:1):e.yearElements.indexOf(w)>=0?w.select():w.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):w.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}return function(){e.element=e.input=t,e.isOpen=!1,function(){var w=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],O=Ct(Ct({},JSON.parse(JSON.stringify(t.dataset||{}))),n),N={};e.config.parseDate=O.parseDate,e.config.formatDate=O.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(ie){e.config._enable=re(ie)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(ie){e.config._disable=re(ie)}});var R=O.mode==="time";if(!O.dateFormat&&(O.enableTime||R)){var ne=nt.defaultConfig.dateFormat||bo.dateFormat;N.dateFormat=O.noCalendar||R?"H:i"+(O.enableSeconds?":S":""):ne+" H:i"+(O.enableSeconds?":S":"")}if(O.altInput&&(O.enableTime||R)&&!O.altFormat){var J=nt.defaultConfig.altFormat||bo.altFormat;N.altFormat=O.noCalendar||R?"h:i"+(O.enableSeconds?":S K":" K"):J+" h:i"+(O.enableSeconds?":S":"")+" K"}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:Q("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:Q("max")});var $=function(ie){return function(oe){e.config[ie==="min"?"_minTime":"_maxTime"]=e.parseDate(oe,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:$("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:$("max")}),O.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,N,O);for(var F=0;F<w.length;F++)e.config[w[F]]=e.config[w[F]]===!0||e.config[w[F]]==="true";for(oa.filter(function(ie){return e.config[ie]!==void 0}).forEach(function(ie){e.config[ie]=ra(e.config[ie]||[]).map(r)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),F=0;F<e.config.plugins.length;F++){var Z=e.config.plugins[F](e)||{};for(var le in Z)oa.indexOf(le)>-1?e.config[le]=ra(Z[le]).map(r).concat(e.config[le]):O[le]===void 0&&(e.config[le]=Z[le])}O.altInputClass||(e.config.altInputClass=me().className+" "+e.config.altInputClass),I("onParseConfig")}(),pe(),function(){if(e.input=me(),!e.input)return void e.config.errorHandler(new Error("Invalid input element specified"));e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=He(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),te()}(),function(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var w=e.config.defaultDate||(e.input.nodeName!=="INPUT"&&e.input.nodeName!=="TEXTAREA"||!e.input.placeholder||e.input.value!==e.input.placeholder?e.input.value:null);w&&U(w,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}(),e.utils={getDaysInMonth:function(w,O){return w===void 0&&(w=e.currentMonth),O===void 0&&(O=e.currentYear),w===1&&(O%4==0&&O%100!=0||O%400==0)?29:e.l10n.daysInMonth[w]}},e.isMobile||function(){var w=window.document.createDocumentFragment();if(e.calendarContainer=He("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(w.appendChild((e.monthNav=He("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=He("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=He("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,H(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function($){e.__hidePrevMonthArrow!==$&&(Ot(e.prevMonthNav,"flatpickr-disabled",$),e.__hidePrevMonthArrow=$)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function($){e.__hideNextMonthArrow!==$&&(Ot(e.nextMonthNav,"flatpickr-disabled",$),e.__hideNextMonthArrow=$)}}),e.currentYearElement=e.yearElements[0],_e(),e.monthNav)),e.innerContainer=He("div","flatpickr-innerContainer"),e.config.weekNumbers){var O=function(){e.calendarContainer.classList.add("hasWeeks");var $=He("div","flatpickr-weekwrapper");$.appendChild(He("span","flatpickr-weekday",e.l10n.weekAbbreviation));var F=He("div","flatpickr-weeks");return $.appendChild(F),{weekWrapper:$,weekNumbers:F}}(),N=O.weekWrapper,R=O.weekNumbers;e.innerContainer.appendChild(N),e.weekNumbers=R,e.weekWrapper=N}e.rContainer=He("div","flatpickr-rContainer"),e.rContainer.appendChild(z()),e.daysContainer||(e.daysContainer=He("div","flatpickr-days"),e.daysContainer.tabIndex=-1),j(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),w.appendChild(e.innerContainer)}e.config.enableTime&&w.appendChild(function(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var $=sa(e.config);e.timeContainer=He("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var F=He("span","flatpickr-time-separator",":"),Z=Pr("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=Z.getElementsByTagName("input")[0];var le=Pr("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=le.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?$.hours:function(oe){switch(oe%24){case 0:case 12:return 12;default:return oe%12}}($.hours)),e.minuteElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():$.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(Z),e.timeContainer.appendChild(F),e.timeContainer.appendChild(le),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var ie=Pr("flatpickr-second");e.secondElement=ie.getElementsByTagName("input")[0],e.secondElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():$.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(He("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(ie)}return e.config.time_24hr||(e.amPM=He("span","flatpickr-am-pm",e.l10n.amPM[Ut((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}()),Ot(e.calendarContainer,"rangeMode",e.config.mode==="range"),Ot(e.calendarContainer,"animate",e.config.animate===!0),Ot(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(w);var ne=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!ne&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var J=He("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(J,e.element),J.appendChild(e.element),e.altInput&&J.appendChild(e.altInput),J.appendChild(e.calendarContainer)}e.config.static||e.config.inline||(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}(),function(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(N){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+N+"]"),function(R){return f(R,"click",e[N])})}),e.isMobile)return void function(){var N=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=He("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=N,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=N==="datetime-local"?"Y-m-d\\TH:i:S":N==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}f(e.mobileInput,"change",function(R){e.setDate(Lt(R).value,!1,e.mobileFormatStr),I("onChange"),I("onClose")})}();var w=Uc(W,50);if(e._debouncedChange=Uc(d,qg),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&f(e.daysContainer,"mouseover",function(N){e.config.mode==="range"&&ce(Lt(N))}),f(e._input,"keydown",Oe),e.calendarContainer!==void 0&&f(e.calendarContainer,"keydown",Oe),e.config.inline||e.config.static||f(window,"resize",w),window.ontouchstart!==void 0?f(window.document,"touchstart",fe):f(window.document,"mousedown",fe),f(window.document,"focus",fe,{capture:!0}),e.config.clickOpens===!0&&(f(e._input,"focus",e.open),f(e._input,"click",e.open)),e.daysContainer!==void 0&&(f(e.monthNav,"click",ge),f(e.monthNav,["keyup","increment"],p),f(e.daysContainer,"click",L)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var O=function(N){return Lt(N).select()};f(e.timeContainer,["increment"],a),f(e.timeContainer,"blur",a,{capture:!0}),f(e.timeContainer,"click",m),f([e.hourElement,e.minuteElement],["focus","click"],O),e.secondElement!==void 0&&f(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&f(e.amPM,"click",function(N){a(N)})}e.config.allowInput&&f(e._input,"blur",he)}(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&l(e.config.noCalendar?e.latestSelectedDateObj:void 0),Pe(!1)),i();var x=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&x&&V(),I("onReady")}(),e}function wo(t,n){for(var e=Array.prototype.slice.call(t).filter(function(a){return a instanceof HTMLElement}),o=[],r=0;r<e.length;r++){var i=e[r];try{if(i.getAttribute("data-fp-omit")!==null)continue;i._flatpickr!==void 0&&(i._flatpickr.destroy(),i._flatpickr=void 0),i._flatpickr=Jg(i,n||{}),o.push(i._flatpickr)}catch(a){console.error(a)}}return o.length===1?o[0]:o}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return wo(this,t)},HTMLElement.prototype.flatpickr=function(t){return wo([this],t)});var nt=function(t,n){return typeof t=="string"?wo(window.document.querySelectorAll(t),n):t instanceof Node?wo([t],n):wo(t,n)};nt.defaultConfig={},nt.l10ns={en:Ct({},sr),default:Ct({},sr)},nt.localize=function(t){nt.l10ns.default=Ct(Ct({},nt.l10ns.default),t)},nt.setDefaults=function(t){nt.defaultConfig=Ct(Ct({},nt.defaultConfig),t)},nt.parseDate=za({}),nt.formatDate=Ef({}),nt.compareDates=Rt,typeof jQuery<"u"&&jQuery.fn!==void 0&&(jQuery.fn.flatpickr=function(t){return wo(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t=="string"?parseInt(t,10):t))},typeof window<"u"&&(window.flatpickr=nt);const Xg=["onCreate","onDestroy"],ca=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],Qg=t=>{const n=g.useMemo(()=>({...t}),[t]),{defaultValue:e,options:o={},value:r,children:i,render:a}=n,c=g.useMemo(()=>((d,h)=>(ca.forEach(m=>{const v=h[m],y=d[m];if(v){y&&!Array.isArray(y)?d[m]=[d[m]]:d[m]||(d[m]=[]);const b=Array.isArray(v)?v:[v];d[m].length===0?d[m]=b:d[m].push(...b)}}),ca.forEach(m=>{delete h[m]}),Xg.forEach(m=>{delete h[m]}),d))(o,n),[o,n]),l=g.useRef(null),u=g.useRef(void 0);g.useImperativeHandle(t.ref,()=>({get flatpickr(){return u.current}}),[]),g.useEffect(()=>{var d;if(c.onClose=c.onClose||(()=>{var m;(m=l.current)!=null&&m.blur&&l.current.blur()}),u.current=(((h=nt)==null?void 0:h.default)||nt)(l.current,c),u.current&&r!==void 0&&u.current.setDate(r,!1),t.onCreate&&t.onCreate(u.current),u.current){const m=Object.getOwnPropertyNames(c);for(let v=m.length-1;v>=0;v--){const y=m[v];let b=c[y];(b==null?void 0:b.toString())!==((d=u.current.config[y])==null?void 0:d.toString())&&(ca.includes(y)&&!Array.isArray(b)&&(b=[b]),u.current.set(y,b))}r!==void 0&&r!==u.current.input.value&&u.current.setDate(r,!1)}var h;return()=>{t.onDestroy&&t.onDestroy(u.current),u.current&&u.current.destroy(),u.current=void 0}},[c,o,n,r,t]);const p=g.useCallback(d=>{l.current=d},[]);if(a)return a({...n,defaultValue:e,value:r},p);const f=g.useCallback(d=>{var h,m;t&&t.onChange&&(Array.isArray(t==null?void 0:t.onChange)?(h=t==null?void 0:t.onChange)==null||h.forEach(()=>[new Date(d.target.value)],(r==null?void 0:r.toString())||""):typeof t.onChange=="function"&&((m=t==null?void 0:t.onChange)==null||m.call(t,[new Date(d.target.value)],(r==null?void 0:r.toString())||"",u.current)))},[t,r]);return o.wrap?s.jsx("div",{className:"flatpickr",ref:p,children:i}):s.jsx("input",{onChange:f,...n,value:r==null?void 0:r.toString(),defaultValue:e,ref:p})},Gc="T42.GD.Execute",jf=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Of=(t,n)=>t in n;function e0({time:t,frequency:n,day:e}){const o=new Date(`01/01/2000 ${t}`),r=o.getMinutes(),i=o.getHours();let a="*";return n==="weekly"&&e&&(a=function(c){const l={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!Of(c,l))throw new Error(`Invalid day: ${c}`);return l[c]}(e).toString()),`${r} ${i} * * ${a}`}function t0(t){const n=g.useContext(De.IOConnectContext),{value:e,update:o}=Ht({prefKey:Tr(t)}),{value:r,update:i}=Ht({prefKey:Tr(t,"Time")}),{value:a,update:c}=Ht({prefKey:Tr(t,"Frequency")}),{value:l,update:u}=Ht({prefKey:Tr(t,"Day")}),p=g.useCallback(async()=>{try{await n.interop.invoke(Gc,{command:`cancel-${t}`})}catch(d){console.error(d)}},[n,t]),f=g.useCallback(async()=>{try{const d=e0({time:r??"12:00 AM",frequency:a??"daily",day:a==="weekly"?l:"*"});await n.interop.invoke(Gc,{command:`schedule-${t}`,args:{cronTime:d,discardUnsavedLayoutChanges:!1}})}catch(d){console.error(`Failed to update cron job for ${t}:`,d)}},[n,t,r,a,l]);return g.useEffect(()=>{n&&e&&f()},[n,e,f]),{enabled:e??!1,time:r??"12:00 AM",frequency:a??"daily",day:l??"Monday",setEnabled:async d=>{d||await p();try{await o(d)}catch(h){console.error("Failed to update enabled state:",h)}},setTime:async d=>{try{await i(d)}catch(h){console.error("Failed to update time:",h)}},setFrequency:async d=>{try{await c(d),d==="daily"&&await u(void 0)}catch(h){console.error("Failed to update frequency:",h)}},setDay:async d=>{var h;if(h=d,jf.includes(h))try{await u(d)}catch(m){console.error("Failed to update day:",m)}else console.error("Invalid day provided")}}}function Tr(t,n){const e=t==="restart"?"_system_scheduleRestart":"_system_scheduleShutdown";return n?`${e}${n}`:e}function Nf({className:t,variant:n,...e}){const o=K("io-block-list-gap",n,t),{enabled:r,time:i,frequency:a,day:c,setEnabled:l,setTime:u,setFrequency:p,setDay:f}=t0(n);return s.jsxs(Ke,{className:o,...e,children:[s.jsx(ft,{label:`Schedule ${n}`,align:"right",onChange:d=>l(d.target.checked),checked:r}),s.jsxs("div",{className:"scheduler-controls",children:[s.jsxs("div",{className:"io-control-input io-control-leading-icon direction-up",children:[s.jsx(et,{variant:"clock"}),s.jsx(Qg,{className:"io-input",options:{enableTime:!0,noCalendar:!0,dateFormat:"h:i K",defaultDate:i,clickOpens:!0},value:i,onClose:async([d])=>{const h=d.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0});await u(h)}})]}),s.jsxs(Jt,{text:a.charAt(0).toUpperCase()+a.slice(1),icon:"chevron-down",iconRight:!0,children:[s.jsx(Jt.Item,{onClick:()=>p("daily"),children:"Daily"}),s.jsx(Jt.Item,{onClick:()=>p("weekly"),children:"Weekly"})]}),a==="weekly"&&s.jsx(Jt,{text:c,icon:"chevron-down",iconRight:!0,children:jf.map(d=>s.jsx(Jt.Item,{onClick:()=>f(d),children:d},d))})]})]})}function n0({className:t,...n}){return s.jsx(Nf,{...n,className:t,variant:"restart"})}function o0({className:t,...n}){return s.jsx(Nf,{...n,className:t,variant:"shutdown"})}const If={Body:Pg,General:Tg,Theme:xs,PinnedPosition:Mg,AllowDocking:_g,MinimizeToTray:Lg,AutoClose:Rg,ShowTutorialOnStartup:Fg,Layouts:Bg,LayoutsRestoreLastSaved:Hg,LayoutsSaveCurrentOnExit:Wg,LayoutsShowUnsavedChangesPrompt:Cs,LayoutsShowDeletePrompt:ks,Downloads:zg,DownloadsAskForEachDownload:$g,DownloadsLocation:Ug,System:Vg,SystemRestartSection:n0,SystemShutdownSection:o0},Af=g.createContext(If),r0=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...If,...n}),[n]);return s.jsx(Af.Provider,{value:e,children:t})});r0.displayName="PreferencesPanelComponentsStoreProvider";const mr=()=>g.useContext(Af),i0=({className:t,onClose:n,title:e="Platform Preferences",children:o,...r})=>s.jsxs(Ze,{className:K("io-preferences-panel",t),...r,children:[s.jsxs(Ze.Header,{children:[s.jsx(Ze.Header.Title,{size:"large",text:e,tag:"h1"}),s.jsx(Ze.Header.ButtonGroup,{children:s.jsx(Ze.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),o]}),Pf=t=>{const{General:n,Layouts:e}=Ai();return s.jsxs(So,{...t,children:[s.jsx(n,{}),s.jsx(e,{})]})},Tf=({className:t,title:n="General",...e})=>{const{Theme:o}=Ai();return s.jsx(Ke,{className:K("io-block io-block-list-gap",t),title:n,...e,children:s.jsx(o,{})})},Df=({className:t,title:n="Layouts",...e})=>{const{LayoutsShowDeletePrompt:o,LayoutsShowUnsavedChangesPrompt:r}=Ai();return s.jsxs(Ke,{className:K("io-block io-block-list-gap",t),title:n,...e,children:[s.jsx(r,{}),s.jsx(o,{})]})},Mf={Body:Pf,General:Tf,Theme:xs,Layouts:Df,LayoutsShowUnsavedChangesPrompt:Cs,LayoutsShowDeletePrompt:ks},_f=g.createContext(Mf),Lf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Mf,...n}),[n]);return s.jsx(_f.Provider,{value:e,children:t})});Lf.displayName="PreferencesPanelComponentsStoreProvider";const Ai=()=>g.useContext(_f),a0=({onClose:t,title:n="Platform Preferences",...e})=>{const{Body:o}=Ai();return s.jsx(i0,{title:n,onClose:t,...e,children:s.jsx(o,{})})};var s0=Object.freeze({__proto__:null,General:Tf,Layouts:Df,LayoutsShowDeletePrompt:ks,LayoutsShowUnsavedChangesPrompt:Cs,Panel:({components:t,...n})=>s.jsx(Lf,{components:t,children:s.jsx(a0,{...n})}),PanelBody:Pf,Theme:xs});const c0=({name:t,value:n})=>s.jsxs("div",{className:"io-profile-section-item",children:[s.jsx("div",{className:"io-profile-section-item-name",children:t}),s.jsx("div",{className:"io-profile-section-item-value",children:n})]}),Rf=({className:t,items:n,title:e})=>s.jsxs("div",{className:K("io-profile-section-body",t),children:[e&&s.jsx(nn,{className:"io-profile-section-title",text:e}),n.map(({name:o,value:r})=>s.jsx(c0,{name:o,value:r},o))]}),Ss=({className:t,items:n,title:e})=>s.jsxs("section",{className:K("io-profile-section",t),children:[s.jsx(Rf,{items:n,title:e}),s.jsx(hr,{className:"mt-8"})]}),Ff=({title:t="License",...n})=>s.jsx(Ss,{title:t,...n}),Bf=({title:t="Version",...n})=>s.jsx(Ss,{title:t,...n}),Hf=({title:t="Plugins",...n})=>s.jsx(Ss,{title:t,...n}),Wf=({className:t})=>{const n=ki()?"io.Connect Desktop":"io.Connect Browser";return s.jsxs("div",{className:K("io-trademark-container",t),children:[s.jsx("h4",{className:"io-trademark-title",children:n}),s.jsxs("p",{className:"io-trademark-text",children:[n,"® is a registered trademark of"," ",s.jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",new Date().getFullYear(),". All rights reserved."]})]})},zf=({avatarInitials:t=ki()?"CD":"CB",className:n,items:e,onLogout:o,title:r})=>s.jsxs("section",{className:K("io-profile-section",n),children:[s.jsxs("div",{className:"io-user-details-container",children:[s.jsx("div",{className:"io-user-avatar",children:t}),s.jsx(Rf,{className:"mt-12",items:e,title:r})]}),o&&s.jsx(Ge,{className:"io-log-out-button",onClick:o,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),s.jsx(hr,{className:"mt-8"})]}),$f={LicenseSection:Ff,ProductsInfoSection:Bf,PluginsSection:Hf,Trademark:Wf,UserSection:zf},Uf=g.createContext($f),Vf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...$f,...n}),[n]);return s.jsx(Uf.Provider,{value:e,children:t})});Vf.displayName="ProfilePanelComponentsStoreProvider";const l0=t=>{const n=new Date(t);return[{day:"numeric"},{month:"short"},{year:"numeric"}].map(e=>n.toLocaleDateString("en",e)).join(" ")},u0=t=>{if(!t)return{items:[]};const n=[...t.email?[{name:"Email",value:t.email}]:[],...t.type?[{name:"User Type",value:t.type}]:[],...t.role?[{name:"User Role",value:t.role}]:[],{name:"User ID",value:t.id}];if(t.firstName||t.lastName){const e=[t.firstName,t.lastName].filter(o=>!!o);return{avatarInitials:e.map(o=>o.charAt(0)).join(""),items:n,title:e.join(" ")}}return t.username?{avatarInitials:t.username.charAt(0),items:n,title:t.username}:t.email?{avatarInitials:t.email.charAt(0),items:n}:{items:n}},d0=t=>{const n=new Date(2023,5,6),e=t.expiration<n.getTime()?1e3:1;return{items:[{name:"Type",value:t.type},{name:"Expiration Date",value:l0(t.expiration*e)}]}},f0=t=>({items:t.map(n=>({name:n.name,value:n.version}))}),p0=t=>{var e;const n={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return{items:[{name:"io.Connect Browser platform",value:t.platform.apiVersion},{name:"io.Connect Browser client",value:t.client.apiVersion},...t.workspaces?[{name:"Workspaces API",value:t.workspaces.apiVersion}]:[],...(e=t.workspaces)!=null&&e.container&&Of(t.workspaces.container.type,n)?[{name:n[t.workspaces.container.type],value:t.workspaces.container.version}]:[],...t.home?[{name:"Home UI",value:t.home.version}]:[],...t.search?[{name:"Search API",value:t.search.apiVersion}]:[],...t.modals?[{name:"Modals API",value:t.modals.apiVersion}]:[]]}},h0=()=>{const t=window.glue42gd??window.iodesktop;if(!t)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:n,env:e}=t,o=[{name:"Environment",value:e.env},{name:"Region",value:e.region}];return n?{avatarInitials:n.charAt(0),items:o,title:n}:{items:o}},m0=t=>({items:Object.entries(t??{}).map(([e,o])=>({name:e,value:o}))}),g0=t=>({items:t.map(({product:e,version:o})=>({name:e,value:o}))}),v0=t=>ki()?(async n=>{const{licInfo:e,productInfo:o}=(await n.interop.invoke("T42.GD.GetInfo")).returned;return{user:h0(),license:m0(e),productsInfo:g0(o)}})(t):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const n=await window.iobrowser.system.getProfileData();return{user:u0(n.user),license:d0(n.license),plugins:f0(n.plugins),productsInfo:p0(n.productsInfo)}})(),y0=({className:t,onClose:n,onLogout:e,title:o="Profile",...r})=>{var h;const{LicenseSection:i,ProductsInfoSection:a,PluginsSection:c,Trademark:l,UserSection:u}=g.useContext(Uf),p=g.useContext(De.IOConnectContext),[f,d]=g.useState(null);return g.useEffect(()=>{p&&(async()=>{const m=await v0(p);d(m)})().catch(console.error)},[p]),s.jsxs(Ze,{className:K("io-profile-panel",t),...r,children:[s.jsxs(Ze.Header,{children:[s.jsx(Ze.Header.Title,{size:"large",text:o}),s.jsx(Ze.Header.ButtonGroup,{children:s.jsx(Ze.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),s.jsxs(Ze.Body,{children:[f!=null&&f.user.items.length||f!=null&&f.user.title?s.jsx(u,{avatarInitials:f.user.avatarInitials,items:f.user.items,onLogout:e,title:f.user.title}):null,s.jsxs("div",{className:"io-scrollable-profile-sections-container",children:[f!=null&&f.license.items.length?s.jsx(i,{items:f.license.items}):null,f!=null&&f.productsInfo.items.length?s.jsx(a,{items:f.productsInfo.items}):null,(h=f==null?void 0:f.plugins)!=null&&h.items.length?s.jsx(c,{items:f.plugins.items}):null]}),s.jsx(l,{className:"mt-auto"})]})]})};var b0=Object.freeze({__proto__:null,LicenseSection:Ff,Panel:({components:t,...n})=>s.jsx(Vf,{components:t,children:s.jsx(y0,{...n})}),PluginsSection:Hf,ProductsInfoSection:Bf,Trademark:Wf,UserSection:zf});const w0=s0,er=t=>"items"in t,wt={APPLICATION:"application",WORKSPACE:"workspace",LAYOUT:"layout",ACTION_BUTTON:"action-button"},$a=t=>typeof t=="string"?t:t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):JSON.stringify(t),Gf=()=>typeof window.glue42gd<"u"||typeof window.glue42alert<"u"||typeof window.glue42dialog<"u"||typeof window.iodesktop<"u",ii={OPEN_IN_NEW_WINDOW:"openInNewWindow",OPEN_IN_NEW_WORKSPACE:"openInNewWorkspace"},Yf=Gf()?[]:[{name:ii.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out"},{name:ii.OPEN_IN_NEW_WORKSPACE,displayName:"Open in a new Workspace",icon:"pop-out"}],ai={OPEN_IN_NEW_WINDOW:"openInNewWindow",DELETE:"delete"},Zf=[{name:ai.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out",separatorAfter:!0},{name:ai.DELETE,displayName:"Delete",icon:"trash-can"}],cr={ASCENDING:"ascending",DESCENDING:"descending",DISABLED:"disabled"},Pi=new Intl.Collator(void 0,{sensitivity:"base"}),Kf=(t,n)=>Pi.compare(t.title,n.title),qf=(t,n)=>Pi.compare(n.title,t.title),Es=t=>{const{items:n,sortOrder:e,ascendingCompare:o,descendingCompare:r}=t;if(e===cr.DISABLED)return n;const i=e===cr.ASCENDING?o:r;return[...n].sort(i)},xo={FAVORITES:"favorites-section",WORKSPACES:"workspaces-section",APPLICATIONS:"applications-section"},Ua=(t,n,e,o)=>{const{isFolderCollapsible:r}=o,i="/",[a,...c]=e.split(i),l=t.findIndex(p=>er(p)&&p.title===a),u=l!==-1?t[l]:null;return u?[...t.slice(0,l),{...u,items:c.length>0?Ua(u.items,n,c.join(i),o):[...u.items,n]},...t.slice(l+1)]:[...t,{id:a,title:a,items:c.length>0?Ua([],n,c.join(i),o):[n],isCollapsible:r}]},si=t=>{const{title:n,userProperties:e}=t,{folder:o}=e;return o?`${o}/${n}`:n},x0=(t,n)=>Pi.compare(si(t),si(n)),C0=(t,n)=>Pi.compare(si(n),si(t)),k0=(t,n,e)=>{const{isSectionCollapsible:o,sortOrder:r=cr.ASCENDING}=e,a=Es({items:t,sortOrder:r,ascendingCompare:x0,descendingCompare:C0}).reduce((c,l)=>{var f;const u={id:l.id,title:l.title,description:l.caption,type:wt.APPLICATION,icon:"application",iconSrc:l.icon,openInstances:(f=n[l.name])==null?void 0:f.length,contextMenuActions:Yf},p=l.userProperties.folder;return p?Ua(c,u,p,e):[...c,u]},[]);return{id:xo.APPLICATIONS,title:"Apps",items:a,isCollapsible:o}};var S0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ti(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Va={exports:{}},Dr={exports:{}},We={};/** @license React v16.13.1
12
+ `}}function _(k,C){C===void 0&&(C=!0);var j=C?k:k-e.currentMonth;j<0&&e._hidePrevMonthArrow===!0||j>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=j,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,A("onYearChange"),O()),E(),A("onMonthChange"),_e())}function I(k){return e.calendarContainer.contains(k)}function he(k){if(e.isOpen&&!e.config.inline){var C=Lt(k),j=I(C),N=!(C===e.input||C===e.altInput||e.element.contains(C)||k.path&&k.path.indexOf&&(~k.path.indexOf(e.input)||~k.path.indexOf(e.altInput)))&&!j&&!I(k.relatedTarget),F=!e.config.ignoredFocusElements.some(function(te){return te.contains(C)});N&&F&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&a(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function ye(k){if(!(!k||e.config.minDate&&k<e.config.minDate.getFullYear()||e.config.maxDate&&k>e.config.maxDate.getFullYear())){var C=k,j=e.currentYear!==C;e.currentYear=C||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),j&&(e.redraw(),A("onYearChange"),O())}}function ne(k,C){var j;C===void 0&&(C=!0);var N=e.parseDate(k,void 0,C);if(e.config.minDate&&N&&Rt(N,e.config.minDate,C!==void 0?C:!e.minDateHasTime)<0||e.config.maxDate&&N&&Rt(N,e.config.maxDate,C!==void 0?C:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(N===void 0)return!1;for(var F=!!e.config.enable,te=(j=e.config.enable)!==null&&j!==void 0?j:e.config.disable,K=0,z=void 0;K<te.length;K++){if(typeof(z=te[K])=="function"&&z(N)||z instanceof Date&&N!==void 0&&z.getTime()===N.getTime())return F;if(typeof z=="string"){var H=e.parseDate(z,void 0,!0);return H&&H.getTime()===N.getTime()?F:!F}if(typeof z=="object"&&N!==void 0&&z.from&&z.to&&N.getTime()>=z.from.getTime()&&N.getTime()<=z.to.getTime())return F}return!F}function ge(k){return e.daysContainer!==void 0&&k.className.indexOf("hidden")===-1&&k.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(k)}function de(k){var C=k.target===e._input,j=e._input.value.trimEnd()!==Ie();!C||!j||k.relatedTarget&&I(k.relatedTarget)||e.setDate(e._input.value,!0,k.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function Oe(k){var C=Lt(k),j=e.config.wrap?t.contains(C):C===e._input,N=e.config.allowInput,F=e.isOpen&&(!N||!j),te=e.config.inline&&j&&!N;if(k.keyCode===13&&j){if(N)return e.setDate(e._input.value,!0,C===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),C.blur();e.open()}else if(I(C)||F||te){var K=!!e.timeContainer&&e.timeContainer.contains(C);switch(k.keyCode){case 13:K?(k.preventDefault(),a(),P()):R(k);break;case 27:k.preventDefault(),P();break;case 8:case 46:j&&!e.config.allowInput&&(k.preventDefault(),e.clear());break;case 37:case 39:if(K||j)e.hourElement&&e.hourElement.focus();else{k.preventDefault();var z=o();if(e.daysContainer!==void 0&&(N===!1||z&&ge(z))){var H=k.keyCode===39?1:-1;k.ctrlKey?(k.stopPropagation(),_(H),w(S(1),0)):w(void 0,H)}}break;case 38:case 40:k.preventDefault();var Y=k.keyCode===40?1:-1;e.daysContainer&&C.$i!==void 0||C===e.input||C===e.altInput?k.ctrlKey?(k.stopPropagation(),ye(e.currentYear-Y),w(S(1),0)):K||w(void 0,7*Y):C===e.currentYearElement?ye(e.currentYear-Y):e.config.enableTime&&(!K&&e.hourElement&&e.hourElement.focus(),a(k),e._debouncedChange());break;case 9:if(K){var ce=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Q){return Q}),ie=ce.indexOf(C);if(ie!==-1){var oe=ce[ie+(k.shiftKey?-1:1)];k.preventDefault(),(oe||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(C)&&k.shiftKey&&(k.preventDefault(),e._input.focus())}}if(e.amPM!==void 0&&C===e.amPM)switch(k.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],c(),Pe();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],c(),Pe()}(j||I(C))&&A("onKeyDown",k)}function se(k,C){if(C===void 0&&(C="flatpickr-day"),e.selectedDates.length===1&&(!k||k.classList.contains(C)&&!k.classList.contains("flatpickr-disabled"))){for(var j=k?k.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),N=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),F=Math.min(j,e.selectedDates[0].getTime()),te=Math.max(j,e.selectedDates[0].getTime()),K=!1,z=0,H=0,Y=F;Y<te;Y+=Yg.DAY)ne(new Date(Y),!0)||(K=K||Y>F&&Y<te,Y<N&&(!z||Y>z)?z=Y:Y>N&&(!H||Y<H)&&(H=Y));Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+C)).forEach(function(ce){var ie=ce.dateObj.getTime(),oe=z>0&&ie<z||H>0&&ie>H;if(oe)return ce.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(Q){ce.classList.remove(Q)});K&&!oe||(["startRange","inRange","endRange","notAllowed"].forEach(function(Q){ce.classList.remove(Q)}),k!==void 0&&(k.classList.add(j<=e.selectedDates[0].getTime()?"startRange":"endRange"),N<j&&ie===N?ce.classList.add("startRange"):N>j&&ie===N&&ce.classList.add("endRange"),ie>=z&&(H===0||ie<=H)&&Vg(ie,N,j)&&ce.classList.add("inRange")))})}}function W(){!e.isOpen||e.config.static||e.config.inline||V()}function X(k){return function(C){var j=e.config["_"+k+"Date"]=e.parseDate(C,e.config.dateFormat),N=e.config["_"+(k==="min"?"max":"min")+"Date"];j!==void 0&&(e[k==="min"?"minDateHasTime":"maxDateHasTime"]=j.getHours()>0||j.getMinutes()>0||j.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(F){return ne(F)}),e.selectedDates.length||k!=="min"||l(j),Pe()),e.daysContainer&&(T(),j!==void 0?e.currentYearElement[k]=j.getFullYear().toString():e.currentYearElement.removeAttribute(k),e.currentYearElement.disabled=!!N&&j!==void 0&&N.getFullYear()===j.getFullYear())}}function fe(){return e.config.wrap?t.querySelector("[data-input]"):t}function ue(){typeof e.config.locale!="object"&&nt.l10ns[e.config.locale]===void 0&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=Ct(Ct({},nt.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?nt.l10ns[e.config.locale]:void 0),zn.D="("+e.l10n.weekdays.shorthand.join("|")+")",zn.l="("+e.l10n.weekdays.longhand.join("|")+")",zn.M="("+e.l10n.months.shorthand.join("|")+")",zn.F="("+e.l10n.months.longhand.join("|")+")",zn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")",Ct(Ct({},n),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr===void 0&&nt.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Ef(e),e.parseDate=$a({config:e.config,l10n:e.l10n})}function V(k){if(typeof e.config.position!="function"){if(e.calendarContainer!==void 0){A("onPreCalendarPosition");var C=k||e._positionElement,j=Array.prototype.reduce.call(e.calendarContainer.children,function(Te,Ne){return Te+Ne.offsetHeight},0),N=e.calendarContainer.offsetWidth,F=e.config.position.split(" "),te=F[0],K=F.length>1?F[1]:null,z=C.getBoundingClientRect(),H=window.innerHeight-z.bottom,Y=te==="above"||te!=="below"&&H<j&&z.top>j,ce=window.pageYOffset+z.top+(Y?-j-2:C.offsetHeight+2);if(Ot(e.calendarContainer,"arrowTop",!Y),Ot(e.calendarContainer,"arrowBottom",Y),!e.config.inline){var ie=window.pageXOffset+z.left,oe=!1,Q=!1;K==="center"?(ie-=(N-z.width)/2,oe=!0):K==="right"&&(ie-=N-z.width,Q=!0),Ot(e.calendarContainer,"arrowLeft",!oe&&!Q),Ot(e.calendarContainer,"arrowCenter",oe),Ot(e.calendarContainer,"arrowRight",Q);var ve=window.document.body.offsetWidth-(window.pageXOffset+z.right),Ae=ie+N>window.document.body.offsetWidth,Ve=ve+N>window.document.body.offsetWidth;if(Ot(e.calendarContainer,"rightMost",Ae),!e.config.static)if(e.calendarContainer.style.top=ce+"px",Ae)if(Ve){var Ee=function(){for(var Te=null,Ne=0;Ne<document.styleSheets.length;Ne++){var qe=document.styleSheets[Ne];if(qe.cssRules){try{qe.cssRules}catch{continue}Te=qe;break}}return Te??(Kt=document.createElement("style"),document.head.appendChild(Kt),Kt.sheet);var Kt}();if(Ee===void 0)return;var Se=window.document.body.offsetWidth,Ce=Math.max(0,Se/2-N/2),le=Ee.cssRules.length,be="{left:"+z.left+"px;right:auto;}";Ot(e.calendarContainer,"rightMost",!1),Ot(e.calendarContainer,"centerMost",!0),Ee.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+be,le),e.calendarContainer.style.left=Ce+"px",e.calendarContainer.style.right="auto"}else e.calendarContainer.style.left="auto",e.calendarContainer.style.right=ve+"px";else e.calendarContainer.style.left=ie+"px",e.calendarContainer.style.right="auto"}}}else e.config.position(e,k)}function T(){e.config.noCalendar||e.isMobile||(O(),_e(),E())}function P(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function R(k){k.preventDefault(),k.stopPropagation();var C=Sf(Lt(k),function(Y){return Y.classList&&Y.classList.contains("flatpickr-day")&&!Y.classList.contains("flatpickr-disabled")&&!Y.classList.contains("notAllowed")});if(C!==void 0){var j=C,N=e.latestSelectedDateObj=new Date(j.dateObj.getTime()),F=(N.getMonth()<e.currentMonth||N.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=j,e.config.mode==="single")e.selectedDates=[N];else if(e.config.mode==="multiple"){var te=xe(N);te?e.selectedDates.splice(parseInt(te),1):e.selectedDates.push(N)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=N,e.selectedDates.push(N),Rt(N,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(Y,ce){return Y.getTime()-ce.getTime()}));if(c(),F){var K=e.currentYear!==N.getFullYear();e.currentYear=N.getFullYear(),e.currentMonth=N.getMonth(),K&&(A("onYearChange"),O()),A("onMonthChange")}if(_e(),E(),Pe(),F||e.config.mode==="range"||e.config.showMonths!==1?e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus():b(j),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var z=e.config.mode==="single"&&!e.config.enableTime,H=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(z||H)&&P()}d()}}e.parseDate=$a({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=p,e._setHoursFromDate=l,e._positionCalendar=V,e.changeMonth=_,e.changeYear=ye,e.clear=function(k,C){if(k===void 0&&(k=!0),C===void 0&&(C=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,C===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var j=sa(e.config);u(j.hours,j.minutes,j.seconds)}e.redraw(),k&&A("onChange")},e.close=function(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),A("onClose")},e.onMouseOver=se,e._createElement=Be,e.createDay=y,e.destroy=function(){e.config!==void 0&&A("onDestroy");for(var k=e._handlers.length;k--;)e._handlers[k].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var C=e.calendarContainer.parentNode;if(C.lastChild&&C.removeChild(C.lastChild),C.parentNode){for(;C.firstChild;)C.parentNode.insertBefore(C.firstChild,C);C.parentNode.removeChild(C)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(j){try{delete e[j]}catch{}})},e.isEnabled=ne,e.jumpToDate=h,e.updateValue=Pe,e.open=function(k,C){if(C===void 0&&(C=e._positionElement),e.isMobile===!0){if(k){k.preventDefault();var j=Lt(k);j&&j.blur()}return e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),void A("onOpen")}if(!(e._input.disabled||e.config.inline)){var N=e.isOpen;e.isOpen=!0,N||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),A("onOpen"),V(C)),e.config.enableTime===!0&&e.config.noCalendar===!0&&(e.config.allowInput!==!1||k!==void 0&&e.timeContainer.contains(k.relatedTarget)||setTimeout(function(){return e.hourElement.select()},50))}},e.redraw=T,e.set=function(k,C){if(k!==null&&typeof k=="object")for(var j in Object.assign(e.config,k),k)G[j]!==void 0&&G[j].forEach(function(N){return N()});else e.config[k]=C,G[k]!==void 0?G[k].forEach(function(N){return N()}):oa.indexOf(k)>-1&&(e.config[k]=ra(C));e.redraw(),Pe(!0)},e.setDate=function(k,C,j){if(C===void 0&&(C=!1),j===void 0&&(j=e.config.dateFormat),k!==0&&!k||k instanceof Array&&k.length===0)return e.clear(C);U(k,j),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),h(void 0,C),l(),e.selectedDates.length===0&&e.clear(!1),Pe(C),C&&A("onChange")},e.toggle=function(k){if(e.isOpen===!0)return e.close();e.open(k)};var G={locale:[ue,Z],showMonths:[B,i,$],minDate:[h],maxDate:[h],positionElement:[ee],clickOpens:[function(){e.config.clickOpens===!0?(p(e._input,"focus",e.open),p(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function U(k,C){var j=[];if(k instanceof Array)j=k.map(function(N){return e.parseDate(N,C)});else if(k instanceof Date||typeof k=="number")j=[e.parseDate(k,C)];else if(typeof k=="string")switch(e.config.mode){case"single":case"time":j=[e.parseDate(k,C)];break;case"multiple":j=k.split(e.config.conjunction).map(function(N){return e.parseDate(N,C)});break;case"range":j=k.split(e.l10n.rangeSeparator).map(function(N){return e.parseDate(N,C)})}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(k)));e.selectedDates=e.config.allowInvalidPreload?j:j.filter(function(N){return N instanceof Date&&ne(N,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(N,F){return N.getTime()-F.getTime()})}function re(k){return k.slice().map(function(C){return typeof C=="string"||typeof C=="number"||C instanceof Date?e.parseDate(C,void 0,!0):C&&typeof C=="object"&&C.from&&C.to?{from:e.parseDate(C.from,void 0),to:e.parseDate(C.to,void 0)}:C}).filter(function(C){return C})}function ee(){e._positionElement=e.config.positionElement||e._input}function A(k,C){if(e.config!==void 0){var j=e.config[k];if(j!==void 0&&j.length>0)for(var N=0;j[N]&&N<j.length;N++)j[N](e.selectedDates,e.input.value,e,C);k==="onChange"&&(e.input.dispatchEvent(ke("change")),e.input.dispatchEvent(ke("input")))}}function ke(k){var C=document.createEvent("Event");return C.initEvent(k,!0,!0),C}function xe(k){for(var C=0;C<e.selectedDates.length;C++){var j=e.selectedDates[C];if(j instanceof Date&&Rt(j,k)===0)return""+C}return!1}function _e(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(k,C){var j=new Date(e.currentYear,e.currentMonth,1);j.setMonth(e.currentMonth+C),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[C].textContent=ri(j.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=j.getMonth().toString(),k.value=j.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Ie(k){var C=k||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(j){return e.formatDate(j,C)}).filter(function(j,N,F){return e.config.mode!=="range"||e.config.enableTime||F.indexOf(j)===N}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function Pe(k){k===void 0&&(k=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Ie(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=Ie(e.config.altFormat)),k!==!1&&A("onValueUpdate")}function me(k){var C=Lt(k),j=e.prevMonthNav.contains(C),N=e.nextMonthNav.contains(C);j||N?_(j?-1:1):e.yearElements.indexOf(C)>=0?C.select():C.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):C.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}return function(){e.element=e.input=t,e.isOpen=!1,function(){var C=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],j=Ct(Ct({},JSON.parse(JSON.stringify(t.dataset||{}))),n),N={};e.config.parseDate=j.parseDate,e.config.formatDate=j.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(ie){e.config._enable=re(ie)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(ie){e.config._disable=re(ie)}});var F=j.mode==="time";if(!j.dateFormat&&(j.enableTime||F)){var te=nt.defaultConfig.dateFormat||bo.dateFormat;N.dateFormat=j.noCalendar||F?"H:i"+(j.enableSeconds?":S":""):te+" H:i"+(j.enableSeconds?":S":"")}if(j.altInput&&(j.enableTime||F)&&!j.altFormat){var K=nt.defaultConfig.altFormat||bo.altFormat;N.altFormat=j.noCalendar||F?"h:i"+(j.enableSeconds?":S K":" K"):K+" h:i"+(j.enableSeconds?":S":"")+" K"}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:X("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:X("max")});var z=function(ie){return function(oe){e.config[ie==="min"?"_minTime":"_maxTime"]=e.parseDate(oe,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:z("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:z("max")}),j.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,N,j);for(var H=0;H<C.length;H++)e.config[C[H]]=e.config[C[H]]===!0||e.config[C[H]]==="true";for(oa.filter(function(ie){return e.config[ie]!==void 0}).forEach(function(ie){e.config[ie]=ra(e.config[ie]||[]).map(r)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),H=0;H<e.config.plugins.length;H++){var Y=e.config.plugins[H](e)||{};for(var ce in Y)oa.indexOf(ce)>-1?e.config[ce]=ra(Y[ce]).map(r).concat(e.config[ce]):j[ce]===void 0&&(e.config[ce]=Y[ce])}j.altInputClass||(e.config.altInputClass=fe().className+" "+e.config.altInputClass),A("onParseConfig")}(),ue(),function(){if(e.input=fe(),!e.input)return void e.config.errorHandler(new Error("Invalid input element specified"));e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=Be(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),ee()}(),function(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var C=e.config.defaultDate||(e.input.nodeName!=="INPUT"&&e.input.nodeName!=="TEXTAREA"||!e.input.placeholder||e.input.value!==e.input.placeholder?e.input.value:null);C&&U(C,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}(),e.utils={getDaysInMonth:function(C,j){return C===void 0&&(C=e.currentMonth),j===void 0&&(j=e.currentYear),C===1&&(j%4==0&&j%100!=0||j%400==0)?29:e.l10n.daysInMonth[C]}},e.isMobile||function(){var C=window.document.createDocumentFragment();if(e.calendarContainer=Be("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(C.appendChild((e.monthNav=Be("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=Be("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=Be("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,B(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(z){e.__hidePrevMonthArrow!==z&&(Ot(e.prevMonthNav,"flatpickr-disabled",z),e.__hidePrevMonthArrow=z)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(z){e.__hideNextMonthArrow!==z&&(Ot(e.nextMonthNav,"flatpickr-disabled",z),e.__hideNextMonthArrow=z)}}),e.currentYearElement=e.yearElements[0],_e(),e.monthNav)),e.innerContainer=Be("div","flatpickr-innerContainer"),e.config.weekNumbers){var j=function(){e.calendarContainer.classList.add("hasWeeks");var z=Be("div","flatpickr-weekwrapper");z.appendChild(Be("span","flatpickr-weekday",e.l10n.weekAbbreviation));var H=Be("div","flatpickr-weeks");return z.appendChild(H),{weekWrapper:z,weekNumbers:H}}(),N=j.weekWrapper,F=j.weekNumbers;e.innerContainer.appendChild(N),e.weekNumbers=F,e.weekWrapper=N}e.rContainer=Be("div","flatpickr-rContainer"),e.rContainer.appendChild($()),e.daysContainer||(e.daysContainer=Be("div","flatpickr-days"),e.daysContainer.tabIndex=-1),E(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),C.appendChild(e.innerContainer)}e.config.enableTime&&C.appendChild(function(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var z=sa(e.config);e.timeContainer=Be("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var H=Be("span","flatpickr-time-separator",":"),Y=Pr("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=Y.getElementsByTagName("input")[0];var ce=Pr("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=ce.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?z.hours:function(oe){switch(oe%24){case 0:case 12:return 12;default:return oe%12}}(z.hours)),e.minuteElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():z.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(Y),e.timeContainer.appendChild(H),e.timeContainer.appendChild(ce),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var ie=Pr("flatpickr-second");e.secondElement=ie.getElementsByTagName("input")[0],e.secondElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():z.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(Be("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(ie)}return e.config.time_24hr||(e.amPM=Be("span","flatpickr-am-pm",e.l10n.amPM[Ut((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}()),Ot(e.calendarContainer,"rangeMode",e.config.mode==="range"),Ot(e.calendarContainer,"animate",e.config.animate===!0),Ot(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(C);var te=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!te&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var K=Be("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(K,e.element),K.appendChild(e.element),e.altInput&&K.appendChild(e.altInput),K.appendChild(e.calendarContainer)}e.config.static||e.config.inline||(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}(),function(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(N){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+N+"]"),function(F){return p(F,"click",e[N])})}),e.isMobile)return void function(){var N=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=Be("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=N,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=N==="datetime-local"?"Y-m-d\\TH:i:S":N==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}p(e.mobileInput,"change",function(F){e.setDate(Lt(F).value,!1,e.mobileFormatStr),A("onChange"),A("onClose")})}();var C=Vc(W,50);if(e._debouncedChange=Vc(d,Zg),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&p(e.daysContainer,"mouseover",function(N){e.config.mode==="range"&&se(Lt(N))}),p(e._input,"keydown",Oe),e.calendarContainer!==void 0&&p(e.calendarContainer,"keydown",Oe),e.config.inline||e.config.static||p(window,"resize",C),window.ontouchstart!==void 0?p(window.document,"touchstart",he):p(window.document,"mousedown",he),p(window.document,"focus",he,{capture:!0}),e.config.clickOpens===!0&&(p(e._input,"focus",e.open),p(e._input,"click",e.open)),e.daysContainer!==void 0&&(p(e.monthNav,"click",me),p(e.monthNav,["keyup","increment"],f),p(e.daysContainer,"click",R)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var j=function(N){return Lt(N).select()};p(e.timeContainer,["increment"],a),p(e.timeContainer,"blur",a,{capture:!0}),p(e.timeContainer,"click",m),p([e.hourElement,e.minuteElement],["focus","click"],j),e.secondElement!==void 0&&p(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&p(e.amPM,"click",function(N){a(N)})}e.config.allowInput&&p(e._input,"blur",de)}(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&l(e.config.noCalendar?e.latestSelectedDateObj:void 0),Pe(!1)),i();var k=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&k&&V(),A("onReady")}(),e}function wo(t,n){for(var e=Array.prototype.slice.call(t).filter(function(a){return a instanceof HTMLElement}),o=[],r=0;r<e.length;r++){var i=e[r];try{if(i.getAttribute("data-fp-omit")!==null)continue;i._flatpickr!==void 0&&(i._flatpickr.destroy(),i._flatpickr=void 0),i._flatpickr=Kg(i,n||{}),o.push(i._flatpickr)}catch(a){console.error(a)}}return o.length===1?o[0]:o}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return wo(this,t)},HTMLElement.prototype.flatpickr=function(t){return wo([this],t)});var nt=function(t,n){return typeof t=="string"?wo(window.document.querySelectorAll(t),n):t instanceof Node?wo([t],n):wo(t,n)};nt.defaultConfig={},nt.l10ns={en:Ct({},sr),default:Ct({},sr)},nt.localize=function(t){nt.l10ns.default=Ct(Ct({},nt.l10ns.default),t)},nt.setDefaults=function(t){nt.defaultConfig=Ct(Ct({},nt.defaultConfig),t)},nt.parseDate=$a({}),nt.formatDate=Ef({}),nt.compareDates=Rt,typeof jQuery<"u"&&jQuery.fn!==void 0&&(jQuery.fn.flatpickr=function(t){return wo(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t=="string"?parseInt(t,10):t))},typeof window<"u"&&(window.flatpickr=nt);const qg=["onCreate","onDestroy"],ca=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],Jg=t=>{const n=g.useMemo(()=>({...t}),[t]),{defaultValue:e,options:o={},value:r,children:i,render:a}=n,c=g.useMemo(()=>((d,h)=>(ca.forEach(m=>{const v=h[m],y=d[m];if(v){y&&!Array.isArray(y)?d[m]=[d[m]]:d[m]||(d[m]=[]);const b=Array.isArray(v)?v:[v];d[m].length===0?d[m]=b:d[m].push(...b)}}),ca.forEach(m=>{delete h[m]}),qg.forEach(m=>{delete h[m]}),d))(o,n),[o,n]),l=g.useRef(null),u=g.useRef(void 0);g.useImperativeHandle(t.ref,()=>({get flatpickr(){return u.current}}),[]),g.useEffect(()=>{var d;if(c.onClose=c.onClose||(()=>{var m;(m=l.current)!=null&&m.blur&&l.current.blur()}),u.current=(((h=nt)==null?void 0:h.default)||nt)(l.current,c),u.current&&r!==void 0&&u.current.setDate(r,!1),t.onCreate&&t.onCreate(u.current),u.current){const m=Object.getOwnPropertyNames(c);for(let v=m.length-1;v>=0;v--){const y=m[v];let b=c[y];(b==null?void 0:b.toString())!==((d=u.current.config[y])==null?void 0:d.toString())&&(ca.includes(y)&&!Array.isArray(b)&&(b=[b]),u.current.set(y,b))}r!==void 0&&r!==u.current.input.value&&u.current.setDate(r,!1)}var h;return()=>{t.onDestroy&&t.onDestroy(u.current),u.current&&u.current.destroy(),u.current=void 0}},[c,o,n,r,t]);const f=g.useCallback(d=>{l.current=d},[]);if(a)return a({...n,defaultValue:e,value:r},f);const p=g.useCallback(d=>{var h,m;t&&t.onChange&&(Array.isArray(t==null?void 0:t.onChange)?(h=t==null?void 0:t.onChange)==null||h.forEach(()=>[new Date(d.target.value)],(r==null?void 0:r.toString())||""):typeof t.onChange=="function"&&((m=t==null?void 0:t.onChange)==null||m.call(t,[new Date(d.target.value)],(r==null?void 0:r.toString())||"",u.current)))},[t,r]);return o.wrap?s.jsx("div",{className:"flatpickr",ref:f,children:i}):s.jsx("input",{onChange:p,...n,value:r==null?void 0:r.toString(),defaultValue:e,ref:f})},Yc="T42.GD.Execute",jf=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Of=(t,n)=>t in n;function Xg({time:t,frequency:n,day:e}){const o=new Date(`01/01/2000 ${t}`),r=o.getMinutes(),i=o.getHours();let a="*";return n==="weekly"&&e&&(a=function(c){const l={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!Of(c,l))throw new Error(`Invalid day: ${c}`);return l[c]}(e).toString()),`${r} ${i} * * ${a}`}function Qg(t){const n=g.useContext(De.IOConnectContext),{value:e,update:o}=Ht({prefKey:Tr(t)}),{value:r,update:i}=Ht({prefKey:Tr(t,"Time")}),{value:a,update:c}=Ht({prefKey:Tr(t,"Frequency")}),{value:l,update:u}=Ht({prefKey:Tr(t,"Day")}),f=g.useCallback(async()=>{try{await n.interop.invoke(Yc,{command:`cancel-${t}`})}catch(d){console.error(d)}},[n,t]),p=g.useCallback(async()=>{try{const d=Xg({time:r??"12:00 AM",frequency:a??"daily",day:a==="weekly"?l:"*"});await n.interop.invoke(Yc,{command:`schedule-${t}`,args:{cronTime:d,discardUnsavedLayoutChanges:!1}})}catch(d){console.error(`Failed to update cron job for ${t}:`,d)}},[n,t,r,a,l]);return g.useEffect(()=>{n&&e&&p()},[n,e,p]),{enabled:e??!1,time:r??"12:00 AM",frequency:a??"daily",day:l??"Monday",setEnabled:async d=>{d||await f();try{await o(d)}catch(h){console.error("Failed to update enabled state:",h)}},setTime:async d=>{try{await i(d)}catch(h){console.error("Failed to update time:",h)}},setFrequency:async d=>{try{await c(d),d==="daily"&&await u(void 0)}catch(h){console.error("Failed to update frequency:",h)}},setDay:async d=>{var h;if(h=d,jf.includes(h))try{await u(d)}catch(m){console.error("Failed to update day:",m)}else console.error("Invalid day provided")}}}function Tr(t,n){const e=t==="restart"?"_system_scheduleRestart":"_system_scheduleShutdown";return n?`${e}${n}`:e}function Nf({className:t,variant:n,...e}){const o=q("io-block-list-gap",n,t),{enabled:r,time:i,frequency:a,day:c,setEnabled:l,setTime:u,setFrequency:f,setDay:p}=Qg(n);return s.jsxs(Ke,{className:o,...e,children:[s.jsx(ft,{label:`Schedule ${n}`,align:"right",onChange:d=>l(d.target.checked),checked:r}),s.jsxs("div",{className:"scheduler-controls",children:[s.jsxs("div",{className:"io-control-input io-control-leading-icon direction-up",children:[s.jsx(et,{variant:"clock"}),s.jsx(Jg,{className:"io-input",options:{enableTime:!0,noCalendar:!0,dateFormat:"h:i K",defaultDate:i,clickOpens:!0},value:i,onClose:async([d])=>{const h=d.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0});await u(h)}})]}),s.jsxs(Jt,{text:a.charAt(0).toUpperCase()+a.slice(1),icon:"chevron-down",iconRight:!0,children:[s.jsx(Jt.Item,{onClick:()=>f("daily"),children:"Daily"}),s.jsx(Jt.Item,{onClick:()=>f("weekly"),children:"Weekly"})]}),a==="weekly"&&s.jsx(Jt,{text:c,icon:"chevron-down",iconRight:!0,children:jf.map(d=>s.jsx(Jt.Item,{onClick:()=>p(d),children:d},d))})]})]})}function e0({className:t,...n}){return s.jsx(Nf,{...n,className:t,variant:"restart"})}function t0({className:t,...n}){return s.jsx(Nf,{...n,className:t,variant:"shutdown"})}const If={Body:Ig,General:Ag,Theme:Cs,PinnedPosition:Tg,AllowDocking:Dg,MinimizeToTray:Mg,AutoClose:_g,ShowTutorialOnStartup:Lg,Layouts:Rg,LayoutsRestoreLastSaved:Fg,LayoutsSaveCurrentOnExit:Bg,LayoutsShowUnsavedChangesPrompt:ks,LayoutsShowDeletePrompt:Ss,Downloads:Hg,DownloadsAskForEachDownload:Wg,DownloadsLocation:zg,System:$g,SystemRestartSection:e0,SystemShutdownSection:t0},Af=g.createContext(If),n0=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...If,...n}),[n]);return s.jsx(Af.Provider,{value:e,children:t})});n0.displayName="PreferencesPanelComponentsStoreProvider";const mr=()=>g.useContext(Af),o0=({className:t,onClose:n,title:e="Platform Preferences",children:o,...r})=>s.jsxs(Ze,{className:q("io-preferences-panel",t),...r,children:[s.jsxs(Ze.Header,{children:[s.jsx(Ze.Header.Title,{size:"large",text:e,tag:"h1"}),s.jsx(Ze.Header.ButtonGroup,{children:s.jsx(Ze.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),o]}),Pf=t=>{const{General:n,Layouts:e}=Ai();return s.jsxs(So,{...t,children:[s.jsx(n,{}),s.jsx(e,{})]})},Tf=({className:t,title:n="General",...e})=>{const{Theme:o}=Ai();return s.jsx(Ke,{className:q("io-block io-block-list-gap",t),title:n,...e,children:s.jsx(o,{})})},Df=({className:t,title:n="Layouts",...e})=>{const{LayoutsShowDeletePrompt:o,LayoutsShowUnsavedChangesPrompt:r}=Ai();return s.jsxs(Ke,{className:q("io-block io-block-list-gap",t),title:n,...e,children:[s.jsx(r,{}),s.jsx(o,{})]})},Mf={Body:Pf,General:Tf,Theme:Cs,Layouts:Df,LayoutsShowUnsavedChangesPrompt:ks,LayoutsShowDeletePrompt:Ss},_f=g.createContext(Mf),Lf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Mf,...n}),[n]);return s.jsx(_f.Provider,{value:e,children:t})});Lf.displayName="PreferencesPanelComponentsStoreProvider";const Ai=()=>g.useContext(_f),r0=({onClose:t,title:n="Platform Preferences",...e})=>{const{Body:o}=Ai();return s.jsx(o0,{title:n,onClose:t,...e,children:s.jsx(o,{})})};var i0=Object.freeze({__proto__:null,General:Tf,Layouts:Df,LayoutsShowDeletePrompt:Ss,LayoutsShowUnsavedChangesPrompt:ks,Panel:({components:t,...n})=>s.jsx(Lf,{components:t,children:s.jsx(r0,{...n})}),PanelBody:Pf,Theme:Cs});const a0=({name:t,value:n})=>s.jsxs("div",{className:"io-profile-section-item",children:[s.jsx("div",{className:"io-profile-section-item-name",children:t}),s.jsx("div",{className:"io-profile-section-item-value",children:n})]}),Rf=({className:t,items:n,title:e})=>s.jsxs("div",{className:q("io-profile-section-body",t),children:[e&&s.jsx(nn,{className:"io-profile-section-title",text:e}),n.map(({name:o,value:r})=>s.jsx(a0,{name:o,value:r},o))]}),Es=({className:t,items:n,title:e})=>s.jsxs("section",{className:q("io-profile-section",t),children:[s.jsx(Rf,{items:n,title:e}),s.jsx(hr,{className:"mt-8"})]}),Ff=({title:t="License",...n})=>s.jsx(Es,{title:t,...n}),Bf=({title:t="Version",...n})=>s.jsx(Es,{title:t,...n}),Hf=({title:t="Plugins",...n})=>s.jsx(Es,{title:t,...n}),Wf=({className:t})=>{const n=ki()?"io.Connect Desktop":"io.Connect Browser";return s.jsxs("div",{className:q("io-trademark-container",t),children:[s.jsx("h4",{className:"io-trademark-title",children:n}),s.jsxs("p",{className:"io-trademark-text",children:[n,"® is a registered trademark of"," ",s.jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",new Date().getFullYear(),". All rights reserved."]})]})},zf=({avatarInitials:t=ki()?"CD":"CB",className:n,items:e,onLogout:o,title:r})=>s.jsxs("section",{className:q("io-profile-section",n),children:[s.jsxs("div",{className:"io-user-details-container",children:[s.jsx("div",{className:"io-user-avatar",children:t}),s.jsx(Rf,{className:"mt-12",items:e,title:r})]}),o&&s.jsx(Ge,{className:"io-log-out-button",onClick:o,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),s.jsx(hr,{className:"mt-8"})]}),$f={LicenseSection:Ff,ProductsInfoSection:Bf,PluginsSection:Hf,Trademark:Wf,UserSection:zf},Uf=g.createContext($f),Vf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...$f,...n}),[n]);return s.jsx(Uf.Provider,{value:e,children:t})});Vf.displayName="ProfilePanelComponentsStoreProvider";const s0=t=>{const n=new Date(t);return[{day:"numeric"},{month:"short"},{year:"numeric"}].map(e=>n.toLocaleDateString("en",e)).join(" ")},c0=t=>{if(!t)return{items:[]};const n=[...t.email?[{name:"Email",value:t.email}]:[],...t.type?[{name:"User Type",value:t.type}]:[],...t.role?[{name:"User Role",value:t.role}]:[],{name:"User ID",value:t.id}];if(t.firstName||t.lastName){const e=[t.firstName,t.lastName].filter(o=>!!o);return{avatarInitials:e.map(o=>o.charAt(0)).join(""),items:n,title:e.join(" ")}}return t.username?{avatarInitials:t.username.charAt(0),items:n,title:t.username}:t.email?{avatarInitials:t.email.charAt(0),items:n}:{items:n}},l0=t=>{const n=new Date(2023,5,6),e=t.expiration<n.getTime()?1e3:1;return{items:[{name:"Type",value:t.type},{name:"Expiration Date",value:s0(t.expiration*e)}]}},u0=t=>({items:t.map(n=>({name:n.name,value:n.version}))}),d0=t=>{var e;const n={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return{items:[{name:"io.Connect Browser platform",value:t.platform.apiVersion},{name:"io.Connect Browser client",value:t.client.apiVersion},...t.workspaces?[{name:"Workspaces API",value:t.workspaces.apiVersion}]:[],...(e=t.workspaces)!=null&&e.container&&Of(t.workspaces.container.type,n)?[{name:n[t.workspaces.container.type],value:t.workspaces.container.version}]:[],...t.home?[{name:"Home UI",value:t.home.version}]:[],...t.search?[{name:"Search API",value:t.search.apiVersion}]:[],...t.modals?[{name:"Modals API",value:t.modals.apiVersion}]:[]]}},f0=()=>{const t=window.glue42gd??window.iodesktop;if(!t)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:n,env:e}=t,o=[{name:"Environment",value:e.env},{name:"Region",value:e.region}];return n?{avatarInitials:n.charAt(0),items:o,title:n}:{items:o}},p0=t=>({items:Object.entries(t??{}).map(([e,o])=>({name:e,value:o}))}),h0=t=>({items:t.map(({product:e,version:o})=>({name:e,value:o}))}),m0=t=>ki()?(async n=>{const{licInfo:e,productInfo:o}=(await n.interop.invoke("T42.GD.GetInfo")).returned;return{user:f0(),license:p0(e),productsInfo:h0(o)}})(t):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const n=await window.iobrowser.system.getProfileData();return{user:c0(n.user),license:l0(n.license),plugins:u0(n.plugins),productsInfo:d0(n.productsInfo)}})(),g0=({className:t,onClose:n,onLogout:e,title:o="Profile",...r})=>{var h;const{LicenseSection:i,ProductsInfoSection:a,PluginsSection:c,Trademark:l,UserSection:u}=g.useContext(Uf),f=g.useContext(De.IOConnectContext),[p,d]=g.useState(null);return g.useEffect(()=>{f&&(async()=>{const m=await m0(f);d(m)})().catch(console.error)},[f]),s.jsxs(Ze,{className:q("io-profile-panel",t),...r,children:[s.jsxs(Ze.Header,{children:[s.jsx(Ze.Header.Title,{size:"large",text:o}),s.jsx(Ze.Header.ButtonGroup,{children:s.jsx(Ze.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),s.jsxs(Ze.Body,{children:[p!=null&&p.user.items.length||p!=null&&p.user.title?s.jsx(u,{avatarInitials:p.user.avatarInitials,items:p.user.items,onLogout:e,title:p.user.title}):null,s.jsxs("div",{className:"io-scrollable-profile-sections-container",children:[p!=null&&p.license.items.length?s.jsx(i,{items:p.license.items}):null,p!=null&&p.productsInfo.items.length?s.jsx(a,{items:p.productsInfo.items}):null,(h=p==null?void 0:p.plugins)!=null&&h.items.length?s.jsx(c,{items:p.plugins.items}):null]}),s.jsx(l,{className:"mt-auto"})]})]})};var v0=Object.freeze({__proto__:null,LicenseSection:Ff,Panel:({components:t,...n})=>s.jsx(Vf,{components:t,children:s.jsx(g0,{...n})}),PluginsSection:Hf,ProductsInfoSection:Bf,Trademark:Wf,UserSection:zf});const y0=i0,er=t=>"items"in t,wt={APPLICATION:"application",WORKSPACE:"workspace",LAYOUT:"layout",ACTION_BUTTON:"action-button"},Ua=t=>typeof t=="string"?t:t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):JSON.stringify(t),Gf=()=>typeof window.glue42gd<"u"||typeof window.glue42alert<"u"||typeof window.glue42dialog<"u"||typeof window.iodesktop<"u",ii={OPEN_IN_NEW_WINDOW:"openInNewWindow",OPEN_IN_NEW_WORKSPACE:"openInNewWorkspace"},Yf=Gf()?[]:[{name:ii.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out"},{name:ii.OPEN_IN_NEW_WORKSPACE,displayName:"Open in a new Workspace",icon:"pop-out"}],ai={OPEN_IN_NEW_WINDOW:"openInNewWindow",DELETE:"delete"},Zf=[{name:ai.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out",separatorAfter:!0},{name:ai.DELETE,displayName:"Delete",icon:"trash-can"}],cr={ASCENDING:"ascending",DESCENDING:"descending",DISABLED:"disabled"},Pi=new Intl.Collator(void 0,{sensitivity:"base"}),Kf=(t,n)=>Pi.compare(t.title,n.title),qf=(t,n)=>Pi.compare(n.title,t.title),js=t=>{const{items:n,sortOrder:e,ascendingCompare:o,descendingCompare:r}=t;if(e===cr.DISABLED)return n;const i=e===cr.ASCENDING?o:r;return[...n].sort(i)},xo={FAVORITES:"favorites-section",WORKSPACES:"workspaces-section",APPLICATIONS:"applications-section"},Va=(t,n,e,o)=>{const{isFolderCollapsible:r}=o,i="/",[a,...c]=e.split(i),l=t.findIndex(f=>er(f)&&f.title===a),u=l!==-1?t[l]:null;return u?[...t.slice(0,l),{...u,items:c.length>0?Va(u.items,n,c.join(i),o):[...u.items,n]},...t.slice(l+1)]:[...t,{id:a,title:a,items:c.length>0?Va([],n,c.join(i),o):[n],isCollapsible:r}]},si=t=>{const{title:n,userProperties:e}=t,{folder:o}=e;return o?`${o}/${n}`:n},b0=(t,n)=>Pi.compare(si(t),si(n)),w0=(t,n)=>Pi.compare(si(n),si(t)),x0=(t,n,e)=>{const{isSectionCollapsible:o,sortOrder:r=cr.ASCENDING}=e,a=js({items:t,sortOrder:r,ascendingCompare:b0,descendingCompare:w0}).reduce((c,l)=>{var p;const u={id:l.id,title:l.title,description:l.caption,type:wt.APPLICATION,icon:"application",iconSrc:l.icon,openInstances:(p=n[l.name])==null?void 0:p.length,contextMenuActions:Yf},f=l.userProperties.folder;return f?Va(c,u,f,e):[...c,u]},[]);return{id:xo.APPLICATIONS,title:"Apps",items:a,isCollapsible:o}};var C0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ti(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ga={exports:{}},Dr={exports:{}},We={};/** @license React v16.13.1
13
13
  * react-is.production.min.js
14
14
  *
15
15
  * Copyright (c) Facebook, Inc. and its affiliates.
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var Yc;function E0(){if(Yc)return We;Yc=1;var t=typeof Symbol=="function"&&Symbol.for,n=t?Symbol.for("react.element"):60103,e=t?Symbol.for("react.portal"):60106,o=t?Symbol.for("react.fragment"):60107,r=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,v=t?Symbol.for("react.block"):60121,y=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,S=t?Symbol.for("react.scope"):60119;function k(j){if(typeof j=="object"&&j!==null){var E=j.$$typeof;switch(E){case n:switch(j=j.type,j){case l:case u:case o:case i:case r:case f:return j;default:switch(j=j&&j.$$typeof,j){case c:case p:case m:case h:case a:return j;default:return E}}case e:return E}}}function C(j){return k(j)===u}return We.AsyncMode=l,We.ConcurrentMode=u,We.ContextConsumer=c,We.ContextProvider=a,We.Element=n,We.ForwardRef=p,We.Fragment=o,We.Lazy=m,We.Memo=h,We.Portal=e,We.Profiler=i,We.StrictMode=r,We.Suspense=f,We.isAsyncMode=function(j){return C(j)||k(j)===l},We.isConcurrentMode=C,We.isContextConsumer=function(j){return k(j)===c},We.isContextProvider=function(j){return k(j)===a},We.isElement=function(j){return typeof j=="object"&&j!==null&&j.$$typeof===n},We.isForwardRef=function(j){return k(j)===p},We.isFragment=function(j){return k(j)===o},We.isLazy=function(j){return k(j)===m},We.isMemo=function(j){return k(j)===h},We.isPortal=function(j){return k(j)===e},We.isProfiler=function(j){return k(j)===i},We.isStrictMode=function(j){return k(j)===r},We.isSuspense=function(j){return k(j)===f},We.isValidElementType=function(j){return typeof j=="string"||typeof j=="function"||j===o||j===u||j===i||j===r||j===f||j===d||typeof j=="object"&&j!==null&&(j.$$typeof===m||j.$$typeof===h||j.$$typeof===a||j.$$typeof===c||j.$$typeof===p||j.$$typeof===y||j.$$typeof===b||j.$$typeof===S||j.$$typeof===v)},We.typeOf=k,We}var ze={};/** @license React v16.13.1
19
+ */var Zc;function k0(){if(Zc)return We;Zc=1;var t=typeof Symbol=="function"&&Symbol.for,n=t?Symbol.for("react.element"):60103,e=t?Symbol.for("react.portal"):60106,o=t?Symbol.for("react.fragment"):60107,r=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,f=t?Symbol.for("react.forward_ref"):60112,p=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,v=t?Symbol.for("react.block"):60121,y=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,S=t?Symbol.for("react.scope"):60119;function w(E){if(typeof E=="object"&&E!==null){var O=E.$$typeof;switch(O){case n:switch(E=E.type,E){case l:case u:case o:case i:case r:case p:return E;default:switch(E=E&&E.$$typeof,E){case c:case f:case m:case h:case a:return E;default:return O}}case e:return O}}}function x(E){return w(E)===u}return We.AsyncMode=l,We.ConcurrentMode=u,We.ContextConsumer=c,We.ContextProvider=a,We.Element=n,We.ForwardRef=f,We.Fragment=o,We.Lazy=m,We.Memo=h,We.Portal=e,We.Profiler=i,We.StrictMode=r,We.Suspense=p,We.isAsyncMode=function(E){return x(E)||w(E)===l},We.isConcurrentMode=x,We.isContextConsumer=function(E){return w(E)===c},We.isContextProvider=function(E){return w(E)===a},We.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===n},We.isForwardRef=function(E){return w(E)===f},We.isFragment=function(E){return w(E)===o},We.isLazy=function(E){return w(E)===m},We.isMemo=function(E){return w(E)===h},We.isPortal=function(E){return w(E)===e},We.isProfiler=function(E){return w(E)===i},We.isStrictMode=function(E){return w(E)===r},We.isSuspense=function(E){return w(E)===p},We.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===o||E===u||E===i||E===r||E===p||E===d||typeof E=="object"&&E!==null&&(E.$$typeof===m||E.$$typeof===h||E.$$typeof===a||E.$$typeof===c||E.$$typeof===f||E.$$typeof===y||E.$$typeof===b||E.$$typeof===S||E.$$typeof===v)},We.typeOf=w,We}var ze={};/** @license React v16.13.1
20
20
  * react-is.development.js
21
21
  *
22
22
  * Copyright (c) Facebook, Inc. and its affiliates.
23
23
  *
24
24
  * This source code is licensed under the MIT license found in the
25
25
  * LICENSE file in the root directory of this source tree.
26
- */var Zc;function j0(){return Zc||(Zc=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,n=t?Symbol.for("react.element"):60103,e=t?Symbol.for("react.portal"):60106,o=t?Symbol.for("react.fragment"):60107,r=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,p=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,v=t?Symbol.for("react.block"):60121,y=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,S=t?Symbol.for("react.scope"):60119;function k(I){return typeof I=="string"||typeof I=="function"||I===o||I===u||I===i||I===r||I===f||I===d||typeof I=="object"&&I!==null&&(I.$$typeof===m||I.$$typeof===h||I.$$typeof===a||I.$$typeof===c||I.$$typeof===p||I.$$typeof===y||I.$$typeof===b||I.$$typeof===S||I.$$typeof===v)}function C(I){if(typeof I=="object"&&I!==null){var ke=I.$$typeof;switch(ke){case n:var xe=I.type;switch(xe){case l:case u:case o:case i:case r:case f:return xe;default:var _e=xe&&xe.$$typeof;switch(_e){case c:case p:case m:case h:case a:return _e;default:return ke}}case e:return ke}}}var j=l,E=u,P=c,H=a,z=n,q=p,B=o,A=m,fe=h,ve=e,Y=i,de=r,he=f,Oe=!1;function ce(I){return Oe||(Oe=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),W(I)||C(I)===l}function W(I){return C(I)===u}function Q(I){return C(I)===c}function me(I){return C(I)===a}function pe(I){return typeof I=="object"&&I!==null&&I.$$typeof===n}function V(I){return C(I)===p}function D(I){return C(I)===o}function T(I){return C(I)===m}function L(I){return C(I)===h}function G(I){return C(I)===e}function U(I){return C(I)===i}function re(I){return C(I)===r}function te(I){return C(I)===f}ze.AsyncMode=j,ze.ConcurrentMode=E,ze.ContextConsumer=P,ze.ContextProvider=H,ze.Element=z,ze.ForwardRef=q,ze.Fragment=B,ze.Lazy=A,ze.Memo=fe,ze.Portal=ve,ze.Profiler=Y,ze.StrictMode=de,ze.Suspense=he,ze.isAsyncMode=ce,ze.isConcurrentMode=W,ze.isContextConsumer=Q,ze.isContextProvider=me,ze.isElement=pe,ze.isForwardRef=V,ze.isFragment=D,ze.isLazy=T,ze.isMemo=L,ze.isPortal=G,ze.isProfiler=U,ze.isStrictMode=re,ze.isSuspense=te,ze.isValidElementType=k,ze.typeOf=C}()),ze}var Kc;function Jf(){return Kc||(Kc=1,process.env.NODE_ENV==="production"?Dr.exports=E0():Dr.exports=j0()),Dr.exports}/*
26
+ */var Kc;function S0(){return Kc||(Kc=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,n=t?Symbol.for("react.element"):60103,e=t?Symbol.for("react.portal"):60106,o=t?Symbol.for("react.fragment"):60107,r=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,c=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,f=t?Symbol.for("react.forward_ref"):60112,p=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,v=t?Symbol.for("react.block"):60121,y=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,S=t?Symbol.for("react.scope"):60119;function w(A){return typeof A=="string"||typeof A=="function"||A===o||A===u||A===i||A===r||A===p||A===d||typeof A=="object"&&A!==null&&(A.$$typeof===m||A.$$typeof===h||A.$$typeof===a||A.$$typeof===c||A.$$typeof===f||A.$$typeof===y||A.$$typeof===b||A.$$typeof===S||A.$$typeof===v)}function x(A){if(typeof A=="object"&&A!==null){var ke=A.$$typeof;switch(ke){case n:var xe=A.type;switch(xe){case l:case u:case o:case i:case r:case p:return xe;default:var _e=xe&&xe.$$typeof;switch(_e){case c:case f:case m:case h:case a:return _e;default:return ke}}case e:return ke}}}var E=l,O=u,M=c,B=a,$=n,Z=f,_=o,I=m,he=h,ye=e,ne=i,ge=r,de=p,Oe=!1;function se(A){return Oe||(Oe=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),W(A)||x(A)===l}function W(A){return x(A)===u}function X(A){return x(A)===c}function fe(A){return x(A)===a}function ue(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function V(A){return x(A)===f}function T(A){return x(A)===o}function P(A){return x(A)===m}function R(A){return x(A)===h}function G(A){return x(A)===e}function U(A){return x(A)===i}function re(A){return x(A)===r}function ee(A){return x(A)===p}ze.AsyncMode=E,ze.ConcurrentMode=O,ze.ContextConsumer=M,ze.ContextProvider=B,ze.Element=$,ze.ForwardRef=Z,ze.Fragment=_,ze.Lazy=I,ze.Memo=he,ze.Portal=ye,ze.Profiler=ne,ze.StrictMode=ge,ze.Suspense=de,ze.isAsyncMode=se,ze.isConcurrentMode=W,ze.isContextConsumer=X,ze.isContextProvider=fe,ze.isElement=ue,ze.isForwardRef=V,ze.isFragment=T,ze.isLazy=P,ze.isMemo=R,ze.isPortal=G,ze.isProfiler=U,ze.isStrictMode=re,ze.isSuspense=ee,ze.isValidElementType=w,ze.typeOf=x}()),ze}var qc;function Jf(){return qc||(qc=1,process.env.NODE_ENV==="production"?Dr.exports=k0():Dr.exports=S0()),Dr.exports}/*
27
27
  object-assign
28
28
  (c) Sindre Sorhus
29
29
  @license MIT
30
- */var la,qc;function O0(){if(qc)return la;qc=1;var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable;function o(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function r(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},c=0;c<10;c++)a["_"+String.fromCharCode(c)]=c;var l=Object.getOwnPropertyNames(a).map(function(p){return a[p]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(p){u[p]=p}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return la=r()?Object.assign:function(i,a){for(var c,l=o(i),u,p=1;p<arguments.length;p++){c=Object(arguments[p]);for(var f in c)n.call(c,f)&&(l[f]=c[f]);if(t){u=t(c);for(var d=0;d<u.length;d++)e.call(c,u[d])&&(l[u[d]]=c[u[d]])}}return l},la}var ua,Jc;function js(){if(Jc)return ua;Jc=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ua=t,ua}var da,Xc;function Xf(){return Xc||(Xc=1,da=Function.call.bind(Object.prototype.hasOwnProperty)),da}var fa,Qc;function N0(){if(Qc)return fa;Qc=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var n=js(),e={},o=Xf();t=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function r(i,a,c,l,u){if(process.env.NODE_ENV!=="production"){for(var p in i)if(o(i,p)){var f;try{if(typeof i[p]!="function"){var d=Error((l||"React class")+": "+c+" type `"+p+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[p]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=i[p](a,p,l,c,null,n)}catch(m){f=m}if(f&&!(f instanceof Error)&&t((l||"React class")+": type specification of "+c+" `"+p+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in e)){e[f.message]=!0;var h=u?u():"";t("Failed "+c+" type: "+f.message+(h??""))}}}}return r.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(e={})},fa=r,fa}var pa,el;function I0(){if(el)return pa;el=1;var t=Jf(),n=O0(),e=js(),o=Xf(),r=N0(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(c){var l="Warning: "+c;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function a(){return null}return pa=function(c,l){var u=typeof Symbol=="function"&&Symbol.iterator,p="@@iterator";function f(W){var Q=W&&(u&&W[u]||W[p]);if(typeof Q=="function")return Q}var d="<<anonymous>>",h={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:S(),arrayOf:k,element:C(),elementType:j(),instanceOf:E,node:q(),objectOf:H,oneOf:P,oneOfType:z,shape:A,exact:fe};function m(W,Q){return W===Q?W!==0||1/W===1/Q:W!==W&&Q!==Q}function v(W,Q){this.message=W,this.data=Q&&typeof Q=="object"?Q:{},this.stack=""}v.prototype=Error.prototype;function y(W){if(process.env.NODE_ENV!=="production")var Q={},me=0;function pe(D,T,L,G,U,re,te){if(G=G||d,re=re||L,te!==e){if(l){var I=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw I.name="Invariant Violation",I}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ke=G+":"+L;!Q[ke]&&me<3&&(i("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+G+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),Q[ke]=!0,me++)}}return T[L]==null?D?T[L]===null?new v("The "+U+" `"+re+"` is marked as required "+("in `"+G+"`, but its value is `null`.")):new v("The "+U+" `"+re+"` is marked as required in "+("`"+G+"`, but its value is `undefined`.")):null:W(T,L,G,U,re)}var V=pe.bind(null,!1);return V.isRequired=pe.bind(null,!0),V}function b(W){function Q(me,pe,V,D,T,L){var G=me[pe],U=de(G);if(U!==W){var re=he(G);return new v("Invalid "+D+" `"+T+"` of type "+("`"+re+"` supplied to `"+V+"`, expected ")+("`"+W+"`."),{expectedType:W})}return null}return y(Q)}function S(){return y(a)}function k(W){function Q(me,pe,V,D,T){if(typeof W!="function")return new v("Property `"+T+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var L=me[pe];if(!Array.isArray(L)){var G=de(L);return new v("Invalid "+D+" `"+T+"` of type "+("`"+G+"` supplied to `"+V+"`, expected an array."))}for(var U=0;U<L.length;U++){var re=W(L,U,V,D,T+"["+U+"]",e);if(re instanceof Error)return re}return null}return y(Q)}function C(){function W(Q,me,pe,V,D){var T=Q[me];if(!c(T)){var L=de(T);return new v("Invalid "+V+" `"+D+"` of type "+("`"+L+"` supplied to `"+pe+"`, expected a single ReactElement."))}return null}return y(W)}function j(){function W(Q,me,pe,V,D){var T=Q[me];if(!t.isValidElementType(T)){var L=de(T);return new v("Invalid "+V+" `"+D+"` of type "+("`"+L+"` supplied to `"+pe+"`, expected a single ReactElement type."))}return null}return y(W)}function E(W){function Q(me,pe,V,D,T){if(!(me[pe]instanceof W)){var L=W.name||d,G=ce(me[pe]);return new v("Invalid "+D+" `"+T+"` of type "+("`"+G+"` supplied to `"+V+"`, expected ")+("instance of `"+L+"`."))}return null}return y(Q)}function P(W){if(!Array.isArray(W))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function Q(me,pe,V,D,T){for(var L=me[pe],G=0;G<W.length;G++)if(m(L,W[G]))return null;var U=JSON.stringify(W,function(te,I){var ke=he(I);return ke==="symbol"?String(I):I});return new v("Invalid "+D+" `"+T+"` of value `"+String(L)+"` "+("supplied to `"+V+"`, expected one of "+U+"."))}return y(Q)}function H(W){function Q(me,pe,V,D,T){if(typeof W!="function")return new v("Property `"+T+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var L=me[pe],G=de(L);if(G!=="object")return new v("Invalid "+D+" `"+T+"` of type "+("`"+G+"` supplied to `"+V+"`, expected an object."));for(var U in L)if(o(L,U)){var re=W(L,U,V,D,T+"."+U,e);if(re instanceof Error)return re}return null}return y(Q)}function z(W){if(!Array.isArray(W))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var Q=0;Q<W.length;Q++){var me=W[Q];if(typeof me!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Oe(me)+" at index "+Q+"."),a}function pe(V,D,T,L,G){for(var U=[],re=0;re<W.length;re++){var te=W[re],I=te(V,D,T,L,G,e);if(I==null)return null;I.data&&o(I.data,"expectedType")&&U.push(I.data.expectedType)}var ke=U.length>0?", expected one of type ["+U.join(", ")+"]":"";return new v("Invalid "+L+" `"+G+"` supplied to "+("`"+T+"`"+ke+"."))}return y(pe)}function q(){function W(Q,me,pe,V,D){return ve(Q[me])?null:new v("Invalid "+V+" `"+D+"` supplied to "+("`"+pe+"`, expected a ReactNode."))}return y(W)}function B(W,Q,me,pe,V){return new v((W||"React class")+": "+Q+" type `"+me+"."+pe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function A(W){function Q(me,pe,V,D,T){var L=me[pe],G=de(L);if(G!=="object")return new v("Invalid "+D+" `"+T+"` of type `"+G+"` "+("supplied to `"+V+"`, expected `object`."));for(var U in W){var re=W[U];if(typeof re!="function")return B(V,D,T,U,he(re));var te=re(L,U,V,D,T+"."+U,e);if(te)return te}return null}return y(Q)}function fe(W){function Q(me,pe,V,D,T){var L=me[pe],G=de(L);if(G!=="object")return new v("Invalid "+D+" `"+T+"` of type `"+G+"` "+("supplied to `"+V+"`, expected `object`."));var U=n({},me[pe],W);for(var re in U){var te=W[re];if(o(W,re)&&typeof te!="function")return B(V,D,T,re,he(te));if(!te)return new v("Invalid "+D+" `"+T+"` key `"+re+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(me[pe],null," ")+`
31
- Valid keys: `+JSON.stringify(Object.keys(W),null," "));var I=te(L,re,V,D,T+"."+re,e);if(I)return I}return null}return y(Q)}function ve(W){switch(typeof W){case"number":case"string":case"undefined":return!0;case"boolean":return!W;case"object":if(Array.isArray(W))return W.every(ve);if(W===null||c(W))return!0;var Q=f(W);if(Q){var me=Q.call(W),pe;if(Q!==W.entries){for(;!(pe=me.next()).done;)if(!ve(pe.value))return!1}else for(;!(pe=me.next()).done;){var V=pe.value;if(V&&!ve(V[1]))return!1}}else return!1;return!0;default:return!1}}function Y(W,Q){return W==="symbol"?!0:Q?Q["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Q instanceof Symbol:!1}function de(W){var Q=typeof W;return Array.isArray(W)?"array":W instanceof RegExp?"object":Y(Q,W)?"symbol":Q}function he(W){if(typeof W>"u"||W===null)return""+W;var Q=de(W);if(Q==="object"){if(W instanceof Date)return"date";if(W instanceof RegExp)return"regexp"}return Q}function Oe(W){var Q=he(W);switch(Q){case"array":case"object":return"an "+Q;case"boolean":case"date":case"regexp":return"a "+Q;default:return Q}}function ce(W){return!W.constructor||!W.constructor.name?d:W.constructor.name}return h.checkPropTypes=r,h.resetWarningCache=r.resetWarningCache,h.PropTypes=h,h},pa}var ha,tl;function A0(){if(tl)return ha;tl=1;var t=js();function n(){}function e(){}return e.resetWarningCache=n,ha=function(){function o(a,c,l,u,p,f){if(f!==t){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}o.isRequired=o;function r(){return o}var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:e,resetWarningCache:n};return i.PropTypes=i,i},ha}if(process.env.NODE_ENV!=="production"){var P0=Jf(),T0=!0;Va.exports=I0()(P0.isElement,T0)}else Va.exports=A0()();var D0=Va.exports;const X=Ti(D0);var Qf={exports:{}};/*!
30
+ */var la,Jc;function E0(){if(Jc)return la;Jc=1;var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable;function o(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function r(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},c=0;c<10;c++)a["_"+String.fromCharCode(c)]=c;var l=Object.getOwnPropertyNames(a).map(function(f){return a[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return la=r()?Object.assign:function(i,a){for(var c,l=o(i),u,f=1;f<arguments.length;f++){c=Object(arguments[f]);for(var p in c)n.call(c,p)&&(l[p]=c[p]);if(t){u=t(c);for(var d=0;d<u.length;d++)e.call(c,u[d])&&(l[u[d]]=c[u[d]])}}return l},la}var ua,Xc;function Os(){if(Xc)return ua;Xc=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ua=t,ua}var da,Qc;function Xf(){return Qc||(Qc=1,da=Function.call.bind(Object.prototype.hasOwnProperty)),da}var fa,el;function j0(){if(el)return fa;el=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var n=Os(),e={},o=Xf();t=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function r(i,a,c,l,u){if(process.env.NODE_ENV!=="production"){for(var f in i)if(o(i,f)){var p;try{if(typeof i[f]!="function"){var d=Error((l||"React class")+": "+c+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}p=i[f](a,f,l,c,null,n)}catch(m){p=m}if(p&&!(p instanceof Error)&&t((l||"React class")+": type specification of "+c+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in e)){e[p.message]=!0;var h=u?u():"";t("Failed "+c+" type: "+p.message+(h??""))}}}}return r.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(e={})},fa=r,fa}var pa,tl;function O0(){if(tl)return pa;tl=1;var t=Jf(),n=E0(),e=Os(),o=Xf(),r=j0(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(c){var l="Warning: "+c;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function a(){return null}return pa=function(c,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function p(W){var X=W&&(u&&W[u]||W[f]);if(typeof X=="function")return X}var d="<<anonymous>>",h={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:S(),arrayOf:w,element:x(),elementType:E(),instanceOf:O,node:Z(),objectOf:B,oneOf:M,oneOfType:$,shape:I,exact:he};function m(W,X){return W===X?W!==0||1/W===1/X:W!==W&&X!==X}function v(W,X){this.message=W,this.data=X&&typeof X=="object"?X:{},this.stack=""}v.prototype=Error.prototype;function y(W){if(process.env.NODE_ENV!=="production")var X={},fe=0;function ue(T,P,R,G,U,re,ee){if(G=G||d,re=re||R,ee!==e){if(l){var A=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw A.name="Invariant Violation",A}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ke=G+":"+R;!X[ke]&&fe<3&&(i("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+G+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),X[ke]=!0,fe++)}}return P[R]==null?T?P[R]===null?new v("The "+U+" `"+re+"` is marked as required "+("in `"+G+"`, but its value is `null`.")):new v("The "+U+" `"+re+"` is marked as required in "+("`"+G+"`, but its value is `undefined`.")):null:W(P,R,G,U,re)}var V=ue.bind(null,!1);return V.isRequired=ue.bind(null,!0),V}function b(W){function X(fe,ue,V,T,P,R){var G=fe[ue],U=ge(G);if(U!==W){var re=de(G);return new v("Invalid "+T+" `"+P+"` of type "+("`"+re+"` supplied to `"+V+"`, expected ")+("`"+W+"`."),{expectedType:W})}return null}return y(X)}function S(){return y(a)}function w(W){function X(fe,ue,V,T,P){if(typeof W!="function")return new v("Property `"+P+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var R=fe[ue];if(!Array.isArray(R)){var G=ge(R);return new v("Invalid "+T+" `"+P+"` of type "+("`"+G+"` supplied to `"+V+"`, expected an array."))}for(var U=0;U<R.length;U++){var re=W(R,U,V,T,P+"["+U+"]",e);if(re instanceof Error)return re}return null}return y(X)}function x(){function W(X,fe,ue,V,T){var P=X[fe];if(!c(P)){var R=ge(P);return new v("Invalid "+V+" `"+T+"` of type "+("`"+R+"` supplied to `"+ue+"`, expected a single ReactElement."))}return null}return y(W)}function E(){function W(X,fe,ue,V,T){var P=X[fe];if(!t.isValidElementType(P)){var R=ge(P);return new v("Invalid "+V+" `"+T+"` of type "+("`"+R+"` supplied to `"+ue+"`, expected a single ReactElement type."))}return null}return y(W)}function O(W){function X(fe,ue,V,T,P){if(!(fe[ue]instanceof W)){var R=W.name||d,G=se(fe[ue]);return new v("Invalid "+T+" `"+P+"` of type "+("`"+G+"` supplied to `"+V+"`, expected ")+("instance of `"+R+"`."))}return null}return y(X)}function M(W){if(!Array.isArray(W))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function X(fe,ue,V,T,P){for(var R=fe[ue],G=0;G<W.length;G++)if(m(R,W[G]))return null;var U=JSON.stringify(W,function(ee,A){var ke=de(A);return ke==="symbol"?String(A):A});return new v("Invalid "+T+" `"+P+"` of value `"+String(R)+"` "+("supplied to `"+V+"`, expected one of "+U+"."))}return y(X)}function B(W){function X(fe,ue,V,T,P){if(typeof W!="function")return new v("Property `"+P+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var R=fe[ue],G=ge(R);if(G!=="object")return new v("Invalid "+T+" `"+P+"` of type "+("`"+G+"` supplied to `"+V+"`, expected an object."));for(var U in R)if(o(R,U)){var re=W(R,U,V,T,P+"."+U,e);if(re instanceof Error)return re}return null}return y(X)}function $(W){if(!Array.isArray(W))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var X=0;X<W.length;X++){var fe=W[X];if(typeof fe!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Oe(fe)+" at index "+X+"."),a}function ue(V,T,P,R,G){for(var U=[],re=0;re<W.length;re++){var ee=W[re],A=ee(V,T,P,R,G,e);if(A==null)return null;A.data&&o(A.data,"expectedType")&&U.push(A.data.expectedType)}var ke=U.length>0?", expected one of type ["+U.join(", ")+"]":"";return new v("Invalid "+R+" `"+G+"` supplied to "+("`"+P+"`"+ke+"."))}return y(ue)}function Z(){function W(X,fe,ue,V,T){return ye(X[fe])?null:new v("Invalid "+V+" `"+T+"` supplied to "+("`"+ue+"`, expected a ReactNode."))}return y(W)}function _(W,X,fe,ue,V){return new v((W||"React class")+": "+X+" type `"+fe+"."+ue+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function I(W){function X(fe,ue,V,T,P){var R=fe[ue],G=ge(R);if(G!=="object")return new v("Invalid "+T+" `"+P+"` of type `"+G+"` "+("supplied to `"+V+"`, expected `object`."));for(var U in W){var re=W[U];if(typeof re!="function")return _(V,T,P,U,de(re));var ee=re(R,U,V,T,P+"."+U,e);if(ee)return ee}return null}return y(X)}function he(W){function X(fe,ue,V,T,P){var R=fe[ue],G=ge(R);if(G!=="object")return new v("Invalid "+T+" `"+P+"` of type `"+G+"` "+("supplied to `"+V+"`, expected `object`."));var U=n({},fe[ue],W);for(var re in U){var ee=W[re];if(o(W,re)&&typeof ee!="function")return _(V,T,P,re,de(ee));if(!ee)return new v("Invalid "+T+" `"+P+"` key `"+re+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(fe[ue],null," ")+`
31
+ Valid keys: `+JSON.stringify(Object.keys(W),null," "));var A=ee(R,re,V,T,P+"."+re,e);if(A)return A}return null}return y(X)}function ye(W){switch(typeof W){case"number":case"string":case"undefined":return!0;case"boolean":return!W;case"object":if(Array.isArray(W))return W.every(ye);if(W===null||c(W))return!0;var X=p(W);if(X){var fe=X.call(W),ue;if(X!==W.entries){for(;!(ue=fe.next()).done;)if(!ye(ue.value))return!1}else for(;!(ue=fe.next()).done;){var V=ue.value;if(V&&!ye(V[1]))return!1}}else return!1;return!0;default:return!1}}function ne(W,X){return W==="symbol"?!0:X?X["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&X instanceof Symbol:!1}function ge(W){var X=typeof W;return Array.isArray(W)?"array":W instanceof RegExp?"object":ne(X,W)?"symbol":X}function de(W){if(typeof W>"u"||W===null)return""+W;var X=ge(W);if(X==="object"){if(W instanceof Date)return"date";if(W instanceof RegExp)return"regexp"}return X}function Oe(W){var X=de(W);switch(X){case"array":case"object":return"an "+X;case"boolean":case"date":case"regexp":return"a "+X;default:return X}}function se(W){return!W.constructor||!W.constructor.name?d:W.constructor.name}return h.checkPropTypes=r,h.resetWarningCache=r.resetWarningCache,h.PropTypes=h,h},pa}var ha,nl;function N0(){if(nl)return ha;nl=1;var t=Os();function n(){}function e(){}return e.resetWarningCache=n,ha=function(){function o(a,c,l,u,f,p){if(p!==t){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}o.isRequired=o;function r(){return o}var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:e,resetWarningCache:n};return i.PropTypes=i,i},ha}if(process.env.NODE_ENV!=="production"){var I0=Jf(),A0=!0;Ga.exports=O0()(I0.isElement,A0)}else Ga.exports=N0()();var P0=Ga.exports;const J=Ti(P0);var Qf={exports:{}};/*!
32
32
  Copyright (c) 2018 Jed Watson.
33
33
  Licensed under the MIT License (MIT), see
34
34
  http://jedwatson.github.io/classnames
35
- */(function(t){(function(){var n={}.hasOwnProperty;function e(){for(var i="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(i=r(i,o(c)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return e.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var c in i)n.call(i,c)&&i[c]&&(a=r(a,c));return a}function r(i,a){return a?i?i+" "+a:i+a:i}t.exports?(e.default=e,t.exports=e):window.classNames=e})()})(Qf);var M0=Qf.exports;const ot=Ti(M0);function Ga(t){"@babel/helpers - typeof";return Ga=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ga(t)}var _0;function Di(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_0;return n?t.split(" ").map(function(e){return n[e]||e}).join(" "):t}function L0(t,n){var e={};return Object.keys(t).forEach(function(o){n.indexOf(o)===-1&&(e[o]=t[o])}),e}function R0(t,n){for(var e=Array.isArray(n)?n:[n],o=e.length,r,i={};o>0;)o-=1,r=e[o],i[r]=t[r];return i}var F0=(typeof window>"u"?"undefined":Ga(window))==="object"&&window.Element||function(){};function B0(t,n,e){if(!(t[n]instanceof F0))return new Error("Invalid prop `"+n+"` supplied to `"+e+"`. Expected prop to be an instance of Element. Validation failed.")}X.oneOfType([X.string,X.func,B0,X.shape({current:X.any})]);var Os=X.oneOfType([X.func,X.string,X.shape({$$typeof:X.symbol,render:X.func}),X.arrayOf(X.oneOfType([X.func,X.string,X.shape({$$typeof:X.symbol,render:X.func})]))]),H0={Fade:150,Collapse:350,Modal:300,Carousel:600,Offcanvas:300},nl=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],Mr={ENTERING:"entering",ENTERED:"entered",EXITING:"exiting",EXITED:"exited"},W0=["className","cssModule","variant","innerRef"];function Ya(){return Ya=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Ya.apply(this,arguments)}function ol(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function z0(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?ol(Object(e),!0).forEach(function(o){$0(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ol(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function $0(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function U0(t,n){if(t==null)return{};var e=V0(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function V0(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var G0={active:X.bool,"aria-label":X.string,onClick:X.func,variant:X.oneOf(["white"]),className:X.string,cssModule:X.object,innerRef:X.oneOfType([X.object,X.string,X.func])};function ep(t){var n=t.className;t.cssModule;var e=t.variant,o=t.innerRef,r=U0(t,W0),i=Di(ot(n,"btn-close",e&&"btn-close-".concat(e)));return g.createElement("button",Ya({ref:o,type:"button",className:i},z0({"aria-label":"close"},r)))}ep.propTypes=G0;var Y0=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function Za(){return Za=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Za.apply(this,arguments)}function Z0(t,n){if(t==null)return{};var e=K0(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function K0(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var q0={active:X.bool,"aria-label":X.string,block:X.bool,children:X.node,className:X.string,cssModule:X.object,close:X.bool,color:X.string,disabled:X.bool,innerRef:X.oneOfType([X.object,X.func,X.string]),onClick:X.func,outline:X.bool,size:X.string,tag:Os};function ci(t){var n=g.useCallback(function(S){if(t.disabled){S.preventDefault();return}if(t.onClick)return t.onClick(S)},[t.onClick,t.disabled]),e=t.active,o=t["aria-label"],r=t.block,i=t.className,a=t.close,c=t.cssModule,l=t.color,u=l===void 0?"secondary":l,p=t.outline,f=t.size,d=t.tag,h=d===void 0?"button":d,m=t.innerRef,v=Z0(t,Y0);if(a)return g.createElement(ep,v);var y="btn".concat(p?"-outline":"","-").concat(u),b=Di(ot(i,"btn",y,f?"btn-".concat(f):!1,r?"d-block w-100":!1,{active:e,disabled:t.disabled}),c);return v.href&&h==="button"&&(h="a"),g.createElement(h,Za({type:h==="button"&&v.onClick?"button":void 0},v,{className:b,ref:m,onClick:n,"aria-label":o}))}ci.propTypes=q0;var rl=function(n){return n.reduce(function(e,o){var r=o[0],i=o[1];return e[r]=i,e},{})},il=typeof window<"u"&&window.document&&window.document.createElement?M.useLayoutEffect:M.useEffect,Mt="top",Yt="bottom",Zt="right",_t="left",Ns="auto",gr=[Mt,Yt,Zt,_t],Eo="start",lr="end",J0="clippingParents",tp="viewport",$o="popper",X0="reference",al=gr.reduce(function(t,n){return t.concat([n+"-"+Eo,n+"-"+lr])},[]),np=[].concat(gr,[Ns]).reduce(function(t,n){return t.concat([n,n+"-"+Eo,n+"-"+lr])},[]),Q0="beforeRead",ev="read",tv="afterRead",nv="beforeMain",ov="main",rv="afterMain",iv="beforeWrite",av="write",sv="afterWrite",cv=[Q0,ev,tv,nv,ov,rv,iv,av,sv];function on(t){return t?(t.nodeName||"").toLowerCase():null}function Wt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function no(t){var n=Wt(t).Element;return t instanceof n||t instanceof Element}function Gt(t){var n=Wt(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function Is(t){if(typeof ShadowRoot>"u")return!1;var n=Wt(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function lv(t){var n=t.state;Object.keys(n.elements).forEach(function(e){var o=n.styles[e]||{},r=n.attributes[e]||{},i=n.elements[e];!Gt(i)||!on(i)||(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var c=r[a];c===!1?i.removeAttribute(a):i.setAttribute(a,c===!0?"":c)}))})}function uv(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach(function(o){var r=n.elements[o],i=n.attributes[o]||{},a=Object.keys(n.styles.hasOwnProperty(o)?n.styles[o]:e[o]),c=a.reduce(function(l,u){return l[u]="",l},{});!Gt(r)||!on(r)||(Object.assign(r.style,c),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}const dv={name:"applyStyles",enabled:!0,phase:"write",fn:lv,effect:uv,requires:["computeStyles"]};function tn(t){return t.split("-")[0]}var Jn=Math.max,li=Math.min,jo=Math.round;function Ka(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function op(){return!/^((?!chrome|android).)*safari/i.test(Ka())}function Oo(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);var o=t.getBoundingClientRect(),r=1,i=1;n&&Gt(t)&&(r=t.offsetWidth>0&&jo(o.width)/t.offsetWidth||1,i=t.offsetHeight>0&&jo(o.height)/t.offsetHeight||1);var a=no(t)?Wt(t):window,c=a.visualViewport,l=!op()&&e,u=(o.left+(l&&c?c.offsetLeft:0))/r,p=(o.top+(l&&c?c.offsetTop:0))/i,f=o.width/r,d=o.height/i;return{width:f,height:d,top:p,right:u+f,bottom:p+d,left:u,x:u,y:p}}function As(t){var n=Oo(t),e=t.offsetWidth,o=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-o)<=1&&(o=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:o}}function rp(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&Is(e)){var o=n;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function pn(t){return Wt(t).getComputedStyle(t)}function fv(t){return["table","td","th"].indexOf(on(t))>=0}function Tn(t){return((no(t)?t.ownerDocument:t.document)||window.document).documentElement}function Mi(t){return on(t)==="html"?t:t.assignedSlot||t.parentNode||(Is(t)?t.host:null)||Tn(t)}function sl(t){return!Gt(t)||pn(t).position==="fixed"?null:t.offsetParent}function pv(t){var n=/firefox/i.test(Ka()),e=/Trident/i.test(Ka());if(e&&Gt(t)){var o=pn(t);if(o.position==="fixed")return null}var r=Mi(t);for(Is(r)&&(r=r.host);Gt(r)&&["html","body"].indexOf(on(r))<0;){var i=pn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||n&&i.willChange==="filter"||n&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function vr(t){for(var n=Wt(t),e=sl(t);e&&fv(e)&&pn(e).position==="static";)e=sl(e);return e&&(on(e)==="html"||on(e)==="body"&&pn(e).position==="static")?n:e||pv(t)||n}function Ps(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function tr(t,n,e){return Jn(t,li(n,e))}function hv(t,n,e){var o=tr(t,n,e);return o>e?e:o}function ip(){return{top:0,right:0,bottom:0,left:0}}function ap(t){return Object.assign({},ip(),t)}function sp(t,n){return n.reduce(function(e,o){return e[o]=t,e},{})}var mv=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,ap(typeof n!="number"?n:sp(n,gr))};function gv(t){var n,e=t.state,o=t.name,r=t.options,i=e.elements.arrow,a=e.modifiersData.popperOffsets,c=tn(e.placement),l=Ps(c),u=[_t,Zt].indexOf(c)>=0,p=u?"height":"width";if(!(!i||!a)){var f=mv(r.padding,e),d=As(i),h=l==="y"?Mt:_t,m=l==="y"?Yt:Zt,v=e.rects.reference[p]+e.rects.reference[l]-a[l]-e.rects.popper[p],y=a[l]-e.rects.reference[l],b=vr(i),S=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,k=v/2-y/2,C=f[h],j=S-d[p]-f[m],E=S/2-d[p]/2+k,P=tr(C,E,j),H=l;e.modifiersData[o]=(n={},n[H]=P,n.centerOffset=P-E,n)}}function vv(t){var n=t.state,e=t.options,o=e.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=n.elements.popper.querySelector(r),!r)||rp(n.elements.popper,r)&&(n.elements.arrow=r))}const yv={name:"arrow",enabled:!0,phase:"main",fn:gv,effect:vv,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function No(t){return t.split("-")[1]}var bv={top:"auto",right:"auto",bottom:"auto",left:"auto"};function wv(t,n){var e=t.x,o=t.y,r=n.devicePixelRatio||1;return{x:jo(e*r)/r||0,y:jo(o*r)/r||0}}function cl(t){var n,e=t.popper,o=t.popperRect,r=t.placement,i=t.variation,a=t.offsets,c=t.position,l=t.gpuAcceleration,u=t.adaptive,p=t.roundOffsets,f=t.isFixed,d=a.x,h=d===void 0?0:d,m=a.y,v=m===void 0?0:m,y=typeof p=="function"?p({x:h,y:v}):{x:h,y:v};h=y.x,v=y.y;var b=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),k=_t,C=Mt,j=window;if(u){var E=vr(e),P="clientHeight",H="clientWidth";if(E===Wt(e)&&(E=Tn(e),pn(E).position!=="static"&&c==="absolute"&&(P="scrollHeight",H="scrollWidth")),E=E,r===Mt||(r===_t||r===Zt)&&i===lr){C=Yt;var z=f&&E===j&&j.visualViewport?j.visualViewport.height:E[P];v-=z-o.height,v*=l?1:-1}if(r===_t||(r===Mt||r===Yt)&&i===lr){k=Zt;var q=f&&E===j&&j.visualViewport?j.visualViewport.width:E[H];h-=q-o.width,h*=l?1:-1}}var B=Object.assign({position:c},u&&bv),A=p===!0?wv({x:h,y:v},Wt(e)):{x:h,y:v};if(h=A.x,v=A.y,l){var fe;return Object.assign({},B,(fe={},fe[C]=S?"0":"",fe[k]=b?"0":"",fe.transform=(j.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",fe))}return Object.assign({},B,(n={},n[C]=S?v+"px":"",n[k]=b?h+"px":"",n.transform="",n))}function xv(t){var n=t.state,e=t.options,o=e.gpuAcceleration,r=o===void 0?!0:o,i=e.adaptive,a=i===void 0?!0:i,c=e.roundOffsets,l=c===void 0?!0:c,u={placement:tn(n.placement),variation:No(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,cl(Object.assign({},u,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:l})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,cl(Object.assign({},u,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}const Cv={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:xv,data:{}};var _r={passive:!0};function kv(t){var n=t.state,e=t.instance,o=t.options,r=o.scroll,i=r===void 0?!0:r,a=o.resize,c=a===void 0?!0:a,l=Wt(n.elements.popper),u=[].concat(n.scrollParents.reference,n.scrollParents.popper);return i&&u.forEach(function(p){p.addEventListener("scroll",e.update,_r)}),c&&l.addEventListener("resize",e.update,_r),function(){i&&u.forEach(function(p){p.removeEventListener("scroll",e.update,_r)}),c&&l.removeEventListener("resize",e.update,_r)}}const Sv={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kv,data:{}};var Ev={left:"right",right:"left",bottom:"top",top:"bottom"};function Ur(t){return t.replace(/left|right|bottom|top/g,function(n){return Ev[n]})}var jv={start:"end",end:"start"};function ll(t){return t.replace(/start|end/g,function(n){return jv[n]})}function Ts(t){var n=Wt(t),e=n.pageXOffset,o=n.pageYOffset;return{scrollLeft:e,scrollTop:o}}function Ds(t){return Oo(Tn(t)).left+Ts(t).scrollLeft}function Ov(t,n){var e=Wt(t),o=Tn(t),r=e.visualViewport,i=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){i=r.width,a=r.height;var u=op();(u||!u&&n==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:c+Ds(t),y:l}}function Nv(t){var n,e=Tn(t),o=Ts(t),r=(n=t.ownerDocument)==null?void 0:n.body,i=Jn(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Jn(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-o.scrollLeft+Ds(t),l=-o.scrollTop;return pn(r||e).direction==="rtl"&&(c+=Jn(e.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:c,y:l}}function Ms(t){var n=pn(t),e=n.overflow,o=n.overflowX,r=n.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+o)}function cp(t){return["html","body","#document"].indexOf(on(t))>=0?t.ownerDocument.body:Gt(t)&&Ms(t)?t:cp(Mi(t))}function nr(t,n){var e;n===void 0&&(n=[]);var o=cp(t),r=o===((e=t.ownerDocument)==null?void 0:e.body),i=Wt(o),a=r?[i].concat(i.visualViewport||[],Ms(o)?o:[]):o,c=n.concat(a);return r?c:c.concat(nr(Mi(a)))}function qa(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Iv(t,n){var e=Oo(t,!1,n==="fixed");return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function ul(t,n,e){return n===tp?qa(Ov(t,e)):no(n)?Iv(n,e):qa(Nv(Tn(t)))}function Av(t){var n=nr(Mi(t)),e=["absolute","fixed"].indexOf(pn(t).position)>=0,o=e&&Gt(t)?vr(t):t;return no(o)?n.filter(function(r){return no(r)&&rp(r,o)&&on(r)!=="body"}):[]}function Pv(t,n,e,o){var r=n==="clippingParents"?Av(t):[].concat(n),i=[].concat(r,[e]),a=i[0],c=i.reduce(function(l,u){var p=ul(t,u,o);return l.top=Jn(p.top,l.top),l.right=li(p.right,l.right),l.bottom=li(p.bottom,l.bottom),l.left=Jn(p.left,l.left),l},ul(t,a,o));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function lp(t){var n=t.reference,e=t.element,o=t.placement,r=o?tn(o):null,i=o?No(o):null,a=n.x+n.width/2-e.width/2,c=n.y+n.height/2-e.height/2,l;switch(r){case Mt:l={x:a,y:n.y-e.height};break;case Yt:l={x:a,y:n.y+n.height};break;case Zt:l={x:n.x+n.width,y:c};break;case _t:l={x:n.x-e.width,y:c};break;default:l={x:n.x,y:n.y}}var u=r?Ps(r):null;if(u!=null){var p=u==="y"?"height":"width";switch(i){case Eo:l[u]=l[u]-(n[p]/2-e[p]/2);break;case lr:l[u]=l[u]+(n[p]/2-e[p]/2);break}}return l}function ur(t,n){n===void 0&&(n={});var e=n,o=e.placement,r=o===void 0?t.placement:o,i=e.strategy,a=i===void 0?t.strategy:i,c=e.boundary,l=c===void 0?J0:c,u=e.rootBoundary,p=u===void 0?tp:u,f=e.elementContext,d=f===void 0?$o:f,h=e.altBoundary,m=h===void 0?!1:h,v=e.padding,y=v===void 0?0:v,b=ap(typeof y!="number"?y:sp(y,gr)),S=d===$o?X0:$o,k=t.rects.popper,C=t.elements[m?S:d],j=Pv(no(C)?C:C.contextElement||Tn(t.elements.popper),l,p,a),E=Oo(t.elements.reference),P=lp({reference:E,element:k,strategy:"absolute",placement:r}),H=qa(Object.assign({},k,P)),z=d===$o?H:E,q={top:j.top-z.top+b.top,bottom:z.bottom-j.bottom+b.bottom,left:j.left-z.left+b.left,right:z.right-j.right+b.right},B=t.modifiersData.offset;if(d===$o&&B){var A=B[r];Object.keys(q).forEach(function(fe){var ve=[Zt,Yt].indexOf(fe)>=0?1:-1,Y=[Mt,Yt].indexOf(fe)>=0?"y":"x";q[fe]+=A[Y]*ve})}return q}function Tv(t,n){n===void 0&&(n={});var e=n,o=e.placement,r=e.boundary,i=e.rootBoundary,a=e.padding,c=e.flipVariations,l=e.allowedAutoPlacements,u=l===void 0?np:l,p=No(o),f=p?c?al:al.filter(function(m){return No(m)===p}):gr,d=f.filter(function(m){return u.indexOf(m)>=0});d.length===0&&(d=f);var h=d.reduce(function(m,v){return m[v]=ur(t,{placement:v,boundary:r,rootBoundary:i,padding:a})[tn(v)],m},{});return Object.keys(h).sort(function(m,v){return h[m]-h[v]})}function Dv(t){if(tn(t)===Ns)return[];var n=Ur(t);return[ll(t),n,ll(n)]}function Mv(t){var n=t.state,e=t.options,o=t.name;if(!n.modifiersData[o]._skip){for(var r=e.mainAxis,i=r===void 0?!0:r,a=e.altAxis,c=a===void 0?!0:a,l=e.fallbackPlacements,u=e.padding,p=e.boundary,f=e.rootBoundary,d=e.altBoundary,h=e.flipVariations,m=h===void 0?!0:h,v=e.allowedAutoPlacements,y=n.options.placement,b=tn(y),S=b===y,k=l||(S||!m?[Ur(y)]:Dv(y)),C=[y].concat(k).reduce(function(V,D){return V.concat(tn(D)===Ns?Tv(n,{placement:D,boundary:p,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:v}):D)},[]),j=n.rects.reference,E=n.rects.popper,P=new Map,H=!0,z=C[0],q=0;q<C.length;q++){var B=C[q],A=tn(B),fe=No(B)===Eo,ve=[Mt,Yt].indexOf(A)>=0,Y=ve?"width":"height",de=ur(n,{placement:B,boundary:p,rootBoundary:f,altBoundary:d,padding:u}),he=ve?fe?Zt:_t:fe?Yt:Mt;j[Y]>E[Y]&&(he=Ur(he));var Oe=Ur(he),ce=[];if(i&&ce.push(de[A]<=0),c&&ce.push(de[he]<=0,de[Oe]<=0),ce.every(function(V){return V})){z=B,H=!1;break}P.set(B,ce)}if(H)for(var W=m?3:1,Q=function(D){var T=C.find(function(L){var G=P.get(L);if(G)return G.slice(0,D).every(function(U){return U})});if(T)return z=T,"break"},me=W;me>0;me--){var pe=Q(me);if(pe==="break")break}n.placement!==z&&(n.modifiersData[o]._skip=!0,n.placement=z,n.reset=!0)}}const _v={name:"flip",enabled:!0,phase:"main",fn:Mv,requiresIfExists:["offset"],data:{_skip:!1}};function dl(t,n,e){return e===void 0&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function fl(t){return[Mt,Zt,Yt,_t].some(function(n){return t[n]>=0})}function Lv(t){var n=t.state,e=t.name,o=n.rects.reference,r=n.rects.popper,i=n.modifiersData.preventOverflow,a=ur(n,{elementContext:"reference"}),c=ur(n,{altBoundary:!0}),l=dl(a,o),u=dl(c,r,i),p=fl(l),f=fl(u);n.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:p,hasPopperEscaped:f},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":f})}const Rv={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Lv};function Fv(t,n,e){var o=tn(t),r=[_t,Mt].indexOf(o)>=0?-1:1,i=typeof e=="function"?e(Object.assign({},n,{placement:t})):e,a=i[0],c=i[1];return a=a||0,c=(c||0)*r,[_t,Zt].indexOf(o)>=0?{x:c,y:a}:{x:a,y:c}}function Bv(t){var n=t.state,e=t.options,o=t.name,r=e.offset,i=r===void 0?[0,0]:r,a=np.reduce(function(p,f){return p[f]=Fv(f,n.rects,i),p},{}),c=a[n.placement],l=c.x,u=c.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=l,n.modifiersData.popperOffsets.y+=u),n.modifiersData[o]=a}const Hv={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Bv};function Wv(t){var n=t.state,e=t.name;n.modifiersData[e]=lp({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}const zv={name:"popperOffsets",enabled:!0,phase:"read",fn:Wv,data:{}};function $v(t){return t==="x"?"y":"x"}function Uv(t){var n=t.state,e=t.options,o=t.name,r=e.mainAxis,i=r===void 0?!0:r,a=e.altAxis,c=a===void 0?!1:a,l=e.boundary,u=e.rootBoundary,p=e.altBoundary,f=e.padding,d=e.tether,h=d===void 0?!0:d,m=e.tetherOffset,v=m===void 0?0:m,y=ur(n,{boundary:l,rootBoundary:u,padding:f,altBoundary:p}),b=tn(n.placement),S=No(n.placement),k=!S,C=Ps(b),j=$v(C),E=n.modifiersData.popperOffsets,P=n.rects.reference,H=n.rects.popper,z=typeof v=="function"?v(Object.assign({},n.rects,{placement:n.placement})):v,q=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),B=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,A={x:0,y:0};if(E){if(i){var fe,ve=C==="y"?Mt:_t,Y=C==="y"?Yt:Zt,de=C==="y"?"height":"width",he=E[C],Oe=he+y[ve],ce=he-y[Y],W=h?-H[de]/2:0,Q=S===Eo?P[de]:H[de],me=S===Eo?-H[de]:-P[de],pe=n.elements.arrow,V=h&&pe?As(pe):{width:0,height:0},D=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:ip(),T=D[ve],L=D[Y],G=tr(0,P[de],V[de]),U=k?P[de]/2-W-G-T-q.mainAxis:Q-G-T-q.mainAxis,re=k?-P[de]/2+W+G+L+q.mainAxis:me+G+L+q.mainAxis,te=n.elements.arrow&&vr(n.elements.arrow),I=te?C==="y"?te.clientTop||0:te.clientLeft||0:0,ke=(fe=B==null?void 0:B[C])!=null?fe:0,xe=he+U-ke-I,_e=he+re-ke,Ie=tr(h?li(Oe,xe):Oe,he,h?Jn(ce,_e):ce);E[C]=Ie,A[C]=Ie-he}if(c){var Pe,ge=C==="x"?Mt:_t,x=C==="x"?Yt:Zt,w=E[j],O=j==="y"?"height":"width",N=w+y[ge],R=w-y[x],ne=[Mt,_t].indexOf(b)!==-1,J=(Pe=B==null?void 0:B[j])!=null?Pe:0,$=ne?N:w-P[O]-H[O]-J+q.altAxis,F=ne?w+P[O]+H[O]-J-q.altAxis:R,Z=h&&ne?hv($,w,F):tr(h?$:N,w,h?F:R);E[j]=Z,A[j]=Z-w}n.modifiersData[o]=A}}const Vv={name:"preventOverflow",enabled:!0,phase:"main",fn:Uv,requiresIfExists:["offset"]};function Gv(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Yv(t){return t===Wt(t)||!Gt(t)?Ts(t):Gv(t)}function Zv(t){var n=t.getBoundingClientRect(),e=jo(n.width)/t.offsetWidth||1,o=jo(n.height)/t.offsetHeight||1;return e!==1||o!==1}function Kv(t,n,e){e===void 0&&(e=!1);var o=Gt(n),r=Gt(n)&&Zv(n),i=Tn(n),a=Oo(t,r,e),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!e)&&((on(n)!=="body"||Ms(i))&&(c=Yv(n)),Gt(n)?(l=Oo(n,!0),l.x+=n.clientLeft,l.y+=n.clientTop):i&&(l.x=Ds(i))),{x:a.left+c.scrollLeft-l.x,y:a.top+c.scrollTop-l.y,width:a.width,height:a.height}}function qv(t){var n=new Map,e=new Set,o=[];t.forEach(function(i){n.set(i.name,i)});function r(i){e.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(c){if(!e.has(c)){var l=n.get(c);l&&r(l)}}),o.push(i)}return t.forEach(function(i){e.has(i.name)||r(i)}),o}function Jv(t){var n=qv(t);return cv.reduce(function(e,o){return e.concat(n.filter(function(r){return r.phase===o}))},[])}function Xv(t){var n;return function(){return n||(n=new Promise(function(e){Promise.resolve().then(function(){n=void 0,e(t())})})),n}}function Qv(t){var n=t.reduce(function(e,o){var r=e[o.name];return e[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,e},{});return Object.keys(n).map(function(e){return n[e]})}var pl={placement:"bottom",modifiers:[],strategy:"absolute"};function hl(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function e1(t){t===void 0&&(t={});var n=t,e=n.defaultModifiers,o=e===void 0?[]:e,r=n.defaultOptions,i=r===void 0?pl:r;return function(c,l,u){u===void 0&&(u=i);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},pl,i),modifiersData:{},elements:{reference:c,popper:l},attributes:{},styles:{}},f=[],d=!1,h={state:p,setOptions:function(b){var S=typeof b=="function"?b(p.options):b;v(),p.options=Object.assign({},i,p.options,S),p.scrollParents={reference:no(c)?nr(c):c.contextElement?nr(c.contextElement):[],popper:nr(l)};var k=Jv(Qv([].concat(o,p.options.modifiers)));return p.orderedModifiers=k.filter(function(C){return C.enabled}),m(),h.update()},forceUpdate:function(){if(!d){var b=p.elements,S=b.reference,k=b.popper;if(hl(S,k)){p.rects={reference:Kv(S,vr(k),p.options.strategy==="fixed"),popper:As(k)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(q){return p.modifiersData[q.name]=Object.assign({},q.data)});for(var C=0;C<p.orderedModifiers.length;C++){if(p.reset===!0){p.reset=!1,C=-1;continue}var j=p.orderedModifiers[C],E=j.fn,P=j.options,H=P===void 0?{}:P,z=j.name;typeof E=="function"&&(p=E({state:p,options:H,name:z,instance:h})||p)}}}},update:Xv(function(){return new Promise(function(y){h.forceUpdate(),y(p)})}),destroy:function(){v(),d=!0}};if(!hl(c,l))return h;h.setOptions(u).then(function(y){!d&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){p.orderedModifiers.forEach(function(y){var b=y.name,S=y.options,k=S===void 0?{}:S,C=y.effect;if(typeof C=="function"){var j=C({state:p,name:b,instance:h,options:k}),E=function(){};f.push(j||E)}})}function v(){f.forEach(function(y){return y()}),f=[]}return h}}var t1=[Sv,zv,Cv,dv,Hv,_v,Vv,yv,Rv],n1=e1({defaultModifiers:t1}),o1=typeof Element<"u",r1=typeof Map=="function",i1=typeof Set=="function",a1=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Vr(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var e,o,r;if(Array.isArray(t)){if(e=t.length,e!=n.length)return!1;for(o=e;o--!==0;)if(!Vr(t[o],n[o]))return!1;return!0}var i;if(r1&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!n.has(o.value[0]))return!1;for(i=t.entries();!(o=i.next()).done;)if(!Vr(o.value[1],n.get(o.value[0])))return!1;return!0}if(i1&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(a1&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(e=t.length,e!=n.length)return!1;for(o=e;o--!==0;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof n.valueOf=="function")return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof n.toString=="function")return t.toString()===n.toString();if(r=Object.keys(t),e=r.length,e!==Object.keys(n).length)return!1;for(o=e;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,r[o]))return!1;if(o1&&t instanceof Element)return!1;for(o=e;o--!==0;)if(!((r[o]==="_owner"||r[o]==="__v"||r[o]==="__o")&&t.$$typeof)&&!Vr(t[r[o]],n[r[o]]))return!1;return!0}return t!==t&&n!==n}var s1=function(n,e){try{return Vr(n,e)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}};const c1=Ti(s1);var l1=[],u1=function(n,e,o){o===void 0&&(o={});var r=M.useRef(null),i={onFirstUpdate:o.onFirstUpdate,placement:o.placement||"bottom",strategy:o.strategy||"absolute",modifiers:o.modifiers||l1},a=M.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),c=a[0],l=a[1],u=M.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(h){var m=h.state,v=Object.keys(m.elements);Ll.flushSync(function(){l({styles:rl(v.map(function(y){return[y,m.styles[y]||{}]})),attributes:rl(v.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),p=M.useMemo(function(){var d={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[u,{name:"applyStyles",enabled:!1}])};return c1(r.current,d)?r.current||d:(r.current=d,d)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,u]),f=M.useRef();return il(function(){f.current&&f.current.setOptions(p)},[p]),il(function(){if(!(n==null||e==null)){var d=o.createPopper||n1,h=d(n,e,p);return f.current=h,function(){h.destroy(),f.current=null}}},[n,e,o.createPopper]),{state:f.current?f.current.state:null,styles:c.styles,attributes:c.attributes,update:f.current?f.current.update:null,forceUpdate:f.current?f.current.forceUpdate:null}},d1=["className","cssModule","size","vertical","tag"];function Ja(){return Ja=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Ja.apply(this,arguments)}function ml(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function f1(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?ml(Object(e),!0).forEach(function(o){p1(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ml(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function p1(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function h1(t,n){if(t==null)return{};var e=m1(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function m1(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var g1={"aria-label":X.string,className:X.string,cssModule:X.object,role:X.string,size:X.string,tag:Os,vertical:X.bool};function up(t){var n=t.className,e=t.cssModule,o=t.size,r=t.vertical,i=t.tag,a=i===void 0?"div":i,c=h1(t,d1),l=Di(ot(n,o?"btn-group-"+o:!1,r?"btn-group-vertical":"btn-group"),e);return g.createElement(a,Ja({},f1({role:"group"},c),{className:l}))}up.propTypes=g1;function v1(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function Xa(t,n){return Xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},Xa(t,n)}function y1(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,Xa(t,n)}const gl={disabled:!1};var b1=process.env.NODE_ENV!=="production"?X.oneOfType([X.number,X.shape({enter:X.number,exit:X.number,appear:X.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&X.oneOfType([X.string,X.shape({enter:X.string,exit:X.string,active:X.string}),X.shape({enter:X.string,enterDone:X.string,enterActive:X.string,exit:X.string,exitDone:X.string,exitActive:X.string})]);const dp=g.createContext(null);var w1=function(n){return n.scrollTop},qo="unmounted",Ln="exited",Rn="entering",ho="entered",Qa="exiting",mn=function(t){y1(n,t);function n(o,r){var i;i=t.call(this,o,r)||this;var a=r,c=a&&!a.isMounting?o.enter:o.appear,l;return i.appearStatus=null,o.in?c?(l=Ln,i.appearStatus=Rn):l=ho:o.unmountOnExit||o.mountOnEnter?l=qo:l=Ln,i.state={status:l},i.nextCallback=null,i}n.getDerivedStateFromProps=function(r,i){var a=r.in;return a&&i.status===qo?{status:Ln}:null};var e=n.prototype;return e.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},e.componentDidUpdate=function(r){var i=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==Rn&&a!==ho&&(i=Rn):(a===Rn||a===ho)&&(i=Qa)}this.updateStatus(!1,i)},e.componentWillUnmount=function(){this.cancelNextCallback()},e.getTimeouts=function(){var r=this.props.timeout,i,a,c;return i=a=c=r,r!=null&&typeof r!="number"&&(i=r.exit,a=r.enter,c=r.appear!==void 0?r.appear:a),{exit:i,enter:a,appear:c}},e.updateStatus=function(r,i){if(r===void 0&&(r=!1),i!==null)if(this.cancelNextCallback(),i===Rn){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Un.findDOMNode(this);a&&w1(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ln&&this.setState({status:qo})},e.performEnter=function(r){var i=this,a=this.props.enter,c=this.context?this.context.isMounting:r,l=this.props.nodeRef?[c]:[Un.findDOMNode(this),c],u=l[0],p=l[1],f=this.getTimeouts(),d=c?f.appear:f.enter;if(!r&&!a||gl.disabled){this.safeSetState({status:ho},function(){i.props.onEntered(u)});return}this.props.onEnter(u,p),this.safeSetState({status:Rn},function(){i.props.onEntering(u,p),i.onTransitionEnd(d,function(){i.safeSetState({status:ho},function(){i.props.onEntered(u,p)})})})},e.performExit=function(){var r=this,i=this.props.exit,a=this.getTimeouts(),c=this.props.nodeRef?void 0:Un.findDOMNode(this);if(!i||gl.disabled){this.safeSetState({status:Ln},function(){r.props.onExited(c)});return}this.props.onExit(c),this.safeSetState({status:Qa},function(){r.props.onExiting(c),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:Ln},function(){r.props.onExited(c)})})})},e.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},e.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},e.setNextCallback=function(r){var i=this,a=!0;return this.nextCallback=function(c){a&&(a=!1,i.nextCallback=null,r(c))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},e.onTransitionEnd=function(r,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:Un.findDOMNode(this),c=r==null&&!this.props.addEndListener;if(!a||c){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],p=l[1];this.props.addEndListener(u,p)}r!=null&&setTimeout(this.nextCallback,r)},e.render=function(){var r=this.state.status;if(r===qo)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var c=v1(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return g.createElement(dp.Provider,{value:null},typeof a=="function"?a(r,c):g.cloneElement(g.Children.only(a),c))},n}(g.Component);mn.contextType=dp;mn.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:X.shape({current:typeof Element>"u"?X.any:function(t,n,e,o,r,i){var a=t[n];return X.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(t,n,e,o,r,i)}}),children:X.oneOfType([X.func.isRequired,X.element.isRequired]).isRequired,in:X.bool,mountOnEnter:X.bool,unmountOnExit:X.bool,appear:X.bool,enter:X.bool,exit:X.bool,timeout:function(n){var e=b1;n.addEndListener||(e=e.isRequired);for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return e.apply(void 0,[n].concat(r))},addEndListener:X.func,onEnter:X.func,onEntering:X.func,onEntered:X.func,onExit:X.func,onExiting:X.func,onExited:X.func}:{};function so(){}mn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:so,onEntering:so,onEntered:so,onExit:so,onExiting:so,onExited:so};mn.UNMOUNTED=qo;mn.EXITED=Ln;mn.ENTERING=Rn;mn.ENTERED=ho;mn.EXITING=Qa;const _s=mn;function es(t){"@babel/helpers - typeof";return es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},es(t)}var x1=["tag","horizontal","isOpen","className","navbar","cssModule","children","innerRef"],co;function ui(){return ui=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},ui.apply(this,arguments)}function C1(t,n){if(t==null)return{};var e=k1(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function k1(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function S1(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function vl(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function E1(t,n,e){return n&&vl(t.prototype,n),e&&vl(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function j1(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&ts(t,n)}function ts(t,n){return ts=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},ts(t,n)}function O1(t){var n=I1();return function(){var o=di(t),r;if(n){var i=di(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return N1(this,r)}}function N1(t,n){if(n&&(es(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fp(t)}function fp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function I1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function di(t){return di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},di(t)}function yl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function Io(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?yl(Object(e),!0).forEach(function(o){vo(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):yl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function vo(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var A1=Io(Io({},_s.propTypes),{},{horizontal:X.bool,isOpen:X.bool,children:X.oneOfType([X.arrayOf(X.node),X.node]),tag:Os,className:X.node,navbar:X.bool,cssModule:X.object,innerRef:X.shape({current:X.object})}),P1=Io(Io({},_s.defaultProps),{},{horizontal:!1,isOpen:!1,appear:!1,enter:!0,exit:!0,tag:"div",timeout:H0.Collapse}),T1=(co={},vo(co,Mr.ENTERING,"collapsing"),vo(co,Mr.ENTERED,"collapse show"),vo(co,Mr.EXITING,"collapsing"),vo(co,Mr.EXITED,"collapse"),co);function D1(t){return T1[t]||"collapse"}var Ls=function(t){j1(e,t);var n=O1(e);function e(o){var r;return S1(this,e),r=n.call(this,o),r.state={dimension:null},r.nodeRef=o.innerRef||g.createRef(),["onEntering","onEntered","onExit","onExiting","onExited"].forEach(function(i){r[i]=r[i].bind(fp(r))}),r}return E1(e,[{key:"onEntering",value:function(r,i){var a=this.getNode();this.setState({dimension:this.getDimension(a)}),this.props.onEntering(a,i)}},{key:"onEntered",value:function(r,i){var a=this.getNode();this.setState({dimension:null}),this.props.onEntered(a,i)}},{key:"onExit",value:function(){var r=this.getNode();this.setState({dimension:this.getDimension(r)}),this.props.onExit(r)}},{key:"onExiting",value:function(){var r=this.getNode();this.getDimension(r),this.setState({dimension:0}),this.props.onExiting(r)}},{key:"onExited",value:function(){var r=this.getNode();this.setState({dimension:null}),this.props.onExited(r)}},{key:"getNode",value:function(){return this.nodeRef.current}},{key:"getDimension",value:function(r){return this.props.horizontal?r.scrollWidth:r.scrollHeight}},{key:"render",value:function(){var r=this,i=this.props,a=i.tag,c=i.horizontal,l=i.isOpen,u=i.className,p=i.navbar,f=i.cssModule,d=i.children;i.innerRef;var h=C1(i,x1),m=this.state.dimension,v=R0(h,nl),y=L0(h,nl);return g.createElement(_s,ui({},v,{in:l,nodeRef:this.nodeRef,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(b){var S=D1(b),k=Di(ot(u,c&&"collapse-horizontal",S,p&&"navbar-collapse"),f),C=m===null?null:vo({},c?"width":"height",m);return g.createElement(a,ui({},y,{style:Io(Io({},y.style),C),className:k,ref:r.nodeRef}),d)})}}]),e}(g.Component);Ls.propTypes=A1;Ls.defaultProps=P1;const pp=Ls,M1=t=>{const{className:n,isOpen:e,showCollapseIcon:o,showFolderIcon:r,title:i,...a}=t;return s.jsx(ut.ItemHeader,{className:ot("io-base-section-header",n),prepend:r&&s.jsx(et,{size:"16",variant:e?"folder-open":"folder"}),append:o&&s.jsx(et,{className:ot("collapse-icon",!e&&"collapsed"),size:"10",variant:"expand"}),tooltip:i,...a,children:i})},hp=()=>{const[t,n]=g.useState([]),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=l=>{const{name:u,title:p,caption:f,icon:d,userProperties:h}=l;return{id:u,name:u,title:p??u,caption:f,icon:d,userProperties:h}},r=e.appManager.onAppAdded(l=>{if(l.userProperties.hidden||"hidden"in l&&l.hidden)return;const u=o(l);n(p=>[...p,u])}),i=e.appManager.onAppChanged(l=>{const u=o(l);n(p=>[...p.filter(f=>f.id!==u.id),u])}),a=e.appManager.onAppRemoved(l=>{const u=o(l);n(p=>p.filter(f=>f.id!==u.id))}),c=[r,a,i];return()=>c.forEach(l=>l())},[e]),t},_1=()=>{const[t,n]=g.useState({}),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.appManager.onInstanceStarted(a=>{n(c=>{const l=c[a.application.name]??[];return{...c,[a.application.name]:[...l,a.id]}})}),r=e.appManager.onInstanceStopped(a=>{n(c=>({...c,[a.application.name]:c[a.application.name].filter(l=>l!==a.id)}))}),i=[o,r];return()=>i.forEach(a=>a())},[e]),t},L1=t=>{g.useEffect(()=>{var e;if(!((e=window.iobrowser)!=null&&e.platformStarted)||t)return;const n=o=>{o.preventDefault(),o.returnValue=!0};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t])},Rs=()=>{const[t,n]=g.useState(),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{var o;try{const i=!((o=e.windows.my())!=null&&o.name)?Co.getFrameId():void 0;n(i)}catch(r){console.error("Failed to get the current frame ID ",{error:r})}},[e,Co.getFrameId,n]),t},Le={SUCCESS:"success",WARNING:"warning"},R1={success:5*1e3,warning:10*1e3},Fe=async t=>{const{io:n,variant:e,text:o,error:r}=t,i=$a(r);try{if(e===Le.WARNING&&n.logger.warn(i?`${o} ${i}`:o),!("modals"in n&&n.modals))throw new Error("Modals are not enabled.");const a={text:o,variant:e,ttl:R1[e]};await n.modals.alerts.request(a)}catch(a){n.logger.warn(`Failed to request alert. ${$a(a)}`)}},F1=async t=>{var o;const{io:n,item:e}=t;try{await((o=n.appManager.application(e.id))==null?void 0:o.start())}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to start app "${e.title}" in a new window.`,error:r})}},B1=async t=>{const{io:n,item:e,frameId:o}=t;if(!n.workspaces)return;const r={type:"workspace",definition:{frame:o?{reuseFrameId:o}:{newFrame:!0}}},i=n.workspaces.getBuilder(r);i.addGroup().addWindow({appName:e.id});try{await i.create()}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to start app "${e.title}" in a new Workspace.`,error:a})}},H1={[ii.OPEN_IN_NEW_WINDOW]:F1,[ii.OPEN_IN_NEW_WORKSPACE]:B1},mp=()=>{const t=g.useContext(De.IOConnectContext),n=Rs();return(e,o)=>{H1[o]({io:t,item:e,frameId:n})}},To={NO_INPUTS_CONFIRMATION_DIALOG:"noInputsConfirmationDialog",SINGLE_CHECKBOX_DIALOG:"singleCheckboxDialog",SINGLE_TEXT_INPUT_DIALOG:"singleTextInputDialog"},Fs="(.|\\s)*\\S(.|\\s)*",W1=async t=>{var i;const{io:n,layout:e,showDeletePromptPref:o,updateShowDeletePromptPref:r}=t;if("modals"in n&&n.modals&&o){const a="delete",c="do-not-ask-again",{isEnterPressed:l,responseButtonClicked:u,inputs:p}=await n.modals.dialogs.request({templateName:To.SINGLE_CHECKBOX_DIALOG,variables:{heading:`Delete Layout "${e.name}"`,text:"Are you sure you want to delete this Layout?",checkbox:{id:c,label:"Don't ask me again"},actionButtons:[{variant:"critical",text:"Delete",id:a},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(((i=p==null?void 0:p.find(h=>h.id===c))==null?void 0:i.checked)&&r(!1),!(l||(u==null?void 0:u.id)===a))return}try{await n.layouts.remove("Global",e.name),e.isDefault&&await n.layouts.clearDefaultGlobal(),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully deleted.`})}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to delete Layout "${e.name}".`,error:a})}},z1=async t=>{var f;const{io:n,layout:e,setDefaultLayout:o}=t;if(!("modals"in n&&n.modals)){console.error("Cannot rename Layout because io dialogs are not enabled");return}const r="rename",i="new-layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await n.modals.dialogs.request({templateName:To.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Rename "${e.name}"`,input:{id:i,initialValue:e.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Fs}},actionButtons:[{variant:"primary",text:"Rename",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(f=l==null?void 0:l.find(d=>d.id===i))==null?void 0:f.value;if(a||(c==null?void 0:c.id)===r){if(u===e.name){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}". The new Layout name must be different from the current one.`});return}try{if((await n.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}" to "${u}". A Layout with name "${u}" already exists.`});return}const h=await n.layouts.get(e.name,"Global");if(!h){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}". The Layout wasn't found.`});return}await n.layouts.rename(h,u),e.isDefault&&await o({name:u}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully renamed to "${u}".`})}catch(d){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}".`,error:d})}}},$1=async t=>{const{io:n,layout:e}=t;try{await n.layouts.save({name:e.name,type:"Global"}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was saved successfully.`})}catch(o){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${e.name}".`,error:o})}},U1=async t=>{var f;const{io:n,layout:e,setActiveLayout:o}=t;if(!("modals"in n&&n.modals)){console.error("Cannot save Layout under a new name because io dialogs are not enabled");return}const r="save-as",i="layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await n.modals.dialogs.request({templateName:To.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Save Layout "${e.name}" as`,input:{id:i,initialValue:e.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Fs}},actionButtons:[{variant:"primary",text:"Save as",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(f=l==null?void 0:l.find(d=>d.id===i))==null?void 0:f.value;if(a||(c==null?void 0:c.id)===r){if(u===e.name){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout as "${u}". The new Layout must have a unique name.`});return}try{if((await n.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout as "${u}". A Layout with this name already exists.`});return}const h=await n.layouts.get(e.name,"Global");if(!h){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${e.name}". The Layout wasn't found.`});return}await n.layouts.import([{...h,name:u}],"merge"),e.isActive&&o({name:u}),await Fe({io:n,variant:Le.SUCCESS,text:`The Layout was successfully saved as "${u}".`})}catch(d){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${u}".`,error:d})}}},V1=async t=>{const{io:n,layout:e,setDefaultLayout:o}=t;try{await o({name:e.name}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully set as the default Layout.`})}catch{await Fe({io:n,variant:Le.WARNING,text:`Failed to set Layout "${e.name}" as the default Layout.`})}},G1=async t=>{const{io:n,layout:e,closeLaunchpad:o}=t;try{await n.layouts.restore({name:e.name}),o(),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was loaded successfully.`})}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to load Layout "${e.name}".`,error:r})}},Y1={delete:W1,rename:z1,save:$1,saveAs:U1,setAsDefault:V1,load:G1},Z1="interopio_home_ui_auth0_validation_error",K1="interopio_home_ui_user",q1="interopio_home_ui_platform_window",yr="interopio_home_ui_platform_setup",gp="interopio_home_ui_active_layout";var gt=function(t){return{ok:!0,result:t}},st=function(t){return{ok:!1,error:t}},J1=function(t){return t.ok===!0?Promise.resolve(t.result):Promise.reject(t.error)},X1=function(t,n){return n.ok===!0?n.result:t},Q1=function(t){if(t.ok===!0)return t.result;throw t.error},ey=function(t,n){return n.ok===!0?gt(t(n.result)):n},bl=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:gt(t(n.result,e.result))},ma=function(t,n){return n.ok===!0?n:st(t(n.error))},ty=function(t,n){return n.ok===!0?t(n.result):n};/*! *****************************************************************************
35
+ */(function(t){(function(){var n={}.hasOwnProperty;function e(){for(var i="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(i=r(i,o(c)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return e.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var c in i)n.call(i,c)&&i[c]&&(a=r(a,c));return a}function r(i,a){return a?i?i+" "+a:i+a:i}t.exports?(e.default=e,t.exports=e):window.classNames=e})()})(Qf);var T0=Qf.exports;const ot=Ti(T0);function Ya(t){"@babel/helpers - typeof";return Ya=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ya(t)}var D0;function Di(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:D0;return n?t.split(" ").map(function(e){return n[e]||e}).join(" "):t}function M0(t,n){var e={};return Object.keys(t).forEach(function(o){n.indexOf(o)===-1&&(e[o]=t[o])}),e}function _0(t,n){for(var e=Array.isArray(n)?n:[n],o=e.length,r,i={};o>0;)o-=1,r=e[o],i[r]=t[r];return i}var L0=(typeof window>"u"?"undefined":Ya(window))==="object"&&window.Element||function(){};function R0(t,n,e){if(!(t[n]instanceof L0))return new Error("Invalid prop `"+n+"` supplied to `"+e+"`. Expected prop to be an instance of Element. Validation failed.")}J.oneOfType([J.string,J.func,R0,J.shape({current:J.any})]);var Ns=J.oneOfType([J.func,J.string,J.shape({$$typeof:J.symbol,render:J.func}),J.arrayOf(J.oneOfType([J.func,J.string,J.shape({$$typeof:J.symbol,render:J.func})]))]),F0={Fade:150,Collapse:350,Modal:300,Carousel:600,Offcanvas:300},ol=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],Mr={ENTERING:"entering",ENTERED:"entered",EXITING:"exiting",EXITED:"exited"},B0=["className","cssModule","variant","innerRef"];function Za(){return Za=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Za.apply(this,arguments)}function rl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function H0(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?rl(Object(e),!0).forEach(function(o){W0(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):rl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function W0(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function z0(t,n){if(t==null)return{};var e=$0(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function $0(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var U0={active:J.bool,"aria-label":J.string,onClick:J.func,variant:J.oneOf(["white"]),className:J.string,cssModule:J.object,innerRef:J.oneOfType([J.object,J.string,J.func])};function ep(t){var n=t.className;t.cssModule;var e=t.variant,o=t.innerRef,r=z0(t,B0),i=Di(ot(n,"btn-close",e&&"btn-close-".concat(e)));return g.createElement("button",Za({ref:o,type:"button",className:i},H0({"aria-label":"close"},r)))}ep.propTypes=U0;var V0=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function Ka(){return Ka=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Ka.apply(this,arguments)}function G0(t,n){if(t==null)return{};var e=Y0(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function Y0(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var Z0={active:J.bool,"aria-label":J.string,block:J.bool,children:J.node,className:J.string,cssModule:J.object,close:J.bool,color:J.string,disabled:J.bool,innerRef:J.oneOfType([J.object,J.func,J.string]),onClick:J.func,outline:J.bool,size:J.string,tag:Ns};function ci(t){var n=g.useCallback(function(S){if(t.disabled){S.preventDefault();return}if(t.onClick)return t.onClick(S)},[t.onClick,t.disabled]),e=t.active,o=t["aria-label"],r=t.block,i=t.className,a=t.close,c=t.cssModule,l=t.color,u=l===void 0?"secondary":l,f=t.outline,p=t.size,d=t.tag,h=d===void 0?"button":d,m=t.innerRef,v=G0(t,V0);if(a)return g.createElement(ep,v);var y="btn".concat(f?"-outline":"","-").concat(u),b=Di(ot(i,"btn",y,p?"btn-".concat(p):!1,r?"d-block w-100":!1,{active:e,disabled:t.disabled}),c);return v.href&&h==="button"&&(h="a"),g.createElement(h,Ka({type:h==="button"&&v.onClick?"button":void 0},v,{className:b,ref:m,onClick:n,"aria-label":o}))}ci.propTypes=Z0;var il=function(n){return n.reduce(function(e,o){var r=o[0],i=o[1];return e[r]=i,e},{})},al=typeof window<"u"&&window.document&&window.document.createElement?D.useLayoutEffect:D.useEffect,Mt="top",Yt="bottom",Zt="right",_t="left",Is="auto",gr=[Mt,Yt,Zt,_t],Eo="start",lr="end",K0="clippingParents",tp="viewport",$o="popper",q0="reference",sl=gr.reduce(function(t,n){return t.concat([n+"-"+Eo,n+"-"+lr])},[]),np=[].concat(gr,[Is]).reduce(function(t,n){return t.concat([n,n+"-"+Eo,n+"-"+lr])},[]),J0="beforeRead",X0="read",Q0="afterRead",ev="beforeMain",tv="main",nv="afterMain",ov="beforeWrite",rv="write",iv="afterWrite",av=[J0,X0,Q0,ev,tv,nv,ov,rv,iv];function on(t){return t?(t.nodeName||"").toLowerCase():null}function Wt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function no(t){var n=Wt(t).Element;return t instanceof n||t instanceof Element}function Gt(t){var n=Wt(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function As(t){if(typeof ShadowRoot>"u")return!1;var n=Wt(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function sv(t){var n=t.state;Object.keys(n.elements).forEach(function(e){var o=n.styles[e]||{},r=n.attributes[e]||{},i=n.elements[e];!Gt(i)||!on(i)||(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var c=r[a];c===!1?i.removeAttribute(a):i.setAttribute(a,c===!0?"":c)}))})}function cv(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach(function(o){var r=n.elements[o],i=n.attributes[o]||{},a=Object.keys(n.styles.hasOwnProperty(o)?n.styles[o]:e[o]),c=a.reduce(function(l,u){return l[u]="",l},{});!Gt(r)||!on(r)||(Object.assign(r.style,c),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}const lv={name:"applyStyles",enabled:!0,phase:"write",fn:sv,effect:cv,requires:["computeStyles"]};function tn(t){return t.split("-")[0]}var Jn=Math.max,li=Math.min,jo=Math.round;function qa(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function op(){return!/^((?!chrome|android).)*safari/i.test(qa())}function Oo(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);var o=t.getBoundingClientRect(),r=1,i=1;n&&Gt(t)&&(r=t.offsetWidth>0&&jo(o.width)/t.offsetWidth||1,i=t.offsetHeight>0&&jo(o.height)/t.offsetHeight||1);var a=no(t)?Wt(t):window,c=a.visualViewport,l=!op()&&e,u=(o.left+(l&&c?c.offsetLeft:0))/r,f=(o.top+(l&&c?c.offsetTop:0))/i,p=o.width/r,d=o.height/i;return{width:p,height:d,top:f,right:u+p,bottom:f+d,left:u,x:u,y:f}}function Ps(t){var n=Oo(t),e=t.offsetWidth,o=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-o)<=1&&(o=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:o}}function rp(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&As(e)){var o=n;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function pn(t){return Wt(t).getComputedStyle(t)}function uv(t){return["table","td","th"].indexOf(on(t))>=0}function Tn(t){return((no(t)?t.ownerDocument:t.document)||window.document).documentElement}function Mi(t){return on(t)==="html"?t:t.assignedSlot||t.parentNode||(As(t)?t.host:null)||Tn(t)}function cl(t){return!Gt(t)||pn(t).position==="fixed"?null:t.offsetParent}function dv(t){var n=/firefox/i.test(qa()),e=/Trident/i.test(qa());if(e&&Gt(t)){var o=pn(t);if(o.position==="fixed")return null}var r=Mi(t);for(As(r)&&(r=r.host);Gt(r)&&["html","body"].indexOf(on(r))<0;){var i=pn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||n&&i.willChange==="filter"||n&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function vr(t){for(var n=Wt(t),e=cl(t);e&&uv(e)&&pn(e).position==="static";)e=cl(e);return e&&(on(e)==="html"||on(e)==="body"&&pn(e).position==="static")?n:e||dv(t)||n}function Ts(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function tr(t,n,e){return Jn(t,li(n,e))}function fv(t,n,e){var o=tr(t,n,e);return o>e?e:o}function ip(){return{top:0,right:0,bottom:0,left:0}}function ap(t){return Object.assign({},ip(),t)}function sp(t,n){return n.reduce(function(e,o){return e[o]=t,e},{})}var pv=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,ap(typeof n!="number"?n:sp(n,gr))};function hv(t){var n,e=t.state,o=t.name,r=t.options,i=e.elements.arrow,a=e.modifiersData.popperOffsets,c=tn(e.placement),l=Ts(c),u=[_t,Zt].indexOf(c)>=0,f=u?"height":"width";if(!(!i||!a)){var p=pv(r.padding,e),d=Ps(i),h=l==="y"?Mt:_t,m=l==="y"?Yt:Zt,v=e.rects.reference[f]+e.rects.reference[l]-a[l]-e.rects.popper[f],y=a[l]-e.rects.reference[l],b=vr(i),S=b?l==="y"?b.clientHeight||0:b.clientWidth||0:0,w=v/2-y/2,x=p[h],E=S-d[f]-p[m],O=S/2-d[f]/2+w,M=tr(x,O,E),B=l;e.modifiersData[o]=(n={},n[B]=M,n.centerOffset=M-O,n)}}function mv(t){var n=t.state,e=t.options,o=e.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=n.elements.popper.querySelector(r),!r)||rp(n.elements.popper,r)&&(n.elements.arrow=r))}const gv={name:"arrow",enabled:!0,phase:"main",fn:hv,effect:mv,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function No(t){return t.split("-")[1]}var vv={top:"auto",right:"auto",bottom:"auto",left:"auto"};function yv(t,n){var e=t.x,o=t.y,r=n.devicePixelRatio||1;return{x:jo(e*r)/r||0,y:jo(o*r)/r||0}}function ll(t){var n,e=t.popper,o=t.popperRect,r=t.placement,i=t.variation,a=t.offsets,c=t.position,l=t.gpuAcceleration,u=t.adaptive,f=t.roundOffsets,p=t.isFixed,d=a.x,h=d===void 0?0:d,m=a.y,v=m===void 0?0:m,y=typeof f=="function"?f({x:h,y:v}):{x:h,y:v};h=y.x,v=y.y;var b=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),w=_t,x=Mt,E=window;if(u){var O=vr(e),M="clientHeight",B="clientWidth";if(O===Wt(e)&&(O=Tn(e),pn(O).position!=="static"&&c==="absolute"&&(M="scrollHeight",B="scrollWidth")),O=O,r===Mt||(r===_t||r===Zt)&&i===lr){x=Yt;var $=p&&O===E&&E.visualViewport?E.visualViewport.height:O[M];v-=$-o.height,v*=l?1:-1}if(r===_t||(r===Mt||r===Yt)&&i===lr){w=Zt;var Z=p&&O===E&&E.visualViewport?E.visualViewport.width:O[B];h-=Z-o.width,h*=l?1:-1}}var _=Object.assign({position:c},u&&vv),I=f===!0?yv({x:h,y:v},Wt(e)):{x:h,y:v};if(h=I.x,v=I.y,l){var he;return Object.assign({},_,(he={},he[x]=S?"0":"",he[w]=b?"0":"",he.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",he))}return Object.assign({},_,(n={},n[x]=S?v+"px":"",n[w]=b?h+"px":"",n.transform="",n))}function bv(t){var n=t.state,e=t.options,o=e.gpuAcceleration,r=o===void 0?!0:o,i=e.adaptive,a=i===void 0?!0:i,c=e.roundOffsets,l=c===void 0?!0:c,u={placement:tn(n.placement),variation:No(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,ll(Object.assign({},u,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:l})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,ll(Object.assign({},u,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}const wv={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:bv,data:{}};var _r={passive:!0};function xv(t){var n=t.state,e=t.instance,o=t.options,r=o.scroll,i=r===void 0?!0:r,a=o.resize,c=a===void 0?!0:a,l=Wt(n.elements.popper),u=[].concat(n.scrollParents.reference,n.scrollParents.popper);return i&&u.forEach(function(f){f.addEventListener("scroll",e.update,_r)}),c&&l.addEventListener("resize",e.update,_r),function(){i&&u.forEach(function(f){f.removeEventListener("scroll",e.update,_r)}),c&&l.removeEventListener("resize",e.update,_r)}}const Cv={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:xv,data:{}};var kv={left:"right",right:"left",bottom:"top",top:"bottom"};function Ur(t){return t.replace(/left|right|bottom|top/g,function(n){return kv[n]})}var Sv={start:"end",end:"start"};function ul(t){return t.replace(/start|end/g,function(n){return Sv[n]})}function Ds(t){var n=Wt(t),e=n.pageXOffset,o=n.pageYOffset;return{scrollLeft:e,scrollTop:o}}function Ms(t){return Oo(Tn(t)).left+Ds(t).scrollLeft}function Ev(t,n){var e=Wt(t),o=Tn(t),r=e.visualViewport,i=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){i=r.width,a=r.height;var u=op();(u||!u&&n==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:c+Ms(t),y:l}}function jv(t){var n,e=Tn(t),o=Ds(t),r=(n=t.ownerDocument)==null?void 0:n.body,i=Jn(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Jn(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-o.scrollLeft+Ms(t),l=-o.scrollTop;return pn(r||e).direction==="rtl"&&(c+=Jn(e.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:c,y:l}}function _s(t){var n=pn(t),e=n.overflow,o=n.overflowX,r=n.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+o)}function cp(t){return["html","body","#document"].indexOf(on(t))>=0?t.ownerDocument.body:Gt(t)&&_s(t)?t:cp(Mi(t))}function nr(t,n){var e;n===void 0&&(n=[]);var o=cp(t),r=o===((e=t.ownerDocument)==null?void 0:e.body),i=Wt(o),a=r?[i].concat(i.visualViewport||[],_s(o)?o:[]):o,c=n.concat(a);return r?c:c.concat(nr(Mi(a)))}function Ja(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Ov(t,n){var e=Oo(t,!1,n==="fixed");return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function dl(t,n,e){return n===tp?Ja(Ev(t,e)):no(n)?Ov(n,e):Ja(jv(Tn(t)))}function Nv(t){var n=nr(Mi(t)),e=["absolute","fixed"].indexOf(pn(t).position)>=0,o=e&&Gt(t)?vr(t):t;return no(o)?n.filter(function(r){return no(r)&&rp(r,o)&&on(r)!=="body"}):[]}function Iv(t,n,e,o){var r=n==="clippingParents"?Nv(t):[].concat(n),i=[].concat(r,[e]),a=i[0],c=i.reduce(function(l,u){var f=dl(t,u,o);return l.top=Jn(f.top,l.top),l.right=li(f.right,l.right),l.bottom=li(f.bottom,l.bottom),l.left=Jn(f.left,l.left),l},dl(t,a,o));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function lp(t){var n=t.reference,e=t.element,o=t.placement,r=o?tn(o):null,i=o?No(o):null,a=n.x+n.width/2-e.width/2,c=n.y+n.height/2-e.height/2,l;switch(r){case Mt:l={x:a,y:n.y-e.height};break;case Yt:l={x:a,y:n.y+n.height};break;case Zt:l={x:n.x+n.width,y:c};break;case _t:l={x:n.x-e.width,y:c};break;default:l={x:n.x,y:n.y}}var u=r?Ts(r):null;if(u!=null){var f=u==="y"?"height":"width";switch(i){case Eo:l[u]=l[u]-(n[f]/2-e[f]/2);break;case lr:l[u]=l[u]+(n[f]/2-e[f]/2);break}}return l}function ur(t,n){n===void 0&&(n={});var e=n,o=e.placement,r=o===void 0?t.placement:o,i=e.strategy,a=i===void 0?t.strategy:i,c=e.boundary,l=c===void 0?K0:c,u=e.rootBoundary,f=u===void 0?tp:u,p=e.elementContext,d=p===void 0?$o:p,h=e.altBoundary,m=h===void 0?!1:h,v=e.padding,y=v===void 0?0:v,b=ap(typeof y!="number"?y:sp(y,gr)),S=d===$o?q0:$o,w=t.rects.popper,x=t.elements[m?S:d],E=Iv(no(x)?x:x.contextElement||Tn(t.elements.popper),l,f,a),O=Oo(t.elements.reference),M=lp({reference:O,element:w,strategy:"absolute",placement:r}),B=Ja(Object.assign({},w,M)),$=d===$o?B:O,Z={top:E.top-$.top+b.top,bottom:$.bottom-E.bottom+b.bottom,left:E.left-$.left+b.left,right:$.right-E.right+b.right},_=t.modifiersData.offset;if(d===$o&&_){var I=_[r];Object.keys(Z).forEach(function(he){var ye=[Zt,Yt].indexOf(he)>=0?1:-1,ne=[Mt,Yt].indexOf(he)>=0?"y":"x";Z[he]+=I[ne]*ye})}return Z}function Av(t,n){n===void 0&&(n={});var e=n,o=e.placement,r=e.boundary,i=e.rootBoundary,a=e.padding,c=e.flipVariations,l=e.allowedAutoPlacements,u=l===void 0?np:l,f=No(o),p=f?c?sl:sl.filter(function(m){return No(m)===f}):gr,d=p.filter(function(m){return u.indexOf(m)>=0});d.length===0&&(d=p);var h=d.reduce(function(m,v){return m[v]=ur(t,{placement:v,boundary:r,rootBoundary:i,padding:a})[tn(v)],m},{});return Object.keys(h).sort(function(m,v){return h[m]-h[v]})}function Pv(t){if(tn(t)===Is)return[];var n=Ur(t);return[ul(t),n,ul(n)]}function Tv(t){var n=t.state,e=t.options,o=t.name;if(!n.modifiersData[o]._skip){for(var r=e.mainAxis,i=r===void 0?!0:r,a=e.altAxis,c=a===void 0?!0:a,l=e.fallbackPlacements,u=e.padding,f=e.boundary,p=e.rootBoundary,d=e.altBoundary,h=e.flipVariations,m=h===void 0?!0:h,v=e.allowedAutoPlacements,y=n.options.placement,b=tn(y),S=b===y,w=l||(S||!m?[Ur(y)]:Pv(y)),x=[y].concat(w).reduce(function(V,T){return V.concat(tn(T)===Is?Av(n,{placement:T,boundary:f,rootBoundary:p,padding:u,flipVariations:m,allowedAutoPlacements:v}):T)},[]),E=n.rects.reference,O=n.rects.popper,M=new Map,B=!0,$=x[0],Z=0;Z<x.length;Z++){var _=x[Z],I=tn(_),he=No(_)===Eo,ye=[Mt,Yt].indexOf(I)>=0,ne=ye?"width":"height",ge=ur(n,{placement:_,boundary:f,rootBoundary:p,altBoundary:d,padding:u}),de=ye?he?Zt:_t:he?Yt:Mt;E[ne]>O[ne]&&(de=Ur(de));var Oe=Ur(de),se=[];if(i&&se.push(ge[I]<=0),c&&se.push(ge[de]<=0,ge[Oe]<=0),se.every(function(V){return V})){$=_,B=!1;break}M.set(_,se)}if(B)for(var W=m?3:1,X=function(T){var P=x.find(function(R){var G=M.get(R);if(G)return G.slice(0,T).every(function(U){return U})});if(P)return $=P,"break"},fe=W;fe>0;fe--){var ue=X(fe);if(ue==="break")break}n.placement!==$&&(n.modifiersData[o]._skip=!0,n.placement=$,n.reset=!0)}}const Dv={name:"flip",enabled:!0,phase:"main",fn:Tv,requiresIfExists:["offset"],data:{_skip:!1}};function fl(t,n,e){return e===void 0&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function pl(t){return[Mt,Zt,Yt,_t].some(function(n){return t[n]>=0})}function Mv(t){var n=t.state,e=t.name,o=n.rects.reference,r=n.rects.popper,i=n.modifiersData.preventOverflow,a=ur(n,{elementContext:"reference"}),c=ur(n,{altBoundary:!0}),l=fl(a,o),u=fl(c,r,i),f=pl(l),p=pl(u);n.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:p},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}const _v={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Mv};function Lv(t,n,e){var o=tn(t),r=[_t,Mt].indexOf(o)>=0?-1:1,i=typeof e=="function"?e(Object.assign({},n,{placement:t})):e,a=i[0],c=i[1];return a=a||0,c=(c||0)*r,[_t,Zt].indexOf(o)>=0?{x:c,y:a}:{x:a,y:c}}function Rv(t){var n=t.state,e=t.options,o=t.name,r=e.offset,i=r===void 0?[0,0]:r,a=np.reduce(function(f,p){return f[p]=Lv(p,n.rects,i),f},{}),c=a[n.placement],l=c.x,u=c.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=l,n.modifiersData.popperOffsets.y+=u),n.modifiersData[o]=a}const Fv={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Rv};function Bv(t){var n=t.state,e=t.name;n.modifiersData[e]=lp({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}const Hv={name:"popperOffsets",enabled:!0,phase:"read",fn:Bv,data:{}};function Wv(t){return t==="x"?"y":"x"}function zv(t){var n=t.state,e=t.options,o=t.name,r=e.mainAxis,i=r===void 0?!0:r,a=e.altAxis,c=a===void 0?!1:a,l=e.boundary,u=e.rootBoundary,f=e.altBoundary,p=e.padding,d=e.tether,h=d===void 0?!0:d,m=e.tetherOffset,v=m===void 0?0:m,y=ur(n,{boundary:l,rootBoundary:u,padding:p,altBoundary:f}),b=tn(n.placement),S=No(n.placement),w=!S,x=Ts(b),E=Wv(x),O=n.modifiersData.popperOffsets,M=n.rects.reference,B=n.rects.popper,$=typeof v=="function"?v(Object.assign({},n.rects,{placement:n.placement})):v,Z=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),_=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,I={x:0,y:0};if(O){if(i){var he,ye=x==="y"?Mt:_t,ne=x==="y"?Yt:Zt,ge=x==="y"?"height":"width",de=O[x],Oe=de+y[ye],se=de-y[ne],W=h?-B[ge]/2:0,X=S===Eo?M[ge]:B[ge],fe=S===Eo?-B[ge]:-M[ge],ue=n.elements.arrow,V=h&&ue?Ps(ue):{width:0,height:0},T=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:ip(),P=T[ye],R=T[ne],G=tr(0,M[ge],V[ge]),U=w?M[ge]/2-W-G-P-Z.mainAxis:X-G-P-Z.mainAxis,re=w?-M[ge]/2+W+G+R+Z.mainAxis:fe+G+R+Z.mainAxis,ee=n.elements.arrow&&vr(n.elements.arrow),A=ee?x==="y"?ee.clientTop||0:ee.clientLeft||0:0,ke=(he=_==null?void 0:_[x])!=null?he:0,xe=de+U-ke-A,_e=de+re-ke,Ie=tr(h?li(Oe,xe):Oe,de,h?Jn(se,_e):se);O[x]=Ie,I[x]=Ie-de}if(c){var Pe,me=x==="x"?Mt:_t,k=x==="x"?Yt:Zt,C=O[E],j=E==="y"?"height":"width",N=C+y[me],F=C-y[k],te=[Mt,_t].indexOf(b)!==-1,K=(Pe=_==null?void 0:_[E])!=null?Pe:0,z=te?N:C-M[j]-B[j]-K+Z.altAxis,H=te?C+M[j]+B[j]-K-Z.altAxis:F,Y=h&&te?fv(z,C,H):tr(h?z:N,C,h?H:F);O[E]=Y,I[E]=Y-C}n.modifiersData[o]=I}}const $v={name:"preventOverflow",enabled:!0,phase:"main",fn:zv,requiresIfExists:["offset"]};function Uv(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Vv(t){return t===Wt(t)||!Gt(t)?Ds(t):Uv(t)}function Gv(t){var n=t.getBoundingClientRect(),e=jo(n.width)/t.offsetWidth||1,o=jo(n.height)/t.offsetHeight||1;return e!==1||o!==1}function Yv(t,n,e){e===void 0&&(e=!1);var o=Gt(n),r=Gt(n)&&Gv(n),i=Tn(n),a=Oo(t,r,e),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!e)&&((on(n)!=="body"||_s(i))&&(c=Vv(n)),Gt(n)?(l=Oo(n,!0),l.x+=n.clientLeft,l.y+=n.clientTop):i&&(l.x=Ms(i))),{x:a.left+c.scrollLeft-l.x,y:a.top+c.scrollTop-l.y,width:a.width,height:a.height}}function Zv(t){var n=new Map,e=new Set,o=[];t.forEach(function(i){n.set(i.name,i)});function r(i){e.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(c){if(!e.has(c)){var l=n.get(c);l&&r(l)}}),o.push(i)}return t.forEach(function(i){e.has(i.name)||r(i)}),o}function Kv(t){var n=Zv(t);return av.reduce(function(e,o){return e.concat(n.filter(function(r){return r.phase===o}))},[])}function qv(t){var n;return function(){return n||(n=new Promise(function(e){Promise.resolve().then(function(){n=void 0,e(t())})})),n}}function Jv(t){var n=t.reduce(function(e,o){var r=e[o.name];return e[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,e},{});return Object.keys(n).map(function(e){return n[e]})}var hl={placement:"bottom",modifiers:[],strategy:"absolute"};function ml(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function Xv(t){t===void 0&&(t={});var n=t,e=n.defaultModifiers,o=e===void 0?[]:e,r=n.defaultOptions,i=r===void 0?hl:r;return function(c,l,u){u===void 0&&(u=i);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},hl,i),modifiersData:{},elements:{reference:c,popper:l},attributes:{},styles:{}},p=[],d=!1,h={state:f,setOptions:function(b){var S=typeof b=="function"?b(f.options):b;v(),f.options=Object.assign({},i,f.options,S),f.scrollParents={reference:no(c)?nr(c):c.contextElement?nr(c.contextElement):[],popper:nr(l)};var w=Kv(Jv([].concat(o,f.options.modifiers)));return f.orderedModifiers=w.filter(function(x){return x.enabled}),m(),h.update()},forceUpdate:function(){if(!d){var b=f.elements,S=b.reference,w=b.popper;if(ml(S,w)){f.rects={reference:Yv(S,vr(w),f.options.strategy==="fixed"),popper:Ps(w)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(Z){return f.modifiersData[Z.name]=Object.assign({},Z.data)});for(var x=0;x<f.orderedModifiers.length;x++){if(f.reset===!0){f.reset=!1,x=-1;continue}var E=f.orderedModifiers[x],O=E.fn,M=E.options,B=M===void 0?{}:M,$=E.name;typeof O=="function"&&(f=O({state:f,options:B,name:$,instance:h})||f)}}}},update:qv(function(){return new Promise(function(y){h.forceUpdate(),y(f)})}),destroy:function(){v(),d=!0}};if(!ml(c,l))return h;h.setOptions(u).then(function(y){!d&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){f.orderedModifiers.forEach(function(y){var b=y.name,S=y.options,w=S===void 0?{}:S,x=y.effect;if(typeof x=="function"){var E=x({state:f,name:b,instance:h,options:w}),O=function(){};p.push(E||O)}})}function v(){p.forEach(function(y){return y()}),p=[]}return h}}var Qv=[Cv,Hv,wv,lv,Fv,Dv,$v,gv,_v],e1=Xv({defaultModifiers:Qv}),t1=typeof Element<"u",n1=typeof Map=="function",o1=typeof Set=="function",r1=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Vr(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var e,o,r;if(Array.isArray(t)){if(e=t.length,e!=n.length)return!1;for(o=e;o--!==0;)if(!Vr(t[o],n[o]))return!1;return!0}var i;if(n1&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!n.has(o.value[0]))return!1;for(i=t.entries();!(o=i.next()).done;)if(!Vr(o.value[1],n.get(o.value[0])))return!1;return!0}if(o1&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(r1&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(e=t.length,e!=n.length)return!1;for(o=e;o--!==0;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof n.valueOf=="function")return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof n.toString=="function")return t.toString()===n.toString();if(r=Object.keys(t),e=r.length,e!==Object.keys(n).length)return!1;for(o=e;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,r[o]))return!1;if(t1&&t instanceof Element)return!1;for(o=e;o--!==0;)if(!((r[o]==="_owner"||r[o]==="__v"||r[o]==="__o")&&t.$$typeof)&&!Vr(t[r[o]],n[r[o]]))return!1;return!0}return t!==t&&n!==n}var i1=function(n,e){try{return Vr(n,e)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}};const a1=Ti(i1);var s1=[],c1=function(n,e,o){o===void 0&&(o={});var r=D.useRef(null),i={onFirstUpdate:o.onFirstUpdate,placement:o.placement||"bottom",strategy:o.strategy||"absolute",modifiers:o.modifiers||s1},a=D.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),c=a[0],l=a[1],u=D.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(h){var m=h.state,v=Object.keys(m.elements);Rl.flushSync(function(){l({styles:il(v.map(function(y){return[y,m.styles[y]||{}]})),attributes:il(v.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),f=D.useMemo(function(){var d={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[u,{name:"applyStyles",enabled:!1}])};return a1(r.current,d)?r.current||d:(r.current=d,d)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,u]),p=D.useRef();return al(function(){p.current&&p.current.setOptions(f)},[f]),al(function(){if(!(n==null||e==null)){var d=o.createPopper||e1,h=d(n,e,f);return p.current=h,function(){h.destroy(),p.current=null}}},[n,e,o.createPopper]),{state:p.current?p.current.state:null,styles:c.styles,attributes:c.attributes,update:p.current?p.current.update:null,forceUpdate:p.current?p.current.forceUpdate:null}},l1=["className","cssModule","size","vertical","tag"];function Xa(){return Xa=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Xa.apply(this,arguments)}function gl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function u1(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?gl(Object(e),!0).forEach(function(o){d1(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):gl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function d1(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function f1(t,n){if(t==null)return{};var e=p1(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function p1(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var h1={"aria-label":J.string,className:J.string,cssModule:J.object,role:J.string,size:J.string,tag:Ns,vertical:J.bool};function up(t){var n=t.className,e=t.cssModule,o=t.size,r=t.vertical,i=t.tag,a=i===void 0?"div":i,c=f1(t,l1),l=Di(ot(n,o?"btn-group-"+o:!1,r?"btn-group-vertical":"btn-group"),e);return g.createElement(a,Xa({},u1({role:"group"},c),{className:l}))}up.propTypes=h1;function m1(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function Qa(t,n){return Qa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},Qa(t,n)}function g1(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,Qa(t,n)}const vl={disabled:!1};var v1=process.env.NODE_ENV!=="production"?J.oneOfType([J.number,J.shape({enter:J.number,exit:J.number,appear:J.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&J.oneOfType([J.string,J.shape({enter:J.string,exit:J.string,active:J.string}),J.shape({enter:J.string,enterDone:J.string,enterActive:J.string,exit:J.string,exitDone:J.string,exitActive:J.string})]);const dp=g.createContext(null);var y1=function(n){return n.scrollTop},qo="unmounted",Ln="exited",Rn="entering",ho="entered",es="exiting",mn=function(t){g1(n,t);function n(o,r){var i;i=t.call(this,o,r)||this;var a=r,c=a&&!a.isMounting?o.enter:o.appear,l;return i.appearStatus=null,o.in?c?(l=Ln,i.appearStatus=Rn):l=ho:o.unmountOnExit||o.mountOnEnter?l=qo:l=Ln,i.state={status:l},i.nextCallback=null,i}n.getDerivedStateFromProps=function(r,i){var a=r.in;return a&&i.status===qo?{status:Ln}:null};var e=n.prototype;return e.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},e.componentDidUpdate=function(r){var i=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==Rn&&a!==ho&&(i=Rn):(a===Rn||a===ho)&&(i=es)}this.updateStatus(!1,i)},e.componentWillUnmount=function(){this.cancelNextCallback()},e.getTimeouts=function(){var r=this.props.timeout,i,a,c;return i=a=c=r,r!=null&&typeof r!="number"&&(i=r.exit,a=r.enter,c=r.appear!==void 0?r.appear:a),{exit:i,enter:a,appear:c}},e.updateStatus=function(r,i){if(r===void 0&&(r=!1),i!==null)if(this.cancelNextCallback(),i===Rn){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Un.findDOMNode(this);a&&y1(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ln&&this.setState({status:qo})},e.performEnter=function(r){var i=this,a=this.props.enter,c=this.context?this.context.isMounting:r,l=this.props.nodeRef?[c]:[Un.findDOMNode(this),c],u=l[0],f=l[1],p=this.getTimeouts(),d=c?p.appear:p.enter;if(!r&&!a||vl.disabled){this.safeSetState({status:ho},function(){i.props.onEntered(u)});return}this.props.onEnter(u,f),this.safeSetState({status:Rn},function(){i.props.onEntering(u,f),i.onTransitionEnd(d,function(){i.safeSetState({status:ho},function(){i.props.onEntered(u,f)})})})},e.performExit=function(){var r=this,i=this.props.exit,a=this.getTimeouts(),c=this.props.nodeRef?void 0:Un.findDOMNode(this);if(!i||vl.disabled){this.safeSetState({status:Ln},function(){r.props.onExited(c)});return}this.props.onExit(c),this.safeSetState({status:es},function(){r.props.onExiting(c),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:Ln},function(){r.props.onExited(c)})})})},e.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},e.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},e.setNextCallback=function(r){var i=this,a=!0;return this.nextCallback=function(c){a&&(a=!1,i.nextCallback=null,r(c))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},e.onTransitionEnd=function(r,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:Un.findDOMNode(this),c=r==null&&!this.props.addEndListener;if(!a||c){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],f=l[1];this.props.addEndListener(u,f)}r!=null&&setTimeout(this.nextCallback,r)},e.render=function(){var r=this.state.status;if(r===qo)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var c=m1(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return g.createElement(dp.Provider,{value:null},typeof a=="function"?a(r,c):g.cloneElement(g.Children.only(a),c))},n}(g.Component);mn.contextType=dp;mn.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:J.shape({current:typeof Element>"u"?J.any:function(t,n,e,o,r,i){var a=t[n];return J.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(t,n,e,o,r,i)}}),children:J.oneOfType([J.func.isRequired,J.element.isRequired]).isRequired,in:J.bool,mountOnEnter:J.bool,unmountOnExit:J.bool,appear:J.bool,enter:J.bool,exit:J.bool,timeout:function(n){var e=v1;n.addEndListener||(e=e.isRequired);for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return e.apply(void 0,[n].concat(r))},addEndListener:J.func,onEnter:J.func,onEntering:J.func,onEntered:J.func,onExit:J.func,onExiting:J.func,onExited:J.func}:{};function so(){}mn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:so,onEntering:so,onEntered:so,onExit:so,onExiting:so,onExited:so};mn.UNMOUNTED=qo;mn.EXITED=Ln;mn.ENTERING=Rn;mn.ENTERED=ho;mn.EXITING=es;const Ls=mn;function ts(t){"@babel/helpers - typeof";return ts=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ts(t)}var b1=["tag","horizontal","isOpen","className","navbar","cssModule","children","innerRef"],co;function ui(){return ui=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},ui.apply(this,arguments)}function w1(t,n){if(t==null)return{};var e=x1(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function x1(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function C1(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function yl(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function k1(t,n,e){return n&&yl(t.prototype,n),e&&yl(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function S1(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&ns(t,n)}function ns(t,n){return ns=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},ns(t,n)}function E1(t){var n=O1();return function(){var o=di(t),r;if(n){var i=di(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return j1(this,r)}}function j1(t,n){if(n&&(ts(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fp(t)}function fp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function O1(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function di(t){return di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},di(t)}function bl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function Io(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?bl(Object(e),!0).forEach(function(o){vo(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):bl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function vo(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var N1=Io(Io({},Ls.propTypes),{},{horizontal:J.bool,isOpen:J.bool,children:J.oneOfType([J.arrayOf(J.node),J.node]),tag:Ns,className:J.node,navbar:J.bool,cssModule:J.object,innerRef:J.shape({current:J.object})}),I1=Io(Io({},Ls.defaultProps),{},{horizontal:!1,isOpen:!1,appear:!1,enter:!0,exit:!0,tag:"div",timeout:F0.Collapse}),A1=(co={},vo(co,Mr.ENTERING,"collapsing"),vo(co,Mr.ENTERED,"collapse show"),vo(co,Mr.EXITING,"collapsing"),vo(co,Mr.EXITED,"collapse"),co);function P1(t){return A1[t]||"collapse"}var Rs=function(t){S1(e,t);var n=E1(e);function e(o){var r;return C1(this,e),r=n.call(this,o),r.state={dimension:null},r.nodeRef=o.innerRef||g.createRef(),["onEntering","onEntered","onExit","onExiting","onExited"].forEach(function(i){r[i]=r[i].bind(fp(r))}),r}return k1(e,[{key:"onEntering",value:function(r,i){var a=this.getNode();this.setState({dimension:this.getDimension(a)}),this.props.onEntering(a,i)}},{key:"onEntered",value:function(r,i){var a=this.getNode();this.setState({dimension:null}),this.props.onEntered(a,i)}},{key:"onExit",value:function(){var r=this.getNode();this.setState({dimension:this.getDimension(r)}),this.props.onExit(r)}},{key:"onExiting",value:function(){var r=this.getNode();this.getDimension(r),this.setState({dimension:0}),this.props.onExiting(r)}},{key:"onExited",value:function(){var r=this.getNode();this.setState({dimension:null}),this.props.onExited(r)}},{key:"getNode",value:function(){return this.nodeRef.current}},{key:"getDimension",value:function(r){return this.props.horizontal?r.scrollWidth:r.scrollHeight}},{key:"render",value:function(){var r=this,i=this.props,a=i.tag,c=i.horizontal,l=i.isOpen,u=i.className,f=i.navbar,p=i.cssModule,d=i.children;i.innerRef;var h=w1(i,b1),m=this.state.dimension,v=_0(h,ol),y=M0(h,ol);return g.createElement(Ls,ui({},v,{in:l,nodeRef:this.nodeRef,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(b){var S=P1(b),w=Di(ot(u,c&&"collapse-horizontal",S,f&&"navbar-collapse"),p),x=m===null?null:vo({},c?"width":"height",m);return g.createElement(a,ui({},y,{style:Io(Io({},y.style),x),className:w,ref:r.nodeRef}),d)})}}]),e}(g.Component);Rs.propTypes=N1;Rs.defaultProps=I1;const pp=Rs,T1=t=>{const{className:n,isOpen:e,showCollapseIcon:o,showFolderIcon:r,title:i,...a}=t;return s.jsx(ut.ItemHeader,{className:ot("io-base-section-header",n),prepend:r&&s.jsx(et,{size:"16",variant:e?"folder-open":"folder"}),append:o&&s.jsx(et,{className:ot("collapse-icon",!e&&"collapsed"),size:"10",variant:"expand"}),tooltip:i,...a,children:i})},hp=()=>{const[t,n]=g.useState([]),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=l=>{const{name:u,title:f,caption:p,icon:d,userProperties:h}=l;return{id:u,name:u,title:f??u,caption:p,icon:d,userProperties:h}},r=e.appManager.onAppAdded(l=>{if(l.userProperties.hidden||"hidden"in l&&l.hidden)return;const u=o(l);n(f=>[...f,u])}),i=e.appManager.onAppChanged(l=>{const u=o(l);n(f=>[...f.filter(p=>p.id!==u.id),u])}),a=e.appManager.onAppRemoved(l=>{const u=o(l);n(f=>f.filter(p=>p.id!==u.id))}),c=[r,a,i];return()=>c.forEach(l=>l())},[e]),t},D1=()=>{const[t,n]=g.useState({}),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.appManager.onInstanceStarted(a=>{n(c=>{const l=c[a.application.name]??[];return{...c,[a.application.name]:[...l,a.id]}})}),r=e.appManager.onInstanceStopped(a=>{n(c=>({...c,[a.application.name]:c[a.application.name].filter(l=>l!==a.id)}))}),i=[o,r];return()=>i.forEach(a=>a())},[e]),t},M1=t=>{g.useEffect(()=>{var e;if(!((e=window.iobrowser)!=null&&e.platformStarted)||t)return;const n=o=>{o.preventDefault(),o.returnValue=!0};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t])},Fs=()=>{const[t,n]=g.useState(),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{var o;try{const i=!((o=e.windows.my())!=null&&o.name)?Co.getFrameId():void 0;n(i)}catch(r){console.error("Failed to get the current frame ID ",{error:r})}},[e,Co.getFrameId,n]),t},Le={SUCCESS:"success",WARNING:"warning"},_1={success:5*1e3,warning:10*1e3},Fe=async t=>{const{io:n,variant:e,text:o,error:r}=t,i=Ua(r);try{if(e===Le.WARNING&&n.logger.warn(i?`${o} ${i}`:o),!("modals"in n&&n.modals))throw new Error("Modals are not enabled.");const a={text:o,variant:e,ttl:_1[e]};await n.modals.alerts.request(a)}catch(a){n.logger.warn(`Failed to request alert. ${Ua(a)}`)}},L1=async t=>{var o;const{io:n,item:e}=t;try{await((o=n.appManager.application(e.id))==null?void 0:o.start())}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to start app "${e.title}" in a new window.`,error:r})}},R1=async t=>{const{io:n,item:e,frameId:o}=t;if(!n.workspaces)return;const r={type:"workspace",definition:{frame:o?{reuseFrameId:o}:{newFrame:!0}}},i=n.workspaces.getBuilder(r);i.addGroup().addWindow({appName:e.id});try{await i.create()}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to start app "${e.title}" in a new Workspace.`,error:a})}},F1={[ii.OPEN_IN_NEW_WINDOW]:L1,[ii.OPEN_IN_NEW_WORKSPACE]:R1},mp=()=>{const t=g.useContext(De.IOConnectContext),n=Fs();return(e,o)=>{F1[o]({io:t,item:e,frameId:n})}},To={NO_INPUTS_CONFIRMATION_DIALOG:"noInputsConfirmationDialog",SINGLE_CHECKBOX_DIALOG:"singleCheckboxDialog",SINGLE_TEXT_INPUT_DIALOG:"singleTextInputDialog"},Bs="(.|\\s)*\\S(.|\\s)*",B1=async t=>{var i;const{io:n,layout:e,showDeletePromptPref:o,updateShowDeletePromptPref:r}=t;if("modals"in n&&n.modals&&o){const a="delete",c="do-not-ask-again",{isEnterPressed:l,responseButtonClicked:u,inputs:f}=await n.modals.dialogs.request({templateName:To.SINGLE_CHECKBOX_DIALOG,variables:{heading:`Delete Layout "${e.name}"`,text:"Are you sure you want to delete this Layout?",checkbox:{id:c,label:"Don't ask me again"},actionButtons:[{variant:"critical",text:"Delete",id:a},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(((i=f==null?void 0:f.find(h=>h.id===c))==null?void 0:i.checked)&&r(!1),!(l||(u==null?void 0:u.id)===a))return}try{await n.layouts.remove("Global",e.name),e.isDefault&&await n.layouts.clearDefaultGlobal(),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully deleted.`})}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to delete Layout "${e.name}".`,error:a})}},H1=async t=>{var p;const{io:n,layout:e,setDefaultLayout:o}=t;if(!("modals"in n&&n.modals)){console.error("Cannot rename Layout because io dialogs are not enabled");return}const r="rename",i="new-layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await n.modals.dialogs.request({templateName:To.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Rename "${e.name}"`,input:{id:i,initialValue:e.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Bs}},actionButtons:[{variant:"primary",text:"Rename",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(p=l==null?void 0:l.find(d=>d.id===i))==null?void 0:p.value;if(a||(c==null?void 0:c.id)===r){if(u===e.name){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}". The new Layout name must be different from the current one.`});return}try{if((await n.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}" to "${u}". A Layout with name "${u}" already exists.`});return}const h=await n.layouts.get(e.name,"Global");if(!h){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}". The Layout wasn't found.`});return}await n.layouts.rename(h,u),e.isDefault&&await o({name:u}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully renamed to "${u}".`})}catch(d){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}".`,error:d})}}},W1=async t=>{const{io:n,layout:e}=t;try{await n.layouts.save({name:e.name,type:"Global"}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was saved successfully.`})}catch(o){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${e.name}".`,error:o})}},z1=async t=>{var p;const{io:n,layout:e,setActiveLayout:o}=t;if(!("modals"in n&&n.modals)){console.error("Cannot save Layout under a new name because io dialogs are not enabled");return}const r="save-as",i="layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await n.modals.dialogs.request({templateName:To.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Save Layout "${e.name}" as`,input:{id:i,initialValue:e.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Bs}},actionButtons:[{variant:"primary",text:"Save as",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(p=l==null?void 0:l.find(d=>d.id===i))==null?void 0:p.value;if(a||(c==null?void 0:c.id)===r){if(u===e.name){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout as "${u}". The new Layout must have a unique name.`});return}try{if((await n.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout as "${u}". A Layout with this name already exists.`});return}const h=await n.layouts.get(e.name,"Global");if(!h){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${e.name}". The Layout wasn't found.`});return}await n.layouts.import([{...h,name:u}],"merge"),e.isActive&&o({name:u}),await Fe({io:n,variant:Le.SUCCESS,text:`The Layout was successfully saved as "${u}".`})}catch(d){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${u}".`,error:d})}}},$1=async t=>{const{io:n,layout:e,setDefaultLayout:o}=t;try{await o({name:e.name}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully set as the default Layout.`})}catch{await Fe({io:n,variant:Le.WARNING,text:`Failed to set Layout "${e.name}" as the default Layout.`})}},U1=async t=>{const{io:n,layout:e,closeLaunchpad:o}=t;try{await n.layouts.restore({name:e.name}),o(),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was loaded successfully.`})}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to load Layout "${e.name}".`,error:r})}},V1={delete:B1,rename:H1,save:W1,saveAs:z1,setAsDefault:$1,load:U1},G1="interopio_home_ui_auth0_validation_error",Y1="interopio_home_ui_user",Z1="interopio_home_ui_platform_window",yr="interopio_home_ui_platform_setup",gp="interopio_home_ui_active_layout";var gt=function(t){return{ok:!0,result:t}},st=function(t){return{ok:!1,error:t}},K1=function(t){return t.ok===!0?Promise.resolve(t.result):Promise.reject(t.error)},q1=function(t,n){return n.ok===!0?n.result:t},J1=function(t){if(t.ok===!0)return t.result;throw t.error},X1=function(t,n){return n.ok===!0?gt(t(n.result)):n},wl=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:gt(t(n.result,e.result))},ma=function(t,n){return n.ok===!0?n:st(t(n.error))},Q1=function(t,n){return n.ok===!0?t(n.result):n};/*! *****************************************************************************
36
36
  Copyright (c) Microsoft Corporation.
37
37
 
38
38
  Permission to use, copy, modify, and/or distribute this software for any
@@ -45,17 +45,17 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
45
45
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
46
46
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
47
47
  PERFORMANCE OF THIS SOFTWARE.
48
- ***************************************************************************** */var ns=function(){return ns=Object.assign||function(n){for(var e,o=1,r=arguments.length;o<r;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ns.apply(this,arguments)};function ny(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function os(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!os(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(var e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!os(t[o[e]],n[o[e]]))return!1;return!0}}var Jo=function(t){return Array.isArray(t)},Lr=function(t){return typeof t=="object"&&t!==null&&!Jo(t)},oy=function(t){switch(typeof t){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return t instanceof Array?"an array":t===null?"null":"an object";default:return JSON.stringify(t)}},cn=function(t,n){return"expected "+t+", got "+oy(n)},Uo=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Vo=function(t,n){var e=n.at,o=ny(n,["at"]);return ns({at:t+(e||"")},o)},pt=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ma(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return J1(e.run(o))},this.runWithException=function(o){return Q1(e.run(o))},this.map=function(o){return new t(function(r){return ey(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return ty(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?gt(n):st({message:cn("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?gt(n):st({message:cn("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?gt(n):st({message:cn("a boolean",n)})})},t.constant=function(n){return new t(function(e){return os(e,n)?gt(n):st({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Lr(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok===!0)i.result!==void 0&&(o[r]=i.result);else return e[r]===void 0?st({message:"the key '"+r+"' is required but was not present"}):st(Vo("."+r,i.error))}return gt(o)}else return Lr(e)?gt(e):st({message:cn("an object",e)})})},t.array=function(n){return new t(function(e){if(Jo(e)&&n){var o=function(r,i){return ma(function(a){return Vo("["+i+"]",a)},n.decode(r))};return e.reduce(function(r,i,a){return bl(function(c,l){return c.concat([l])},r,o(i,a))},gt([]))}else return Jo(e)?gt(e):st({message:cn("an array",e)})})},t.tuple=function(n){return new t(function(e){if(Jo(e)){if(e.length!==n.length)return st({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(i.ok)o[r]=i.result;else return st(Vo("["+r+"]",i.error))}return gt(o)}else return st({message:cn("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return bl(Object.assign,a,c.decode(i))},gt({}))})},t.anyJson=function(){return new t(function(n){return gt(n)})},t.unknownJson=function(){return new t(function(n){return gt(n)})},t.dict=function(n){return new t(function(e){if(Lr(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok===!0)o[r]=i.result;else return st(Vo("."+r,i.error))}return gt(o)}else return st({message:cn("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?gt(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return st({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return gt(X1(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return st({at:Uo(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Lr(r))return st({at:Uo(n.slice(0,i+1)),message:cn("an object",r)});if(typeof n[i]=="number"&&!Jo(r))return st({at:Uo(n.slice(0,i+1)),message:cn("an array",r)});r=r[n[i]]}return ma(function(a){return r===void 0?{at:Uo(n),message:"path does not exist"}:Vo(Uo(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return gt(n)})},t.fail=function(n){return new t(function(e){return st({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),ry=pt.string,iy=pt.number,Ao=pt.boolean,jt=pt.anyJson;pt.unknownJson;var An=pt.constant,Xe=pt.object,ay=pt.array;pt.tuple;pt.dict;var Me=pt.optional,dr=pt.oneOf;pt.union;pt.intersection;pt.withDefault;pt.valueAt;pt.succeed;var sy=pt.fail;pt.lazy;const Dt=ry().where(t=>t.length>0,"Expected a non-empty string"),cy=iy().where(t=>t>=0,"Expected a non-negative number");Ao();const zt=(t,n)=>{const e=typeof t;return e==="function"?jt():sy(`The provided argument as ${n} should be of type function, provided: ${typeof e}`)},vp=Xe({name:Dt}),ly="Welcome",uy=t=>t.components.reduce((e,o)=>{if(o.type==="workspaceFrame"){const r=o.state.workspaces.map(i=>i.config.name);e.push(...r)}return e},[]),wl=t=>t.trim().length>0,dy=(t,n)=>{const[e,o]=g.useState(void 0),[r,i]=rn("sessionStorage",gp,vp),a=g.useRef(!1),c=Us(),l=Vs(),u=g.useContext(De.IOConnectContext),p=g.useCallback(async({name:f})=>{try{await u.layouts.setDefaultGlobal(f)}catch(d){console.error("Failed to set default Layout: ",{error:d})}},[u]);return g.useEffect(()=>{if(u)return u.layouts.onDefaultGlobalChanged(f=>{o(f)})},[u]),g.useEffect(()=>{if(u)return u.layouts.onRestored(f=>{i({name:f.name})})},[u]),g.useEffect(()=>{if(u)return u.layouts.onRemoved(f=>{(f==null?void 0:f.name)===(r==null?void 0:r.name)&&i(null)})},[u,r]),g.useEffect(()=>{if(u)return u.layouts.onRenamed((f,d)=>{(d==null?void 0:d.name)===(r==null?void 0:r.name)&&i({name:f.name})})},[u,r]),g.useEffect(()=>{var d;if(!u||!((d=window.iobrowser)!=null&&d.platformStarted)||a.current)return;(async()=>{var b;a.current=!0;const h=await u.layouts.getDefaultGlobal()??(await u.layouts.getAll("Global")).find(S=>S.name===ly);if(!h||(o({name:h.name}),r))return;if(t(!0),n){await c(h.name),t(!1);return}const m=await((b=u.workspaces)==null?void 0:b.getWorkspace(S=>S.children.length===0)),v=await u.layouts.get(h.name,"Global");if(!v)throw new Error("Default Global Layout not found.");const y=uy(v);Promise.all(y.map((S,k)=>l({id:S,reuseWorkspaceId:k===0?m==null?void 0:m.id:void 0}))),t(!1)})().catch(h=>console.error("Initial Global Layout setup failed. ",$a(h)))},[u,r,c,l,n]),{defaultLayout:e,activeLayout:r,setDefaultLayout:p,setActiveLayout:i}},yp=g.createContext(void 0),gn=()=>{const t=g.useContext(yp);if(t===void 0)throw new Error("useLaunchpadAPI must be used within a LaunchpadAPIProvider");return t},fy=({children:t,close:n,isGlobalLayoutsAvailable:e})=>{const[o,r]=g.useState(!1),{defaultLayout:i,activeLayout:a,setDefaultLayout:c,setActiveLayout:l}=dy(r,e),u=g.useMemo(()=>({close:n,defaultLayout:i,activeLayout:a,setDefaultLayout:c,setActiveLayout:l,isLayoutOperationBlocked:o,setIsLayoutOperationBlocked:r}),[n,i,a,c,l,o]);return s.jsx(yp.Provider,{value:u,children:t})},Do={CUSTOM_PREFS:"customPrefs",COLLAPSED_SECTIONS:"_launchpad_collapsedSections",FAVORITES:"_launchpad_favorites",IS_LAYOUTS_PANEL_OPEN:"_launchpad_isLayoutsPanelOpen",IS_LAUNCHPAD_COLLAPSED:"_launchpad_isCollapsed",IS_LAUNCHPAD_PINNED:"_launchpad_isPinned",LAYOUTS_SHOW_UNSAVED_CHANGES_PROMPT:"_layouts_showUnsavedChangesPrompt",LAYOUTS_SHOW_DELETE_PROMPT:"_layouts_showDeletePrompt"},ro=()=>{const{value:t,update:n,isLoading:e,error:o}=Ht({prefKey:Do.IS_LAUNCHPAD_PINNED}),r=g.useCallback(()=>n(i=>!i),[n]);return{error:o,isLaunchpadPinned:t,isLoading:e,toggle:r}},bp=()=>{const t=g.useContext(De.IOConnectContext),{setActiveLayout:n,setDefaultLayout:e,close:o}=gn(),{isLaunchpadPinned:r}=ro(),{value:i,update:a}=Ht({prefKey:Do.LAYOUTS_SHOW_DELETE_PROMPT}),c=()=>{r||o==null||o()};return g.useCallback(async u=>{const{layout:p,actionName:f}=u;return await Y1[f]({io:t,layout:p,setActiveLayout:n,setDefaultLayout:e,closeLaunchpad:c,showDeletePromptPref:i,updateShowDeletePromptPref:a})},[t,e,n,o,i,a])},Mo=()=>{const{isLayoutOperationBlocked:t,setIsLayoutOperationBlocked:n}=gn();return async e=>{if(!t){n(!0);try{await e()}catch(o){console.error("Layout operation failed: ",{error:o})}n(!1)}}},wp={CREATE_WORKSPACE:"createWorkspace"},py=async t=>{const{io:n,item:e}=t;if(n.workspaces)try{await n.workspaces.restoreWorkspace(e.id,{newFrame:!0})}catch(o){await Fe({io:n,variant:Le.WARNING,text:`Failed to load Workspace "${e.title}".`,error:o})}},hy=async t=>{const{io:n,item:e,removeFavorite:o}=t;if(n.workspaces){if("modals"in n&&n.modals){const r="delete",{isEnterPressed:i,responseButtonClicked:a}=await n.modals.dialogs.request({templateName:To.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:`Delete "${e.title}"`,text:"Are you sure you want to delete this Workspace?",actionButtons:[{variant:"critical",text:"Delete",id:r},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(!(i||(a==null?void 0:a.id)===r))return}try{await n.workspaces.layouts.delete(e.id),await o(e),await Fe({io:n,variant:Le.SUCCESS,text:`"Workspace ${e.title}" was successfully deleted.`})}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to delete Workspace "${e.title}".`,error:r})}}},my=async t=>{const{io:n}=t;if(n.workspaces)try{await n.workspaces.createWorkspace({children:[],frame:{newFrame:!0}})}catch(e){await Fe({io:n,variant:Le.WARNING,text:"Failed to create a new Workspace.",error:e})}},gy={[ai.OPEN_IN_NEW_WINDOW]:py,[ai.DELETE]:hy,[wp.CREATE_WORKSPACE]:my};class xp{constructor(){It(this,"queue",[]);It(this,"isExecutingQueue",!1)}enqueue(n){return new Promise((e,o)=>{this.queue.push({action:n,resolve:e,reject:o}),this.executeQueue()})}async executeQueue(){if(!this.isExecutingQueue){for(this.isExecutingQueue=!0;this.queue.length;){const n=this.queue.shift();if(!n){this.isExecutingQueue=!1;return}try{const e=await n.action();n.resolve(e)}catch(e){n.reject(e)}await this.intervalBreak()}this.isExecutingQueue=!1}}intervalBreak(){return new Promise(n=>setTimeout(n,0))}}const Cp=()=>{const[t,n]=g.useState([]),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!(e!=null&&e.workspaces))return;let o=!1;const r=e.workspaces.layouts.onSaved(({name:a})=>{o||t.find(({id:c})=>c===a)||n(c=>[...c,{id:a,title:a}])}),i=e.workspaces.layouts.onRemoved(({name:a})=>{o||n(c=>c.filter(({title:l})=>l!==a))});return()=>{o=!0,[r,i].forEach(async a=>{try{(await a)()}catch(c){console.error(c)}})}},[e,t]),t},xl=new xp,_i=()=>{const{value:t,update:n,isLoading:e}=Ht({prefKey:Do.FAVORITES}),o=hp(),r=Cp(),i=g.useMemo(()=>(t??[]).filter(l=>l.type===wt.APPLICATION?o.some(u=>u.id===l.id):l.type===wt.WORKSPACE?r.some(u=>u.id===l.id):!0),[t,o,r]),a=g.useCallback(({openInstances:l,...u})=>xl.enqueue(()=>n((p=[])=>{const f=p.find(d=>d.id===u.id&&d.type&&u.type);return f?p.filter(d=>d!==f):[u,...p]})),[n]),c=g.useCallback(l=>xl.enqueue(()=>n((u=[])=>u.filter(p=>!(p.id===l.id&&p.type===l.type)))),[n]);return{favorites:i,toggleFavorite:a,removeFavorite:c,isLoading:e}},kp=()=>{const t=g.useContext(De.IOConnectContext),{removeFavorite:n}=_i();return(e,o)=>{gy[o]({io:t,item:e,removeFavorite:n})}},vy=()=>{const t=g.useContext(De.IOConnectContext);return async n=>t.interop.methods().every(e=>e.name!==(n==null?void 0:n.method))?console.error("Interop method not found."):await t.interop.invoke(n.method,n.params,n.target).catch(e=>console.error({error:e}))},yy=()=>{const[t,n]=g.useState(!1),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;let o;return(async()=>{var r;try{o=await((r=e.workspaces)==null?void 0:r.onWorkspaceOpened(()=>n(!0)))}catch(i){console.error(i)}})(),()=>o==null?void 0:o()},[e]),t};var rs={exports:{}};(function(t,n){(function(e,o){var r="1.0.38",i="",a="?",c="function",l="undefined",u="object",p="string",f="major",d="model",h="name",m="type",v="vendor",y="version",b="architecture",S="console",k="mobile",C="tablet",j="smarttv",E="wearable",P="embedded",H=500,z="Amazon",q="Apple",B="ASUS",A="BlackBerry",fe="Browser",ve="Chrome",Y="Edge",de="Firefox",he="Google",Oe="Huawei",ce="LG",W="Microsoft",Q="Motorola",me="Opera",pe="Samsung",V="Sharp",D="Sony",T="Xiaomi",L="Zebra",G="Facebook",U="Chromium OS",re="Mac OS",te=function(J,$){var F={};for(var Z in J)$[Z]&&$[Z].length%2===0?F[Z]=$[Z].concat(J[Z]):F[Z]=J[Z];return F},I=function(J){for(var $={},F=0;F<J.length;F++)$[J[F].toUpperCase()]=J[F];return $},ke=function(J,$){return typeof J===p?xe($).indexOf(xe(J))!==-1:!1},xe=function(J){return J.toLowerCase()},_e=function(J){return typeof J===p?J.replace(/[^\d\.]/g,i).split(".")[0]:o},Ie=function(J,$){if(typeof J===p)return J=J.replace(/^\s\s*/,i),typeof $===l?J:J.substring(0,H)},Pe=function(J,$){for(var F=0,Z,le,ie,oe,ee,ye;F<$.length&&!ee;){var Ae=$[F],Ve=$[F+1];for(Z=le=0;Z<Ae.length&&!ee&&Ae[Z];)if(ee=Ae[Z++].exec(J),ee)for(ie=0;ie<Ve.length;ie++)ye=ee[++le],oe=Ve[ie],typeof oe===u&&oe.length>0?oe.length===2?typeof oe[1]==c?this[oe[0]]=oe[1].call(this,ye):this[oe[0]]=oe[1]:oe.length===3?typeof oe[1]===c&&!(oe[1].exec&&oe[1].test)?this[oe[0]]=ye?oe[1].call(this,ye,oe[2]):o:this[oe[0]]=ye?ye.replace(oe[1],oe[2]):o:oe.length===4&&(this[oe[0]]=ye?oe[3].call(this,ye.replace(oe[1],oe[2])):o):this[oe]=ye||o;F+=2}},ge=function(J,$){for(var F in $)if(typeof $[F]===u&&$[F].length>0){for(var Z=0;Z<$[F].length;Z++)if(ke($[F][Z],J))return F===a?o:F}else if(ke($[F],J))return F===a?o:F;return J},x={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},w={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},O={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,y],[/opios[\/ ]+([\w\.]+)/i],[y,[h,me+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[h,me+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[h,me]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[h,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,y],[/\bddg\/([\w\.]+)/i],[y,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[h,"UC"+fe]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[h,"Smart Lenovo "+fe]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+fe],y],[/\bfocus\/([\w\.]+)/i],[y,[h,de+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[h,me+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[h,me+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[h,"MIUI "+fe]],[/fxios\/([-\w\.]+)/i],[y,[h,de]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+fe]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+fe],y],[/samsungbrowser\/([\w\.]+)/i],[y,[h,pe+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],y],[/metasr[\/ ]?([\d\.]+)/i],[y,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[h,y],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,G],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[h,ve+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,ve+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[h,"Android "+fe]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[y,ge,x]],[/(webkit|khtml)\/([\w\.]+)/i],[h,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[h,de+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[h,y],[/(cobalt)\/([\w\.]+)/i],[h,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,xe]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows (ce|mobile); ppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[b,/ower/,i,xe]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,xe]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[v,pe],[m,C]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[v,pe],[m,k]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[v,q],[m,k]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[v,q],[m,C]],[/(macintosh);/i],[d,[v,q]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[v,V],[m,k]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[v,Oe],[m,C]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[v,Oe],[m,k]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[d,/_/g," "],[v,T],[m,k]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[v,T],[m,C]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[v,"OPPO"],[m,k]],[/\b(opd2\d{3}a?) bui/i],[d,[v,"OPPO"],[m,C]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[v,"Vivo"],[m,k]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[v,"Realme"],[m,k]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[v,Q],[m,k]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[v,Q],[m,C]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[v,ce],[m,C]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[v,ce],[m,k]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[v,"Lenovo"],[m,C]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[v,"Nokia"],[m,k]],[/(pixel c)\b/i],[d,[v,he],[m,C]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[v,he],[m,k]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[v,D],[m,k]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[v,D],[m,C]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[v,"OnePlus"],[m,k]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[v,z],[m,C]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[v,z],[m,k]],[/(playbook);[-\w\),; ]+(rim)/i],[d,v,[m,C]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[v,A],[m,k]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[v,B],[m,C]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[v,B],[m,k]],[/(nexus 9)/i],[d,[v,"HTC"],[m,C]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[v,[d,/_/g," "],[m,k]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[v,"Acer"],[m,C]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[v,"Meizu"],[m,k]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[v,"Ulefone"],[m,k]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[v,d,[m,k]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[v,d,[m,C]],[/(surface duo)/i],[d,[v,W],[m,C]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[v,"Fairphone"],[m,k]],[/(u304aa)/i],[d,[v,"AT&T"],[m,k]],[/\bsie-(\w*)/i],[d,[v,"Siemens"],[m,k]],[/\b(rct\w+) b/i],[d,[v,"RCA"],[m,C]],[/\b(venue[\d ]{2,7}) b/i],[d,[v,"Dell"],[m,C]],[/\b(q(?:mv|ta)\w+) b/i],[d,[v,"Verizon"],[m,C]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[v,"Barnes & Noble"],[m,C]],[/\b(tm\d{3}\w+) b/i],[d,[v,"NuVision"],[m,C]],[/\b(k88) b/i],[d,[v,"ZTE"],[m,C]],[/\b(nx\d{3}j) b/i],[d,[v,"ZTE"],[m,k]],[/\b(gen\d{3}) b.+49h/i],[d,[v,"Swiss"],[m,k]],[/\b(zur\d{3}) b/i],[d,[v,"Swiss"],[m,C]],[/\b((zeki)?tb.*\b) b/i],[d,[v,"Zeki"],[m,C]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[v,"Dragon Touch"],d,[m,C]],[/\b(ns-?\w{0,9}) b/i],[d,[v,"Insignia"],[m,C]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[v,"NextBook"],[m,C]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[v,"Voice"],d,[m,k]],[/\b(lvtel\-)?(v1[12]) b/i],[[v,"LvTel"],d,[m,k]],[/\b(ph-1) /i],[d,[v,"Essential"],[m,k]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[v,"Envizen"],[m,C]],[/\b(trio[-\w\. ]+) b/i],[d,[v,"MachSpeed"],[m,C]],[/\btu_(1491) b/i],[d,[v,"Rotor"],[m,C]],[/(shield[\w ]+) b/i],[d,[v,"Nvidia"],[m,C]],[/(sprint) (\w+)/i],[v,d,[m,k]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[v,W],[m,k]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[v,L],[m,C]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[v,L],[m,k]],[/smart-tv.+(samsung)/i],[v,[m,j]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[v,pe],[m,j]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[v,ce],[m,j]],[/(apple) ?tv/i],[v,[d,q+" TV"],[m,j]],[/crkey/i],[[d,ve+"cast"],[v,he],[m,j]],[/droid.+aft(\w+)( bui|\))/i],[d,[v,z],[m,j]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[v,V],[m,j]],[/(bravia[\w ]+)( bui|\))/i],[d,[v,D],[m,j]],[/(mitv-\w{5}) bui/i],[d,[v,T],[m,j]],[/Hbbtv.*(technisat) (.*);/i],[v,d,[m,j]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[v,Ie],[d,Ie],[m,j]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,j]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[v,d,[m,S]],[/droid.+; (shield) bui/i],[d,[v,"Nvidia"],[m,S]],[/(playstation [345portablevi]+)/i],[d,[v,D],[m,S]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[v,W],[m,S]],[/((pebble))app/i],[v,d,[m,E]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[v,q],[m,E]],[/droid.+; (glass) \d/i],[d,[v,he],[m,E]],[/droid.+; (wt63?0{2,3})\)/i],[d,[v,L],[m,E]],[/(quest( \d| pro)?)/i],[d,[v,G],[m,E]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[v,[m,P]],[/(aeobc)\b/i],[d,[v,z],[m,P]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[m,k]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[m,C]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,C]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,k]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[v,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[h,Y+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,y],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[h,[y,ge,w]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,ge,w],[h,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,re],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,y],[/\(bb(10);/i],[y,[h,A]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[h,de+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[h,ve+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,U],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,y],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,y]]},N=function(J,$){if(typeof J===u&&($=J,J=o),!(this instanceof N))return new N(J,$).getResult();var F=typeof e!==l&&e.navigator?e.navigator:o,Z=J||(F&&F.userAgent?F.userAgent:i),le=F&&F.userAgentData?F.userAgentData:o,ie=$?te(O,$):O,oe=F&&F.userAgent==Z;return this.getBrowser=function(){var ee={};return ee[h]=o,ee[y]=o,Pe.call(ee,Z,ie.browser),ee[f]=_e(ee[y]),oe&&F&&F.brave&&typeof F.brave.isBrave==c&&(ee[h]="Brave"),ee},this.getCPU=function(){var ee={};return ee[b]=o,Pe.call(ee,Z,ie.cpu),ee},this.getDevice=function(){var ee={};return ee[v]=o,ee[d]=o,ee[m]=o,Pe.call(ee,Z,ie.device),oe&&!ee[m]&&le&&le.mobile&&(ee[m]=k),oe&&ee[d]=="Macintosh"&&F&&typeof F.standalone!==l&&F.maxTouchPoints&&F.maxTouchPoints>2&&(ee[d]="iPad",ee[m]=C),ee},this.getEngine=function(){var ee={};return ee[h]=o,ee[y]=o,Pe.call(ee,Z,ie.engine),ee},this.getOS=function(){var ee={};return ee[h]=o,ee[y]=o,Pe.call(ee,Z,ie.os),oe&&!ee[h]&&le&&le.platform&&le.platform!="Unknown"&&(ee[h]=le.platform.replace(/chrome os/i,U).replace(/macos/i,re)),ee},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Z},this.setUA=function(ee){return Z=typeof ee===p&&ee.length>H?Ie(ee,H):ee,this},this.setUA(Z),this};N.VERSION=r,N.BROWSER=I([h,y,f]),N.CPU=I([b]),N.DEVICE=I([d,v,m,S,k,j,C,E,P]),N.ENGINE=N.OS=I([h,y]),t.exports&&(n=t.exports=N),n.UAParser=N;var R=typeof e!==l&&(e.jQuery||e.Zepto);if(R&&!R.ua){var ne=new N;R.ua=ne.getResult(),R.ua.get=function(){return ne.getUA()},R.ua.set=function(J){ne.setUA(J);var $=ne.getResult();for(var F in $)R.ua[F]=$[F]}}})(typeof window=="object"?window:S0)})(rs,rs.exports);var by=rs.exports;const Fn=new by.UAParser,wy=()=>M.useMemo(()=>({os:Fn.getOS(),browser:Fn.getBrowser(),cpu:Fn.getCPU(),device:Fn.getDevice(),engine:Fn.getEngine(),ua:Fn.getUA()}),[]),xy=()=>M.useMemo(()=>Fn.getBrowser(),[]),Bs=()=>{const{ua:t}=wy();return t.includes("io-connect-desktop")},Sp=()=>{const[t,n]=g.useState([]),[e,o]=g.useState(!1),r=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!r)return;let i=!1;const a=[],c=r.layouts.onAdded(p=>{if(p.type!=="Global"||i)return;o(!0);const{name:f}=p;n(d=>[...d,{name:f}])}),l=r.layouts.onRemoved(p=>{p.type!=="Global"||i||n(f=>f.filter(d=>d.name!==p.name))}),u=r.layouts.onRenamed((p,f)=>{if(p.type!=="Global"||i)return;const{name:d}=p;n(h=>{const m=h.findIndex(v=>v.name===(f==null?void 0:f.name));return m===-1?h:[...h.slice(0,m),{name:d},...h.slice(m+1)]})});return a.push(c,l,u),()=>{i=!0,a.forEach(p=>p())}},[r]),{layouts:t,isInitialized:e}},Ep=()=>{const[t,n]=g.useState([]),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.notifications.onRaised(a=>n(c=>[...c,a])),r=e.notifications.onClosed(a=>n(c=>c.filter(l=>l.id!==a.id))),i=e.notifications.onStateChanged(({id:a},c)=>{n(l=>{const u=l.findIndex(p=>p.id===a);return u===-1?l:[...l.slice(0,u),{...l[u],state:c},...l.slice(u+1)]})});return e.notifications.list().then(n).catch(console.error),()=>{o(),r(),i()}},[e]),t},Cy=()=>{const[t,n]=g.useState({}),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.notifications.onConfigurationChanged(r=>n(r));return()=>{o()}},[e]),t},Hs=t=>{const{handler:n,skip:e}=t;g.useEffect(()=>{if(e)return;const o=r=>{var i;((i=document.activeElement)==null?void 0:i.nodeName)==="IFRAME"&&n(r)};return window.addEventListener("blur",o,!0),()=>{window.removeEventListener("blur",o,!0)}},[n,e])},Ws=t=>{const{eventType:n,handler:e,ref:o,skip:r}=t;g.useEffect(()=>{if(r)return;const i=a=>{const c=a.target;(Array.isArray(o)?o.every(u=>u.current&&!u.current.contains(c)):o.current&&!o.current.contains(c))&&e(a)};return document.addEventListener(n,i,!0),()=>{document.removeEventListener(n,i,!0)}},[n,e,o,r])},ky=Xe({name:Dt}),br=Xe({isCompleted:Ao()}),rn=(t,n,e)=>{const[o,r]=g.useState(()=>{try{const c=window[t].getItem(n);return c?JSON.parse(c):null}catch(c){return console.log(c),null}}),i=`${t}-${n}`;g.useEffect(()=>{const c=l=>{r(l.detail)};return window.addEventListener(i,c),()=>{window.removeEventListener(i,c)}},[i]);const a=g.useCallback(c=>{try{if(!c){window[t].removeItem(n),r(null);return}const l=e.run(c);if(!l.ok){console.warn(`Error validating the value to be stored: ${l.error.message}`);return}const u=l.result;r(u),window[t].setItem(n,JSON.stringify(u)),window.dispatchEvent(new CustomEvent(i,{detail:u}))}catch(l){console.log(l)}},[n,t,i,e]);return[o,a]},zs=()=>{const[t,n]=rn("sessionStorage",q1,ky);return{isPlatformWindow:!t||window.name===t.name,setPlatformWindow:n}},$s=()=>{const[t,n]=g.useState([]);return g.useEffect(()=>{const e=({key:i})=>{n(a=>a.includes(i)?a:a.concat(i))},o=i=>{n(a=>a.filter(c=>c!==i.key))},r=()=>{n([])};return document.addEventListener("keydown",e),document.addEventListener("keyup",o),window.addEventListener("blur",r),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",o),window.removeEventListener("blur",r)}},[]),t.length===1?t[0]:null},Us=()=>{const t=g.useContext(De.IOConnectContext);return g.useCallback(async(n,e)=>{if(t)try{await t.layouts.restore({name:n}),e==null||e({name:n}),await Fe({io:t,variant:Le.SUCCESS,text:`Layout "${n}" was loaded successfully.`})}catch(o){await Fe({io:t,variant:Le.WARNING,text:`Failed to load Layout "${n}".`,error:o})}},[t])},Li={CONTROL:"Control",SHIFT:"Shift"},Vs=()=>{const t=g.useContext(De.IOConnectContext),n=Rs();return async({id:e,modifier:o,reuseWorkspaceId:r})=>{var i;try{const a=o===Li.CONTROL?{newFrame:!0}:{frameId:n,reuseWorkspaceId:r};await((i=t.workspaces)==null?void 0:i.restoreWorkspace(e,a))}catch(a){await Fe({io:t,variant:Le.WARNING,text:`Failed to load Workspace "${e}".`,error:a})}}},Sy=t=>{const[n,e]=g.useState([]),[o,r]=g.useState(!0),i=g.useRef(null),a=g.useContext(De.IOConnectContext);return g.useEffect(()=>{const c=a==null?void 0:a.search;if(!c)return;const l=[],u=[];return(async f=>{r(!0),e([]);const d=await c.query({search:f.trim(),providerLimits:{maxResults:100,maxResultsPerType:5}});if(d===i.current)return;i.current=d;const h=d.onResults(y=>{y.results.forEach(b=>{u.find(k=>k.id===b.id&&k.type.name===b.type.name)||u.push(b)}),r(!1),e([...u])}),m=d.onCompleted(()=>{r(!1)}),v=d.onError(y=>{console.error(`Query failed. Provider: ${y.provider}; Error: ${y.error}`)});l.push(h,m,v)})(t),()=>{l.forEach(f=>f())}},[a,t]),{resultsToRender:n,isLoading:o}},jp=()=>{const t=g.useContext(De.IOConnectContext),n=async({id:o})=>{var r;await((r=t.appManager.application(o))==null?void 0:r.start())},e=async({id:o,modifier:r})=>{var u,p;const i=await((u=t.workspaces)==null?void 0:u.getWorkspace(f=>f.isSelected===!0)),a=i==null?void 0:i.children[0];if(r===Li.CONTROL||!i||(a==null?void 0:a.type)==="window"){await((p=t.appManager.application(o))==null?void 0:p.start());return}await((a==null?void 0:a.type)==="group"?a:await(a??i).addGroup()).addWindow({appName:o})};return async o=>{try{await(Gf()?n:e)(o)}catch(r){await Fe({io:t,variant:Le.WARNING,text:`Failed to start app "${o.title}".`,error:r})}}},Ey=()=>{const[t,n]=g.useState({}),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=[];return(async()=>{var r,i;try{const a=await((r=e.workspaces)==null?void 0:r.onWorkspaceOpened(l=>n(u=>({...u,[l.title]:[...u[l.title]??[],l.id]}))));o.push(a);const c=await((i=e.workspaces)==null?void 0:i.onWorkspaceClosed(({workspaceId:l})=>n(u=>{const p={...u};for(const f in p)if(p[f].includes(l)){p[f]=p[f].filter(d=>d!==l);break}return p})));o.push(c)}catch(a){console.error(a)}})(),()=>o.forEach(r=>r==null?void 0:r())},[e]),t},Op=t=>t.key==="Enter"||t.key===" ",Ri=(t,n)=>typeof t>"u"?{}:{tabIndex:0,onClick:t,onKeyDown:e=>{Op(e)&&(e.preventDefault(),t==null||t(e)),n==null||n(e)}},Np=({event:t,currentIndex:n,moveFocus:e,min:o,max:r,onClose:i})=>{switch(t.key){case"ArrowUp":{e(Math.max(n-1,o));break}case"ArrowDown":{e(Math.min(n+1,r));break}case"Home":{e(o);break}case"End":{e(r);break}case"Escape":{if(i){i();break}return}default:return}t.stopPropagation(),t.preventDefault()};const jy=g.forwardRef((t,n)=>{const{title:e,actions:o,className:r,onClose:i,onActionItemClick:a,...c}=t,l=g.useRef({}),[u,p]=g.useState(0),f=d=>{var h;(h=l.current[d])==null||h.focus(),p(d)};return g.useEffect(()=>{var d;(d=l.current[u])==null||d.focus()},[]),s.jsxs(ut,{ref:n,className:ot(r,"context-menu"),onClick:d=>d.stopPropagation(),onKeyDown:d=>Np({event:d,currentIndex:u,min:0,max:o.length-1,moveFocus:f,onClose:i}),...c,children:[e&&s.jsx(ut.ItemSection,{children:e}),o.map((d,h)=>{const m=d.displayName||d.name,v=d.iconSrc?s.jsx(Iu,{size:"16",src:d.iconSrc,alt:`${m} icon`}):d.icon&&s.jsx(et,{size:"16",variant:d.icon});return s.jsxs(g.Fragment,{children:[s.jsx(ut.Item,{ref:y=>l.current[h]=y,prepend:v,disabled:d.disabled,tabIndex:-1,...Ri(y=>a(y,d)),children:m}),d.separatorAfter&&s.jsx("li",{className:"context-menu-separator","aria-hidden":!0})]},d.name)})]})});function Gs(t){const{title:n,buttonSize:e="16",icon:o="ellipsis-vertical",iconSize:r="12",actions:i,isTabStop:a,onActionItemClick:c,buttonVariant:l,placement:u,offset:p,shouldCloseOnOutsideScroll:f=!1,shouldCloseOnWindowBlur:d=!1}=t,[h,m]=g.useState(!1),[v,y]=g.useState(null),[b,S]=g.useState(null),k=g.useRef(null),C=g.useRef(null),j=g.useMemo(()=>[C,k],[]),E=g.useCallback(()=>m(!1),[]),{styles:P,attributes:H}=u1(v,b,{placement:u,modifiers:[{name:"offset",options:{offset:p}}]});g.useEffect(()=>{k.current=v},[v]),g.useEffect(()=>{C.current=b},[b]),Ws({eventType:"mouseup",handler:E,ref:j,skip:!h}),Hs({handler:E,skip:!h}),g.useEffect(()=>{if(!(!d||!h))return window.addEventListener("blur",E),()=>{window.removeEventListener("blur",E)}},[E,h,d]),g.useEffect(()=>{if(!f||!b)return;const B=A=>{if(b.contains(A.target)){A.preventDefault();return}E()};return document.addEventListener("touchmove",B,{passive:!1}),document.addEventListener("wheel",B,{passive:!1}),()=>{document.removeEventListener("touchmove",B),document.removeEventListener("wheel",B)}},[E,b,f]);const z=B=>{B.stopPropagation(),m(A=>!A),b==null||b.focus()},q=(B,A)=>{B.stopPropagation(),c(B,A),E()};return s.jsxs(s.Fragment,{children:[s.jsx(Ue,{ref:y,size:e,icon:o,iconSize:r,variant:l,...Ri(z),tabIndex:a?0:-1}),h&&s.jsx(jy,{ref:S,title:n,actions:i,onActionItemClick:q,onClose:()=>{v==null||v.focus(),E()},style:P.popper,...H.popper})]})}const Oy=t=>{const{isFavoritismEnabled:n=!0,item:e,onClick:o,onKeyDown:r,isFocused:i,liRef:a,...c}=t,{favorites:l,toggleFavorite:u,isLoading:p}=_i(),{description:f,icon:d="application",iconSrc:h,openInstances:m=0,title:v,tooltip:y,className:b,contextMenuActions:S=[]}=e,k=n&&l.some(P=>P.type===e.type&&P.title===e.title),C=P=>{if(Op(P)){o(P),P.preventDefault(),P.stopPropagation();return}r(P)},j=h?s.jsx(Iu,{size:"16",src:h,alt:`${v} icon`}):s.jsx(et,{size:"16",variant:d}),E=s.jsxs(s.Fragment,{children:[m!==0&&s.jsx("span",{className:"open-instances io-text-smaller",children:m===1?"Opened":`${m} opened`}),(n||S.length>0)&&s.jsxs(Re,{className:"item-actions",children:[n&&s.jsx(Ue,{...Ri(P=>{P.stopPropagation(),u(e)}),tabIndex:i?0:-1,size:"24",iconSize:"12",icon:k?"star-full":"star",disabled:p}),S.length>0&&s.jsx(Gs,{buttonSize:"24",iconSize:"12",icon:"ellipsis-vertical",title:v,actions:S,onActionItemClick:o,isTabStop:i,placement:"bottom-end",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0})]})]});return s.jsx(ut.Item,{ref:a,tabIndex:i?0:-1,className:ot("io-base-section-item",b),onKeyDown:C,onClick:o,prepend:j,append:E,description:f,tooltip:y??v,...c,children:v})},Ny=new xp,Iy=()=>{const{value:t,update:n}=Ht({prefKey:Do.COLLAPSED_SECTIONS}),e=g.useCallback(o=>Ny.enqueue(()=>n((r=[])=>r.includes(o)?r.filter(a=>a!==o):[...r,o])),[n]);return{collapsedSections:t,toggleSection:e}},Ys=t=>{const{config:n,level:e=1,path:o=n.id,onItemClick:r}=t,{isCollapsible:i=!0}=n,a=$s(),[c,l]=g.useState(0),u=g.useRef({}),{collapsedSections:p,toggleSection:f}=Iy(),d=i?!(p!=null&&p.includes(o)):!0,h=n.items.filter(C=>er(C)),m=n.items.filter(C=>!er(C)),v=[...h,...m],y=16,b=24,S=C=>{var j,E;(E=(j=u.current[C])==null?void 0:j.querySelector("[tabIndex]"))==null||E.focus(),l(C)},k=async()=>{i&&await f(o)};return s.jsxs(ut.ItemWithSubItems,{className:e===1?"main-section":void 0,children:[s.jsx(M1,{className:e===1?"io-list-item-title main-section-header":void 0,isOpen:d,onClick:k,showCollapseIcon:i,showFolderIcon:e!==1,style:{paddingLeft:`${y+b*Math.max(0,e-2)}px`},title:n.title}),s.jsx(pp,{isOpen:d,tag:ut,children:v.map((C,j)=>er(C)?s.jsx(Ys,{config:C,level:e+1,onItemClick:r,path:`${o}/${C.id}`},C.id):s.jsx(Oy,{style:{paddingLeft:`${y+b*(e-1)}px`},liRef:E=>u.current[j]=E,isFavoritismEnabled:C.type===wt.APPLICATION||C.type===wt.WORKSPACE,item:C,onClick:(E,P)=>r==null?void 0:r(E,{item:C,modifier:a,selectedContextMenuActionName:P==null?void 0:P.name}),onKeyDown:E=>{Np({event:E,moveFocus:S,currentIndex:c,min:0,max:v.length-1})},isFocused:c===j},C.id))})]})},Ip=t=>`${t.type}-${t.id}`,Ay=(t,n)=>Ap(t)[n],Ap=t=>t.reduce((n,e)=>er(e)?{...n,...Ap(e.items)}:{...n,[Ip(e)]:e},{}),Pp=g.createContext(void 0),Py=()=>{const t=g.useContext(Pp);if(t===void 0)throw new Error("useSection must be used within a SectionProvider");return t},Ty=({children:t})=>{const[n,e]=g.useState(null),o=g.useMemo(()=>[n,e],[n]);return s.jsx(Pp.Provider,{value:o,children:t})},Fi=({config:t,onItemClick:n})=>{const[e,o]=Py(),r=gn(),i=$s(),{isLaunchpadPinned:a}=ro(),c=(l,u)=>{const{item:p,selectedContextMenuActionName:f}=u;o({itemName:Ip(p),selectedContextMenuActionName:f})};return g.useEffect(()=>{var f;if(!n||!e)return;const{itemName:l,selectedContextMenuActionName:u}=e,p=Ay(t.items,l);p&&(n({item:p,modifier:i,selectedContextMenuActionName:u}),o(null),!(i===Li.SHIFT||a)&&((f=r.close)==null||f.call(r)))},[e,t.items,r,n,i,o,a]),s.jsx(Ys,{config:t,onItemClick:c})};function Tp(t){const{isFolderCollapsible:n,isSectionCollapsible:e,sortOrder:o}=t,r=hp(),i=_1(),a=jp(),c=mp(),l=g.useMemo(()=>k0(r,i,{isFolderCollapsible:n,isSectionCollapsible:e,sortOrder:o}),[r,i,n,e,o]),u=p=>{const{item:f,modifier:d,selectedContextMenuActionName:h}=p;if(!h)return a({id:f.id,title:f.title,modifier:d});c(f,h)};return s.jsx(Fi,{config:l,onItemClick:u})}const Dy=(t,n)=>{const{isSectionCollapsible:e,sortOrder:o=cr.DISABLED}=n,r=Es({items:t,sortOrder:o,ascendingCompare:Kf,descendingCompare:qf});return{id:xo.FAVORITES,title:"Favorites",items:r,isCollapsible:e}},Dp=t=>{const{isSectionCollapsible:n,sortOrder:e}=t,{favorites:o}=_i(),r=g.useMemo(()=>Dy(o,{isSectionCollapsible:n,sortOrder:e}),[o,n,e]);return o.length>0?s.jsx(Fi,{config:r}):null},My=t=>{const{active:n,className:e,...o}=t;return s.jsx(Ue,{className:ot("launchpad-button",{active:n},e),"aria-label":"Launchpad",icon:"logo",variant:"circle",size:"32",title:n?"Close Launchpad":"Open Launchpad",...o})};var _y=function(n){return Ly(n)&&!Ry(n)};function Ly(t){return!!t&&typeof t=="object"}function Ry(t){var n=Object.prototype.toString.call(t);return n==="[object RegExp]"||n==="[object Date]"||Hy(t)}var Fy=typeof Symbol=="function"&&Symbol.for,By=Fy?Symbol.for("react.element"):60103;function Hy(t){return t.$$typeof===By}function Wy(t){return Array.isArray(t)?[]:{}}function fr(t,n){return n.clone!==!1&&n.isMergeableObject(t)?Po(Wy(t),t,n):t}function zy(t,n,e){return t.concat(n).map(function(o){return fr(o,e)})}function $y(t,n){if(!n.customMerge)return Po;var e=n.customMerge(t);return typeof e=="function"?e:Po}function Uy(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(n){return Object.propertyIsEnumerable.call(t,n)}):[]}function Cl(t){return Object.keys(t).concat(Uy(t))}function Mp(t,n){try{return n in t}catch{return!1}}function Vy(t,n){return Mp(t,n)&&!(Object.hasOwnProperty.call(t,n)&&Object.propertyIsEnumerable.call(t,n))}function Gy(t,n,e){var o={};return e.isMergeableObject(t)&&Cl(t).forEach(function(r){o[r]=fr(t[r],e)}),Cl(n).forEach(function(r){Vy(t,r)||(Mp(t,r)&&e.isMergeableObject(n[r])?o[r]=$y(r,e)(t[r],n[r],e):o[r]=fr(n[r],e))}),o}function Po(t,n,e){e=e||{},e.arrayMerge=e.arrayMerge||zy,e.isMergeableObject=e.isMergeableObject||_y,e.cloneUnlessOtherwiseSpecified=fr;var o=Array.isArray(n),r=Array.isArray(t),i=o===r;return i?o?e.arrayMerge(t,n,e):Gy(t,n,e):fr(n,e)}Po.all=function(n,e){if(!Array.isArray(n))throw new Error("first argument should be an array");return n.reduce(function(o,r){return Po(o,r,e)},{})};var Yy=Po,Zy=Yy;const Ky=Ti(Zy),On={WINDOW_MANAGEMENT:"window-management",NOTIFICATIONS:"notifications"},Bi="getScreenDetails"in window,qy={header:{showHeader:!0,showSearch:!0},mode:"default"},Jy=({className:t,children:n})=>s.jsx("header",{className:ot("launchpad-header",t),children:n}),_p=({className:t})=>{const{isLaunchpadPinned:n,isLoading:e,toggle:o}=ro();return s.jsx(Ue,{className:t,size:"32",variant:"circle",icon:n?"unpin":"pin",onClick:o,disabled:e})},Xy=g.forwardRef((t,n)=>{const{onSearch:e,searchTerm:o,onClear:r,className:i}=t,a=g.useContext(De.IOConnectContext);return g.useEffect(()=>{a!=null&&a.search&&a.search.setDebounceMS(450)},[a]),s.jsx(Qn,{id:"search-input",className:ot("search-bar",i),ref:n,placeholder:"Find anything",value:o,onChange:e,autoComplete:"off",iconPrepend:"search",iconAppend:o.length?"close":void 0,iconAppendOnClick:r})}),Lp=()=>{const{defaultLayout:t,activeLayout:n}=gn();return e=>({name:e,isDefault:e===(t==null?void 0:t.name),isActive:e===(n==null?void 0:n.name)})},Qy=()=>{const t=bp(),n=Lp(),e=Mo();return async(o,r)=>{const{id:i}=o,a=n(i);await e(()=>t({layout:a,actionName:r}))}},eb=()=>{const t=mp(),n=kp(),e=Qy();return o=>{if(o===wt.APPLICATION)return t;if(o===wt.WORKSPACE)return n;if(o===wt.LAYOUT)return e}},lo={RENAME:"rename",SAVE:"save",SAVE_AS:"saveAs",DELETE:"delete",SET_AS_DEFAULT:"setAsDefault",LOAD:"load"},Rp=t=>[{name:lo.RENAME,displayName:"Rename",icon:"pen-line"},{name:lo.SAVE,displayName:"Save",disabled:!t.isActive,icon:"floppy"},{name:lo.SAVE_AS,displayName:"Save as",icon:"floppy-disk-pen",separatorAfter:!0},{name:lo.DELETE,displayName:"Delete",icon:"trash-can",separatorAfter:!0},{name:lo.SET_AS_DEFAULT,displayName:"Set as Default",disabled:t.isDefault,icon:"user-gear",separatorAfter:!0},{name:lo.LOAD,displayName:"Load",icon:"spinner"}],tb=t=>{const n=Lp();return t.reduce((e,o)=>{const{type:r}=o,i=o.id||o.displayName;if(!i)return e;let a=[];if(r.name===wt.APPLICATION)a=Yf;else if(r.name===wt.WORKSPACE)a=Zf;else if(r.name===wt.LAYOUT){const p=n(i);a=Rp(p)}else o.secondaryActions&&(a=o.secondaryActions.map(({name:p,method:f,params:d,target:h})=>({name:p,interopParams:{method:f,params:d,target:h}})));const c={id:i,title:o.displayName||i,description:o.description,type:r.name,iconSrc:o.iconURL,mainAction:o.action,contextMenuActions:a},l=e.findIndex(({title:p})=>r.displayName?p===r.displayName:p===r.name),u=e[l];return u?[...e.slice(0,l),{...u,items:[...u.items,c]},...e.slice(l+1)]:[...e,{id:r.name,title:r.displayName||r.name,items:[c]}]},[])};function nb(t){const{resultsToRender:n,isLoading:e}=Sy(t.searchTerm),{close:o}=gn(),r=vy(),i=Vs(),a=jp(),c=Us(),l=eb(),u=tb(n),p=Mo(),{isLaunchpadPinned:f}=ro(),d=(m,v)=>{const y=l(m.type);y==null||y(m,v)},h=async(m,v)=>{var H;const{item:y,modifier:b,selectedContextMenuActionName:S}=v,{type:k,id:C,title:j,mainAction:E}=y,P=S?(H=y.contextMenuActions)==null?void 0:H.find(z=>z.name===S):null;P!=null&&P.interopParams?r(P.interopParams):S?d(y,S):E?r(E):k===wt.APPLICATION?a({id:C,title:j,modifier:b}):k===wt.WORKSPACE?i({id:C,modifier:b}):k===wt.LAYOUT&&p(()=>c(C)),!(b===Li.SHIFT||f)&&(o==null||o())};return e?s.jsx("p",{className:"search-loading",children:"Loading..."}):n.length===0?s.jsx("p",{className:"search-no-results",children:"No results found. Try searching by app name, workspace title, or keywords."}):s.jsx(ut,{children:u.map((m,v)=>s.jsx(Ys,{config:m,onItemClick:h},m.id||v))})}const ob=(t,n,e)=>{const{isSectionCollapsible:o,sortOrder:r=cr.ASCENDING}=e,a=Es({items:t,sortOrder:r,ascendingCompare:Kf,descendingCompare:qf}).map(c=>{var l;return{...c,type:wt.WORKSPACE,icon:"workspace",openInstances:(l=n[c.title])==null?void 0:l.length,contextMenuActions:Zf}});return{id:xo.WORKSPACES,title:"Workspaces",items:[...a,{id:wp.CREATE_WORKSPACE,icon:"add",title:"Create Workspace",type:wt.ACTION_BUTTON,tooltip:"Create an empty Workspace in a new window",className:"create-workspace-btn"}],isCollapsible:o}},Fp=t=>{const{isSectionCollapsible:n,sortOrder:e}=t,o=Cp(),r=Ey(),i=Vs(),a=kp(),c=g.useMemo(()=>ob(o,r,{isSectionCollapsible:n,sortOrder:e}),[o,r,n,e]),l=u=>{const{item:p,modifier:f,selectedContextMenuActionName:d}=u;return d?a(p,d):p.type===wt.ACTION_BUTTON?a(p,p.id):i({id:p.id,modifier:f})};return s.jsx(Fi,{config:c,onItemClick:l})},rb=[{placementId:xo.FAVORITES,Component:Dp},{placementId:xo.WORKSPACES,Component:Fp},{placementId:xo.APPLICATIONS,Component:Tp}],ib=()=>{const{value:t,update:n,isLoading:e,error:o}=Ht({prefKey:Do.IS_LAYOUTS_PANEL_OPEN});return{error:o,isLayoutsPanelOpen:t,setIsLayoutsPanelOpen:n,isLoading:e}},ab=({layoutName:t})=>{const n=g.useContext(De.IOConnectContext),e=Mo(),o=r=>{r.stopPropagation(),e(async()=>{try{await n.layouts.save({name:t,type:"Global"}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${t}" was saved successfully.`})}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${t}".`,error:a})}})};return s.jsx(Ue,{icon:"floppy",size:"24",iconSize:"12",onClick:o,title:"Save Layout"})},sb=({layout:t})=>{const n=bp(),e=Mo(),o=async(r,i)=>{r.stopPropagation(),await e(()=>n({layout:t,actionName:i.name}))};return s.jsx(Gs,{buttonSize:"24",iconSize:"12",title:t.name,icon:"ellipsis-vertical",actions:Rp(t),onActionItemClick:o,placement:"top-end",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0})},Bp=({layouts:t})=>{const{isLaunchpadPinned:n}=ro(),{close:e}=gn(),o=Us(),r=Mo(),i=()=>{n||e==null||e()},a=c=>r(()=>o(c.name,i));return s.jsx(ut,{className:"layouts-list",variant:"single",checkIcon:{variant:"check",tooltip:"Active Layout"},children:t.map(c=>s.jsx(ut.Item,{className:"layouts-list-item",onClick:()=>a(c),append:s.jsxs(s.Fragment,{children:[c.isDefault&&s.jsx(Au,{variant:"default",title:"Default Layout",children:"Default"}),s.jsxs(up,{children:[c.isActive&&s.jsx(ab,{layoutName:c.name}),s.jsx(sb,{layout:c})]})]}),isSelected:c.isActive,tooltip:c.name,children:c.name},c.name))})},cb=()=>{const{layouts:t}=Sp(),{activeLayout:n,defaultLayout:e}=gn(),o=g.useMemo(()=>t.map(r=>({...r,isActive:r.name===(n==null?void 0:n.name),isDefault:r.name===(e==null?void 0:e.name)})),[t,n,e]);return s.jsx(Bp,{layouts:o})},lb=()=>{const{defaultLayout:t,activeLayout:n}=gn();return n?s.jsx(Bp,{layouts:[{...n,isDefault:n.name===(t==null?void 0:t.name),isActive:!0}]}):s.jsx("p",{className:"io-text-small no-active-layout",children:"Choose which Layout to load"})},ub=()=>{const t=g.useContext(De.IOConnectContext),{setActiveLayout:n}=gn(),e=Mo(),o=async()=>{var f;if(!("modals"in t&&t.modals)){console.error("Cannot create Layout because io dialogs are not enabled");return}const r="create",i="layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await t.modals.dialogs.request({templateName:To.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:"Create Layout",input:{id:i,initialValue:"Create Layout",validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Fs}},actionButtons:[{variant:"primary",text:"Create",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(f=l==null?void 0:l.find(d=>d.id===i))==null?void 0:f.value;if(a||(c==null?void 0:c.id)===r)try{if((await t.layouts.getAll("Global")).find(h=>h.name===u)){await Fe({io:t,variant:Le.WARNING,text:`Failed to create Layout "${u}". A Layout with this name already exists.`});return}await t.layouts.save({name:u}),n({name:u}),await Fe({io:t,variant:Le.SUCCESS,text:`Layout "${u}" was created successfully.`})}catch(d){await Fe({io:t,variant:Le.WARNING,text:`Failed to create Layout "${u}".`,error:d})}};return s.jsx(Re,{variant:"fullwidth",className:"create-layout-btn-group",children:s.jsx(Ge,{variant:"primary",text:"Create Layout",onClick:()=>e(o)})})};const db=()=>{const t=g.useRef(null),{layouts:n,isInitialized:e}=Sp(),{isLayoutsPanelOpen:o,setIsLayoutsPanelOpen:r}=ib();g.useEffect(()=>{!e||n.length>0||!o||r(!1)},[n,e,o,r]);const i=g.useCallback(()=>r(a=>!a),[r]);return s.jsxs("footer",{className:"layouts-panel",ref:t,children:[s.jsx(hr,{className:"layouts-panel-separator"}),s.jsxs("div",{className:"layouts-panel-header","aria-label":"Layouts panel","aria-expanded":o,role:"button",...Ri(n.length?i:void 0),children:[s.jsx(nn,{tag:"h2",size:"normal",text:n.length>0?"Layouts":"Start using Layouts"}),n.length>0&&s.jsx(Ue,{className:ot("layouts-panel-toggle-button",{"layouts-panel-toggle-button-rotated":o}),icon:"expand",iconSize:"12",size:"24"})]}),s.jsx(pp,{isOpen:o,tag:"div",children:s.jsx(cb,{})}),n.length>0&&!o?s.jsx(lb,{}):s.jsx(ub,{})]})},fb=()=>{const{value:t,update:n,isLoading:e,error:o}=Ht({prefKey:Do.IS_LAUNCHPAD_COLLAPSED});return{error:o,isLaunchpadCollapsed:t,setIsLaunchpadCollapsed:n,isLoading:e}};const Hp=t=>{const{isOpen:n=!0,onClose:e,className:o,settings:r={},components:i={},windowManagementPermissionState:a="granted",...c}=t,l=g.useMemo(()=>Ky(qy,r),[r]),{showSearch:u,showHeader:p}=l.header??{},{sections:f=rb}=i,{BeforeSearch:d,AfterSearch:h}=i.header??{},[m,v]=g.useState(""),y=g.useRef(null),b=Bi&&a==="granted",S=Rs(),{isLaunchpadPinned:k}=ro(),{isLaunchpadCollapsed:C,setIsLaunchpadCollapsed:j}=fb();g.useEffect(()=>{var H;n&&((H=y.current)==null||H.focus())},[n]),g.useEffect(()=>{k&&j(!1)},[j,k]);const E=H=>{const z=H.target.value;wl(z)&&C&&j(!1),v(z)},P=()=>{var H;v(""),(H=y.current)==null||H.focus()};return s.jsx(fy,{close:e,isGlobalLayoutsAvailable:b,children:s.jsxs("div",{className:ot("launchpad",o),...c,children:[p&&s.jsxs(Jy,{className:S||k?void 0:"draggable",children:[d&&s.jsx(d,{}),u&&s.jsx(Xy,{ref:y,searchTerm:m,onSearch:E,onClear:P,className:S?void 0:"non-draggable"}),h&&s.jsx(h,{}),h===void 0&&l.mode!=="pinned"&&s.jsx(_p,{className:"ms-auto"})]}),s.jsxs("div",{className:ot("launchpad-body",C?"collapsed":void 0),children:[s.jsx("main",{className:"launchpad-main",children:wl(m)?s.jsx(nb,{searchTerm:m}):s.jsx(Ty,{children:s.jsx(ut,{children:f.map(({Component:H,placementId:z})=>s.jsx(H,{},z))})})}),b&&s.jsx(db,{})]})]})})},Wp=g.createContext(void 0),zp=()=>{const t=g.useContext(Wp);if(t===void 0)throw new Error("useWorkspaceComponentsContext must be used within an WorkspaceComponentsContextProvider");return t},pb=()=>{const t=Bi?[On.NOTIFICATIONS,On.WINDOW_MANAGEMENT]:[On.NOTIFICATIONS];return Promise.all(t.map(async n=>{const e=await navigator.permissions.query({name:n});return e.stableName=n,e}))},$p=g.createContext(void 0),Dn=()=>{const t=g.useContext($p);if(t===void 0)throw new Error("useIOConnectHome must be used within an IOConnectHomeProvider");return t},hb=({children:t})=>{const[n,e]=rn("localStorage",yr,br),[o,r]=g.useState([]),i=g.useMemo(()=>o.reduce((f,d)=>({...f,[d.stableName]:{state:d.state}}),{}),[o]),a={isLoading:o.length===0,statuses:i},[c,l]=g.useState(!1),u={isLoggingOut:c,setIsLoggingOut:l};g.useEffect(()=>{let f=!1;const d=pb().then(h=>{if(f)return;r(h);const m=[];let v=!1;return h.forEach((y,b)=>{const S=k=>{if(f||!k.target||v)return;const C=k.target;if(C.state==="prompt")return e({isCompleted:!1}),v=!0,window.location.reload();r(E=>[...E.slice(0,b),C,...E.slice(b+1)])};y.addEventListener("change",S),m.push(()=>y.removeEventListener("change",S))}),m}).catch(console.warn);return()=>{f=!0,d.then(h=>{h==null||h.forEach(m=>m())})}},[e]);const p=g.useMemo(()=>({permission:a,login:u}),[a,u]);return s.jsx($p.Provider,{value:p,children:t})},mb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,fill:"#3C3E3F",rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),s.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,stroke:"#4B4E4F",strokeMiterlimit:10,rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),s.jsx("path",{fill:"#36A86B",d:"M125.31 100.086c-1.656 0-3-1.41-3-3.149 0-1.74 1.344-3.15 3-3.15 1.657 0 3 1.41 3 3.15s-1.343 3.149-3 3.149Z"}),s.jsx("rect",{width:21.694,height:6.057,fill:"#AAB0B0",rx:3.028,transform:"matrix(1 0 0 -1 132.72 99.844)"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("rect",{width:64,height:64,x:53,y:24,fill:"#36AA6C",rx:32}),s.jsx("path",{fill:"#fff",d:"M84.068 42.02c0-.466.408-.932.932-.932.466 0 .932.466.932.932v.99c4.66.467 8.388 4.428 8.388 9.262v1.748a9.57 9.57 0 0 0 2.796 6.756l.174.175c.466.466.758 1.165.758 1.806a2.61 2.61 0 0 1-2.621 2.621H74.514c-1.456-.058-2.563-1.165-2.563-2.621 0-.7.233-1.34.758-1.806l.116-.175c1.806-1.805 2.854-4.252 2.854-6.757v-1.747a9.3 9.3 0 0 1 8.388-9.261v-.99ZM85 44.816c-4.136 0-7.456 3.379-7.456 7.456v1.748c0 3.028-1.223 5.94-3.378 8.096l-.175.117a.94.94 0 0 0-.175.524c0 .408.291.699.7.699h20.91c.408 0 .758-.291.758-.7 0-.174-.117-.349-.233-.523l-.175-.117a11.502 11.502 0 0 1-3.378-8.155v-1.689c0-4.077-3.32-7.456-7.456-7.456H85Zm-1.806 23.008c.291.758.99 1.224 1.806 1.224.757 0 1.456-.466 1.747-1.224.175-.466.7-.757 1.165-.582a.976.976 0 0 1 .583 1.223A3.717 3.717 0 0 1 85 70.912c-1.631 0-3.029-.99-3.553-2.447a.976.976 0 0 1 .582-1.223c.466-.175.99.116 1.165.582Z"}),s.jsx("path",{fill:"#36A86B",d:"M113.791 86.146c-1.922 0-3.48-1.62-3.48-3.62 0-1.999 1.558-3.62 3.48-3.62s3.481 1.621 3.481 3.62c0 2-1.559 3.62-3.481 3.62Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),gb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v94H0z",transform:"translate(0 20)"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:113,x:.5,y:20.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#3C3E3F",stroke:"#5D5D5D",strokeMiterlimit:10,d:"M22.338.5h125.324c2.746 0 4.941 2.144 4.941 4.75v76.938c0 2.608-2.195 4.751-4.941 4.751H22.338c-2.746 0-4.94-2.143-4.94-4.75V5.25c0-2.607 2.194-4.751 4.94-4.751Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M116.905 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533ZM127.206 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M137.505 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),s.jsx("circle",{cx:46.208,cy:58.882,r:20.294,fill:"#36AA6C"}),s.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M45.501 53.17a1 1 0 0 1 1.414 0l6.364 6.363a1 1 0 0 1-1.414 1.415l-4.657-4.657v48.23a1 1 0 0 1-2 0v-48.23l-4.657 4.657a1 1 0 0 1-1.414-1.415l6.364-6.364Z",clipRule:"evenodd"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:114,y:20,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:50.521,y1:5.735,y2:95.406,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),vb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeLinejoin:"round",strokeMiterlimit:10,d:"M27.449 103.584a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.495 1.495 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5V88.6h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V66.37h.5V64.35h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V42.12h.5V40.1h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5V19.89h-.5V17.87h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5V40.1h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5V88.6h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M128 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"M143.015 89.758a6.667 6.667 0 0 0 5.823-3.379c1.237-2.082 1.237-4.646 0-6.758-1.207-2.082-3.409-3.38-5.823-3.38a6.742 6.742 0 0 0-5.853 3.38c-1.237 2.112-1.237 4.676 0 6.758 1.207 2.112 3.409 3.38 5.853 3.38Zm0-14.482c2.746 0 5.28 1.479 6.668 3.862 1.388 2.414 1.388 5.34 0 7.724a7.666 7.666 0 0 1-6.668 3.862 7.678 7.678 0 0 1-6.698-3.862c-1.388-2.384-1.388-5.31 0-7.724a7.741 7.741 0 0 1 6.698-3.862Zm.724 2.897a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-1.689 7.723c0 .543.422.966.965.966a.973.973 0 0 0 .966-.966.993.993 0 0 0-.966-.965.972.972 0 0 0-.965.965Zm-.966 0c0-1.056.845-1.93 1.931-1.93.513 0 .996.21 1.328.573l3.228-1.931a.478.478 0 0 1 .664.15c.15.242.06.544-.151.664l-3.228 1.931c.06.181.09.362.09.543 0 1.087-.875 1.931-1.931 1.931a1.906 1.906 0 0 1-1.931-1.93Zm6.034-6.275a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-8.93 2.655c.392 0 .724.332.724.724a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.301-.724.724-.724Zm2.172-2.655a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M12 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"M27.351 76.62a.804.804 0 0 0-.73 0L21.45 78.81c-.322.117-.556.438-.526.789 0 2.746 1.139 7.596 5.697 9.787a.804.804 0 0 0 .73 0c4.558-2.19 5.697-7.04 5.727-9.787a.855.855 0 0 0-.556-.789l-5.17-2.191Zm-1.08-.877a1.816 1.816 0 0 1 1.46 0l5.142 2.192c.643.292 1.14.905 1.14 1.665-.03 2.922-1.228 8.21-6.253 10.635a1.798 1.798 0 0 1-1.548 0c-5.026-2.425-6.223-7.713-6.223-10.635-.03-.76.467-1.373 1.11-1.665l5.171-2.192Z"}),s.jsx("rect",{width:30,height:30,fill:"#5A5C5C",rx:15,transform:"matrix(1 0 0 -1 12 45.46)"}),s.jsx("path",{fill:"#DDD",d:"M18.653 23.886c.132-.184.422-.237.58-.079l16.033 12.657a.394.394 0 0 1 .08.58c-.133.185-.396.212-.58.08L18.732 24.466a.42.42 0 0 1-.08-.58Zm10.416 6.065-1.45-1.16a7.74 7.74 0 0 1 4.746 2.189c.159.184.159.448 0 .606a.447.447 0 0 1-.606 0 6.555 6.555 0 0 0-2.69-1.635Zm-5.01.343a6.346 6.346 0 0 0-1.82 1.292.447.447 0 0 1-.606 0 .414.414 0 0 1 0-.58 7.975 7.975 0 0 1 1.688-1.292l.738.58Zm-.184-4.43-.791-.633a11.395 11.395 0 0 1 3.928-.686c3.218 0 6.17 1.319 8.307 3.428.158.159.158.422 0 .607-.158.158-.422.158-.607 0a10.84 10.84 0 0 0-7.7-3.19c-1.107 0-2.135.157-3.137.474ZM19.84 26.97l.686.528c-.449.343-.844.685-1.24 1.08a.447.447 0 0 1-.606 0c-.159-.184-.159-.447 0-.606.369-.369.765-.685 1.16-1.002Zm5.801 8.702a1.699 1.699 0 0 1-.21-1.687c.263-.554.79-.95 1.397-1.002a1.662 1.662 0 0 1 1.53.712c.369.5.448 1.134.21 1.687-.263.554-.79.95-1.397 1.002a1.662 1.662 0 0 1-1.53-.712Zm2.215-1.002a.868.868 0 0 0-.844-.843.85.85 0 0 0-.843.843c0 .475.369.844.843.844a.85.85 0 0 0 .844-.844Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M128 30c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"m142.001 23.885-.424 1.457c-.091.364-.364.637-.668.789-.243.121-.455.242-.667.364a1.232 1.232 0 0 1-1.032.212l-1.456-.364h-.122a3.276 3.276 0 0 0-.455.668l-.152.212a7.838 7.838 0 0 0-.333.728c0 .03.03.091.06.122l1.062 1.061c.243.273.364.668.334 1.002v.758c.03.334-.091.698-.334.971l-1.062 1.092a.231.231 0 0 0-.06.122c.091.242.212.485.333.728l.122.212c.152.213.303.456.455.668h.152l1.456-.364c.364-.091.759 0 1.032.182.212.151.424.273.667.394.304.152.577.425.668.79l.424 1.456c0 .03.031.06.061.09.304.061.607.061.941.061.303 0 .607 0 .91-.06.03-.03.061-.061.061-.091l.424-1.457c.091-.364.364-.637.668-.789a4.79 4.79 0 0 0 .667-.394c.304-.182.668-.273 1.032-.182l1.456.364h.152c.152-.212.304-.455.455-.668l.122-.212c.121-.243.242-.486.333-.728 0-.03-.03-.091-.06-.122l-1.062-1.092a1.316 1.316 0 0 1-.334-.97c0-.122.03-.244.03-.395 0-.122-.03-.243-.03-.364-.03-.334.091-.729.334-1.002l1.062-1.061c.03-.03.06-.092.06-.122a7.838 7.838 0 0 0-.333-.728l-.122-.212a12.155 12.155 0 0 0-.455-.668h-.152l-1.456.364c-.364.091-.728 0-1.032-.182a4.789 4.789 0 0 0-.667-.394c-.304-.152-.577-.425-.668-.79l-.424-1.456a.233.233 0 0 0-.061-.121 9.146 9.146 0 0 0-.91-.06c-.334 0-.637.03-.941.06a.233.233 0 0 0-.061.121Zm1.002-1.153c.394 0 .758.03 1.153.091.06.03.091.03.151.061.273.152.516.425.607.728l.425 1.457c0 .06.061.151.152.182.273.121.546.273.789.455.091.06.182.09.242.06l1.487-.364c.303-.09.668-.03.941.152l.121.122c.212.242.394.546.576.849l.152.212v.03c.152.304.304.608.425.911.03.06.03.091.03.152.031.334-.091.667-.333.91l-1.062 1.092c-.031.03-.061.122-.061.213 0 .151.03.303.03.455 0 .151-.03.303-.03.455 0 .121.03.212.061.243l1.062 1.092c.242.243.364.576.333.91 0 .03 0 .091-.03.152-.121.303-.273.607-.425.91l-.152.243a5.476 5.476 0 0 1-.606.85c-.031.06-.061.09-.091.12a1.206 1.206 0 0 1-.971.152l-1.457-.364c-.06-.03-.151 0-.242.061-.243.152-.516.303-.789.455-.091.03-.152.121-.152.182l-.425 1.426a1.277 1.277 0 0 1-.607.759c-.06.03-.091.03-.151.06-.395.03-.759.061-1.153.061-.395 0-.789-.03-1.184-.06-.06-.03-.091-.03-.151-.061a1.277 1.277 0 0 1-.607-.759l-.425-1.426c0-.06-.061-.151-.152-.182a4.11 4.11 0 0 1-.789-.455c-.091-.06-.182-.06-.242-.06l-1.457.363c-.333.091-.667.03-.94-.151-.061-.03-.091-.06-.122-.091-.242-.273-.424-.577-.606-.88l-.122-.213-.03-.03a11.98 11.98 0 0 1-.425-.91c0-.06-.03-.091-.03-.152 0-.334.091-.667.334-.91l1.061-1.092c.031-.03.061-.122.061-.243v-.91c0-.091-.03-.182-.061-.213l-1.061-1.092c-.243-.243-.334-.576-.334-.91 0-.061.03-.091.03-.152.121-.303.273-.607.425-.91l.03-.03.122-.213a6.09 6.09 0 0 1 .606-.85.24.24 0 0 1 .122-.12c.273-.183.607-.244.94-.153l1.457.364c.06.03.151 0 .242-.06.243-.152.516-.334.789-.455.091-.03.152-.122.152-.182l.425-1.457c.091-.303.334-.576.607-.728.06-.03.091-.03.151-.06.395-.061.789-.092 1.184-.092Zm-1.699 7.768c0 .637.303 1.183.849 1.486.516.304 1.153.304 1.699 0 .516-.303.85-.85.85-1.486 0-.607-.334-1.153-.85-1.457-.546-.303-1.183-.303-1.699 0-.546.304-.849.85-.849 1.457Zm4.369 0c0 .97-.516 1.85-1.335 2.336a2.781 2.781 0 0 1-2.67 0c-.85-.485-1.335-1.365-1.335-2.336 0-.94.485-1.82 1.335-2.306a2.781 2.781 0 0 1 2.67 0 2.702 2.702 0 0 1 1.335 2.306Z"}),s.jsx("circle",{cx:85,cy:57.277,r:32,fill:"#36AA6C"}),s.jsx("path",{fill:"#fff",d:"M72.313 42.777h9.968v1.812h-9.969c-1.019 0-1.812.85-1.812 1.813v16.312a1.79 1.79 0 0 0 1.813 1.813h25.374c.963 0 1.813-.793 1.813-1.813V46.402c0-.963-.85-1.813-1.813-1.813H87.72v-1.812h9.969c1.982 0 3.624 1.642 3.624 3.625v16.312a3.613 3.613 0 0 1-3.624 3.625H89.19l.623 3.625h3.342c.453 0 .906.453.906.907 0 .51-.453.906-.906.906H76.844a.895.895 0 0 1-.906-.906c0-.454.396-.907.906-.907h3.285l.623-3.625h-8.44c-2.039 0-3.624-1.586-3.624-3.625V46.402a3.614 3.614 0 0 1 3.624-3.625Zm10.251 23.562-.623 3.625h6.061l-.623-3.625h-4.815Zm3.342-22.656v12.348l2.946-3.002c.34-.34.962-.34 1.302 0 .34.34.34.963 0 1.302l-4.531 4.532c-.34.34-.963.34-1.303 0l-4.53-4.532c-.34-.34-.34-.962 0-1.302.339-.34.962-.34 1.302 0l3.002 3.002V43.683c0-.453.396-.906.906-.906.453 0 .906.453.906.906Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),yb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeMiterlimit:10,d:"M27.449 103.138a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.493 1.493 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.022h-.5v-2.02h.5V80.07h-.5V78.05h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V57.84h.5v-2.02h-.5V53.8h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V33.59h.5V31.57h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5V53.8h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.029v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#36AA6C",d:"M114.756 28.708H55.244c-1.427 0-2.584 1.512-2.584 3.377v49.491c0 1.866 1.157 3.378 2.584 3.378h59.512c1.427 0 2.584-1.512 2.584-3.378v-49.49c0-1.866-1.157-3.378-2.584-3.378Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M98.8 37.185a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM104.076 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M109.351 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 18.367H43.32c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H10.803c-.193 0-.41-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.13-.808.317-1.06.186-.254.402-.36.595-.36Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M26.192 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM31.468 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M36.743 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 18.367h32.517c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H126.63c-.193 0-.409-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.131-.808.317-1.06.186-.254.402-.36.595-.36Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M142.019 26.344a1.416 1.416 0 1 0 0-2.832 1.416 1.416 0 0 0 0 2.832ZM147.294 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M152.569 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 63.694H43.32c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H10.803c-.193 0-.41-.106-.595-.359-.186-.253-.317-.626-.317-1.06V65.113c0-.435.13-.808.317-1.061.186-.253.402-.358.595-.358Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M27.192 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM32.468 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M37.743 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 63.694h32.517c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H126.63c-.193 0-.409-.106-.595-.359s-.317-.626-.317-1.06V65.113c0-.435.131-.808.317-1.061.186-.253.402-.358.595-.358Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M143.019 71.672a1.416 1.416 0 1 0 0-2.833 1.416 1.416 0 0 0 0 2.833ZM148.294 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M153.569 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#fff",d:"M49.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),s.jsx("path",{fill:"#fff",d:"M44.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),s.jsx("path",{fill:"#fff",d:"M44.482 40.488h-5.836a.486.486 0 1 1 0-.973h5.836a.486.486 0 1 1 0 .973ZM60.597 40.004l-3.255-3.255a.486.486 0 1 1 .688-.688l3.6 3.6c.19.19.19.497 0 .687l-3.594 3.593a.486.486 0 1 1-.688-.688l3.25-3.249Z"}),s.jsx("path",{fill:"#3BB272",d:"M32.147 36.709a3.375 3.375 0 1 1 0 6.75 3.375 3.375 0 0 1 0-6.75Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 65.808v-5.836a.487.487 0 0 0-.973 0v5.836a.486.486 0 1 0 .973 0Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 70.808v-5.836a.487.487 0 0 0-.973 0v5.837a.486.486 0 1 0 .973 0Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 70.644v5.836a.487.487 0 0 1-.973 0v-5.836a.486.486 0 1 1 .973 0ZM133.578 54.529l-3.255 3.255a.487.487 0 0 1-.688-.688l3.599-3.599c.19-.19.498-.19.688 0l3.593 3.593a.486.486 0 1 1-.688.688l-3.249-3.249Z"}),s.jsx("path",{fill:"#AAB0B0",d:"M130.282 82.98a3.376 3.376 0 1 1 6.752 0 3.376 3.376 0 0 1-6.752 0Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),bb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#DE2122",d:"M79.593 28.399c2.403-4.163 8.411-4.163 10.814 0l29.741 51.512c2.403 4.162-.601 9.366-5.407 9.366H55.259c-4.806 0-7.81-5.204-5.407-9.366l29.74-51.512Z"}),s.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M81.84 42.528h6.321a1 1 0 0 1 .994 1.113l-2.691 23.67a1 1 0 0 1-.994.887h-1.033a1 1 0 0 1-.994-.89l-2.596-23.671a1 1 0 0 1 .994-1.11Zm3.128 30.366a3.547 3.547 0 1 0 0 7.093 3.547 3.547 0 0 0 0-7.093Z",clipRule:"evenodd"}),s.jsx("path",{fill:"#5A5C5C",d:"M115.69 27.082 132.459.185l17.514-.151-25.545 24.389 17.858 23.176-25.076 13.678L131.267 47.6 115.69 27.082Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),wb={edgeNotificationsPermissionTimeout:15e3},Qe={WINDOW_MANAGEMENT:On.WINDOW_MANAGEMENT,NOTIFICATIONS:On.NOTIFICATIONS,POPUPS:"popups",PWA_INSTALL:"pwa-install"},xb={name:Qe.WINDOW_MANAGEMENT,label:`Allow window management${Bi?"":" (not available in your browser)"}`,heading:"Allow Window Management",description:`By granting this permission you will be able to load layouts containing multiple
48
+ ***************************************************************************** */var os=function(){return os=Object.assign||function(n){for(var e,o=1,r=arguments.length;o<r;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},os.apply(this,arguments)};function ey(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function rs(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!rs(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(var e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!rs(t[o[e]],n[o[e]]))return!1;return!0}}var Jo=function(t){return Array.isArray(t)},Lr=function(t){return typeof t=="object"&&t!==null&&!Jo(t)},ty=function(t){switch(typeof t){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return t instanceof Array?"an array":t===null?"null":"an object";default:return JSON.stringify(t)}},cn=function(t,n){return"expected "+t+", got "+ty(n)},Uo=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Vo=function(t,n){var e=n.at,o=ey(n,["at"]);return os({at:t+(e||"")},o)},pt=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ma(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return K1(e.run(o))},this.runWithException=function(o){return J1(e.run(o))},this.map=function(o){return new t(function(r){return X1(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return Q1(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?gt(n):st({message:cn("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?gt(n):st({message:cn("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?gt(n):st({message:cn("a boolean",n)})})},t.constant=function(n){return new t(function(e){return rs(e,n)?gt(n):st({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Lr(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok===!0)i.result!==void 0&&(o[r]=i.result);else return e[r]===void 0?st({message:"the key '"+r+"' is required but was not present"}):st(Vo("."+r,i.error))}return gt(o)}else return Lr(e)?gt(e):st({message:cn("an object",e)})})},t.array=function(n){return new t(function(e){if(Jo(e)&&n){var o=function(r,i){return ma(function(a){return Vo("["+i+"]",a)},n.decode(r))};return e.reduce(function(r,i,a){return wl(function(c,l){return c.concat([l])},r,o(i,a))},gt([]))}else return Jo(e)?gt(e):st({message:cn("an array",e)})})},t.tuple=function(n){return new t(function(e){if(Jo(e)){if(e.length!==n.length)return st({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(i.ok)o[r]=i.result;else return st(Vo("["+r+"]",i.error))}return gt(o)}else return st({message:cn("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return wl(Object.assign,a,c.decode(i))},gt({}))})},t.anyJson=function(){return new t(function(n){return gt(n)})},t.unknownJson=function(){return new t(function(n){return gt(n)})},t.dict=function(n){return new t(function(e){if(Lr(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok===!0)o[r]=i.result;else return st(Vo("."+r,i.error))}return gt(o)}else return st({message:cn("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?gt(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return st({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return gt(q1(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return st({at:Uo(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Lr(r))return st({at:Uo(n.slice(0,i+1)),message:cn("an object",r)});if(typeof n[i]=="number"&&!Jo(r))return st({at:Uo(n.slice(0,i+1)),message:cn("an array",r)});r=r[n[i]]}return ma(function(a){return r===void 0?{at:Uo(n),message:"path does not exist"}:Vo(Uo(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return gt(n)})},t.fail=function(n){return new t(function(e){return st({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),ny=pt.string,oy=pt.number,Ao=pt.boolean,jt=pt.anyJson;pt.unknownJson;var An=pt.constant,Xe=pt.object,ry=pt.array;pt.tuple;pt.dict;var Me=pt.optional,dr=pt.oneOf;pt.union;pt.intersection;pt.withDefault;pt.valueAt;pt.succeed;var iy=pt.fail;pt.lazy;const Dt=ny().where(t=>t.length>0,"Expected a non-empty string"),ay=oy().where(t=>t>=0,"Expected a non-negative number");Ao();const zt=(t,n)=>{const e=typeof t;return e==="function"?jt():iy(`The provided argument as ${n} should be of type function, provided: ${typeof e}`)},vp=Xe({name:Dt}),sy="Welcome",cy=t=>t.components.reduce((e,o)=>{if(o.type==="workspaceFrame"){const r=o.state.workspaces.map(i=>i.config.name);e.push(...r)}return e},[]),xl=t=>t.trim().length>0,ly=(t,n)=>{const[e,o]=g.useState(void 0),[r,i]=rn("sessionStorage",gp,vp),a=g.useRef(!1),c=Vs(),l=Gs(),u=g.useContext(De.IOConnectContext),f=g.useCallback(async({name:p})=>{try{await u.layouts.setDefaultGlobal(p)}catch(d){console.error("Failed to set default Layout: ",{error:d})}},[u]);return g.useEffect(()=>{if(u)return u.layouts.onDefaultGlobalChanged(p=>{o(p)})},[u]),g.useEffect(()=>{if(u)return u.layouts.onRestored(p=>{i({name:p.name})})},[u]),g.useEffect(()=>{if(u)return u.layouts.onRemoved(p=>{(p==null?void 0:p.name)===(r==null?void 0:r.name)&&i(null)})},[u,r]),g.useEffect(()=>{if(u)return u.layouts.onRenamed((p,d)=>{(d==null?void 0:d.name)===(r==null?void 0:r.name)&&i({name:p.name})})},[u,r]),g.useEffect(()=>{var d;if(!u||!((d=window.iobrowser)!=null&&d.platformStarted)||a.current)return;(async()=>{var b;a.current=!0;const h=await u.layouts.getDefaultGlobal()??(await u.layouts.getAll("Global")).find(S=>S.name===sy);if(!h||(o({name:h.name}),r))return;if(t(!0),n){await c(h.name),t(!1);return}const m=await((b=u.workspaces)==null?void 0:b.getWorkspace(S=>S.children.length===0)),v=await u.layouts.get(h.name,"Global");if(!v)throw new Error("Default Global Layout not found.");const y=cy(v);Promise.all(y.map((S,w)=>l({id:S,reuseWorkspaceId:w===0?m==null?void 0:m.id:void 0}))),t(!1)})().catch(h=>console.error("Initial Global Layout setup failed. ",Ua(h)))},[u,r,c,l,n]),{defaultLayout:e,activeLayout:r,setDefaultLayout:f,setActiveLayout:i}},yp=g.createContext(void 0),gn=()=>{const t=g.useContext(yp);if(t===void 0)throw new Error("useLaunchpadAPI must be used within a LaunchpadAPIProvider");return t},uy=({children:t,close:n,isGlobalLayoutsAvailable:e})=>{const[o,r]=g.useState(!1),{defaultLayout:i,activeLayout:a,setDefaultLayout:c,setActiveLayout:l}=ly(r,e),u=g.useMemo(()=>({close:n,defaultLayout:i,activeLayout:a,setDefaultLayout:c,setActiveLayout:l,isLayoutOperationBlocked:o,setIsLayoutOperationBlocked:r}),[n,i,a,c,l,o]);return s.jsx(yp.Provider,{value:u,children:t})},Do={CUSTOM_PREFS:"customPrefs",COLLAPSED_SECTIONS:"_launchpad_collapsedSections",FAVORITES:"_launchpad_favorites",IS_LAYOUTS_PANEL_OPEN:"_launchpad_isLayoutsPanelOpen",IS_LAUNCHPAD_COLLAPSED:"_launchpad_isCollapsed",IS_LAUNCHPAD_PINNED:"_launchpad_isPinned",LAYOUTS_SHOW_UNSAVED_CHANGES_PROMPT:"_layouts_showUnsavedChangesPrompt",LAYOUTS_SHOW_DELETE_PROMPT:"_layouts_showDeletePrompt"},ro=()=>{const{value:t,update:n,isLoading:e,error:o}=Ht({prefKey:Do.IS_LAUNCHPAD_PINNED}),r=g.useCallback(()=>n(i=>!i),[n]);return{error:o,isLaunchpadPinned:t,isLoading:e,toggle:r}},bp=()=>{const t=g.useContext(De.IOConnectContext),{setActiveLayout:n,setDefaultLayout:e,close:o}=gn(),{isLaunchpadPinned:r}=ro(),{value:i,update:a}=Ht({prefKey:Do.LAYOUTS_SHOW_DELETE_PROMPT}),c=()=>{r||o==null||o()};return g.useCallback(async u=>{const{layout:f,actionName:p}=u;return await V1[p]({io:t,layout:f,setActiveLayout:n,setDefaultLayout:e,closeLaunchpad:c,showDeletePromptPref:i,updateShowDeletePromptPref:a})},[t,e,n,o,i,a])},Mo=()=>{const{isLayoutOperationBlocked:t,setIsLayoutOperationBlocked:n}=gn();return async e=>{if(!t){n(!0);try{await e()}catch(o){console.error("Layout operation failed: ",{error:o})}n(!1)}}},wp={CREATE_WORKSPACE:"createWorkspace"},dy=async t=>{const{io:n,item:e}=t;if(n.workspaces)try{await n.workspaces.restoreWorkspace(e.id,{newFrame:!0})}catch(o){await Fe({io:n,variant:Le.WARNING,text:`Failed to load Workspace "${e.title}".`,error:o})}},fy=async t=>{const{io:n,item:e,removeFavorite:o}=t;if(n.workspaces){if("modals"in n&&n.modals){const r="delete",{isEnterPressed:i,responseButtonClicked:a}=await n.modals.dialogs.request({templateName:To.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:`Delete "${e.title}"`,text:"Are you sure you want to delete this Workspace?",actionButtons:[{variant:"critical",text:"Delete",id:r},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(!(i||(a==null?void 0:a.id)===r))return}try{await n.workspaces.layouts.delete(e.id),await o(e),await Fe({io:n,variant:Le.SUCCESS,text:`"Workspace ${e.title}" was successfully deleted.`})}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to delete Workspace "${e.title}".`,error:r})}}},py=async t=>{const{io:n}=t;if(n.workspaces)try{await n.workspaces.createWorkspace({children:[],frame:{newFrame:!0}})}catch(e){await Fe({io:n,variant:Le.WARNING,text:"Failed to create a new Workspace.",error:e})}},hy={[ai.OPEN_IN_NEW_WINDOW]:dy,[ai.DELETE]:fy,[wp.CREATE_WORKSPACE]:py};class xp{constructor(){It(this,"queue",[]);It(this,"isExecutingQueue",!1)}enqueue(n){return new Promise((e,o)=>{this.queue.push({action:n,resolve:e,reject:o}),this.executeQueue()})}async executeQueue(){if(!this.isExecutingQueue){for(this.isExecutingQueue=!0;this.queue.length;){const n=this.queue.shift();if(!n){this.isExecutingQueue=!1;return}try{const e=await n.action();n.resolve(e)}catch(e){n.reject(e)}await this.intervalBreak()}this.isExecutingQueue=!1}}intervalBreak(){return new Promise(n=>setTimeout(n,0))}}const Cp=()=>{const[t,n]=g.useState([]),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!(e!=null&&e.workspaces))return;let o=!1;const r=e.workspaces.layouts.onSaved(({name:a})=>{o||t.find(({id:c})=>c===a)||n(c=>[...c,{id:a,title:a}])}),i=e.workspaces.layouts.onRemoved(({name:a})=>{o||n(c=>c.filter(({title:l})=>l!==a))});return()=>{o=!0,[r,i].forEach(async a=>{try{(await a)()}catch(c){console.error(c)}})}},[e,t]),t},Cl=new xp,_i=()=>{const{value:t,update:n,isLoading:e}=Ht({prefKey:Do.FAVORITES}),o=hp(),r=Cp(),i=g.useMemo(()=>(t??[]).filter(l=>l.type===wt.APPLICATION?o.some(u=>u.id===l.id):l.type===wt.WORKSPACE?r.some(u=>u.id===l.id):!0),[t,o,r]),a=g.useCallback(({openInstances:l,...u})=>Cl.enqueue(()=>n((f=[])=>{const p=f.find(d=>d.id===u.id&&d.type&&u.type);return p?f.filter(d=>d!==p):[u,...f]})),[n]),c=g.useCallback(l=>Cl.enqueue(()=>n((u=[])=>u.filter(f=>!(f.id===l.id&&f.type===l.type)))),[n]);return{favorites:i,toggleFavorite:a,removeFavorite:c,isLoading:e}},kp=()=>{const t=g.useContext(De.IOConnectContext),{removeFavorite:n}=_i();return(e,o)=>{hy[o]({io:t,item:e,removeFavorite:n})}},my=()=>{const t=g.useContext(De.IOConnectContext);return async n=>t.interop.methods().every(e=>e.name!==(n==null?void 0:n.method))?console.error("Interop method not found."):await t.interop.invoke(n.method,n.params,n.target).catch(e=>console.error({error:e}))},gy=()=>{const[t,n]=g.useState(!1),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;let o;return(async()=>{var r;try{o=await((r=e.workspaces)==null?void 0:r.onWorkspaceOpened(()=>n(!0)))}catch(i){console.error(i)}})(),()=>o==null?void 0:o()},[e]),t};var is={exports:{}};(function(t,n){(function(e,o){var r="1.0.38",i="",a="?",c="function",l="undefined",u="object",f="string",p="major",d="model",h="name",m="type",v="vendor",y="version",b="architecture",S="console",w="mobile",x="tablet",E="smarttv",O="wearable",M="embedded",B=500,$="Amazon",Z="Apple",_="ASUS",I="BlackBerry",he="Browser",ye="Chrome",ne="Edge",ge="Firefox",de="Google",Oe="Huawei",se="LG",W="Microsoft",X="Motorola",fe="Opera",ue="Samsung",V="Sharp",T="Sony",P="Xiaomi",R="Zebra",G="Facebook",U="Chromium OS",re="Mac OS",ee=function(K,z){var H={};for(var Y in K)z[Y]&&z[Y].length%2===0?H[Y]=z[Y].concat(K[Y]):H[Y]=K[Y];return H},A=function(K){for(var z={},H=0;H<K.length;H++)z[K[H].toUpperCase()]=K[H];return z},ke=function(K,z){return typeof K===f?xe(z).indexOf(xe(K))!==-1:!1},xe=function(K){return K.toLowerCase()},_e=function(K){return typeof K===f?K.replace(/[^\d\.]/g,i).split(".")[0]:o},Ie=function(K,z){if(typeof K===f)return K=K.replace(/^\s\s*/,i),typeof z===l?K:K.substring(0,B)},Pe=function(K,z){for(var H=0,Y,ce,ie,oe,Q,ve;H<z.length&&!Q;){var Ae=z[H],Ve=z[H+1];for(Y=ce=0;Y<Ae.length&&!Q&&Ae[Y];)if(Q=Ae[Y++].exec(K),Q)for(ie=0;ie<Ve.length;ie++)ve=Q[++ce],oe=Ve[ie],typeof oe===u&&oe.length>0?oe.length===2?typeof oe[1]==c?this[oe[0]]=oe[1].call(this,ve):this[oe[0]]=oe[1]:oe.length===3?typeof oe[1]===c&&!(oe[1].exec&&oe[1].test)?this[oe[0]]=ve?oe[1].call(this,ve,oe[2]):o:this[oe[0]]=ve?ve.replace(oe[1],oe[2]):o:oe.length===4&&(this[oe[0]]=ve?oe[3].call(this,ve.replace(oe[1],oe[2])):o):this[oe]=ve||o;H+=2}},me=function(K,z){for(var H in z)if(typeof z[H]===u&&z[H].length>0){for(var Y=0;Y<z[H].length;Y++)if(ke(z[H][Y],K))return H===a?o:H}else if(ke(z[H],K))return H===a?o:H;return K},k={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},C={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},j={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,y],[/opios[\/ ]+([\w\.]+)/i],[y,[h,fe+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[h,fe+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[h,fe]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[h,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,y],[/\bddg\/([\w\.]+)/i],[y,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[h,"UC"+he]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[h,"Smart Lenovo "+he]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+he],y],[/\bfocus\/([\w\.]+)/i],[y,[h,ge+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[h,fe+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[h,fe+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[h,"MIUI "+he]],[/fxios\/([-\w\.]+)/i],[y,[h,ge]],[/\bqihu|(qi?ho?o?|360)browser/i],[[h,"360 "+he]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1 "+he],y],[/samsungbrowser\/([\w\.]+)/i],[y,[h,ue+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[h,/_/g," "],y],[/metasr[\/ ]?([\d\.]+)/i],[y,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[h,y],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,G],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[h,ye+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,ye+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[h,"Android "+he]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[y,me,k]],[/(webkit|khtml)\/([\w\.]+)/i],[h,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[h,ge+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[h,y],[/(cobalt)\/([\w\.]+)/i],[h,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[b,"amd64"]],[/(ia32(?=;))/i],[[b,xe]],[/((?:i[346]|x)86)[;\)]/i],[[b,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[b,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/windows (ce|mobile); ppc;/i],[[b,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[b,/ower/,i,xe]],[/(sun4\w)[;\)]/i],[[b,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[b,xe]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[v,ue],[m,x]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[d,[v,ue],[m,w]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[v,Z],[m,w]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[v,Z],[m,x]],[/(macintosh);/i],[d,[v,Z]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[v,V],[m,w]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[d,[v,Oe],[m,x]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[v,Oe],[m,w]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[d,/_/g," "],[v,P],[m,w]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[d,/_/g," "],[v,P],[m,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[v,"OPPO"],[m,w]],[/\b(opd2\d{3}a?) bui/i],[d,[v,"OPPO"],[m,x]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[v,"Vivo"],[m,w]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[v,"Realme"],[m,w]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[v,X],[m,w]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[v,X],[m,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[v,se],[m,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[v,se],[m,w]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[d,[v,"Lenovo"],[m,x]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[d,/_/g," "],[v,"Nokia"],[m,w]],[/(pixel c)\b/i],[d,[v,de],[m,x]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[v,de],[m,w]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[v,T],[m,w]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,"Xperia Tablet"],[v,T],[m,x]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[v,"OnePlus"],[m,w]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[v,$],[m,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,"Fire Phone $1"],[v,$],[m,w]],[/(playbook);[-\w\),; ]+(rim)/i],[d,v,[m,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[v,I],[m,w]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[v,_],[m,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[v,_],[m,w]],[/(nexus 9)/i],[d,[v,"HTC"],[m,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[v,[d,/_/g," "],[m,w]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[v,"Acer"],[m,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[v,"Meizu"],[m,w]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[v,"Ulefone"],[m,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[v,d,[m,w]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[v,d,[m,x]],[/(surface duo)/i],[d,[v,W],[m,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[v,"Fairphone"],[m,w]],[/(u304aa)/i],[d,[v,"AT&T"],[m,w]],[/\bsie-(\w*)/i],[d,[v,"Siemens"],[m,w]],[/\b(rct\w+) b/i],[d,[v,"RCA"],[m,x]],[/\b(venue[\d ]{2,7}) b/i],[d,[v,"Dell"],[m,x]],[/\b(q(?:mv|ta)\w+) b/i],[d,[v,"Verizon"],[m,x]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[v,"Barnes & Noble"],[m,x]],[/\b(tm\d{3}\w+) b/i],[d,[v,"NuVision"],[m,x]],[/\b(k88) b/i],[d,[v,"ZTE"],[m,x]],[/\b(nx\d{3}j) b/i],[d,[v,"ZTE"],[m,w]],[/\b(gen\d{3}) b.+49h/i],[d,[v,"Swiss"],[m,w]],[/\b(zur\d{3}) b/i],[d,[v,"Swiss"],[m,x]],[/\b((zeki)?tb.*\b) b/i],[d,[v,"Zeki"],[m,x]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[v,"Dragon Touch"],d,[m,x]],[/\b(ns-?\w{0,9}) b/i],[d,[v,"Insignia"],[m,x]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[v,"NextBook"],[m,x]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[v,"Voice"],d,[m,w]],[/\b(lvtel\-)?(v1[12]) b/i],[[v,"LvTel"],d,[m,w]],[/\b(ph-1) /i],[d,[v,"Essential"],[m,w]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[v,"Envizen"],[m,x]],[/\b(trio[-\w\. ]+) b/i],[d,[v,"MachSpeed"],[m,x]],[/\btu_(1491) b/i],[d,[v,"Rotor"],[m,x]],[/(shield[\w ]+) b/i],[d,[v,"Nvidia"],[m,x]],[/(sprint) (\w+)/i],[v,d,[m,w]],[/(kin\.[onetw]{3})/i],[[d,/\./g," "],[v,W],[m,w]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[v,R],[m,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[v,R],[m,w]],[/smart-tv.+(samsung)/i],[v,[m,E]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,"SmartTV"],[v,ue],[m,E]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[v,se],[m,E]],[/(apple) ?tv/i],[v,[d,Z+" TV"],[m,E]],[/crkey/i],[[d,ye+"cast"],[v,de],[m,E]],[/droid.+aft(\w+)( bui|\))/i],[d,[v,$],[m,E]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[v,V],[m,E]],[/(bravia[\w ]+)( bui|\))/i],[d,[v,T],[m,E]],[/(mitv-\w{5}) bui/i],[d,[v,P],[m,E]],[/Hbbtv.*(technisat) (.*);/i],[v,d,[m,E]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[v,Ie],[d,Ie],[m,E]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,E]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[v,d,[m,S]],[/droid.+; (shield) bui/i],[d,[v,"Nvidia"],[m,S]],[/(playstation [345portablevi]+)/i],[d,[v,T],[m,S]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[v,W],[m,S]],[/((pebble))app/i],[v,d,[m,O]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[v,Z],[m,O]],[/droid.+; (glass) \d/i],[d,[v,de],[m,O]],[/droid.+; (wt63?0{2,3})\)/i],[d,[v,R],[m,O]],[/(quest( \d| pro)?)/i],[d,[v,G],[m,O]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[v,[m,M]],[/(aeobc)\b/i],[d,[v,$],[m,M]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[m,w]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[m,x]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,w]],[/(android[-\w\. ]{0,9});.+buil/i],[d,[v,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[h,ne+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,y],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[h,[y,me,C]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,me,C],[h,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,re],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,y],[/\(bb(10);/i],[y,[h,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[h,ge+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[h,ye+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,U],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,y],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,y]]},N=function(K,z){if(typeof K===u&&(z=K,K=o),!(this instanceof N))return new N(K,z).getResult();var H=typeof e!==l&&e.navigator?e.navigator:o,Y=K||(H&&H.userAgent?H.userAgent:i),ce=H&&H.userAgentData?H.userAgentData:o,ie=z?ee(j,z):j,oe=H&&H.userAgent==Y;return this.getBrowser=function(){var Q={};return Q[h]=o,Q[y]=o,Pe.call(Q,Y,ie.browser),Q[p]=_e(Q[y]),oe&&H&&H.brave&&typeof H.brave.isBrave==c&&(Q[h]="Brave"),Q},this.getCPU=function(){var Q={};return Q[b]=o,Pe.call(Q,Y,ie.cpu),Q},this.getDevice=function(){var Q={};return Q[v]=o,Q[d]=o,Q[m]=o,Pe.call(Q,Y,ie.device),oe&&!Q[m]&&ce&&ce.mobile&&(Q[m]=w),oe&&Q[d]=="Macintosh"&&H&&typeof H.standalone!==l&&H.maxTouchPoints&&H.maxTouchPoints>2&&(Q[d]="iPad",Q[m]=x),Q},this.getEngine=function(){var Q={};return Q[h]=o,Q[y]=o,Pe.call(Q,Y,ie.engine),Q},this.getOS=function(){var Q={};return Q[h]=o,Q[y]=o,Pe.call(Q,Y,ie.os),oe&&!Q[h]&&ce&&ce.platform&&ce.platform!="Unknown"&&(Q[h]=ce.platform.replace(/chrome os/i,U).replace(/macos/i,re)),Q},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Y},this.setUA=function(Q){return Y=typeof Q===f&&Q.length>B?Ie(Q,B):Q,this},this.setUA(Y),this};N.VERSION=r,N.BROWSER=A([h,y,p]),N.CPU=A([b]),N.DEVICE=A([d,v,m,S,w,E,x,O,M]),N.ENGINE=N.OS=A([h,y]),t.exports&&(n=t.exports=N),n.UAParser=N;var F=typeof e!==l&&(e.jQuery||e.Zepto);if(F&&!F.ua){var te=new N;F.ua=te.getResult(),F.ua.get=function(){return te.getUA()},F.ua.set=function(K){te.setUA(K);var z=te.getResult();for(var H in z)F.ua[H]=z[H]}}})(typeof window=="object"?window:C0)})(is,is.exports);var vy=is.exports;const Fn=new vy.UAParser,yy=()=>D.useMemo(()=>({os:Fn.getOS(),browser:Fn.getBrowser(),cpu:Fn.getCPU(),device:Fn.getDevice(),engine:Fn.getEngine(),ua:Fn.getUA()}),[]),by=()=>D.useMemo(()=>Fn.getBrowser(),[]),Hs=()=>{const{ua:t}=yy();return t.includes("io-connect-desktop")},Sp=()=>{const[t,n]=g.useState([]),[e,o]=g.useState(!1),r=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!r)return;let i=!1;const a=[],c=r.layouts.onAdded(f=>{if(f.type!=="Global"||i)return;o(!0);const{name:p}=f;n(d=>[...d,{name:p}])}),l=r.layouts.onRemoved(f=>{f.type!=="Global"||i||n(p=>p.filter(d=>d.name!==f.name))}),u=r.layouts.onRenamed((f,p)=>{if(f.type!=="Global"||i)return;const{name:d}=f;n(h=>{const m=h.findIndex(v=>v.name===(p==null?void 0:p.name));return m===-1?h:[...h.slice(0,m),{name:d},...h.slice(m+1)]})});return a.push(c,l,u),()=>{i=!0,a.forEach(f=>f())}},[r]),{layouts:t,isInitialized:e}},Ep=()=>{const[t,n]=g.useState([]),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.notifications.onRaised(a=>n(c=>[...c,a])),r=e.notifications.onClosed(a=>n(c=>c.filter(l=>l.id!==a.id))),i=e.notifications.onStateChanged(({id:a},c)=>{n(l=>{const u=l.findIndex(f=>f.id===a);return u===-1?l:[...l.slice(0,u),{...l[u],state:c},...l.slice(u+1)]})});return e.notifications.list().then(n).catch(console.error),()=>{o(),r(),i()}},[e]),t},wy=()=>{const[t,n]=g.useState({}),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.notifications.onConfigurationChanged(r=>n(r));return()=>{o()}},[e]),t},Ws=t=>{const{handler:n,skip:e}=t;g.useEffect(()=>{if(e)return;const o=r=>{var i;((i=document.activeElement)==null?void 0:i.nodeName)==="IFRAME"&&n(r)};return window.addEventListener("blur",o,!0),()=>{window.removeEventListener("blur",o,!0)}},[n,e])},zs=t=>{const{eventType:n,handler:e,ref:o,skip:r}=t;g.useEffect(()=>{if(r)return;const i=a=>{const c=a.target;(Array.isArray(o)?o.every(u=>u.current&&!u.current.contains(c)):o.current&&!o.current.contains(c))&&e(a)};return document.addEventListener(n,i,!0),()=>{document.removeEventListener(n,i,!0)}},[n,e,o,r])},xy=Xe({name:Dt}),br=Xe({isCompleted:Ao()}),rn=(t,n,e)=>{const[o,r]=g.useState(()=>{try{const c=window[t].getItem(n);return c?JSON.parse(c):null}catch(c){return console.log(c),null}}),i=`${t}-${n}`;g.useEffect(()=>{const c=l=>{r(l.detail)};return window.addEventListener(i,c),()=>{window.removeEventListener(i,c)}},[i]);const a=g.useCallback(c=>{try{if(!c){window[t].removeItem(n),r(null);return}const l=e.run(c);if(!l.ok){console.warn(`Error validating the value to be stored: ${l.error.message}`);return}const u=l.result;r(u),window[t].setItem(n,JSON.stringify(u)),window.dispatchEvent(new CustomEvent(i,{detail:u}))}catch(l){console.log(l)}},[n,t,i,e]);return[o,a]},$s=()=>{const[t,n]=rn("sessionStorage",Z1,xy);return{isPlatformWindow:!t||window.name===t.name,setPlatformWindow:n}},Us=()=>{const[t,n]=g.useState([]);return g.useEffect(()=>{const e=({key:i})=>{n(a=>a.includes(i)?a:a.concat(i))},o=i=>{n(a=>a.filter(c=>c!==i.key))},r=()=>{n([])};return document.addEventListener("keydown",e),document.addEventListener("keyup",o),window.addEventListener("blur",r),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",o),window.removeEventListener("blur",r)}},[]),t.length===1?t[0]:null},Vs=()=>{const t=g.useContext(De.IOConnectContext);return g.useCallback(async(n,e)=>{if(t)try{await t.layouts.restore({name:n}),e==null||e({name:n}),await Fe({io:t,variant:Le.SUCCESS,text:`Layout "${n}" was loaded successfully.`})}catch(o){await Fe({io:t,variant:Le.WARNING,text:`Failed to load Layout "${n}".`,error:o})}},[t])},Li={CONTROL:"Control",SHIFT:"Shift"},Gs=()=>{const t=g.useContext(De.IOConnectContext),n=Fs();return async({id:e,modifier:o,reuseWorkspaceId:r})=>{var i;try{const a=o===Li.CONTROL?{newFrame:!0}:{frameId:n,reuseWorkspaceId:r};await((i=t.workspaces)==null?void 0:i.restoreWorkspace(e,a))}catch(a){await Fe({io:t,variant:Le.WARNING,text:`Failed to load Workspace "${e}".`,error:a})}}},Cy=t=>{const[n,e]=g.useState([]),[o,r]=g.useState(!0),i=g.useRef(null),a=g.useContext(De.IOConnectContext);return g.useEffect(()=>{const c=a==null?void 0:a.search;if(!c)return;const l=[],u=[];return(async p=>{r(!0),e([]);const d=await c.query({search:p.trim(),providerLimits:{maxResults:100,maxResultsPerType:5}});if(d===i.current)return;i.current=d;const h=d.onResults(y=>{y.results.forEach(b=>{u.find(w=>w.id===b.id&&w.type.name===b.type.name)||u.push(b)}),r(!1),e([...u])}),m=d.onCompleted(()=>{r(!1)}),v=d.onError(y=>{console.error(`Query failed. Provider: ${y.provider}; Error: ${y.error}`)});l.push(h,m,v)})(t),()=>{l.forEach(p=>p())}},[a,t]),{resultsToRender:n,isLoading:o}},jp=()=>{const t=g.useContext(De.IOConnectContext),n=async({id:o})=>{var r;await((r=t.appManager.application(o))==null?void 0:r.start())},e=async({id:o,modifier:r})=>{var u,f;const i=await((u=t.workspaces)==null?void 0:u.getWorkspace(p=>p.isSelected===!0)),a=i==null?void 0:i.children[0];if(r===Li.CONTROL||!i||(a==null?void 0:a.type)==="window"){await((f=t.appManager.application(o))==null?void 0:f.start());return}await((a==null?void 0:a.type)==="group"?a:await(a??i).addGroup()).addWindow({appName:o})};return async o=>{try{await(Gf()?n:e)(o)}catch(r){await Fe({io:t,variant:Le.WARNING,text:`Failed to start app "${o.title}".`,error:r})}}},ky=()=>{const[t,n]=g.useState({}),e=g.useContext(De.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=[];return(async()=>{var r,i;try{const a=await((r=e.workspaces)==null?void 0:r.onWorkspaceOpened(l=>n(u=>({...u,[l.title]:[...u[l.title]??[],l.id]}))));o.push(a);const c=await((i=e.workspaces)==null?void 0:i.onWorkspaceClosed(({workspaceId:l})=>n(u=>{const f={...u};for(const p in f)if(f[p].includes(l)){f[p]=f[p].filter(d=>d!==l);break}return f})));o.push(c)}catch(a){console.error(a)}})(),()=>o.forEach(r=>r==null?void 0:r())},[e]),t},Op=t=>t.key==="Enter"||t.key===" ",Ri=(t,n)=>typeof t>"u"?{}:{tabIndex:0,onClick:t,onKeyDown:e=>{Op(e)&&(e.preventDefault(),t==null||t(e)),n==null||n(e)}},Np=({event:t,currentIndex:n,moveFocus:e,min:o,max:r,onClose:i})=>{switch(t.key){case"ArrowUp":{e(Math.max(n-1,o));break}case"ArrowDown":{e(Math.min(n+1,r));break}case"Home":{e(o);break}case"End":{e(r);break}case"Escape":{if(i){i();break}return}default:return}t.stopPropagation(),t.preventDefault()};const Sy=g.forwardRef((t,n)=>{const{title:e,actions:o,className:r,onClose:i,onActionItemClick:a,...c}=t,l=g.useRef({}),[u,f]=g.useState(0),p=d=>{var h;(h=l.current[d])==null||h.focus(),f(d)};return g.useEffect(()=>{var d;(d=l.current[u])==null||d.focus()},[]),s.jsxs(ut,{ref:n,className:ot(r,"context-menu"),onClick:d=>d.stopPropagation(),onKeyDown:d=>Np({event:d,currentIndex:u,min:0,max:o.length-1,moveFocus:p,onClose:i}),...c,children:[e&&s.jsx(ut.ItemSection,{children:e}),o.map((d,h)=>{const m=d.displayName||d.name,v=d.iconSrc?s.jsx(Au,{size:"16",src:d.iconSrc,alt:`${m} icon`}):d.icon&&s.jsx(et,{size:"16",variant:d.icon});return s.jsxs(g.Fragment,{children:[s.jsx(ut.Item,{ref:y=>l.current[h]=y,prepend:v,disabled:d.disabled,tabIndex:-1,...Ri(y=>a(y,d)),children:m}),d.separatorAfter&&s.jsx("li",{className:"context-menu-separator","aria-hidden":!0})]},d.name)})]})});function Ys(t){const{title:n,buttonSize:e="16",icon:o="ellipsis-vertical",iconSize:r="12",actions:i,isTabStop:a,onActionItemClick:c,buttonVariant:l,placement:u,offset:f,shouldCloseOnOutsideScroll:p=!1,shouldCloseOnWindowBlur:d=!1}=t,[h,m]=g.useState(!1),[v,y]=g.useState(null),[b,S]=g.useState(null),w=g.useRef(null),x=g.useRef(null),E=g.useMemo(()=>[x,w],[]),O=g.useCallback(()=>m(!1),[]),{styles:M,attributes:B}=c1(v,b,{placement:u,modifiers:[{name:"offset",options:{offset:f}}]});g.useEffect(()=>{w.current=v},[v]),g.useEffect(()=>{x.current=b},[b]),zs({eventType:"mouseup",handler:O,ref:E,skip:!h}),Ws({handler:O,skip:!h}),g.useEffect(()=>{if(!(!d||!h))return window.addEventListener("blur",O),()=>{window.removeEventListener("blur",O)}},[O,h,d]),g.useEffect(()=>{if(!p||!b)return;const _=I=>{if(b.contains(I.target)){I.preventDefault();return}O()};return document.addEventListener("touchmove",_,{passive:!1}),document.addEventListener("wheel",_,{passive:!1}),()=>{document.removeEventListener("touchmove",_),document.removeEventListener("wheel",_)}},[O,b,p]);const $=_=>{_.stopPropagation(),m(I=>!I),b==null||b.focus()},Z=(_,I)=>{_.stopPropagation(),c(_,I),O()};return s.jsxs(s.Fragment,{children:[s.jsx(Ue,{ref:y,size:e,icon:o,iconSize:r,variant:l,...Ri($),tabIndex:a?0:-1}),h&&s.jsx(Sy,{ref:S,title:n,actions:i,onActionItemClick:Z,onClose:()=>{v==null||v.focus(),O()},style:M.popper,...B.popper})]})}const Ey=t=>{const{isFavoritismEnabled:n=!0,item:e,onClick:o,onKeyDown:r,isFocused:i,liRef:a,...c}=t,{favorites:l,toggleFavorite:u,isLoading:f}=_i(),{description:p,icon:d="application",iconSrc:h,openInstances:m=0,title:v,tooltip:y,className:b,contextMenuActions:S=[]}=e,w=n&&l.some(M=>M.type===e.type&&M.title===e.title),x=M=>{if(Op(M)){o(M),M.preventDefault(),M.stopPropagation();return}r(M)},E=h?s.jsx(Au,{size:"16",src:h,alt:`${v} icon`}):s.jsx(et,{size:"16",variant:d}),O=s.jsxs(s.Fragment,{children:[m!==0&&s.jsx("span",{className:"open-instances io-text-smaller",children:m===1?"Opened":`${m} opened`}),(n||S.length>0)&&s.jsxs(Re,{className:"item-actions",children:[n&&s.jsx(Ue,{...Ri(M=>{M.stopPropagation(),u(e)}),tabIndex:i?0:-1,size:"24",iconSize:"12",icon:w?"star-full":"star",disabled:f}),S.length>0&&s.jsx(Ys,{buttonSize:"24",iconSize:"12",icon:"ellipsis-vertical",title:v,actions:S,onActionItemClick:o,isTabStop:i,placement:"bottom-end",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0})]})]});return s.jsx(ut.Item,{ref:a,tabIndex:i?0:-1,className:ot("io-base-section-item",b),onKeyDown:x,onClick:o,prepend:E,append:O,description:p,tooltip:y??v,...c,children:v})},jy=new xp,Oy=()=>{const{value:t,update:n}=Ht({prefKey:Do.COLLAPSED_SECTIONS}),e=g.useCallback(o=>jy.enqueue(()=>n((r=[])=>r.includes(o)?r.filter(a=>a!==o):[...r,o])),[n]);return{collapsedSections:t,toggleSection:e}},Zs=t=>{const{config:n,level:e=1,path:o=n.id,onItemClick:r}=t,{isCollapsible:i=!0}=n,a=Us(),[c,l]=g.useState(0),u=g.useRef({}),{collapsedSections:f,toggleSection:p}=Oy(),d=i?!(f!=null&&f.includes(o)):!0,h=n.items.filter(x=>er(x)),m=n.items.filter(x=>!er(x)),v=[...h,...m],y=16,b=24,S=x=>{var E,O;(O=(E=u.current[x])==null?void 0:E.querySelector("[tabIndex]"))==null||O.focus(),l(x)},w=async()=>{i&&await p(o)};return s.jsxs(ut.ItemWithSubItems,{className:e===1?"main-section":void 0,children:[s.jsx(T1,{className:e===1?"io-list-item-title main-section-header":void 0,isOpen:d,onClick:w,showCollapseIcon:i,showFolderIcon:e!==1,style:{paddingLeft:`${y+b*Math.max(0,e-2)}px`},title:n.title}),s.jsx(pp,{isOpen:d,tag:ut,children:v.map((x,E)=>er(x)?s.jsx(Zs,{config:x,level:e+1,onItemClick:r,path:`${o}/${x.id}`},x.id):s.jsx(Ey,{style:{paddingLeft:`${y+b*(e-1)}px`},liRef:O=>u.current[E]=O,isFavoritismEnabled:x.type===wt.APPLICATION||x.type===wt.WORKSPACE,item:x,onClick:(O,M)=>r==null?void 0:r(O,{item:x,modifier:a,selectedContextMenuActionName:M==null?void 0:M.name}),onKeyDown:O=>{Np({event:O,moveFocus:S,currentIndex:c,min:0,max:v.length-1})},isFocused:c===E},x.id))})]})},Ip=t=>`${t.type}-${t.id}`,Ny=(t,n)=>Ap(t)[n],Ap=t=>t.reduce((n,e)=>er(e)?{...n,...Ap(e.items)}:{...n,[Ip(e)]:e},{}),Pp=g.createContext(void 0),Iy=()=>{const t=g.useContext(Pp);if(t===void 0)throw new Error("useSection must be used within a SectionProvider");return t},Ay=({children:t})=>{const[n,e]=g.useState(null),o=g.useMemo(()=>[n,e],[n]);return s.jsx(Pp.Provider,{value:o,children:t})},Fi=({config:t,onItemClick:n})=>{const[e,o]=Iy(),r=gn(),i=Us(),{isLaunchpadPinned:a}=ro(),c=(l,u)=>{const{item:f,selectedContextMenuActionName:p}=u;o({itemName:Ip(f),selectedContextMenuActionName:p})};return g.useEffect(()=>{var p;if(!n||!e)return;const{itemName:l,selectedContextMenuActionName:u}=e,f=Ny(t.items,l);f&&(n({item:f,modifier:i,selectedContextMenuActionName:u}),o(null),!(i===Li.SHIFT||a)&&((p=r.close)==null||p.call(r)))},[e,t.items,r,n,i,o,a]),s.jsx(Zs,{config:t,onItemClick:c})};function Tp(t){const{isFolderCollapsible:n,isSectionCollapsible:e,sortOrder:o}=t,r=hp(),i=D1(),a=jp(),c=mp(),l=g.useMemo(()=>x0(r,i,{isFolderCollapsible:n,isSectionCollapsible:e,sortOrder:o}),[r,i,n,e,o]),u=f=>{const{item:p,modifier:d,selectedContextMenuActionName:h}=f;if(!h)return a({id:p.id,title:p.title,modifier:d});c(p,h)};return s.jsx(Fi,{config:l,onItemClick:u})}const Py=(t,n)=>{const{isSectionCollapsible:e,sortOrder:o=cr.DISABLED}=n,r=js({items:t,sortOrder:o,ascendingCompare:Kf,descendingCompare:qf});return{id:xo.FAVORITES,title:"Favorites",items:r,isCollapsible:e}},Dp=t=>{const{isSectionCollapsible:n,sortOrder:e}=t,{favorites:o}=_i(),r=g.useMemo(()=>Py(o,{isSectionCollapsible:n,sortOrder:e}),[o,n,e]);return o.length>0?s.jsx(Fi,{config:r}):null},Ty=t=>{const{active:n,className:e,...o}=t;return s.jsx(Ue,{className:ot("launchpad-button",{active:n},e),"aria-label":"Launchpad",icon:"logo",variant:"circle",size:"32",title:n?"Close Launchpad":"Open Launchpad",...o})};var Dy=function(n){return My(n)&&!_y(n)};function My(t){return!!t&&typeof t=="object"}function _y(t){var n=Object.prototype.toString.call(t);return n==="[object RegExp]"||n==="[object Date]"||Fy(t)}var Ly=typeof Symbol=="function"&&Symbol.for,Ry=Ly?Symbol.for("react.element"):60103;function Fy(t){return t.$$typeof===Ry}function By(t){return Array.isArray(t)?[]:{}}function fr(t,n){return n.clone!==!1&&n.isMergeableObject(t)?Po(By(t),t,n):t}function Hy(t,n,e){return t.concat(n).map(function(o){return fr(o,e)})}function Wy(t,n){if(!n.customMerge)return Po;var e=n.customMerge(t);return typeof e=="function"?e:Po}function zy(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(n){return Object.propertyIsEnumerable.call(t,n)}):[]}function kl(t){return Object.keys(t).concat(zy(t))}function Mp(t,n){try{return n in t}catch{return!1}}function $y(t,n){return Mp(t,n)&&!(Object.hasOwnProperty.call(t,n)&&Object.propertyIsEnumerable.call(t,n))}function Uy(t,n,e){var o={};return e.isMergeableObject(t)&&kl(t).forEach(function(r){o[r]=fr(t[r],e)}),kl(n).forEach(function(r){$y(t,r)||(Mp(t,r)&&e.isMergeableObject(n[r])?o[r]=Wy(r,e)(t[r],n[r],e):o[r]=fr(n[r],e))}),o}function Po(t,n,e){e=e||{},e.arrayMerge=e.arrayMerge||Hy,e.isMergeableObject=e.isMergeableObject||Dy,e.cloneUnlessOtherwiseSpecified=fr;var o=Array.isArray(n),r=Array.isArray(t),i=o===r;return i?o?e.arrayMerge(t,n,e):Uy(t,n,e):fr(n,e)}Po.all=function(n,e){if(!Array.isArray(n))throw new Error("first argument should be an array");return n.reduce(function(o,r){return Po(o,r,e)},{})};var Vy=Po,Gy=Vy;const Yy=Ti(Gy),On={WINDOW_MANAGEMENT:"window-management",NOTIFICATIONS:"notifications"},Bi="getScreenDetails"in window,Zy={header:{showHeader:!0,showSearch:!0},mode:"default"},Ky=({className:t,children:n})=>s.jsx("header",{className:ot("launchpad-header",t),children:n}),_p=({className:t})=>{const{isLaunchpadPinned:n,isLoading:e,toggle:o}=ro();return s.jsx(Ue,{className:t,size:"32",variant:"circle",icon:n?"unpin":"pin",onClick:o,disabled:e})},qy=g.forwardRef((t,n)=>{const{onSearch:e,searchTerm:o,onClear:r,className:i}=t,a=g.useContext(De.IOConnectContext);return g.useEffect(()=>{a!=null&&a.search&&a.search.setDebounceMS(450)},[a]),s.jsx(Qn,{id:"search-input",className:ot("search-bar",i),ref:n,placeholder:"Find anything",value:o,onChange:e,autoComplete:"off",iconPrepend:"search",iconAppend:o.length?"close":void 0,iconAppendOnClick:r})}),Lp=()=>{const{defaultLayout:t,activeLayout:n}=gn();return e=>({name:e,isDefault:e===(t==null?void 0:t.name),isActive:e===(n==null?void 0:n.name)})},Jy=()=>{const t=bp(),n=Lp(),e=Mo();return async(o,r)=>{const{id:i}=o,a=n(i);await e(()=>t({layout:a,actionName:r}))}},Xy=()=>{const t=mp(),n=kp(),e=Jy();return o=>{if(o===wt.APPLICATION)return t;if(o===wt.WORKSPACE)return n;if(o===wt.LAYOUT)return e}},lo={RENAME:"rename",SAVE:"save",SAVE_AS:"saveAs",DELETE:"delete",SET_AS_DEFAULT:"setAsDefault",LOAD:"load"},Rp=t=>[{name:lo.RENAME,displayName:"Rename",icon:"pen-line"},{name:lo.SAVE,displayName:"Save",disabled:!t.isActive,icon:"floppy"},{name:lo.SAVE_AS,displayName:"Save as",icon:"floppy-disk-pen",separatorAfter:!0},{name:lo.DELETE,displayName:"Delete",icon:"trash-can",separatorAfter:!0},{name:lo.SET_AS_DEFAULT,displayName:"Set as Default",disabled:t.isDefault,icon:"user-gear",separatorAfter:!0},{name:lo.LOAD,displayName:"Load",icon:"spinner"}],Qy=t=>{const n=Lp();return t.reduce((e,o)=>{const{type:r}=o,i=o.id||o.displayName;if(!i)return e;let a=[];if(r.name===wt.APPLICATION)a=Yf;else if(r.name===wt.WORKSPACE)a=Zf;else if(r.name===wt.LAYOUT){const f=n(i);a=Rp(f)}else o.secondaryActions&&(a=o.secondaryActions.map(({name:f,method:p,params:d,target:h})=>({name:f,interopParams:{method:p,params:d,target:h}})));const c={id:i,title:o.displayName||i,description:o.description,type:r.name,iconSrc:o.iconURL,mainAction:o.action,contextMenuActions:a},l=e.findIndex(({title:f})=>r.displayName?f===r.displayName:f===r.name),u=e[l];return u?[...e.slice(0,l),{...u,items:[...u.items,c]},...e.slice(l+1)]:[...e,{id:r.name,title:r.displayName||r.name,items:[c]}]},[])};function eb(t){const{resultsToRender:n,isLoading:e}=Cy(t.searchTerm),{close:o}=gn(),r=my(),i=Gs(),a=jp(),c=Vs(),l=Xy(),u=Qy(n),f=Mo(),{isLaunchpadPinned:p}=ro(),d=(m,v)=>{const y=l(m.type);y==null||y(m,v)},h=async(m,v)=>{var B;const{item:y,modifier:b,selectedContextMenuActionName:S}=v,{type:w,id:x,title:E,mainAction:O}=y,M=S?(B=y.contextMenuActions)==null?void 0:B.find($=>$.name===S):null;M!=null&&M.interopParams?r(M.interopParams):S?d(y,S):O?r(O):w===wt.APPLICATION?a({id:x,title:E,modifier:b}):w===wt.WORKSPACE?i({id:x,modifier:b}):w===wt.LAYOUT&&f(()=>c(x)),!(b===Li.SHIFT||p)&&(o==null||o())};return e?s.jsx("p",{className:"search-loading",children:"Loading..."}):n.length===0?s.jsx("p",{className:"search-no-results",children:"No results found. Try searching by app name, workspace title, or keywords."}):s.jsx(ut,{children:u.map((m,v)=>s.jsx(Zs,{config:m,onItemClick:h},m.id||v))})}const tb=(t,n,e)=>{const{isSectionCollapsible:o,sortOrder:r=cr.ASCENDING}=e,a=js({items:t,sortOrder:r,ascendingCompare:Kf,descendingCompare:qf}).map(c=>{var l;return{...c,type:wt.WORKSPACE,icon:"workspace",openInstances:(l=n[c.title])==null?void 0:l.length,contextMenuActions:Zf}});return{id:xo.WORKSPACES,title:"Workspaces",items:[...a,{id:wp.CREATE_WORKSPACE,icon:"add",title:"Create Workspace",type:wt.ACTION_BUTTON,tooltip:"Create an empty Workspace in a new window",className:"create-workspace-btn"}],isCollapsible:o}},Fp=t=>{const{isSectionCollapsible:n,sortOrder:e}=t,o=Cp(),r=ky(),i=Gs(),a=kp(),c=g.useMemo(()=>tb(o,r,{isSectionCollapsible:n,sortOrder:e}),[o,r,n,e]),l=u=>{const{item:f,modifier:p,selectedContextMenuActionName:d}=u;return d?a(f,d):f.type===wt.ACTION_BUTTON?a(f,f.id):i({id:f.id,modifier:p})};return s.jsx(Fi,{config:c,onItemClick:l})},nb=[{placementId:xo.FAVORITES,Component:Dp},{placementId:xo.WORKSPACES,Component:Fp},{placementId:xo.APPLICATIONS,Component:Tp}],ob=()=>{const{value:t,update:n,isLoading:e,error:o}=Ht({prefKey:Do.IS_LAYOUTS_PANEL_OPEN});return{error:o,isLayoutsPanelOpen:t,setIsLayoutsPanelOpen:n,isLoading:e}},rb=({layoutName:t})=>{const n=g.useContext(De.IOConnectContext),e=Mo(),o=r=>{r.stopPropagation(),e(async()=>{try{await n.layouts.save({name:t,type:"Global"}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${t}" was saved successfully.`})}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${t}".`,error:a})}})};return s.jsx(Ue,{icon:"floppy",size:"24",iconSize:"12",onClick:o,title:"Save Layout"})},ib=({layout:t})=>{const n=bp(),e=Mo(),o=async(r,i)=>{r.stopPropagation(),await e(()=>n({layout:t,actionName:i.name}))};return s.jsx(Ys,{buttonSize:"24",iconSize:"12",title:t.name,icon:"ellipsis-vertical",actions:Rp(t),onActionItemClick:o,placement:"top-end",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0})},Bp=({layouts:t})=>{const{isLaunchpadPinned:n}=ro(),{close:e}=gn(),o=Vs(),r=Mo(),i=()=>{n||e==null||e()},a=c=>r(()=>o(c.name,i));return s.jsx(ut,{className:"layouts-list",variant:"single",checkIcon:{variant:"check",tooltip:"Active Layout"},children:t.map(c=>s.jsx(ut.Item,{className:"layouts-list-item",onClick:()=>a(c),append:s.jsxs(s.Fragment,{children:[c.isDefault&&s.jsx(Pu,{variant:"default",title:"Default Layout",children:"Default"}),s.jsxs(up,{children:[c.isActive&&s.jsx(rb,{layoutName:c.name}),s.jsx(ib,{layout:c})]})]}),isSelected:c.isActive,tooltip:c.name,children:c.name},c.name))})},ab=()=>{const{layouts:t}=Sp(),{activeLayout:n,defaultLayout:e}=gn(),o=g.useMemo(()=>t.map(r=>({...r,isActive:r.name===(n==null?void 0:n.name),isDefault:r.name===(e==null?void 0:e.name)})),[t,n,e]);return s.jsx(Bp,{layouts:o})},sb=()=>{const{defaultLayout:t,activeLayout:n}=gn();return n?s.jsx(Bp,{layouts:[{...n,isDefault:n.name===(t==null?void 0:t.name),isActive:!0}]}):s.jsx("p",{className:"io-text-small no-active-layout",children:"Choose which Layout to load"})},cb=()=>{const t=g.useContext(De.IOConnectContext),{setActiveLayout:n}=gn(),e=Mo(),o=async()=>{var p;if(!("modals"in t&&t.modals)){console.error("Cannot create Layout because io dialogs are not enabled");return}const r="create",i="layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await t.modals.dialogs.request({templateName:To.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:"Create Layout",input:{id:i,initialValue:"Create Layout",validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Bs}},actionButtons:[{variant:"primary",text:"Create",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(p=l==null?void 0:l.find(d=>d.id===i))==null?void 0:p.value;if(a||(c==null?void 0:c.id)===r)try{if((await t.layouts.getAll("Global")).find(h=>h.name===u)){await Fe({io:t,variant:Le.WARNING,text:`Failed to create Layout "${u}". A Layout with this name already exists.`});return}await t.layouts.save({name:u}),n({name:u}),await Fe({io:t,variant:Le.SUCCESS,text:`Layout "${u}" was created successfully.`})}catch(d){await Fe({io:t,variant:Le.WARNING,text:`Failed to create Layout "${u}".`,error:d})}};return s.jsx(Re,{variant:"fullwidth",className:"create-layout-btn-group",children:s.jsx(Ge,{variant:"primary",text:"Create Layout",onClick:()=>e(o)})})};const lb=()=>{const t=g.useRef(null),{layouts:n,isInitialized:e}=Sp(),{isLayoutsPanelOpen:o,setIsLayoutsPanelOpen:r}=ob();g.useEffect(()=>{!e||n.length>0||!o||r(!1)},[n,e,o,r]);const i=g.useCallback(()=>r(a=>!a),[r]);return s.jsxs("footer",{className:"layouts-panel",ref:t,children:[s.jsx(hr,{className:"layouts-panel-separator"}),s.jsxs("div",{className:"layouts-panel-header","aria-label":"Layouts panel","aria-expanded":o,role:"button",...Ri(n.length?i:void 0),children:[s.jsx(nn,{tag:"h2",size:"normal",text:n.length>0?"Layouts":"Start using Layouts"}),n.length>0&&s.jsx(Ue,{className:ot("layouts-panel-toggle-button",{"layouts-panel-toggle-button-rotated":o}),icon:"expand",iconSize:"12",size:"24"})]}),s.jsx(pp,{isOpen:o,tag:"div",children:s.jsx(ab,{})}),n.length>0&&!o?s.jsx(sb,{}):s.jsx(cb,{})]})},ub=()=>{const{value:t,update:n,isLoading:e,error:o}=Ht({prefKey:Do.IS_LAUNCHPAD_COLLAPSED});return{error:o,isLaunchpadCollapsed:t,setIsLaunchpadCollapsed:n,isLoading:e}};const Hp=t=>{const{isOpen:n=!0,onClose:e,className:o,settings:r={},components:i={},windowManagementPermissionState:a="granted",...c}=t,l=g.useMemo(()=>Yy(Zy,r),[r]),{showSearch:u,showHeader:f}=l.header??{},{sections:p=nb}=i,{BeforeSearch:d,AfterSearch:h}=i.header??{},[m,v]=g.useState(""),y=g.useRef(null),b=Bi&&a==="granted",S=Fs(),{isLaunchpadPinned:w}=ro(),{isLaunchpadCollapsed:x,setIsLaunchpadCollapsed:E}=ub();g.useEffect(()=>{var B;n&&((B=y.current)==null||B.focus())},[n]),g.useEffect(()=>{w&&E(!1)},[E,w]);const O=B=>{const $=B.target.value;xl($)&&x&&E(!1),v($)},M=()=>{var B;v(""),(B=y.current)==null||B.focus()};return s.jsx(uy,{close:e,isGlobalLayoutsAvailable:b,children:s.jsxs("div",{className:ot("launchpad",o),...c,children:[f&&s.jsxs(Ky,{className:S||w?void 0:"draggable",children:[d&&s.jsx(d,{}),u&&s.jsx(qy,{ref:y,searchTerm:m,onSearch:O,onClear:M,className:S?void 0:"non-draggable"}),h&&s.jsx(h,{}),h===void 0&&l.mode!=="pinned"&&s.jsx(_p,{className:"ms-auto"})]}),s.jsxs("div",{className:ot("launchpad-body",x?"collapsed":void 0),children:[s.jsx("main",{className:"launchpad-main",children:xl(m)?s.jsx(eb,{searchTerm:m}):s.jsx(Ay,{children:s.jsx(ut,{children:p.map(({Component:B,placementId:$})=>s.jsx(B,{},$))})})}),b&&s.jsx(lb,{})]})]})})},Wp=g.createContext(void 0),zp=()=>{const t=g.useContext(Wp);if(t===void 0)throw new Error("useWorkspaceComponentsContext must be used within an WorkspaceComponentsContextProvider");return t},db=()=>{const t=Bi?[On.NOTIFICATIONS,On.WINDOW_MANAGEMENT]:[On.NOTIFICATIONS];return Promise.all(t.map(async n=>{const e=await navigator.permissions.query({name:n});return e.stableName=n,e}))},$p=g.createContext(void 0),Dn=()=>{const t=g.useContext($p);if(t===void 0)throw new Error("useIOConnectHome must be used within an IOConnectHomeProvider");return t},fb=({children:t})=>{const[n,e]=rn("localStorage",yr,br),[o,r]=g.useState([]),i=g.useMemo(()=>o.reduce((p,d)=>({...p,[d.stableName]:{state:d.state}}),{}),[o]),a={isLoading:o.length===0,statuses:i},[c,l]=g.useState(!1),u={isLoggingOut:c,setIsLoggingOut:l};g.useEffect(()=>{let p=!1;const d=db().then(h=>{if(p)return;r(h);const m=[];let v=!1;return h.forEach((y,b)=>{const S=w=>{if(p||!w.target||v)return;const x=w.target;if(x.state==="prompt")return e({isCompleted:!1}),v=!0,window.location.reload();r(O=>[...O.slice(0,b),x,...O.slice(b+1)])};y.addEventListener("change",S),m.push(()=>y.removeEventListener("change",S))}),m}).catch(console.warn);return()=>{p=!0,d.then(h=>{h==null||h.forEach(m=>m())})}},[e]);const f=g.useMemo(()=>({permission:a,login:u}),[a,u]);return s.jsx($p.Provider,{value:f,children:t})},pb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,fill:"#3C3E3F",rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),s.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,stroke:"#4B4E4F",strokeMiterlimit:10,rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),s.jsx("path",{fill:"#36A86B",d:"M125.31 100.086c-1.656 0-3-1.41-3-3.149 0-1.74 1.344-3.15 3-3.15 1.657 0 3 1.41 3 3.15s-1.343 3.149-3 3.149Z"}),s.jsx("rect",{width:21.694,height:6.057,fill:"#AAB0B0",rx:3.028,transform:"matrix(1 0 0 -1 132.72 99.844)"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("rect",{width:64,height:64,x:53,y:24,fill:"#36AA6C",rx:32}),s.jsx("path",{fill:"#fff",d:"M84.068 42.02c0-.466.408-.932.932-.932.466 0 .932.466.932.932v.99c4.66.467 8.388 4.428 8.388 9.262v1.748a9.57 9.57 0 0 0 2.796 6.756l.174.175c.466.466.758 1.165.758 1.806a2.61 2.61 0 0 1-2.621 2.621H74.514c-1.456-.058-2.563-1.165-2.563-2.621 0-.7.233-1.34.758-1.806l.116-.175c1.806-1.805 2.854-4.252 2.854-6.757v-1.747a9.3 9.3 0 0 1 8.388-9.261v-.99ZM85 44.816c-4.136 0-7.456 3.379-7.456 7.456v1.748c0 3.028-1.223 5.94-3.378 8.096l-.175.117a.94.94 0 0 0-.175.524c0 .408.291.699.7.699h20.91c.408 0 .758-.291.758-.7 0-.174-.117-.349-.233-.523l-.175-.117a11.502 11.502 0 0 1-3.378-8.155v-1.689c0-4.077-3.32-7.456-7.456-7.456H85Zm-1.806 23.008c.291.758.99 1.224 1.806 1.224.757 0 1.456-.466 1.747-1.224.175-.466.7-.757 1.165-.582a.976.976 0 0 1 .583 1.223A3.717 3.717 0 0 1 85 70.912c-1.631 0-3.029-.99-3.553-2.447a.976.976 0 0 1 .582-1.223c.466-.175.99.116 1.165.582Z"}),s.jsx("path",{fill:"#36A86B",d:"M113.791 86.146c-1.922 0-3.48-1.62-3.48-3.62 0-1.999 1.558-3.62 3.48-3.62s3.481 1.621 3.481 3.62c0 2-1.559 3.62-3.481 3.62Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),hb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v94H0z",transform:"translate(0 20)"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:113,x:.5,y:20.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#3C3E3F",stroke:"#5D5D5D",strokeMiterlimit:10,d:"M22.338.5h125.324c2.746 0 4.941 2.144 4.941 4.75v76.938c0 2.608-2.195 4.751-4.941 4.751H22.338c-2.746 0-4.94-2.143-4.94-4.75V5.25c0-2.607 2.194-4.751 4.94-4.751Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M116.905 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533ZM127.206 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M137.505 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),s.jsx("circle",{cx:46.208,cy:58.882,r:20.294,fill:"#36AA6C"}),s.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M45.501 53.17a1 1 0 0 1 1.414 0l6.364 6.363a1 1 0 0 1-1.414 1.415l-4.657-4.657v48.23a1 1 0 0 1-2 0v-48.23l-4.657 4.657a1 1 0 0 1-1.414-1.415l6.364-6.364Z",clipRule:"evenodd"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:114,y:20,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:50.521,y1:5.735,y2:95.406,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),mb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeLinejoin:"round",strokeMiterlimit:10,d:"M27.449 103.584a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.495 1.495 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5V88.6h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V66.37h.5V64.35h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V42.12h.5V40.1h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5V19.89h-.5V17.87h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5V40.1h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5V88.6h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M128 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"M143.015 89.758a6.667 6.667 0 0 0 5.823-3.379c1.237-2.082 1.237-4.646 0-6.758-1.207-2.082-3.409-3.38-5.823-3.38a6.742 6.742 0 0 0-5.853 3.38c-1.237 2.112-1.237 4.676 0 6.758 1.207 2.112 3.409 3.38 5.853 3.38Zm0-14.482c2.746 0 5.28 1.479 6.668 3.862 1.388 2.414 1.388 5.34 0 7.724a7.666 7.666 0 0 1-6.668 3.862 7.678 7.678 0 0 1-6.698-3.862c-1.388-2.384-1.388-5.31 0-7.724a7.741 7.741 0 0 1 6.698-3.862Zm.724 2.897a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-1.689 7.723c0 .543.422.966.965.966a.973.973 0 0 0 .966-.966.993.993 0 0 0-.966-.965.972.972 0 0 0-.965.965Zm-.966 0c0-1.056.845-1.93 1.931-1.93.513 0 .996.21 1.328.573l3.228-1.931a.478.478 0 0 1 .664.15c.15.242.06.544-.151.664l-3.228 1.931c.06.181.09.362.09.543 0 1.087-.875 1.931-1.931 1.931a1.906 1.906 0 0 1-1.931-1.93Zm6.034-6.275a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-8.93 2.655c.392 0 .724.332.724.724a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.301-.724.724-.724Zm2.172-2.655a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M12 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"M27.351 76.62a.804.804 0 0 0-.73 0L21.45 78.81c-.322.117-.556.438-.526.789 0 2.746 1.139 7.596 5.697 9.787a.804.804 0 0 0 .73 0c4.558-2.19 5.697-7.04 5.727-9.787a.855.855 0 0 0-.556-.789l-5.17-2.191Zm-1.08-.877a1.816 1.816 0 0 1 1.46 0l5.142 2.192c.643.292 1.14.905 1.14 1.665-.03 2.922-1.228 8.21-6.253 10.635a1.798 1.798 0 0 1-1.548 0c-5.026-2.425-6.223-7.713-6.223-10.635-.03-.76.467-1.373 1.11-1.665l5.171-2.192Z"}),s.jsx("rect",{width:30,height:30,fill:"#5A5C5C",rx:15,transform:"matrix(1 0 0 -1 12 45.46)"}),s.jsx("path",{fill:"#DDD",d:"M18.653 23.886c.132-.184.422-.237.58-.079l16.033 12.657a.394.394 0 0 1 .08.58c-.133.185-.396.212-.58.08L18.732 24.466a.42.42 0 0 1-.08-.58Zm10.416 6.065-1.45-1.16a7.74 7.74 0 0 1 4.746 2.189c.159.184.159.448 0 .606a.447.447 0 0 1-.606 0 6.555 6.555 0 0 0-2.69-1.635Zm-5.01.343a6.346 6.346 0 0 0-1.82 1.292.447.447 0 0 1-.606 0 .414.414 0 0 1 0-.58 7.975 7.975 0 0 1 1.688-1.292l.738.58Zm-.184-4.43-.791-.633a11.395 11.395 0 0 1 3.928-.686c3.218 0 6.17 1.319 8.307 3.428.158.159.158.422 0 .607-.158.158-.422.158-.607 0a10.84 10.84 0 0 0-7.7-3.19c-1.107 0-2.135.157-3.137.474ZM19.84 26.97l.686.528c-.449.343-.844.685-1.24 1.08a.447.447 0 0 1-.606 0c-.159-.184-.159-.447 0-.606.369-.369.765-.685 1.16-1.002Zm5.801 8.702a1.699 1.699 0 0 1-.21-1.687c.263-.554.79-.95 1.397-1.002a1.662 1.662 0 0 1 1.53.712c.369.5.448 1.134.21 1.687-.263.554-.79.95-1.397 1.002a1.662 1.662 0 0 1-1.53-.712Zm2.215-1.002a.868.868 0 0 0-.844-.843.85.85 0 0 0-.843.843c0 .475.369.844.843.844a.85.85 0 0 0 .844-.844Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M128 30c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"m142.001 23.885-.424 1.457c-.091.364-.364.637-.668.789-.243.121-.455.242-.667.364a1.232 1.232 0 0 1-1.032.212l-1.456-.364h-.122a3.276 3.276 0 0 0-.455.668l-.152.212a7.838 7.838 0 0 0-.333.728c0 .03.03.091.06.122l1.062 1.061c.243.273.364.668.334 1.002v.758c.03.334-.091.698-.334.971l-1.062 1.092a.231.231 0 0 0-.06.122c.091.242.212.485.333.728l.122.212c.152.213.303.456.455.668h.152l1.456-.364c.364-.091.759 0 1.032.182.212.151.424.273.667.394.304.152.577.425.668.79l.424 1.456c0 .03.031.06.061.09.304.061.607.061.941.061.303 0 .607 0 .91-.06.03-.03.061-.061.061-.091l.424-1.457c.091-.364.364-.637.668-.789a4.79 4.79 0 0 0 .667-.394c.304-.182.668-.273 1.032-.182l1.456.364h.152c.152-.212.304-.455.455-.668l.122-.212c.121-.243.242-.486.333-.728 0-.03-.03-.091-.06-.122l-1.062-1.092a1.316 1.316 0 0 1-.334-.97c0-.122.03-.244.03-.395 0-.122-.03-.243-.03-.364-.03-.334.091-.729.334-1.002l1.062-1.061c.03-.03.06-.092.06-.122a7.838 7.838 0 0 0-.333-.728l-.122-.212a12.155 12.155 0 0 0-.455-.668h-.152l-1.456.364c-.364.091-.728 0-1.032-.182a4.789 4.789 0 0 0-.667-.394c-.304-.152-.577-.425-.668-.79l-.424-1.456a.233.233 0 0 0-.061-.121 9.146 9.146 0 0 0-.91-.06c-.334 0-.637.03-.941.06a.233.233 0 0 0-.061.121Zm1.002-1.153c.394 0 .758.03 1.153.091.06.03.091.03.151.061.273.152.516.425.607.728l.425 1.457c0 .06.061.151.152.182.273.121.546.273.789.455.091.06.182.09.242.06l1.487-.364c.303-.09.668-.03.941.152l.121.122c.212.242.394.546.576.849l.152.212v.03c.152.304.304.608.425.911.03.06.03.091.03.152.031.334-.091.667-.333.91l-1.062 1.092c-.031.03-.061.122-.061.213 0 .151.03.303.03.455 0 .151-.03.303-.03.455 0 .121.03.212.061.243l1.062 1.092c.242.243.364.576.333.91 0 .03 0 .091-.03.152-.121.303-.273.607-.425.91l-.152.243a5.476 5.476 0 0 1-.606.85c-.031.06-.061.09-.091.12a1.206 1.206 0 0 1-.971.152l-1.457-.364c-.06-.03-.151 0-.242.061-.243.152-.516.303-.789.455-.091.03-.152.121-.152.182l-.425 1.426a1.277 1.277 0 0 1-.607.759c-.06.03-.091.03-.151.06-.395.03-.759.061-1.153.061-.395 0-.789-.03-1.184-.06-.06-.03-.091-.03-.151-.061a1.277 1.277 0 0 1-.607-.759l-.425-1.426c0-.06-.061-.151-.152-.182a4.11 4.11 0 0 1-.789-.455c-.091-.06-.182-.06-.242-.06l-1.457.363c-.333.091-.667.03-.94-.151-.061-.03-.091-.06-.122-.091-.242-.273-.424-.577-.606-.88l-.122-.213-.03-.03a11.98 11.98 0 0 1-.425-.91c0-.06-.03-.091-.03-.152 0-.334.091-.667.334-.91l1.061-1.092c.031-.03.061-.122.061-.243v-.91c0-.091-.03-.182-.061-.213l-1.061-1.092c-.243-.243-.334-.576-.334-.91 0-.061.03-.091.03-.152.121-.303.273-.607.425-.91l.03-.03.122-.213a6.09 6.09 0 0 1 .606-.85.24.24 0 0 1 .122-.12c.273-.183.607-.244.94-.153l1.457.364c.06.03.151 0 .242-.06.243-.152.516-.334.789-.455.091-.03.152-.122.152-.182l.425-1.457c.091-.303.334-.576.607-.728.06-.03.091-.03.151-.06.395-.061.789-.092 1.184-.092Zm-1.699 7.768c0 .637.303 1.183.849 1.486.516.304 1.153.304 1.699 0 .516-.303.85-.85.85-1.486 0-.607-.334-1.153-.85-1.457-.546-.303-1.183-.303-1.699 0-.546.304-.849.85-.849 1.457Zm4.369 0c0 .97-.516 1.85-1.335 2.336a2.781 2.781 0 0 1-2.67 0c-.85-.485-1.335-1.365-1.335-2.336 0-.94.485-1.82 1.335-2.306a2.781 2.781 0 0 1 2.67 0 2.702 2.702 0 0 1 1.335 2.306Z"}),s.jsx("circle",{cx:85,cy:57.277,r:32,fill:"#36AA6C"}),s.jsx("path",{fill:"#fff",d:"M72.313 42.777h9.968v1.812h-9.969c-1.019 0-1.812.85-1.812 1.813v16.312a1.79 1.79 0 0 0 1.813 1.813h25.374c.963 0 1.813-.793 1.813-1.813V46.402c0-.963-.85-1.813-1.813-1.813H87.72v-1.812h9.969c1.982 0 3.624 1.642 3.624 3.625v16.312a3.613 3.613 0 0 1-3.624 3.625H89.19l.623 3.625h3.342c.453 0 .906.453.906.907 0 .51-.453.906-.906.906H76.844a.895.895 0 0 1-.906-.906c0-.454.396-.907.906-.907h3.285l.623-3.625h-8.44c-2.039 0-3.624-1.586-3.624-3.625V46.402a3.614 3.614 0 0 1 3.624-3.625Zm10.251 23.562-.623 3.625h6.061l-.623-3.625h-4.815Zm3.342-22.656v12.348l2.946-3.002c.34-.34.962-.34 1.302 0 .34.34.34.963 0 1.302l-4.531 4.532c-.34.34-.963.34-1.303 0l-4.53-4.532c-.34-.34-.34-.962 0-1.302.339-.34.962-.34 1.302 0l3.002 3.002V43.683c0-.453.396-.906.906-.906.453 0 .906.453.906.906Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),gb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeMiterlimit:10,d:"M27.449 103.138a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.493 1.493 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.022h-.5v-2.02h.5V80.07h-.5V78.05h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V57.84h.5v-2.02h-.5V53.8h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V33.59h.5V31.57h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5V53.8h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.029v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#36AA6C",d:"M114.756 28.708H55.244c-1.427 0-2.584 1.512-2.584 3.377v49.491c0 1.866 1.157 3.378 2.584 3.378h59.512c1.427 0 2.584-1.512 2.584-3.378v-49.49c0-1.866-1.157-3.378-2.584-3.378Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M98.8 37.185a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM104.076 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M109.351 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 18.367H43.32c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H10.803c-.193 0-.41-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.13-.808.317-1.06.186-.254.402-.36.595-.36Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M26.192 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM31.468 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M36.743 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 18.367h32.517c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H126.63c-.193 0-.409-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.131-.808.317-1.06.186-.254.402-.36.595-.36Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M142.019 26.344a1.416 1.416 0 1 0 0-2.832 1.416 1.416 0 0 0 0 2.832ZM147.294 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M152.569 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 63.694H43.32c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H10.803c-.193 0-.41-.106-.595-.359-.186-.253-.317-.626-.317-1.06V65.113c0-.435.13-.808.317-1.061.186-.253.402-.358.595-.358Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M27.192 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM32.468 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M37.743 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 63.694h32.517c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H126.63c-.193 0-.409-.106-.595-.359s-.317-.626-.317-1.06V65.113c0-.435.131-.808.317-1.061.186-.253.402-.358.595-.358Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M143.019 71.672a1.416 1.416 0 1 0 0-2.833 1.416 1.416 0 0 0 0 2.833ZM148.294 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M153.569 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#fff",d:"M49.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),s.jsx("path",{fill:"#fff",d:"M44.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),s.jsx("path",{fill:"#fff",d:"M44.482 40.488h-5.836a.486.486 0 1 1 0-.973h5.836a.486.486 0 1 1 0 .973ZM60.597 40.004l-3.255-3.255a.486.486 0 1 1 .688-.688l3.6 3.6c.19.19.19.497 0 .687l-3.594 3.593a.486.486 0 1 1-.688-.688l3.25-3.249Z"}),s.jsx("path",{fill:"#3BB272",d:"M32.147 36.709a3.375 3.375 0 1 1 0 6.75 3.375 3.375 0 0 1 0-6.75Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 65.808v-5.836a.487.487 0 0 0-.973 0v5.836a.486.486 0 1 0 .973 0Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 70.808v-5.836a.487.487 0 0 0-.973 0v5.837a.486.486 0 1 0 .973 0Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 70.644v5.836a.487.487 0 0 1-.973 0v-5.836a.486.486 0 1 1 .973 0ZM133.578 54.529l-3.255 3.255a.487.487 0 0 1-.688-.688l3.599-3.599c.19-.19.498-.19.688 0l3.593 3.593a.486.486 0 1 1-.688.688l-3.249-3.249Z"}),s.jsx("path",{fill:"#AAB0B0",d:"M130.282 82.98a3.376 3.376 0 1 1 6.752 0 3.376 3.376 0 0 1-6.752 0Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),vb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#DE2122",d:"M79.593 28.399c2.403-4.163 8.411-4.163 10.814 0l29.741 51.512c2.403 4.162-.601 9.366-5.407 9.366H55.259c-4.806 0-7.81-5.204-5.407-9.366l29.74-51.512Z"}),s.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M81.84 42.528h6.321a1 1 0 0 1 .994 1.113l-2.691 23.67a1 1 0 0 1-.994.887h-1.033a1 1 0 0 1-.994-.89l-2.596-23.671a1 1 0 0 1 .994-1.11Zm3.128 30.366a3.547 3.547 0 1 0 0 7.093 3.547 3.547 0 0 0 0-7.093Z",clipRule:"evenodd"}),s.jsx("path",{fill:"#5A5C5C",d:"M115.69 27.082 132.459.185l17.514-.151-25.545 24.389 17.858 23.176-25.076 13.678L131.267 47.6 115.69 27.082Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),yb={edgeNotificationsPermissionTimeout:15e3},Qe={WINDOW_MANAGEMENT:On.WINDOW_MANAGEMENT,NOTIFICATIONS:On.NOTIFICATIONS,POPUPS:"popups",PWA_INSTALL:"pwa-install"},bb={name:Qe.WINDOW_MANAGEMENT,label:`Allow window management${Bi?"":" (not available in your browser)"}`,heading:"Allow Window Management",description:`By granting this permission you will be able to load layouts containing multiple
49
49
  windows and share context data between opened windows.`,instructions:{initial:"Click “Allow” when the browser prompt appears.",additional:`It seems that you closed the permission prompt.
50
50
  Click the "Open permissions prompt" button again and grant the Window Management
51
- permission to allow the platform to function properly.`},Image:yb,actionBtnText:"Open permission prompt"},Cb={name:Qe.NOTIFICATIONS,label:"Allow browser notifications",heading:"Allow Browser Notifications",description:`By granting this permission you will be able to receive platform notifications in the notification center of your
51
+ permission to allow the platform to function properly.`},Image:gb,actionBtnText:"Open permission prompt"},wb={name:Qe.NOTIFICATIONS,label:"Allow browser notifications",heading:"Allow Browser Notifications",description:`By granting this permission you will be able to receive platform notifications in the notification center of your
52
52
  operating system.`,instructions:{initial:"Click “Allow” when the browser prompt appears.",additional:`It seems that you closed the permission prompt or your browser automatically blocks notifications.
53
53
  To allow browser notifications, go to your browser settings or click the "Bell" icon
54
- in the address bar and allow notifications for this site.`},Image:mb,actionBtnText:"Open permission prompt"},kb={name:Qe.POPUPS,label:"Allow pop-ups",heading:"Allow Pop-ups",description:"By granting this permission you will be able to eject apps from Workspaces and save them as part of a Layout.",instructions:{initial:`Click the "Test Pop-Up Settings" button. It should open two pop-ups in order to test the
54
+ in the address bar and allow notifications for this site.`},Image:pb,actionBtnText:"Open permission prompt"},xb={name:Qe.POPUPS,label:"Allow pop-ups",heading:"Allow Pop-ups",description:"By granting this permission you will be able to eject apps from Workspaces and save them as part of a Layout.",instructions:{initial:`Click the "Test Pop-Up Settings" button. It should open two pop-ups in order to test the
55
55
  browser pop-up settings.`,additional:`It seems that pop-ups are disabled in your browser.
56
56
  To allow pop-ups, go to your browser settings or click the "Pop-up blocked" icon
57
- in the address bar and allow pop-ups for this site.`},Image:gb,actionBtnText:"Test pop-up settings"},Sb={name:Qe.PWA_INSTALL,label:"Install as a PWA",heading:"Install as a PWA (optional)",description:"By installing the platform as a Progressive Web App you will get a similar experience as with native desktop apps.",instructions:{initial:"If your browser supports Progressive Web Apps, you can now install the platform as a PWA."},Image:vb,actionBtnText:"Continue to the platform"},Gr=[xb,Cb,kb,Sb],Rr={isCompleted:!1,state:"prompt"},Eb={[Qe.WINDOW_MANAGEMENT]:Rr,[Qe.NOTIFICATIONS]:Rr,[Qe.POPUPS]:Rr,[Qe.PWA_INSTALL]:Rr},jb=({isOpen:t,onClose:n})=>{var a;const{launchpadComponents:e,launchpadSettings:o}=zp(),{permission:r}=Dn(),i=(a=r.statuses[Qe.WINDOW_MANAGEMENT])==null?void 0:a.state;return s.jsx(Hp,{components:e,isOpen:t,onClose:n,settings:o,windowManagementPermissionState:i})};const Up=g.forwardRef((t,n)=>{const{className:e,isOpen:o,onClose:r,Panel:i,pinned:a=!1,position:c="left"}=t;return o&&!i&&console.error('Invalid use of PanelWrapper component. Please provide Panel component when "isOpen" is "true".'),s.jsx("div",{className:ot(e,"panel-wrapper",c,{open:o,pinned:a}),ref:n,children:i&&s.jsx(i,{isOpen:o,onClose:r})})}),Zs=t=>{const{Button:n,Panel:e,panelWrapperClassName:o,pinned:r=!1,position:i="left",tag:a="div",onClose:c}=t,[l,u]=g.useState(!1),p=g.useRef(null),f=g.useCallback(async()=>{u(!1),await(c==null?void 0:c())},[c]),d=()=>{if(l){f();return}u(!0)},h=!l||r;return Ws({eventType:"mouseup",handler:f,ref:p,skip:h}),Hs({handler:f,skip:h}),s.jsxs(a,{ref:p,children:[s.jsx(n,{active:l,onClick:d}),s.jsx(Up,{className:o,isOpen:l,onClose:f,Panel:e,pinned:r,position:i})]})};const Vp=({Button:t=My})=>{const{isLaunchpadPinned:n}=ro();return s.jsx(Zs,{Button:t,Panel:jb,panelWrapperClassName:"launchpad-panel-wrapper",pinned:n})};var is=function(t,n){return is=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])},is(t,n)};function Ob(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");is(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}var yt=function(){return yt=Object.assign||function(n){for(var e,o=1,r=arguments.length;o<r;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},yt.apply(this,arguments)};function Nb(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function uo(t,n,e,o){function r(i){return i instanceof e?i:new e(function(a){a(i)})}return new(e||(e=Promise))(function(i,a){function c(p){try{u(o.next(p))}catch(f){a(f)}}function l(p){try{u(o.throw(p))}catch(f){a(f)}}function u(p){p.done?i(p.value):r(p.value).then(c,l)}u((o=o.apply(t,n||[])).next())})}function fo(t,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(u){return function(p){return l([u,p])}}function l(u){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(e=0)),e;)try{if(o=1,r&&(i=u[0]&2?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,r=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1],i=u;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(u);break}i[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(p){u=[6,p],r=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Qt(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]])}return e}var $n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ks(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function qs(t,n){return t(n={exports:{}},n.exports),n.exports}var Bn=qs(function(t,n){Object.defineProperty(n,"__esModule",{value:!0});var e=function(){function o(){var r=this;this.locked=new Map,this.addToLocked=function(i,a){var c=r.locked.get(i);c===void 0?a===void 0?r.locked.set(i,[]):r.locked.set(i,[a]):a!==void 0&&(c.unshift(a),r.locked.set(i,c))},this.isLocked=function(i){return r.locked.has(i)},this.lock=function(i){return new Promise(function(a,c){r.isLocked(i)?r.addToLocked(i,a):(r.addToLocked(i),a())})},this.unlock=function(i){var a=r.locked.get(i);if(a!==void 0&&a.length!==0){var c=a.pop();r.locked.set(i,a),c!==void 0&&setTimeout(c,0)}else r.locked.delete(i)}}return o.getInstance=function(){return o.instance===void 0&&(o.instance=new o),o.instance},o}();n.default=function(){return e.getInstance()}});Ks(Bn);var Ib=Ks(qs(function(t,n){var e=$n&&$n.__awaiter||function(p,f,d,h){return new(d||(d=Promise))(function(m,v){function y(k){try{S(h.next(k))}catch(C){v(C)}}function b(k){try{S(h.throw(k))}catch(C){v(C)}}function S(k){k.done?m(k.value):new d(function(C){C(k.value)}).then(y,b)}S((h=h.apply(p,f||[])).next())})},o=$n&&$n.__generator||function(p,f){var d,h,m,v,y={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return v={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function b(S){return function(k){return function(C){if(d)throw new TypeError("Generator is already executing.");for(;y;)try{if(d=1,h&&(m=2&C[0]?h.return:C[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,C[1])).done)return m;switch(h=0,m&&(C=[2&C[0],m.value]),C[0]){case 0:case 1:m=C;break;case 4:return y.label++,{value:C[1],done:!1};case 5:y.label++,h=C[1],C=[0];continue;case 7:C=y.ops.pop(),y.trys.pop();continue;default:if(m=y.trys,!((m=m.length>0&&m[m.length-1])||C[0]!==6&&C[0]!==2)){y=0;continue}if(C[0]===3&&(!m||C[1]>m[0]&&C[1]<m[3])){y.label=C[1];break}if(C[0]===6&&y.label<m[1]){y.label=m[1],m=C;break}if(m&&y.label<m[2]){y.label=m[2],y.ops.push(C);break}m[2]&&y.ops.pop(),y.trys.pop();continue}C=f.call(p,y)}catch(j){C=[6,j],h=0}finally{d=m=0}if(5&C[0])throw C[1];return{value:C[0]?C[1]:void 0,done:!0}}([S,k])}}},r=$n;Object.defineProperty(n,"__esModule",{value:!0});var i="browser-tabs-lock-key",a={key:function(p){return e(r,void 0,void 0,function(){return o(this,function(f){throw new Error("Unsupported")})})},getItem:function(p){return e(r,void 0,void 0,function(){return o(this,function(f){throw new Error("Unsupported")})})},clear:function(){return e(r,void 0,void 0,function(){return o(this,function(p){return[2,window.localStorage.clear()]})})},removeItem:function(p){return e(r,void 0,void 0,function(){return o(this,function(f){throw new Error("Unsupported")})})},setItem:function(p,f){return e(r,void 0,void 0,function(){return o(this,function(d){throw new Error("Unsupported")})})},keySync:function(p){return window.localStorage.key(p)},getItemSync:function(p){return window.localStorage.getItem(p)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(p){return window.localStorage.removeItem(p)},setItemSync:function(p,f){return window.localStorage.setItem(p,f)}};function c(p){return new Promise(function(f){return setTimeout(f,p)})}function l(p){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<p;h++)d+=f[Math.floor(Math.random()*f.length)];return d}var u=function(){function p(f){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=f,p.waiters===void 0&&(p.waiters=[])}return p.prototype.acquireLock=function(f,d){return d===void 0&&(d=5e3),e(this,void 0,void 0,function(){var h,m,v,y,b,S,k;return o(this,function(C){switch(C.label){case 0:h=Date.now()+l(4),m=Date.now()+d,v=i+"-"+f,y=this.storageHandler===void 0?a:this.storageHandler,C.label=1;case 1:return Date.now()<m?[4,c(30)]:[3,8];case 2:return C.sent(),y.getItemSync(v)!==null?[3,5]:(b=this.id+"-"+f+"-"+h,[4,c(Math.floor(25*Math.random()))]);case 3:return C.sent(),y.setItemSync(v,JSON.stringify({id:this.id,iat:h,timeoutKey:b,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:return C.sent(),(S=y.getItemSync(v))!==null&&(k=JSON.parse(S)).id===this.id&&k.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(v,h),[2,!0]):[3,7];case 5:return p.lockCorrector(this.storageHandler===void 0?a:this.storageHandler),[4,this.waitForSomethingToChange(m)];case 6:C.sent(),C.label=7;case 7:return h=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},p.prototype.refreshLockWhileAcquired=function(f,d){return e(this,void 0,void 0,function(){var h=this;return o(this,function(m){return setTimeout(function(){return e(h,void 0,void 0,function(){var v,y,b;return o(this,function(S){switch(S.label){case 0:return[4,Bn.default().lock(d)];case 1:return S.sent(),this.acquiredIatSet.has(d)?(v=this.storageHandler===void 0?a:this.storageHandler,(y=v.getItemSync(f))===null?(Bn.default().unlock(d),[2]):((b=JSON.parse(y)).timeRefreshed=Date.now(),v.setItemSync(f,JSON.stringify(b)),Bn.default().unlock(d),this.refreshLockWhileAcquired(f,d),[2])):(Bn.default().unlock(d),[2])}})})},1e3),[2]})})},p.prototype.waitForSomethingToChange=function(f){return e(this,void 0,void 0,function(){return o(this,function(d){switch(d.label){case 0:return[4,new Promise(function(h){var m=!1,v=Date.now(),y=!1;function b(){if(y||(window.removeEventListener("storage",b),p.removeFromWaiting(b),clearTimeout(S),y=!0),!m){m=!0;var k=50-(Date.now()-v);k>0?setTimeout(h,k):h(null)}}window.addEventListener("storage",b),p.addToWaiting(b);var S=setTimeout(b,Math.max(0,f-Date.now()))})];case 1:return d.sent(),[2]}})})},p.addToWaiting=function(f){this.removeFromWaiting(f),p.waiters!==void 0&&p.waiters.push(f)},p.removeFromWaiting=function(f){p.waiters!==void 0&&(p.waiters=p.waiters.filter(function(d){return d!==f}))},p.notifyWaiters=function(){p.waiters!==void 0&&p.waiters.slice().forEach(function(f){return f()})},p.prototype.releaseLock=function(f){return e(this,void 0,void 0,function(){return o(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(f)];case 1:return[2,d.sent()]}})})},p.prototype.releaseLock__private__=function(f){return e(this,void 0,void 0,function(){var d,h,m,v;return o(this,function(y){switch(y.label){case 0:return d=this.storageHandler===void 0?a:this.storageHandler,h=i+"-"+f,(m=d.getItemSync(h))===null?[2]:(v=JSON.parse(m)).id!==this.id?[3,2]:[4,Bn.default().lock(v.iat)];case 1:y.sent(),this.acquiredIatSet.delete(v.iat),d.removeItemSync(h),Bn.default().unlock(v.iat),p.notifyWaiters(),y.label=2;case 2:return[2]}})})},p.lockCorrector=function(f){for(var d=Date.now()-5e3,h=f,m=[],v=0;;){var y=h.keySync(v);if(y===null)break;m.push(y),v++}for(var b=!1,S=0;S<m.length;S++){var k=m[S];if(k.includes(i)){var C=h.getItemSync(k);if(C!==null){var j=JSON.parse(C);(j.timeRefreshed===void 0&&j.timeAcquired<d||j.timeRefreshed!==void 0&&j.timeRefreshed<d)&&(h.removeItemSync(k),b=!0)}}}b&&p.notifyWaiters()},p.waiters=void 0,p}();n.default=u}));const Ab={timeoutInSeconds:60},Gp={name:"auth0-spa-js",version:"2.1.3"},Yp=()=>Date.now();class St extends Error{constructor(n,e){super(e),this.error=n,this.error_description=e,Object.setPrototypeOf(this,St.prototype)}static fromPayload({error:n,error_description:e}){return new St(n,e)}}class Js extends St{constructor(n,e,o,r=null){super(n,e),this.state=o,this.appState=r,Object.setPrototypeOf(this,Js.prototype)}}class pr extends St{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,pr.prototype)}}class Xs extends pr{constructor(n){super(),this.popup=n,Object.setPrototypeOf(this,Xs.prototype)}}class Qs extends St{constructor(n){super("cancelled","Popup closed"),this.popup=n,Object.setPrototypeOf(this,Qs.prototype)}}class ec extends St{constructor(n,e,o){super(n,e),this.mfa_token=o,Object.setPrototypeOf(this,ec.prototype)}}class Hi extends St{constructor(n,e){super("missing_refresh_token",`Missing Refresh Token (audience: '${kl(n,["default"])}', scope: '${kl(e)}')`),this.audience=n,this.scope=e,Object.setPrototypeOf(this,Hi.prototype)}}function kl(t,n=[]){return t&&!n.includes(t)?t:""}const Yr=()=>window.crypto,ga=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let n="";return Array.from(Yr().getRandomValues(new Uint8Array(43))).forEach(e=>n+=t[e%t.length]),n},Sl=t=>btoa(t),as=t=>{var{clientId:n}=t,e=Qt(t,["clientId"]);return new URLSearchParams((o=>Object.keys(o).filter(r=>o[r]!==void 0).reduce((r,i)=>Object.assign(Object.assign({},r),{[i]:o[i]}),{}))(Object.assign({client_id:n},e))).toString()},El=t=>(n=>decodeURIComponent(atob(n).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),Pb=async(t,n)=>{const e=await fetch(t,n);return{ok:e.ok,json:await e.json()}},Tb=async(t,n,e)=>{const o=new AbortController;let r;return n.signal=o.signal,Promise.race([Pb(t,n),new Promise((i,a)=>{r=setTimeout(()=>{o.abort(),a(new Error("Timeout when executing 'fetch'"))},e)})]).finally(()=>{clearTimeout(r)})},Db=async(t,n,e,o,r,i,a)=>{return c={auth:{audience:n,scope:e},timeout:r,fetchUrl:t,fetchOptions:o,useFormData:a},l=i,new Promise(function(u,p){const f=new MessageChannel;f.port1.onmessage=function(d){d.data.error?p(new Error(d.data.error)):u(d.data),f.port1.close()},l.postMessage(c,[f.port2])});var c,l},Mb=async(t,n,e,o,r,i,a=1e4)=>r?Db(t,n,e,o,a,r,i):Tb(t,o,a);async function _b(t,n){var{baseUrl:e,timeout:o,audience:r,scope:i,auth0Client:a,useFormData:c}=t,l=Qt(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const u=c?as(l):JSON.stringify(l);return await async function(p,f,d,h,m,v,y){let b,S=null;for(let H=0;H<3;H++)try{b=await Mb(p,d,h,m,v,y,f),S=null;break}catch(z){S=z}if(S)throw S;const k=b.json,{error:C,error_description:j}=k,E=Qt(k,["error","error_description"]),{ok:P}=b;if(!P){const H=j||`HTTP error. Unable to fetch ${p}`;throw C==="mfa_required"?new ec(C,H,E.mfa_token):C==="missing_refresh_token"?new Hi(d,h):new St(C||"request_error",H)}return E}(`${e}/oauth/token`,o,r||"default",i,{method:"POST",body:u,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||Gp))}},n,c)}const Fr=(...t)=>{return(n=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(n))).join(" ");var n};class en{constructor(n,e="@@auth0spajs@@",o){this.prefix=e,this.suffix=o,this.clientId=n.clientId,this.scope=n.scope,this.audience=n.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(n){const[e,o,r,i]=n.split("::");return new en({clientId:o,scope:i,audience:r},e)}static fromCacheEntry(n){const{scope:e,audience:o,client_id:r}=n;return new en({scope:e,audience:o,clientId:r})}}class Lb{set(n,e){localStorage.setItem(n,JSON.stringify(e))}get(n){const e=window.localStorage.getItem(n);if(e)try{return JSON.parse(e)}catch{return}}remove(n){localStorage.removeItem(n)}allKeys(){return Object.keys(window.localStorage).filter(n=>n.startsWith("@@auth0spajs@@"))}}class Zp{constructor(){this.enclosedCache=function(){let n={};return{set(e,o){n[e]=o},get(e){const o=n[e];if(o)return o},remove(e){delete n[e]},allKeys:()=>Object.keys(n)}}()}}class Rb{constructor(n,e,o){this.cache=n,this.keyManifest=e,this.nowProvider=o||Yp}async setIdToken(n,e,o){var r;const i=this.getIdTokenCacheKey(n);await this.cache.set(i,{id_token:e,decodedToken:o}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(i))}async getIdToken(n){const e=await this.cache.get(this.getIdTokenCacheKey(n.clientId));if(!e&&n.scope&&n.audience){const o=await this.get(n);return!o||!o.id_token||!o.decodedToken?void 0:{id_token:o.id_token,decodedToken:o.decodedToken}}if(e)return{id_token:e.id_token,decodedToken:e.decodedToken}}async get(n,e=0){var o;let r=await this.cache.get(n.toKey());if(!r){const c=await this.getCacheKeys();if(!c)return;const l=this.matchExistingCacheKey(n,c);l&&(r=await this.cache.get(l))}if(!r)return;const i=await this.nowProvider(),a=Math.floor(i/1e3);return r.expiresAt-e<a?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},await this.cache.set(n.toKey(),r),r.body):(await this.cache.remove(n.toKey()),void await((o=this.keyManifest)===null||o===void 0?void 0:o.remove(n.toKey()))):r.body}async set(n){var e;const o=new en({clientId:n.client_id,scope:n.scope,audience:n.audience}),r=await this.wrapCacheEntry(n);await this.cache.set(o.toKey(),r),await((e=this.keyManifest)===null||e===void 0?void 0:e.add(o.toKey()))}async clear(n){var e;const o=await this.getCacheKeys();o&&(await o.filter(r=>!n||r.includes(n)).reduce(async(r,i)=>{await r,await this.cache.remove(i)},Promise.resolve()),await((e=this.keyManifest)===null||e===void 0?void 0:e.clear()))}async wrapCacheEntry(n){const e=await this.nowProvider();return{body:n,expiresAt:Math.floor(e/1e3)+n.expires_in}}async getCacheKeys(){var n;return this.keyManifest?(n=await this.keyManifest.get())===null||n===void 0?void 0:n.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(n){return new en({clientId:n},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(n,e){return e.filter(o=>{var r;const i=en.fromKey(o),a=new Set(i.scope&&i.scope.split(" ")),c=((r=n.scope)===null||r===void 0?void 0:r.split(" "))||[],l=i.scope&&c.reduce((u,p)=>u&&a.has(p),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===n.clientId&&i.audience===n.audience&&l})[0]}}class Fb{constructor(n,e,o){this.storage=n,this.clientId=e,this.cookieDomain=o,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(n){this.storage.save(this.storageKey,n,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Go=t=>typeof t=="number",Bb=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],Hb=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const n=(i=>{const a=i.split("."),[c,l,u]=a;if(a.length!==3||!c||!l||!u)throw new Error("ID token could not be decoded");const p=JSON.parse(El(l)),f={__raw:i},d={};return Object.keys(p).forEach(h=>{f[h]=p[h],Bb.includes(h)||(d[h]=p[h])}),{encoded:{header:c,payload:l,signature:u},header:JSON.parse(El(c)),claims:f,user:d}})(t.id_token);if(!n.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(n.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${n.claims.iss}"`);if(!n.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(n.header.alg!=="RS256")throw new Error(`Signature algorithm of "${n.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!n.claims.aud||typeof n.claims.aud!="string"&&!Array.isArray(n.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(n.claims.aud)){if(!n.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${n.claims.aud.join(", ")}"`);if(n.claims.aud.length>1){if(!n.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(n.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${n.claims.azp}"`)}}else if(n.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${n.claims.aud}"`);if(t.nonce){if(!n.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(n.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${n.claims.nonce}"`)}if(t.max_age&&!Go(n.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(n.claims.exp==null||!Go(n.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Go(n.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const e=t.leeway||60,o=new Date(t.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(n.claims.exp+e),o>r)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${o}) is after expiration time (${r})`);if(n.claims.nbf!=null&&Go(n.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(n.claims.nbf-e),o<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${o}) is before ${i}`)}if(n.claims.auth_time!=null&&Go(n.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(n.claims.auth_time)+t.max_age+e),o>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${o}) is after last auth at ${i}`)}if(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const a=i;if(!n.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(a!==n.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${a}", found "${n.claims.org_id}"`)}else{const a=i.toLowerCase();if(!n.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(a!==n.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${a}", found "${n.claims.org_name}"`)}}return n};var Yn=qs(function(t,n){var e=$n&&$n.__assign||function(){return e=Object.assign||function(l){for(var u,p=1,f=arguments.length;p<f;p++)for(var d in u=arguments[p])Object.prototype.hasOwnProperty.call(u,d)&&(l[d]=u[d]);return l},e.apply(this,arguments)};function o(l,u){if(!u)return"";var p="; "+l;return u===!0?p:p+"="+u}function r(l,u,p){return encodeURIComponent(l).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(u).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(f){if(typeof f.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*f.expires),f.expires=d}return o("Expires",f.expires?f.expires.toUTCString():"")+o("Domain",f.domain)+o("Path",f.path)+o("Secure",f.secure)+o("SameSite",f.sameSite)}(p)}function i(l){for(var u={},p=l?l.split("; "):[],f=/(%[\dA-F]{2})+/gi,d=0;d<p.length;d++){var h=p[d].split("="),m=h.slice(1).join("=");m.charAt(0)==='"'&&(m=m.slice(1,-1));try{u[h[0].replace(f,decodeURIComponent)]=m.replace(f,decodeURIComponent)}catch{}}return u}function a(){return i(document.cookie)}function c(l,u,p){document.cookie=r(l,u,e({path:"/"},p))}n.__esModule=!0,n.encode=r,n.parse=i,n.getAll=a,n.get=function(l){return a()[l]},n.set=c,n.remove=function(l,u){c(l,"",e(e({},u),{expires:-1}))}});Ks(Yn),Yn.encode,Yn.parse,Yn.getAll;var Wb=Yn.get,Kp=Yn.set,qp=Yn.remove;const mo={get(t){const n=Wb(t);if(n!==void 0)return JSON.parse(n)},save(t,n,e){let o={};window.location.protocol==="https:"&&(o={secure:!0,sameSite:"none"}),e!=null&&e.daysUntilExpire&&(o.expires=e.daysUntilExpire),e!=null&&e.cookieDomain&&(o.domain=e.cookieDomain),Kp(t,JSON.stringify(n),o)},remove(t,n){let e={};n!=null&&n.cookieDomain&&(e.domain=n.cookieDomain),qp(t,e)}},zb={get(t){return mo.get(t)||mo.get(`_legacy_${t}`)},save(t,n,e){let o={};window.location.protocol==="https:"&&(o={secure:!0}),e!=null&&e.daysUntilExpire&&(o.expires=e.daysUntilExpire),e!=null&&e.cookieDomain&&(o.domain=e.cookieDomain),Kp(`_legacy_${t}`,JSON.stringify(n),o),mo.save(t,n,e)},remove(t,n){let e={};n!=null&&n.cookieDomain&&(e.domain=n.cookieDomain),qp(t,e),mo.remove(t,n),mo.remove(`_legacy_${t}`,n)}},$b={get(t){if(typeof sessionStorage>"u")return;const n=sessionStorage.getItem(t);return n!=null?JSON.parse(n):void 0},save(t,n){sessionStorage.setItem(t,JSON.stringify(n))},remove(t){sessionStorage.removeItem(t)}};function Ub(t,n,e){var o=n===void 0?null:n,r=function(l,u){var p=atob(l);if(u){for(var f=new Uint8Array(p.length),d=0,h=p.length;d<h;++d)f[d]=p.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return p}(t,e!==void 0&&e),i=r.indexOf(`
58
- `,10)+1,a=r.substring(i)+(o?"//# sourceMappingURL="+o:""),c=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(c)}var jl,Ol,Nl,va,Vb=(jl="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Ol=null,Nl=!1,function(t){return va=va||Ub(jl,Ol,Nl),new Worker(va,t)});const ya={};class Gb{constructor(n,e){this.cache=n,this.clientId=e,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(n){var e;const o=new Set(((e=await this.cache.get(this.manifestKey))===null||e===void 0?void 0:e.keys)||[]);o.add(n),await this.cache.set(this.manifestKey,{keys:[...o]})}async remove(n){const e=await this.cache.get(this.manifestKey);if(e){const o=new Set(e.keys);return o.delete(n),o.size>0?await this.cache.set(this.manifestKey,{keys:[...o]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(n){return`@@auth0spajs@@::${n}`}}const Yb={memory:()=>new Zp().enclosedCache,localstorage:()=>new Lb},Il=t=>Yb[t],Al=t=>{const{openUrl:n,onRedirect:e}=t,o=Qt(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:n===!1||n?n:e})},ba=new Ib;class Zb{constructor(n){let e,o;if(this.userCache=new Zp().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await ba.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),n),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),n.authorizationParams)}),typeof window<"u"&&(()=>{if(!Yr())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Yr().subtle===void 0)throw new Error(`
57
+ in the address bar and allow pop-ups for this site.`},Image:hb,actionBtnText:"Test pop-up settings"},Cb={name:Qe.PWA_INSTALL,label:"Install as a PWA",heading:"Install as a PWA (optional)",description:"By installing the platform as a Progressive Web App you will get a similar experience as with native desktop apps.",instructions:{initial:"If your browser supports Progressive Web Apps, you can now install the platform as a PWA."},Image:mb,actionBtnText:"Continue to the platform"},Gr=[bb,wb,xb,Cb],Rr={isCompleted:!1,state:"prompt"},kb={[Qe.WINDOW_MANAGEMENT]:Rr,[Qe.NOTIFICATIONS]:Rr,[Qe.POPUPS]:Rr,[Qe.PWA_INSTALL]:Rr},Sb=({isOpen:t,onClose:n})=>{var a;const{launchpadComponents:e,launchpadSettings:o}=zp(),{permission:r}=Dn(),i=(a=r.statuses[Qe.WINDOW_MANAGEMENT])==null?void 0:a.state;return s.jsx(Hp,{components:e,isOpen:t,onClose:n,settings:o,windowManagementPermissionState:i})};const Up=g.forwardRef((t,n)=>{const{className:e,isOpen:o,onClose:r,Panel:i,pinned:a=!1,position:c="left"}=t;return o&&!i&&console.error('Invalid use of PanelWrapper component. Please provide Panel component when "isOpen" is "true".'),s.jsx("div",{className:ot(e,"panel-wrapper",c,{open:o,pinned:a}),ref:n,children:i&&s.jsx(i,{isOpen:o,onClose:r})})}),Ks=t=>{const{Button:n,Panel:e,panelWrapperClassName:o,pinned:r=!1,position:i="left",tag:a="div",onClose:c}=t,[l,u]=g.useState(!1),f=g.useRef(null),p=g.useCallback(async()=>{u(!1),await(c==null?void 0:c())},[c]),d=()=>{if(l){p();return}u(!0)},h=!l||r;return zs({eventType:"mouseup",handler:p,ref:f,skip:h}),Ws({handler:p,skip:h}),s.jsxs(a,{ref:f,children:[s.jsx(n,{active:l,onClick:d}),s.jsx(Up,{className:o,isOpen:l,onClose:p,Panel:e,pinned:r,position:i})]})};const Vp=({Button:t=Ty})=>{const{isLaunchpadPinned:n}=ro();return s.jsx(Ks,{Button:t,Panel:Sb,panelWrapperClassName:"launchpad-panel-wrapper",pinned:n})};var as=function(t,n){return as=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])},as(t,n)};function Eb(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");as(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}var yt=function(){return yt=Object.assign||function(n){for(var e,o=1,r=arguments.length;o<r;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},yt.apply(this,arguments)};function jb(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function uo(t,n,e,o){function r(i){return i instanceof e?i:new e(function(a){a(i)})}return new(e||(e=Promise))(function(i,a){function c(f){try{u(o.next(f))}catch(p){a(p)}}function l(f){try{u(o.throw(f))}catch(p){a(p)}}function u(f){f.done?i(f.value):r(f.value).then(c,l)}u((o=o.apply(t,n||[])).next())})}function fo(t,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(u){return function(f){return l([u,f])}}function l(u){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(e=0)),e;)try{if(o=1,r&&(i=u[0]&2?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,r=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1],i=u;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(u);break}i[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(f){u=[6,f],r=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Qt(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]])}return e}var $n=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Js(t,n){return t(n={exports:{}},n.exports),n.exports}var Bn=Js(function(t,n){Object.defineProperty(n,"__esModule",{value:!0});var e=function(){function o(){var r=this;this.locked=new Map,this.addToLocked=function(i,a){var c=r.locked.get(i);c===void 0?a===void 0?r.locked.set(i,[]):r.locked.set(i,[a]):a!==void 0&&(c.unshift(a),r.locked.set(i,c))},this.isLocked=function(i){return r.locked.has(i)},this.lock=function(i){return new Promise(function(a,c){r.isLocked(i)?r.addToLocked(i,a):(r.addToLocked(i),a())})},this.unlock=function(i){var a=r.locked.get(i);if(a!==void 0&&a.length!==0){var c=a.pop();r.locked.set(i,a),c!==void 0&&setTimeout(c,0)}else r.locked.delete(i)}}return o.getInstance=function(){return o.instance===void 0&&(o.instance=new o),o.instance},o}();n.default=function(){return e.getInstance()}});qs(Bn);var Ob=qs(Js(function(t,n){var e=$n&&$n.__awaiter||function(f,p,d,h){return new(d||(d=Promise))(function(m,v){function y(w){try{S(h.next(w))}catch(x){v(x)}}function b(w){try{S(h.throw(w))}catch(x){v(x)}}function S(w){w.done?m(w.value):new d(function(x){x(w.value)}).then(y,b)}S((h=h.apply(f,p||[])).next())})},o=$n&&$n.__generator||function(f,p){var d,h,m,v,y={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return v={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function b(S){return function(w){return function(x){if(d)throw new TypeError("Generator is already executing.");for(;y;)try{if(d=1,h&&(m=2&x[0]?h.return:x[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,x[1])).done)return m;switch(h=0,m&&(x=[2&x[0],m.value]),x[0]){case 0:case 1:m=x;break;case 4:return y.label++,{value:x[1],done:!1};case 5:y.label++,h=x[1],x=[0];continue;case 7:x=y.ops.pop(),y.trys.pop();continue;default:if(m=y.trys,!((m=m.length>0&&m[m.length-1])||x[0]!==6&&x[0]!==2)){y=0;continue}if(x[0]===3&&(!m||x[1]>m[0]&&x[1]<m[3])){y.label=x[1];break}if(x[0]===6&&y.label<m[1]){y.label=m[1],m=x;break}if(m&&y.label<m[2]){y.label=m[2],y.ops.push(x);break}m[2]&&y.ops.pop(),y.trys.pop();continue}x=p.call(f,y)}catch(E){x=[6,E],h=0}finally{d=m=0}if(5&x[0])throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}([S,w])}}},r=$n;Object.defineProperty(n,"__esModule",{value:!0});var i="browser-tabs-lock-key",a={key:function(f){return e(r,void 0,void 0,function(){return o(this,function(p){throw new Error("Unsupported")})})},getItem:function(f){return e(r,void 0,void 0,function(){return o(this,function(p){throw new Error("Unsupported")})})},clear:function(){return e(r,void 0,void 0,function(){return o(this,function(f){return[2,window.localStorage.clear()]})})},removeItem:function(f){return e(r,void 0,void 0,function(){return o(this,function(p){throw new Error("Unsupported")})})},setItem:function(f,p){return e(r,void 0,void 0,function(){return o(this,function(d){throw new Error("Unsupported")})})},keySync:function(f){return window.localStorage.key(f)},getItemSync:function(f){return window.localStorage.getItem(f)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(f){return window.localStorage.removeItem(f)},setItemSync:function(f,p){return window.localStorage.setItem(f,p)}};function c(f){return new Promise(function(p){return setTimeout(p,f)})}function l(f){for(var p="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<f;h++)d+=p[Math.floor(Math.random()*p.length)];return d}var u=function(){function f(p){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=p,f.waiters===void 0&&(f.waiters=[])}return f.prototype.acquireLock=function(p,d){return d===void 0&&(d=5e3),e(this,void 0,void 0,function(){var h,m,v,y,b,S,w;return o(this,function(x){switch(x.label){case 0:h=Date.now()+l(4),m=Date.now()+d,v=i+"-"+p,y=this.storageHandler===void 0?a:this.storageHandler,x.label=1;case 1:return Date.now()<m?[4,c(30)]:[3,8];case 2:return x.sent(),y.getItemSync(v)!==null?[3,5]:(b=this.id+"-"+p+"-"+h,[4,c(Math.floor(25*Math.random()))]);case 3:return x.sent(),y.setItemSync(v,JSON.stringify({id:this.id,iat:h,timeoutKey:b,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:return x.sent(),(S=y.getItemSync(v))!==null&&(w=JSON.parse(S)).id===this.id&&w.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(v,h),[2,!0]):[3,7];case 5:return f.lockCorrector(this.storageHandler===void 0?a:this.storageHandler),[4,this.waitForSomethingToChange(m)];case 6:x.sent(),x.label=7;case 7:return h=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},f.prototype.refreshLockWhileAcquired=function(p,d){return e(this,void 0,void 0,function(){var h=this;return o(this,function(m){return setTimeout(function(){return e(h,void 0,void 0,function(){var v,y,b;return o(this,function(S){switch(S.label){case 0:return[4,Bn.default().lock(d)];case 1:return S.sent(),this.acquiredIatSet.has(d)?(v=this.storageHandler===void 0?a:this.storageHandler,(y=v.getItemSync(p))===null?(Bn.default().unlock(d),[2]):((b=JSON.parse(y)).timeRefreshed=Date.now(),v.setItemSync(p,JSON.stringify(b)),Bn.default().unlock(d),this.refreshLockWhileAcquired(p,d),[2])):(Bn.default().unlock(d),[2])}})})},1e3),[2]})})},f.prototype.waitForSomethingToChange=function(p){return e(this,void 0,void 0,function(){return o(this,function(d){switch(d.label){case 0:return[4,new Promise(function(h){var m=!1,v=Date.now(),y=!1;function b(){if(y||(window.removeEventListener("storage",b),f.removeFromWaiting(b),clearTimeout(S),y=!0),!m){m=!0;var w=50-(Date.now()-v);w>0?setTimeout(h,w):h(null)}}window.addEventListener("storage",b),f.addToWaiting(b);var S=setTimeout(b,Math.max(0,p-Date.now()))})];case 1:return d.sent(),[2]}})})},f.addToWaiting=function(p){this.removeFromWaiting(p),f.waiters!==void 0&&f.waiters.push(p)},f.removeFromWaiting=function(p){f.waiters!==void 0&&(f.waiters=f.waiters.filter(function(d){return d!==p}))},f.notifyWaiters=function(){f.waiters!==void 0&&f.waiters.slice().forEach(function(p){return p()})},f.prototype.releaseLock=function(p){return e(this,void 0,void 0,function(){return o(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(p)];case 1:return[2,d.sent()]}})})},f.prototype.releaseLock__private__=function(p){return e(this,void 0,void 0,function(){var d,h,m,v;return o(this,function(y){switch(y.label){case 0:return d=this.storageHandler===void 0?a:this.storageHandler,h=i+"-"+p,(m=d.getItemSync(h))===null?[2]:(v=JSON.parse(m)).id!==this.id?[3,2]:[4,Bn.default().lock(v.iat)];case 1:y.sent(),this.acquiredIatSet.delete(v.iat),d.removeItemSync(h),Bn.default().unlock(v.iat),f.notifyWaiters(),y.label=2;case 2:return[2]}})})},f.lockCorrector=function(p){for(var d=Date.now()-5e3,h=p,m=[],v=0;;){var y=h.keySync(v);if(y===null)break;m.push(y),v++}for(var b=!1,S=0;S<m.length;S++){var w=m[S];if(w.includes(i)){var x=h.getItemSync(w);if(x!==null){var E=JSON.parse(x);(E.timeRefreshed===void 0&&E.timeAcquired<d||E.timeRefreshed!==void 0&&E.timeRefreshed<d)&&(h.removeItemSync(w),b=!0)}}}b&&f.notifyWaiters()},f.waiters=void 0,f}();n.default=u}));const Nb={timeoutInSeconds:60},Gp={name:"auth0-spa-js",version:"2.1.3"},Yp=()=>Date.now();class St extends Error{constructor(n,e){super(e),this.error=n,this.error_description=e,Object.setPrototypeOf(this,St.prototype)}static fromPayload({error:n,error_description:e}){return new St(n,e)}}class Xs extends St{constructor(n,e,o,r=null){super(n,e),this.state=o,this.appState=r,Object.setPrototypeOf(this,Xs.prototype)}}class pr extends St{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,pr.prototype)}}class Qs extends pr{constructor(n){super(),this.popup=n,Object.setPrototypeOf(this,Qs.prototype)}}class ec extends St{constructor(n){super("cancelled","Popup closed"),this.popup=n,Object.setPrototypeOf(this,ec.prototype)}}class tc extends St{constructor(n,e,o){super(n,e),this.mfa_token=o,Object.setPrototypeOf(this,tc.prototype)}}class Hi extends St{constructor(n,e){super("missing_refresh_token",`Missing Refresh Token (audience: '${Sl(n,["default"])}', scope: '${Sl(e)}')`),this.audience=n,this.scope=e,Object.setPrototypeOf(this,Hi.prototype)}}function Sl(t,n=[]){return t&&!n.includes(t)?t:""}const Yr=()=>window.crypto,ga=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let n="";return Array.from(Yr().getRandomValues(new Uint8Array(43))).forEach(e=>n+=t[e%t.length]),n},El=t=>btoa(t),ss=t=>{var{clientId:n}=t,e=Qt(t,["clientId"]);return new URLSearchParams((o=>Object.keys(o).filter(r=>o[r]!==void 0).reduce((r,i)=>Object.assign(Object.assign({},r),{[i]:o[i]}),{}))(Object.assign({client_id:n},e))).toString()},jl=t=>(n=>decodeURIComponent(atob(n).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),Ib=async(t,n)=>{const e=await fetch(t,n);return{ok:e.ok,json:await e.json()}},Ab=async(t,n,e)=>{const o=new AbortController;let r;return n.signal=o.signal,Promise.race([Ib(t,n),new Promise((i,a)=>{r=setTimeout(()=>{o.abort(),a(new Error("Timeout when executing 'fetch'"))},e)})]).finally(()=>{clearTimeout(r)})},Pb=async(t,n,e,o,r,i,a)=>{return c={auth:{audience:n,scope:e},timeout:r,fetchUrl:t,fetchOptions:o,useFormData:a},l=i,new Promise(function(u,f){const p=new MessageChannel;p.port1.onmessage=function(d){d.data.error?f(new Error(d.data.error)):u(d.data),p.port1.close()},l.postMessage(c,[p.port2])});var c,l},Tb=async(t,n,e,o,r,i,a=1e4)=>r?Pb(t,n,e,o,a,r,i):Ab(t,o,a);async function Db(t,n){var{baseUrl:e,timeout:o,audience:r,scope:i,auth0Client:a,useFormData:c}=t,l=Qt(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const u=c?ss(l):JSON.stringify(l);return await async function(f,p,d,h,m,v,y){let b,S=null;for(let B=0;B<3;B++)try{b=await Tb(f,d,h,m,v,y,p),S=null;break}catch($){S=$}if(S)throw S;const w=b.json,{error:x,error_description:E}=w,O=Qt(w,["error","error_description"]),{ok:M}=b;if(!M){const B=E||`HTTP error. Unable to fetch ${f}`;throw x==="mfa_required"?new tc(x,B,O.mfa_token):x==="missing_refresh_token"?new Hi(d,h):new St(x||"request_error",B)}return O}(`${e}/oauth/token`,o,r||"default",i,{method:"POST",body:u,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||Gp))}},n,c)}const Fr=(...t)=>{return(n=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(n))).join(" ");var n};class en{constructor(n,e="@@auth0spajs@@",o){this.prefix=e,this.suffix=o,this.clientId=n.clientId,this.scope=n.scope,this.audience=n.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(n){const[e,o,r,i]=n.split("::");return new en({clientId:o,scope:i,audience:r},e)}static fromCacheEntry(n){const{scope:e,audience:o,client_id:r}=n;return new en({scope:e,audience:o,clientId:r})}}class Mb{set(n,e){localStorage.setItem(n,JSON.stringify(e))}get(n){const e=window.localStorage.getItem(n);if(e)try{return JSON.parse(e)}catch{return}}remove(n){localStorage.removeItem(n)}allKeys(){return Object.keys(window.localStorage).filter(n=>n.startsWith("@@auth0spajs@@"))}}class Zp{constructor(){this.enclosedCache=function(){let n={};return{set(e,o){n[e]=o},get(e){const o=n[e];if(o)return o},remove(e){delete n[e]},allKeys:()=>Object.keys(n)}}()}}class _b{constructor(n,e,o){this.cache=n,this.keyManifest=e,this.nowProvider=o||Yp}async setIdToken(n,e,o){var r;const i=this.getIdTokenCacheKey(n);await this.cache.set(i,{id_token:e,decodedToken:o}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(i))}async getIdToken(n){const e=await this.cache.get(this.getIdTokenCacheKey(n.clientId));if(!e&&n.scope&&n.audience){const o=await this.get(n);return!o||!o.id_token||!o.decodedToken?void 0:{id_token:o.id_token,decodedToken:o.decodedToken}}if(e)return{id_token:e.id_token,decodedToken:e.decodedToken}}async get(n,e=0){var o;let r=await this.cache.get(n.toKey());if(!r){const c=await this.getCacheKeys();if(!c)return;const l=this.matchExistingCacheKey(n,c);l&&(r=await this.cache.get(l))}if(!r)return;const i=await this.nowProvider(),a=Math.floor(i/1e3);return r.expiresAt-e<a?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},await this.cache.set(n.toKey(),r),r.body):(await this.cache.remove(n.toKey()),void await((o=this.keyManifest)===null||o===void 0?void 0:o.remove(n.toKey()))):r.body}async set(n){var e;const o=new en({clientId:n.client_id,scope:n.scope,audience:n.audience}),r=await this.wrapCacheEntry(n);await this.cache.set(o.toKey(),r),await((e=this.keyManifest)===null||e===void 0?void 0:e.add(o.toKey()))}async clear(n){var e;const o=await this.getCacheKeys();o&&(await o.filter(r=>!n||r.includes(n)).reduce(async(r,i)=>{await r,await this.cache.remove(i)},Promise.resolve()),await((e=this.keyManifest)===null||e===void 0?void 0:e.clear()))}async wrapCacheEntry(n){const e=await this.nowProvider();return{body:n,expiresAt:Math.floor(e/1e3)+n.expires_in}}async getCacheKeys(){var n;return this.keyManifest?(n=await this.keyManifest.get())===null||n===void 0?void 0:n.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(n){return new en({clientId:n},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(n,e){return e.filter(o=>{var r;const i=en.fromKey(o),a=new Set(i.scope&&i.scope.split(" ")),c=((r=n.scope)===null||r===void 0?void 0:r.split(" "))||[],l=i.scope&&c.reduce((u,f)=>u&&a.has(f),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===n.clientId&&i.audience===n.audience&&l})[0]}}class Lb{constructor(n,e,o){this.storage=n,this.clientId=e,this.cookieDomain=o,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(n){this.storage.save(this.storageKey,n,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Go=t=>typeof t=="number",Rb=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],Fb=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const n=(i=>{const a=i.split("."),[c,l,u]=a;if(a.length!==3||!c||!l||!u)throw new Error("ID token could not be decoded");const f=JSON.parse(jl(l)),p={__raw:i},d={};return Object.keys(f).forEach(h=>{p[h]=f[h],Rb.includes(h)||(d[h]=f[h])}),{encoded:{header:c,payload:l,signature:u},header:JSON.parse(jl(c)),claims:p,user:d}})(t.id_token);if(!n.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(n.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${n.claims.iss}"`);if(!n.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(n.header.alg!=="RS256")throw new Error(`Signature algorithm of "${n.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!n.claims.aud||typeof n.claims.aud!="string"&&!Array.isArray(n.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(n.claims.aud)){if(!n.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${n.claims.aud.join(", ")}"`);if(n.claims.aud.length>1){if(!n.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(n.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${n.claims.azp}"`)}}else if(n.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${n.claims.aud}"`);if(t.nonce){if(!n.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(n.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${n.claims.nonce}"`)}if(t.max_age&&!Go(n.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(n.claims.exp==null||!Go(n.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Go(n.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const e=t.leeway||60,o=new Date(t.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(n.claims.exp+e),o>r)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${o}) is after expiration time (${r})`);if(n.claims.nbf!=null&&Go(n.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(n.claims.nbf-e),o<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${o}) is before ${i}`)}if(n.claims.auth_time!=null&&Go(n.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(n.claims.auth_time)+t.max_age+e),o>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${o}) is after last auth at ${i}`)}if(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const a=i;if(!n.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(a!==n.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${a}", found "${n.claims.org_id}"`)}else{const a=i.toLowerCase();if(!n.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(a!==n.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${a}", found "${n.claims.org_name}"`)}}return n};var Yn=Js(function(t,n){var e=$n&&$n.__assign||function(){return e=Object.assign||function(l){for(var u,f=1,p=arguments.length;f<p;f++)for(var d in u=arguments[f])Object.prototype.hasOwnProperty.call(u,d)&&(l[d]=u[d]);return l},e.apply(this,arguments)};function o(l,u){if(!u)return"";var f="; "+l;return u===!0?f:f+"="+u}function r(l,u,f){return encodeURIComponent(l).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(u).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(p){if(typeof p.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*p.expires),p.expires=d}return o("Expires",p.expires?p.expires.toUTCString():"")+o("Domain",p.domain)+o("Path",p.path)+o("Secure",p.secure)+o("SameSite",p.sameSite)}(f)}function i(l){for(var u={},f=l?l.split("; "):[],p=/(%[\dA-F]{2})+/gi,d=0;d<f.length;d++){var h=f[d].split("="),m=h.slice(1).join("=");m.charAt(0)==='"'&&(m=m.slice(1,-1));try{u[h[0].replace(p,decodeURIComponent)]=m.replace(p,decodeURIComponent)}catch{}}return u}function a(){return i(document.cookie)}function c(l,u,f){document.cookie=r(l,u,e({path:"/"},f))}n.__esModule=!0,n.encode=r,n.parse=i,n.getAll=a,n.get=function(l){return a()[l]},n.set=c,n.remove=function(l,u){c(l,"",e(e({},u),{expires:-1}))}});qs(Yn),Yn.encode,Yn.parse,Yn.getAll;var Bb=Yn.get,Kp=Yn.set,qp=Yn.remove;const mo={get(t){const n=Bb(t);if(n!==void 0)return JSON.parse(n)},save(t,n,e){let o={};window.location.protocol==="https:"&&(o={secure:!0,sameSite:"none"}),e!=null&&e.daysUntilExpire&&(o.expires=e.daysUntilExpire),e!=null&&e.cookieDomain&&(o.domain=e.cookieDomain),Kp(t,JSON.stringify(n),o)},remove(t,n){let e={};n!=null&&n.cookieDomain&&(e.domain=n.cookieDomain),qp(t,e)}},Hb={get(t){return mo.get(t)||mo.get(`_legacy_${t}`)},save(t,n,e){let o={};window.location.protocol==="https:"&&(o={secure:!0}),e!=null&&e.daysUntilExpire&&(o.expires=e.daysUntilExpire),e!=null&&e.cookieDomain&&(o.domain=e.cookieDomain),Kp(`_legacy_${t}`,JSON.stringify(n),o),mo.save(t,n,e)},remove(t,n){let e={};n!=null&&n.cookieDomain&&(e.domain=n.cookieDomain),qp(t,e),mo.remove(t,n),mo.remove(`_legacy_${t}`,n)}},Wb={get(t){if(typeof sessionStorage>"u")return;const n=sessionStorage.getItem(t);return n!=null?JSON.parse(n):void 0},save(t,n){sessionStorage.setItem(t,JSON.stringify(n))},remove(t){sessionStorage.removeItem(t)}};function zb(t,n,e){var o=n===void 0?null:n,r=function(l,u){var f=atob(l);if(u){for(var p=new Uint8Array(f.length),d=0,h=f.length;d<h;++d)p[d]=f.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(p.buffer))}return f}(t,e!==void 0&&e),i=r.indexOf(`
58
+ `,10)+1,a=r.substring(i)+(o?"//# sourceMappingURL="+o:""),c=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(c)}var Ol,Nl,Il,va,$b=(Ol="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Nl=null,Il=!1,function(t){return va=va||zb(Ol,Nl,Il),new Worker(va,t)});const ya={};class Ub{constructor(n,e){this.cache=n,this.clientId=e,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(n){var e;const o=new Set(((e=await this.cache.get(this.manifestKey))===null||e===void 0?void 0:e.keys)||[]);o.add(n),await this.cache.set(this.manifestKey,{keys:[...o]})}async remove(n){const e=await this.cache.get(this.manifestKey);if(e){const o=new Set(e.keys);return o.delete(n),o.size>0?await this.cache.set(this.manifestKey,{keys:[...o]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(n){return`@@auth0spajs@@::${n}`}}const Vb={memory:()=>new Zp().enclosedCache,localstorage:()=>new Mb},Al=t=>Vb[t],Pl=t=>{const{openUrl:n,onRedirect:e}=t,o=Qt(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:n===!1||n?n:e})},ba=new Ob;class Gb{constructor(n){let e,o;if(this.userCache=new Zp().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await ba.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),n),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),n.authorizationParams)}),typeof window<"u"&&(()=>{if(!Yr())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Yr().subtle===void 0)throw new Error(`
59
59
  auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
60
- `)})(),n.cache&&n.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),n.cache)o=n.cache;else{if(e=n.cacheLocation||"memory",!Il(e))throw new Error(`Invalid cache location "${e}"`);o=Il(e)()}this.httpTimeoutMs=n.httpTimeoutInSeconds?1e3*n.httpTimeoutInSeconds:1e4,this.cookieStorage=n.legacySameSiteCookie===!1?mo:zb,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(a=>`auth0.${a}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=n.sessionCheckExpiryDays||1;const r=n.useCookiesForTransactions?this.cookieStorage:$b;var i;this.scope=Fr("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Fb(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Yp,this.cacheManager=new Rb(o,o.allKeys?void 0:new Gb(o,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((a,c)=>a?a.startsWith("https://")?a:`https://${a}/`:`${c}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&e==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Vb)}_url(n){const e=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Gp)));return`${this.domainUrl}${n}&auth0Client=${e}`}_authorizeUrl(n){return this._url(`/authorize?${as(n)}`)}async _verifyIdToken(n,e,o){const r=await this.nowProvider();return Hb({iss:this.tokenIssuer,aud:this.options.clientId,id_token:n,nonce:e,organization:o,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:r});var i}_processOrgHint(n){n?this.cookieStorage.save(this.orgHintCookieName,n,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(n,e,o){const r=Sl(ga()),i=Sl(ga()),a=ga(),c=(p=>{const f=new Uint8Array(p);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,m=>h[m])})(window.btoa(String.fromCharCode(...Array.from(f))))})(await(async p=>await Yr().subtle.digest({name:"SHA-256"},new TextEncoder().encode(p)))(a)),l=((p,f,d,h,m,v,y,b)=>Object.assign(Object.assign(Object.assign({client_id:p.clientId},p.authorizationParams),d),{scope:Fr(f,d.scope),response_type:"code",response_mode:b||"query",state:h,nonce:m,redirect_uri:y||p.authorizationParams.redirect_uri,code_challenge:v,code_challenge_method:"S256"}))(this.options,this.scope,n,r,i,c,n.redirect_uri||this.options.authorizationParams.redirect_uri||o,e==null?void 0:e.response_mode),u=this._authorizeUrl(l);return{nonce:i,code_verifier:a,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:r,url:u}}async loginWithPopup(n,e){var o;if(n=n||{},!(e=e||{}).popup&&(e.popup=(c=>{const l=window.screenX+(window.innerWidth-400)/2,u=window.screenY+(window.innerHeight-600)/2;return window.open(c,"auth0:authorize:popup",`left=${l},top=${u},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!e.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const r=await this._prepareAuthorizeUrl(n.authorizationParams||{},{response_mode:"web_message"},window.location.origin);e.popup.location.href=r.url;const i=await(c=>new Promise((l,u)=>{let p;const f=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(f),clearTimeout(d),window.removeEventListener("message",p,!1),u(new Qs(c.popup)))},1e3),d=setTimeout(()=>{clearInterval(f),u(new Xs(c.popup)),window.removeEventListener("message",p,!1)},1e3*(c.timeoutInSeconds||60));p=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(f),window.removeEventListener("message",p,!1),c.popup.close(),h.data.response.error)return u(St.fromPayload(h.data.response));l(h.data.response)}},window.addEventListener("message",p)}))(Object.assign(Object.assign({},e),{timeoutInSeconds:e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==i.state)throw new St("state_mismatch","Invalid state");const a=((o=n.authorizationParams)===null||o===void 0?void 0:o.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:a})}async getUser(){var n;const e=await this._getIdTokenFromCache();return(n=e==null?void 0:e.decodedToken)===null||n===void 0?void 0:n.user}async getIdTokenClaims(){var n;const e=await this._getIdTokenFromCache();return(n=e==null?void 0:e.decodedToken)===null||n===void 0?void 0:n.claims}async loginWithRedirect(n={}){var e;const o=Al(n),{openUrl:r,fragment:i,appState:a}=o,c=Qt(o,["openUrl","fragment","appState"]),l=((e=c.authorizationParams)===null||e===void 0?void 0:e.organization)||this.options.authorizationParams.organization,u=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:p}=u,f=Qt(u,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:a}),l&&{organization:l}));const d=i?`${p}#${i}`:p;r?await r(d):window.location.assign(d)}async handleRedirectCallback(n=window.location.href){const e=n.split("?").slice(1);if(e.length===0)throw new Error("There are no query params available for parsing.");const{state:o,code:r,error:i,error_description:a}=(f=>{f.indexOf("#")>-1&&(f=f.substring(0,f.indexOf("#")));const d=new URLSearchParams(f);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(e.join("")),c=this.transactionManager.get();if(!c)throw new St("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new Js(i,a||i,o,c.appState);if(!c.code_verifier||c.state&&c.state!==o)throw new St("state_mismatch","Invalid state");const l=c.organization,u=c.nonce,p=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:r},p?{redirect_uri:p}:{}),{nonceIn:u,organization:l}),{appState:c.appState}}async checkSession(n){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(n)}catch{}}async getTokenSilently(n={}){var e;const o=Object.assign(Object.assign({cacheMode:"on"},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:Fr(this.scope,(e=n.authorizationParams)===null||e===void 0?void 0:e.scope)})}),r=await((i,a)=>{let c=ya[a];return c||(c=i().finally(()=>{delete ya[a],c=null}),ya[a]=c),c})(()=>this._getTokenSilently(o),`${this.options.clientId}::${o.authorizationParams.audience}::${o.authorizationParams.scope}`);return n.detailedResponse?r:r==null?void 0:r.access_token}async _getTokenSilently(n){const{cacheMode:e}=n,o=Qt(n,["cacheMode"]);if(e!=="off"){const r=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(r)return r}if(e!=="cache-only"){if(!await(async(r,i=3)=>{for(let a=0;a<i;a++)if(await r())return!0;return!1})(()=>ba.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new pr;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),e!=="off"){const u=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(u)return u}const r=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),{id_token:i,access_token:a,oauthTokenScope:c,expires_in:l}=r;return Object.assign(Object.assign({id_token:i,access_token:a},c?{scope:c}:null),{expires_in:l})}finally{await ba.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(n={},e={}){var o;const r=Object.assign(Object.assign({},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:Fr(this.scope,(o=n.authorizationParams)===null||o===void 0?void 0:o.scope)})});return e=Object.assign(Object.assign({},Ab),e),await this.loginWithPopup(r,e),(await this.cacheManager.get(new en({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(n){n.clientId!==null?n.clientId=n.clientId||this.options.clientId:delete n.clientId;const e=n.logoutParams||{},{federated:o}=e,r=Qt(e,["federated"]),i=o?"&federated":"";return this._url(`/v2/logout?${as(Object.assign({clientId:n.clientId},r))}`)+i}async logout(n={}){const e=Al(n),{openUrl:o}=e,r=Qt(e,["openUrl"]);n.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(n.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(r);o?await o(i):o!==!1&&window.location.assign(i)}async _getTokenFromIFrame(n){const e=Object.assign(Object.assign({},n.authorizationParams),{prompt:"none"}),o=this.cookieStorage.get(this.orgHintCookieName);o&&!e.organization&&(e.organization=o);const{url:r,state:i,nonce:a,code_verifier:c,redirect_uri:l,scope:u,audience:p}=await this._prepareAuthorizeUrl(e,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new St("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const f=n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((m,v,y=60)=>new Promise((b,S)=>{const k=window.document.createElement("iframe");k.setAttribute("width","0"),k.setAttribute("height","0"),k.style.display="none";const C=()=>{window.document.body.contains(k)&&(window.document.body.removeChild(k),window.removeEventListener("message",j,!1))};let j;const E=setTimeout(()=>{S(new pr),C()},1e3*y);j=function(P){if(P.origin!=v||!P.data||P.data.type!=="authorization_response")return;const H=P.source;H&&H.close(),P.data.response.error?S(St.fromPayload(P.data.response)):b(P.data.response),clearTimeout(E),window.removeEventListener("message",j,!1),setTimeout(C,2e3)},window.addEventListener("message",j,!1),window.document.body.appendChild(k),k.setAttribute("src",m)}))(r,this.domainUrl,f);if(i!==d.state)throw new St("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},n.authorizationParams),{code_verifier:c,code:d.code,grant_type:"authorization_code",redirect_uri:l,timeout:n.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:a,organization:e.organization});return Object.assign(Object.assign({},h),{scope:u,oauthTokenScope:h.scope,audience:p})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(n){const e=await this.cacheManager.get(new en({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(e&&e.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(n);throw new Hi(n.authorizationParams.audience||"default",n.authorizationParams.scope)}const o=n.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r=typeof n.timeoutInSeconds=="number"?1e3*n.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},n.authorizationParams),{grant_type:"refresh_token",refresh_token:e&&e.refresh_token,redirect_uri:o}),r&&{timeout:r}));return Object.assign(Object.assign({},i),{scope:n.authorizationParams.scope,oauthTokenScope:i.scope,audience:n.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(n);throw i}}async _saveEntryInCache(n){const{id_token:e,decodedToken:o}=n,r=Qt(n,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:e,decodedToken:o}),await this.cacheManager.setIdToken(this.options.clientId,n.id_token,n.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const n=this.options.authorizationParams.audience||"default",e=await this.cacheManager.getIdToken(new en({clientId:this.options.clientId,audience:n,scope:this.scope})),o=this.userCache.get("@@user@@");return e&&e.id_token===(o==null?void 0:o.id_token)?o:(this.userCache.set("@@user@@",e),e)}async _getEntryFromCache({scope:n,audience:e,clientId:o}){const r=await this.cacheManager.get(new en({scope:n,audience:e,clientId:o}),60);if(r&&r.access_token){const{access_token:i,oauthTokenScope:a,expires_in:c}=r,l=await this._getIdTokenFromCache();return l&&Object.assign(Object.assign({id_token:l.id_token,access_token:i},a?{scope:a}:null),{expires_in:c})}}async _requestToken(n,e){const{nonceIn:o,organization:r}=e||{},i=await _b(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},n),this.worker),a=await this._verifyIdToken(i.id_token,o,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:a,scope:n.scope,audience:n.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||a.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:a})}}var Jp={isAuthenticated:!1,isLoading:!0},ln=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},Kb=yt(yt({},Jp),{buildAuthorizeUrl:ln,buildLogoutUrl:ln,getAccessTokenSilently:ln,getAccessTokenWithPopup:ln,getIdTokenClaims:ln,loginWithRedirect:ln,loginWithPopup:ln,logout:ln,handleRedirectCallback:ln}),Xp=g.createContext(Kb),Pl=function(t){Ob(n,t);function n(e,o){var r=t.call(this,o||e)||this;return r.error=e,r.error_description=o,Object.setPrototypeOf(r,n.prototype),r}return n}(Error),qb=/[?&]code=[^&]+/,Jb=/[?&]state=[^&]+/,Xb=/[?&]error=[^&]+/,Qb=function(t){return t===void 0&&(t=window.location.search),(qb.test(t)||Xb.test(t))&&Jb.test(t)},Qp=function(t){return function(n){return n instanceof Error?n:n!==null&&typeof n=="object"&&"error"in n&&typeof n.error=="string"?"error_description"in n&&typeof n.error_description=="string"?new Pl(n.error,n.error_description):new Pl(n.error):new Error(t)}},Tl=Qp("Login failed"),wa=Qp("Get access token failed"),eh=function(t){var n;t!=null&&t.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),t.authorizationParams=t.authorizationParams||{},t.authorizationParams.redirect_uri=t.redirectUri,delete t.redirectUri),!((n=t==null?void 0:t.authorizationParams)===null||n===void 0)&&n.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),t.authorizationParams.redirect_uri=t.authorizationParams.redirectUri,delete t.authorizationParams.redirectUri)},ew=function(t,n){switch(n.type){case"LOGIN_POPUP_STARTED":return yt(yt({},t),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return yt(yt({},t),{isAuthenticated:!!n.user,user:n.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return t.user===n.user?t:yt(yt({},t),{isAuthenticated:!!n.user,user:n.user});case"LOGOUT":return yt(yt({},t),{isAuthenticated:!1,user:void 0});case"ERROR":return yt(yt({},t),{isLoading:!1,error:n.error})}},tw=function(t){return eh(t),yt(yt({},t),{auth0Client:{name:"auth0-react",version:"2.3.0"}})},nw=function(t){window.history.replaceState({},document.title,(t==null?void 0:t.returnTo)||window.location.pathname)},ow=function(t){var n=t.children,e=t.skipRedirectCallback,o=t.onRedirectCallback,r=o===void 0?nw:o,i=t.context,a=i===void 0?Xp:i,c=Nb(t,["children","skipRedirectCallback","onRedirectCallback","context"]),l=g.useState(function(){return new Zb(tw(c))})[0],u=g.useReducer(ew,Jp),p=u[0],f=u[1],d=g.useRef(!1),h=g.useCallback(function(E){return f({type:"ERROR",error:E}),E},[]);g.useEffect(function(){d.current||(d.current=!0,function(){return uo(void 0,void 0,void 0,function(){var E,P,H;return fo(this,function(z){switch(z.label){case 0:return z.trys.push([0,7,,8]),E=void 0,Qb()&&!e?[4,l.handleRedirectCallback()]:[3,3];case 1:return P=z.sent().appState,[4,l.getUser()];case 2:return E=z.sent(),r(P,E),[3,6];case 3:return[4,l.checkSession()];case 4:return z.sent(),[4,l.getUser()];case 5:E=z.sent(),z.label=6;case 6:return f({type:"INITIALISED",user:E}),[3,8];case 7:return H=z.sent(),h(Tl(H)),[3,8];case 8:return[2]}})})}())},[l,r,e,h]);var m=g.useCallback(function(E){return eh(E),l.loginWithRedirect(E)},[l]),v=g.useCallback(function(E,P){return uo(void 0,void 0,void 0,function(){var H,z;return fo(this,function(q){switch(q.label){case 0:f({type:"LOGIN_POPUP_STARTED"}),q.label=1;case 1:return q.trys.push([1,3,,4]),[4,l.loginWithPopup(E,P)];case 2:return q.sent(),[3,4];case 3:return H=q.sent(),h(Tl(H)),[2];case 4:return[4,l.getUser()];case 5:return z=q.sent(),f({type:"LOGIN_POPUP_COMPLETE",user:z}),[2]}})})},[l]),y=g.useCallback(function(E){return E===void 0&&(E={}),uo(void 0,void 0,void 0,function(){return fo(this,function(P){switch(P.label){case 0:return[4,l.logout(E)];case 1:return P.sent(),(E.openUrl||E.openUrl===!1)&&f({type:"LOGOUT"}),[2]}})})},[l]),b=g.useCallback(function(E){return uo(void 0,void 0,void 0,function(){var P,H,z,q;return fo(this,function(B){switch(B.label){case 0:return B.trys.push([0,2,3,5]),[4,l.getTokenSilently(E)];case 1:return P=B.sent(),[3,5];case 2:throw H=B.sent(),wa(H);case 3:return z=f,q={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return z.apply(void 0,[(q.user=B.sent(),q)]),[7];case 5:return[2,P]}})})},[l]),S=g.useCallback(function(E,P){return uo(void 0,void 0,void 0,function(){var H,z,q,B;return fo(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,3,5]),[4,l.getTokenWithPopup(E,P)];case 1:return H=A.sent(),[3,5];case 2:throw z=A.sent(),wa(z);case 3:return q=f,B={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return q.apply(void 0,[(B.user=A.sent(),B)]),[7];case 5:return[2,H]}})})},[l]),k=g.useCallback(function(){return l.getIdTokenClaims()},[l]),C=g.useCallback(function(E){return uo(void 0,void 0,void 0,function(){var P,H,z;return fo(this,function(q){switch(q.label){case 0:return q.trys.push([0,2,3,5]),[4,l.handleRedirectCallback(E)];case 1:return[2,q.sent()];case 2:throw P=q.sent(),wa(P);case 3:return H=f,z={type:"HANDLE_REDIRECT_COMPLETE"},[4,l.getUser()];case 4:return H.apply(void 0,[(z.user=q.sent(),z)]),[7];case 5:return[2]}})})},[l]),j=g.useMemo(function(){return yt(yt({},p),{getAccessTokenSilently:b,getAccessTokenWithPopup:S,getIdTokenClaims:k,loginWithRedirect:m,loginWithPopup:v,logout:y,handleRedirectCallback:C})},[p,b,S,k,m,v,y,C]);return g.createElement(a.Provider,{value:j},n)},th=function(t){return t===void 0&&(t=Xp),g.useContext(t)};const nh=({className:t,children:n,Logo:e})=>s.jsxs("div",{className:ot("info-page-container",t),children:[s.jsx(e,{className:"info-page-logo"}),s.jsx("div",{className:"info-page-wrapper",children:n})]}),rw={value:"data:image/svg+xml,%3Csvg width='5041' height='1232' viewBox='0 0 5041 1232' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_879_362)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M548.6 178H439.6C368.7 178 310 199.5 269.3 244.5C228.6 289.3 206.7 356 206.7 444.3C206.7 532.6 228.6 599.5 269.3 644.2C310.2 689.2 368.7 710.7 439.6 710.7H548.6C619 710.7 677.6 689.2 718.6 644.2C759.5 599.4 781.6 532.6 781.6 444.2C781.6 355.8 759.5 289 718.6 244.2C677.7 199.3 619 177.7 548.6 177.7V178ZM449.5 293.8H538.9C582.2 293.8 611.9 305.2 631.1 328.3C650.5 351.8 660.5 389.2 660.5 444.4C660.5 499.6 650.5 536.7 631.1 560C612 583 582.2 594.1 538.9 594.1H449.5C405.6 594.1 375.9 583 356.9 560C337.6 536.8 327.7 499.7 327.7 444.5C327.7 389.3 337.4 351.9 356.8 328.4C375.9 305.2 405.6 293.8 449.5 293.8Z' fill='white'/%3E%3Cpath d='M0.700195 189.8C0.700195 183.1 6.10017 177.7 12.8002 177.7H108.6C115.3 177.7 120.7 183.1 120.7 189.8V698.6C120.7 705.3 115.3 710.7 108.6 710.7H12.8002C6.10017 710.7 0.700195 705.3 0.700195 698.6V189.8Z' fill='white'/%3E%3Cpath d='M0.700195 11.9002C0.700195 5.7002 5.70018 0.700195 11.9002 0.700195H109.6C115.7 0.700195 120.7 5.7002 120.7 11.9002V109.5C120.7 115.7 115.7 120.7 109.5 120.7H11.9002C5.70018 120.7 0.700195 115.7 0.700195 109.5V11.9002Z' fill='%23007BE5'/%3E%3Cpath d='M827.7 601.9C827.7 595.7 832.7 590.7 838.9 590.7H936.6C942.8 590.7 947.8 595.7 947.8 601.9V699.5C947.8 705.7 942.8 710.7 936.6 710.7H838.9C832.7 710.7 827.7 705.7 827.7 699.5V601.9Z' fill='%23007BE5'/%3E%3Cpath d='M4363.9 293.2C4320.2 293.2 4290.6 304.6 4271.6 327.8C4252.3 351.4 4242.5 388.8 4242.5 444C4242.5 499.2 4252.3 536.4 4271.5 559.7C4290.5 582.6 4320 593.8 4363.8 593.8H4614.7C4622.4 593.8 4628.7 600.1 4628.7 607.8V696.7C4628.7 704.4 4622.4 710.7 4614.7 710.7H4354.1C4283.3 710.7 4224.9 689.1 4184.1 644.1C4143.5 599.3 4121.6 532.4 4121.6 444C4121.6 355.6 4143.5 288.7 4184.1 243.9C4224.8 199 4283.3 177.3 4354.1 177.3H4614.7C4622.4 177.3 4628.7 183.6 4628.7 191.3V279.3C4628.7 287 4622.4 293.3 4614.7 293.3H4363.9V293.2Z' fill='white'/%3E%3Cpath d='M1302.6 165.3C1240.1 165.3 1197 180.9 1169.3 213.3C1141.3 246 1127.4 297.6 1127.4 372.9C1127.4 447.7 1141.1 499 1169 531.6C1196.6 563.9 1239.7 579.5 1302.7 579.5H1552.5C1560.2 579.5 1566.5 585.8 1566.5 593.5V697.1C1566.5 704.8 1560.2 711.1 1552.5 711.1H1302.7C1204.7 711.1 1127.5 683.4 1075 626.4C1022.4 569.7 995.7 484.8 995.7 372.9C995.7 260.5 1022.7 175.4 1075.2 118.4C1127.9 61.3001 1205 33.6001 1302.6 33.6001H1552.4C1560.1 33.6001 1566.4 39.9001 1566.4 47.6001V151.2C1566.4 158.9 1560.1 165.2 1552.4 165.2H1302.6V165.3Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1953.6 177.7H1844.8C1774 177.7 1715.6 199.3 1674.8 244.3C1634.2 289.1 1612.3 356 1612.3 444.4C1612.3 532.8 1634.2 599.7 1674.8 644.5C1715.5 689.4 1774 711.1 1844.8 711.1H1953.6C2023.9 711.1 2082.4 689.5 2123.2 644.5C2163.9 599.7 2186 532.8 2186 444.3C2186 355.8 2163.9 289 2123.2 244.1C2082.3 199.3 2023.9 177.7 1953.6 177.7ZM1854.6 293.7H1943.8C1987 293.7 2016.6 305.1 2035.8 328.3C2055.2 351.9 2065.2 389.3 2065.2 444.5C2065.2 499.7 2055.2 536.8 2035.8 560.2C2016.7 583.2 1987.1 594.3 1943.8 594.3H1854.6C1810.8 594.3 1781.3 583.1 1762.3 560.2C1743 536.9 1733.3 499.8 1733.3 444.5C1733.3 389.3 1743.1 351.9 1762.4 328.3C1781.3 305 1810.9 293.7 1854.6 293.7Z' fill='white'/%3E%3Cpath d='M2679.7 411.6C2679.7 372.5 2668.5 343.5 2645.4 324C2622.1 304.3 2585.3 293.2 2531.9 293.2H2378.4C2375.5 293.2 2374.9 293.9 2374.8 294C2374.5 294.4 2373.6 295.8 2373.6 299.8V696.7C2373.6 704.4 2367.3 710.7 2359.6 710.7H2267.7C2260 710.7 2253.7 704.4 2253.7 696.7V265.6C2253.7 234.7 2258.8 212 2272.6 197.2C2286.5 182.2 2307.5 177.3 2334.2 177.3H2531.8C2620.7 177.3 2688 198.4 2733.3 238.9C2778.7 279.5 2800.5 338.6 2800.5 411.7V696.7C2800.5 704.4 2794.2 710.7 2786.5 710.7H2693.7C2686 710.7 2679.7 704.4 2679.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M3304.7 411.6C3304.7 372.5 3293.5 343.5 3270.4 324C3247.1 304.3 3210.3 293.2 3156.9 293.2H3003.4C3000.5 293.2 2999.9 293.9 2999.8 294C2999.5 294.4 2998.6 295.8 2998.6 299.8V696.7C2998.6 704.4 2992.3 710.7 2984.6 710.7H2892.7C2885 710.7 2878.7 704.4 2878.7 696.7V265.6C2878.7 234.7 2883.8 212 2897.6 197.2C2911.5 182.2 2932.5 177.3 2959.2 177.3H3156.8C3245.7 177.3 3313 198.4 3358.3 238.9C3403.7 279.5 3425.5 338.6 3425.5 411.7V696.7C3425.5 704.4 3419.2 710.7 3411.5 710.7H3318.7C3311 710.7 3304.7 704.4 3304.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M4906.1 292.2C4898.4 292.2 4892.1 298.5 4892.1 306.2V529.2C4892.1 557.5 4897.2 574.3 4906.4 584.1C4915.4 593.8 4930 598.6 4953.7 598.6H5019.2C5026.9 598.6 5033.2 604.9 5033.2 612.6V695.7C5033.2 703.4 5026.9 709.7 5019.2 709.7H4932.1C4877.9 709.7 4836.8 698.8 4809.7 668.6C4782.8 638.6 4771.3 591.5 4771.3 523.4V306.2C4771.3 298.5 4765 292.2 4757.3 292.2H4714.7C4707 292.2 4700.7 285.9 4700.7 278.2V190.2C4700.7 182.5 4707 176.2 4714.7 176.2H4757.3C4765 176.2 4771.3 169.9 4771.3 162.2V67.7002C4771.3 60.0002 4777.6 53.7002 4785.3 53.7002H4878.2C4885.9 53.7002 4892.2 60.0002 4892.2 67.7002V162.2C4892.2 169.9 4898.5 176.2 4906.2 176.2H5021.3C5029 176.2 5035.3 182.5 5035.3 190.2V278.2C5035.3 285.9 5029 292.2 5021.3 292.2H4906.1Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4024.4 607.2C4024.4 599.5 4018.1 593.2 4010.4 593.2H3699.9C3672.9 593.2 3655.3 586 3644.6 575.2C3633.8 564.4 3628.6 548.8 3628.6 529.7V514.5C3628.6 506.8 3634.9 500.5 3642.6 500.5H3866.6C3931.2 500.5 3977.4 486.9 4007.5 459.6C4037.7 432.2 4050.1 392.3 4050.1 343.5C4050.1 292.2 4036.8 250.1 4006.4 220.9C3976.1 191.7 3930.1 176.8 3867.7 176.8H3700.1C3633.9 176.8 3586.5 195.4 3555.6 227.8C3524.8 260.1 3511.8 305 3511.8 355.3V531.7C3511.8 582 3524.9 626.9 3555.6 659.2C3586.5 691.6 3633.9 710.2 3700.1 710.2H4010.6C4018.3 710.2 4024.6 703.9 4024.6 696.2V607.2H4024.4ZM3863.5 403.1H3642.5C3634.8 403.1 3628.5 396.8 3628.5 389.1V356.2C3628.5 337.6 3633.7 321.9 3644.6 311C3655.4 300.1 3672.9 292.7 3699.9 292.7H3866.5C3890.7 292.7 3906.9 298.8 3916.9 308.2C3926.9 317.5 3932 331.3 3932 349.4C3932 367.1 3927.3 380 3917.4 388.6C3907.4 397.4 3890.5 403.1 3863.5 403.1Z' fill='white'/%3E%3Cpath d='M2918.9 872.3C3001.9 872.3 3036.9 909.9 3036.9 966.3C3036.9 1012.2 3013.9 1036.8 2973.2 1047.2C3014.4 1058.2 3037.9 1083.7 3037.9 1129.7C3037.9 1186.1 3003.5 1224.7 2920.5 1224.7H2755.6C2741.5 1224.7 2734.2 1217.9 2734.2 1203.8V893.2C2734.2 879.1 2741.5 872.3 2755.6 872.3H2918.9ZM2765.4 1033.1H2918.9C2976.8 1033.1 3005 1014.8 3005 970.5C3005 929.8 2979.4 903.7 2919.4 903.7H2771.2C2767.5 903.7 2765.5 905.3 2765.5 909.4V1033.1H2765.4ZM2765.4 1187.6C2765.4 1191.8 2767.5 1193.3 2771.1 1193.3H2921C2979.5 1193.3 3006.1 1168.2 3006.1 1125.4C3006.1 1081 2976.9 1060.2 2921 1060.2H2765.5V1187.6H2765.4Z' fill='white'/%3E%3Cpath d='M3294 956.9V985.6H3182.8C3148.9 985.6 3135.3 1000.7 3135.3 1033.6V1224.6H3106.1V1029.9C3106.1 979.8 3125.4 956.8 3176.6 956.8H3294V956.9Z' fill='white'/%3E%3Cpath d='M3489.1 956.9C3562.2 956.9 3608.6 1001.3 3608.6 1091C3608.6 1181.3 3562.1 1224.6 3489.1 1224.6H3431.2C3357.6 1224.6 3311.7 1181.3 3311.7 1091C3311.7 1001.2 3357.6 956.9 3431.2 956.9H3489.1ZM3433.3 985.6C3374.3 985.6 3340.9 1019 3340.9 1091C3340.9 1163.5 3374.3 1196.4 3433.3 1196.4H3487.1C3546.1 1196.4 3579.5 1163.5 3579.5 1091C3579.5 1019 3546.1 985.6 3487.1 985.6H3433.3Z' fill='white'/%3E%3Cpath d='M3674.4 956.9L3706.8 1176.6C3709.4 1195.4 3716.2 1204.3 3737.1 1204.3C3758.5 1204.3 3767.4 1195.4 3771.5 1180.3L3821.6 995.5C3829.4 966.8 3849.3 951.7 3884.2 951.7C3919.1 951.7 3937.4 966.8 3945.3 995.5L3994.9 1180.3C3999.1 1195.4 4007.9 1204.3 4029.3 1204.3C4050.2 1204.3 4056.4 1195.4 4059.6 1176.6L4093.5 956.9H4125.3L4089.3 1179.8C4084.6 1210.6 4069.5 1231 4028.2 1231C3992.7 1231 3975 1216.4 3966.6 1185.1L3917 1000.9C3912.8 985.2 3900.8 978.5 3883.6 978.5C3865.9 978.5 3854.9 985.3 3850.7 1000.9L3799.6 1185.1C3790.7 1216.4 3773.5 1231 3737.5 1231C3695.2 1231 3682.2 1210.1 3677.5 1179.8L3643.1 956.9H3674.4Z' fill='white'/%3E%3Cpath d='M4417.6 956.9V985.6H4260C4219.8 985.6 4203.6 1003.3 4203.6 1032.1C4203.6 1057.2 4216.1 1077.5 4263.6 1077.5H4338.8C4410.8 1077.5 4428.6 1110.9 4428.6 1149.5C4428.6 1194.9 4404.6 1224.7 4344 1224.7H4178V1196.5H4344C4384.2 1196.5 4399.8 1178.2 4399.8 1149.5C4399.8 1124.4 4387.8 1103.6 4339.8 1103.6H4264.6C4193.1 1103.6 4174.8 1069.2 4174.8 1030C4174.8 985.1 4198.8 956.9 4259.4 956.9H4417.6Z' fill='white'/%3E%3Cpath d='M4685.4 956.9C4749.1 956.9 4775.7 986.6 4775.7 1036.8C4775.7 1084.8 4751.2 1111.4 4684.9 1111.4H4526.2V1135.9C4526.2 1170.3 4545 1196.4 4593.5 1196.4H4762.1V1224.6H4593.5C4524.6 1224.6 4497.5 1187.5 4497.5 1136.4V1045.1C4497.5 995 4524.6 956.9 4593.5 956.9H4685.4ZM4526.2 1087.4H4684.3C4729.7 1087.4 4746.9 1069.7 4746.9 1037.8C4746.9 1005.4 4728.6 985.6 4685.3 985.6H4593.4C4544.9 985.6 4526.1 1011.2 4526.1 1045.6V1087.4H4526.2Z' fill='white'/%3E%3Cpath d='M5040.3 956.9V985.6H4929.1C4895.2 985.6 4881.6 1000.7 4881.6 1033.6V1224.6H4852.4V1029.9C4852.4 979.8 4871.7 956.8 4922.9 956.8H5040.3V956.9Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_879_362'%3E%3Crect width='5041' height='1231' fill='white' transform='translate(0 0.700195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"},iw={loginPageLogo:rw},aw="200px",wr=({logoSrc:t=iw.loginPageLogo.value,width:n=aw,className:e="logo"})=>s.jsx("img",{width:n,src:t,className:e,alt:"Login logo"}),oh=()=>s.jsx("span",{className:"spinner"});const Mn=({Logo:t=wr,text:n="Loading..."})=>s.jsx("div",{className:"system-loader-background",children:s.jsxs("div",{className:"system-loader-container flex flex-column ai-center",children:[s.jsx(t,{}),s.jsx("h1",{className:"system-loader-text io-title",children:n}),s.jsx(oh,{})]})});const rh=({children:t,description:n,heading:e,Image:o,title:r,className:i})=>s.jsxs("div",{className:ot("info-card",i),children:[r&&s.jsx("h1",{className:"info-card-title io-title-large",children:r}),o&&s.jsx("div",{className:"info-card-image",children:s.jsx(o,{})}),e&&s.jsx("h3",{className:"info-card-heading io-title",children:e}),s.jsx("p",{className:"info-card-description io-text-default-lh16",children:n}),t]}),sw=({activeStepName:t,showWarnIcon:n,stepsStatuses:e})=>s.jsx("ul",{className:"setup-flow-list io-text-default-lh16",children:Gr.map(({name:o,label:r},i)=>{const a=o===t,c=e[o].state,l=n&&a?s.jsx(et,{variant:"exclamation-mark",size:"12"}):s.jsxs("span",{children:[i+1,"."]});return s.jsx("li",{className:ot(a&&"active"),children:s.jsxs("div",{className:"setup-flow-list-item",children:[s.jsxs("div",{className:"setup-flow-list-item-icon-wrapper",children:[c==="prompt"&&l,c==="granted"&&s.jsx(et,{variant:"check-solid",size:"12"}),c==="denied"&&s.jsx(et,{variant:"close",size:"12"})]}),r]})},o)})}),cw=({edgeNotificationsPermissionTimeout:t,isNotificationsPermissionPromptOpen:n})=>{const{name:e}=xy(),[o,r]=g.useState(!1);return g.useEffect(()=>{if(!n||e!=="Edge")return;const i=setTimeout(()=>r(!0),t);return()=>clearTimeout(i)},[e,t,n]),g.useEffect(()=>{n&&!o||r(!1)},[n,o,r]),{hasEdgeNotificationsPermissionError:o}},lw=(t,n)=>{const{type:e,payload:o}=n;switch(e){case"completed":return{...t,[o.stepName]:{...t[o.stepName],isCompleted:!0}};case"skipped":return{...t,[o.stepName]:{isCompleted:!0,state:"denied"}};case"stateUpdated":{if(!o.state)throw Error('"stateUpdated" action invoked without state in payload');return{...t,[o.stepName]:{isCompleted:o.stepName===Qe.POPUPS?o.state==="granted":o.state!=="prompt",state:o.state}}}default:throw Error("Unknown action: "+e)}},uw=t=>{const{handleDeferredStep:n,handleOperationComplete:e}=t;window.getScreenDetails().catch(async()=>{const{state:o}=await navigator.permissions.query({name:On.WINDOW_MANAGEMENT});o==="prompt"&&n()}).finally(e)},dw=t=>{const{handleDeferredStep:n,handleOperationComplete:e}=t;Notification.requestPermission().then(async()=>{const{state:o}=await navigator.permissions.query({name:On.NOTIFICATIONS});o==="prompt"&&n()}).finally(e)},fw=t=>{const{handleDeferredStep:n,handleOperationComplete:e,dispatchAction:o}=t,r="about:blank",i="popup,width=1,height=1,top=9999,left=9999",a=window.open(r,void 0,i),c=window.open(r,void 0,i);a==null||a.close(),c==null||c.close();const l=!(a&&c);l&&n(),o({type:"stateUpdated",payload:{stepName:Qe.POPUPS,state:l?"denied":"granted"}}),e()},pw=t=>{const{dispatchAction:n}=t;n({type:"completed",payload:{stepName:Qe.PWA_INSTALL}})},hw={[Qe.WINDOW_MANAGEMENT]:uw,[Qe.NOTIFICATIONS]:dw,[Qe.POPUPS]:fw,[Qe.PWA_INSTALL]:pw},mw=({settings:t})=>{const{permission:n}=Dn(),[e,o]=rn("localStorage",yr,br),[r,i]=g.useReducer(lw,Eb),[a,c]=g.useState(!1),[l,u]=g.useState(!1),p=Gr.find(y=>!r[y.name].isCompleted);if(!p)throw new Error("All setup steps are completed. The SetupSteps component should not be used in such case.");const f=p.name,d=Gr[Gr.length-1].name,{hasEdgeNotificationsPermissionError:h}=cw({edgeNotificationsPermissionTimeout:t.edgeNotificationsPermissionTimeout,isNotificationsPermissionPromptOpen:l&&f===On.NOTIFICATIONS}),m=()=>{c(!1),u(!0),hw[f]({handleDeferredStep:()=>c(!0),handleOperationComplete:()=>u(!1),dispatchAction:y=>i(y)}),f===d&&o({isCompleted:!0})},v=()=>{c(!1),i({type:"skipped",payload:{stepName:f}})};return g.useEffect(()=>{h&&(u(!1),c(!0))},[h]),g.useEffect(()=>{var y,b;c(!1),i({type:"stateUpdated",payload:{stepName:Qe.WINDOW_MANAGEMENT,state:Bi?(y=n.statuses[Qe.WINDOW_MANAGEMENT])==null?void 0:y.state:"denied"}}),i({type:"stateUpdated",payload:{stepName:Qe.NOTIFICATIONS,state:(b=n.statuses[Qe.NOTIFICATIONS])==null?void 0:b.state}})},[n.statuses]),s.jsxs(rh,{description:p.description,heading:p.heading,Image:p.Image,title:"Platform Setup",children:[s.jsx(sw,{activeStepName:f,showWarnIcon:a&&f!==Qe.POPUPS,stepsStatuses:r}),s.jsx("p",{className:"io-text-default-lh16",children:a?p.instructions.additional:p.instructions.initial}),s.jsxs(Re,{children:[s.jsx(ci,{className:"io-btn io-btn-lg io-btn-primary setup-flow-btn",disabled:l,onClick:m,children:p.actionBtnText}),f!==d&&f!==Qe.WINDOW_MANAGEMENT&&s.jsx(ci,{className:"io-btn io-btn-lg io-btn-outline setup-flow-btn",disabled:l,onClick:v,children:"Skip"})]}),l&&s.jsx(oh,{})]})};const tc=({components:{Logo:t=wr,Loader:n=Mn}={},settings:e={}})=>{const{permission:o}=Dn();return o.isLoading?s.jsx(n,{text:"Checking browser permissions..."}):s.jsx(nh,{Logo:t,children:s.jsx(mw,{settings:{...wb,...e}})})};const nc=({errorMessage:t})=>{const n="https://support.interop.io",e=s.jsxs(s.Fragment,{children:["It seems that the following error prevents io.Connect Browser",s.jsx("br",{}),"from operating properly:",s.jsxs("span",{className:"browser-start-failed-error",children:["“",t,"”"]}),s.jsxs("span",{className:"help-center-info",children:["For further assistance, visit our"," ",s.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"help center"}),"."]}),s.jsx("span",{className:"thank-you",children:"Thank you for your cooperation."})]});return s.jsx(nh,{Logo:wr,children:s.jsx(rh,{className:"io-init-error-card",heading:"Oops! io.Connect Browser couldn't start...",description:e,Image:bb,children:s.jsx(ci,{className:"io-btn io-btn-lg io-btn-primary",onClick:()=>window.open(n,"_blank","noopener,noreferrer"),children:"Visit the interop.io Help Center"})})})},ih=()=>s.jsxs(s.Fragment,{children:[s.jsx(nn,{tag:"h1",className:"login-title",text:"Making Your Work Flow",size:"large"}),s.jsxs("p",{className:"io-text-default-lh16 login-description",children:["Integrate apps, simplify user experiences and accelerate",s.jsx("br",{}),"digital transformation."]})]}),ah=({Logo:t,children:n,className:e})=>s.jsx("div",{className:"login-page-background",children:s.jsxs("div",{className:ot(e,"login-form-container flex flex-column ai-center"),children:[s.jsx(t,{}),n]})}),gw=({onLogin:t,isLoading:n,validationError:e,components:{Logo:o=wr,Heading:r=ih,Loader:i=Mn}={}})=>n?s.jsx(i,{text:"Verifying credentials..."}):s.jsxs(ah,{Logo:o,children:[s.jsx(r,{}),s.jsx(Ge,{className:"auth0-login-btn",onClick:t,size:"large",variant:"primary",children:"Log In"}),e&&s.jsx(yh,{variant:"critical",text:e.message})]}),Dl=(t,n)=>{const e=n.value,o=e.trim().length>3;return{value:e,isValid:o}},vw=({onLogin:t,setIsLoading:n,loginError:e,setLoginError:o,userInputName:r="email"})=>{const[i,a]=g.useReducer(Dl,{value:"",isValid:!1}),[c,l]=g.useReducer(Dl,{value:"",isValid:!1}),[u,p]=g.useState(!1),[f,d]=g.useState(!1),{isValid:h}=i,{isValid:m}=c,v=h&&m,y=j=>a({value:j.target.value}),b=j=>l({value:j.target.value}),S=()=>{h||p(!0)},k=()=>{m||d(!0)},C=async j=>{if(j.preventDefault(),!!v){n(!0);try{await t(i.value,c.value)}catch(E){o(E)}n(!1)}};return s.jsxs("form",{className:"simple-login-form",onSubmit:C,children:[s.jsx(Qn,{id:"user",errorMessage:u?`The ${r} is too short`:void 0,autoFocus:!0,autoComplete:"off",type:"text",placeholder:`Enter your ${r}`,value:i.value,onChange:y,onBlur:S,onFocus:()=>p(!1)}),s.jsx(Qn,{id:"password",errorMessage:f?"The password is too short":void 0,autoComplete:"off",type:"password",placeholder:"Enter your password",value:c.value,onChange:b,onBlur:k,onFocus:()=>d(!1)}),s.jsx(Ge,{type:"submit",size:"large",variant:"primary",children:"Log In"}),e&&s.jsxs("div",{className:"login-error-feedback",children:[s.jsx(et,{className:"error-icon",variant:"close",size:"12"}),e.message]})]})};const yw=({onLogin:t,userInputName:n,components:{Logo:e=wr,Heading:o=ih,Loader:r=Mn}={}})=>{const[i,a]=g.useState(!1),[c,l]=g.useState(null);return i?s.jsx(r,{text:"Verifying credentials..."}):s.jsxs(ah,{Logo:e,children:[s.jsx(o,{}),s.jsx(vw,{onLogin:t,setIsLoading:a,loginError:c,setLoginError:l,userInputName:n})]})};function bw(t,n){const[e,o]=g.useState(!0),r=g.useContext(De.IOConnectContext);return g.useEffect(()=>{let i;return(async()=>{if(!r.workspaces)return;let a;try{a=await r.workspaces.getWorkspaceById(t)}catch(l){console.warn(l);return}const c=a.getAllGroups().find(l=>l.id===n);c&&(i=await c.onLockConfigurationChanged(({showAddWindowButton:l})=>{l!==void 0&&o(l)}),o(!!c.showAddWindowButton))})(),()=>i==null?void 0:i()},[t,n,r.workspaces]),e}const ww=({groupId:t,workspaceId:n})=>{const e=bw(n,t),o=g.useCallback(r=>{Co.showAddApplicationPopup({bounds:r,groupId:t,workspaceId:n})},[t,n]);return e&&s.jsx(Co.AddWindowButton,{title:"Add App",visible:e,showPopup:o})},xw=t=>s.jsx(Co.GroupHeaderButtons,{...t,addWindow:{visible:!1,showPopup:t.addWindow.showPopup}}),Cw=()=>null;const sh=({className:t,components:n,onClose:e,title:o})=>{const{NotificationsProvider:r,NotificationsPanelProvider:i,SettingsPanel:a}=kf;return s.jsx(r,{children:s.jsx(i,{children:s.jsx(a,{className:t,components:n,onClose:e,title:o})})})};const ch=w0.Panel;const lh=({className:t,components:n,onClose:e,title:o})=>{const r=g.useContext(De.IOConnectContext),{onLogout:i}=zp(),[a,c]=rn("sessionStorage",gp,vp),{login:{setIsLoggingOut:l}}=Dn(),u=g.useCallback(async()=>{var p;if("modals"in r&&r.modals){const f="log-out",{isEnterPressed:d,responseButtonClicked:h}=await r.modals.dialogs.request({templateName:To.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:"Logging out of io.Connect Browser",text:"This will terminate your session.",actionButtons:[{variant:"primary",text:"Log out",id:f,autofocus:!0},{variant:"outline",text:"Cancel",id:"cancel"}]}});if(!(d||(h==null?void 0:h.id)===f))return}Un.flushSync(()=>l(!0));try{i==null||i()}catch(f){console.error(f)}c(null),await((p=r.webPlatform)==null?void 0:p.system.shutdown()),window.location.reload()},[r,i]);return s.jsx(b0.Panel,{className:t,components:n,onClose:e,onLogout:u,title:o})},kw=[{name:"platformPreferences",displayName:"Platform Preferences",icon:"cog",onClick:t=>t(ch)},{name:"notificationSettingsPanel",displayName:"Notification Settings",icon:"bell",onClick:t=>t(sh),separatorAfter:!0},{name:"profile",displayName:"Profile",icon:"user",onClick:t=>t(lh)}],Sw=t=>({onClose:n})=>s.jsx(t,{className:"system-menu-panel",onClose:n});const uh=({actions:t,panelWrapperClassName:n})=>{const[e,o]=g.useState(),r=g.useRef(null),i=$s(),a=g.useCallback(()=>o(void 0),[]),c=!!e;g.useEffect(()=>{!c||i!=="Escape"||a()},[c,i]);const l=g.useCallback((u,p)=>{const f=t.find(({name:h})=>h===p.name);if(!f){console.error(`Action named ${p.name} is not part of the provided list of actions: ${JSON.stringify(t)}!`);return}const d=h=>{const m=Sw(h);o(()=>m)};f.onClick(d)},[t]);return Ws({eventType:"mouseup",handler:a,ref:r,skip:!c}),Hs({handler:a,skip:!c}),s.jsxs(s.Fragment,{children:[s.jsx(Gs,{buttonSize:"32",iconSize:"16",actions:t,onActionItemClick:l,icon:"ellipsis-vertical",buttonVariant:"circle",placement:"bottom-end",offset:[0,8]}),s.jsx(Up,{className:ot("system-menu-panel-wrapper",n),isOpen:c,onClose:a,Panel:e,position:"right",ref:r})]})},Ew=()=>s.jsx("li",{className:"default-header-system-menu",children:s.jsx(uh,{actions:kw})}),jw=()=>{const{showNotificationBadge:t}=Cy(),n=Ep(),o=g.useMemo(()=>n.filter(({state:r})=>r==="Active"||r==="Stale"),[n]).length;return o>0&&t?s.jsx("div",{className:"io-badge io-badge-primary notifications-badge",children:o<100?o:"99+"}):null};const dh=t=>{const{className:n,active:e,...o}=t;return s.jsxs("div",{className:ot(n,"notifications-panel-button"),...o,children:[s.jsx(Ue,{icon:"bell",size:"32",iconSize:"16",variant:"circle"}),s.jsx(jw,{})]})},fh=({className:t,components:n,onClose:e,settings:o,title:r})=>{const{NotificationsProvider:i,NotificationsPanelProvider:a,Panel:c}=kf;return s.jsx(i,{children:s.jsx(a,{children:s.jsx(c,{className:t,components:n,onClose:e,settings:o,title:r})})})},ph=({Button:t=dh,Panel:n=fh,position:e="right",...o})=>{const r=Ep(),i=g.useContext(De.IOConnectContext),a=g.useCallback(async()=>{await Promise.all(r.map(({id:c})=>i.notifications.setState(c,"Seen")))},[r]);return s.jsx(Zs,{Button:t,Panel:n,position:e,onClose:a,...o})};const Ow=()=>s.jsxs(s.Fragment,{children:[s.jsx(ph,{tag:"li"}),s.jsx(Ew,{})]}),oc=({onLogout:t,workspaces:n,launchpad:e,Loader:o=Mn,isBeforeunloadDialogEnabled:r})=>{var v,y,b,S;const{LogoComponent:i,SystemButtonsComponent:a}=((v=n==null?void 0:n.components)==null?void 0:v.header)??{},{setPlatformWindow:c}=zs(),{isInitialSetupCompleted:l}=ed(),u=(y=window.iobrowser)==null?void 0:y.platformStarted,p=i??(u?Vp:Cw),f=a??(u?Ow:void 0),d=yy(),{login:{isLoggingOut:h}}=Dn();L1(r===!1||h),g.useEffect(()=>{u&&c({name:window.name})},[u,c]);const m=g.useMemo(()=>({onLogout:t,launchpadSettings:e==null?void 0:e.settings,launchpadComponents:e==null?void 0:e.components}),[t,e==null?void 0:e.settings,e==null?void 0:e.components]);return s.jsxs(Wp.Provider,{value:m,children:[(!d||!l)&&s.jsx(o,{text:"Loading io.Connect Home..."}),s.jsx(Co,{components:{...n==null?void 0:n.components,header:{...(b=n==null?void 0:n.components)==null?void 0:b.header,LogoComponent:p,SystemButtonsComponent:f},groupHeader:{AfterTabsComponent:ww,ButtonsComponent:xw,...(S=n==null?void 0:n.components)==null?void 0:S.groupHeader}}})]})},Nw=Xe({id:Dt,username:Me(Dt),email:Me(Dt),firstName:Me(Dt),lastName:Me(Dt),token:Me(Dt),password:Me(Dt)}),Iw=({config:t})=>{var b,S,k,C;const{setupFlow:n,login:e,workspaces:o,launchpad:r,getIOConnectConfig:i}=t,[a,c]=rn("localStorage",K1,Nw),[l]=rn("localStorage",yr,br),[u,p]=g.useState(null),{login:{isLoggingOut:f}}=Dn(),d=Bs(),h=((b=t.components)==null?void 0:b.SystemLoader)??Mn,m=((S=t.components)==null?void 0:S.IOInitErrorScreen)??nc,v=g.useCallback(async(j,E)=>{const P=await e.onLogin(j,E);c(P)},[e,c]),y=g.useCallback(()=>{var j;(j=e.onLogout)==null||j.call(e),c(null)},[e.onLogout,c]);return f?s.jsx(h,{text:"Logging out..."}):a?!(l!=null&&l.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&!d?s.jsx(tc,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:h}}):u&&!u.message.includes("has already been started")?s.jsx(m,{errorMessage:u.message}):s.jsx(De.IOConnectProvider,{settings:i({type:"simple",user:a}),onInitError:p,fallback:s.jsx(h,{text:"Initializing the platform..."}),children:s.jsx(Ei,{launchpadMode:(k=r==null?void 0:r.settings)==null?void 0:k.mode,children:s.jsx(oc,{workspaces:o,launchpad:r,onLogout:y,isBeforeunloadDialogEnabled:(C=t.settings)==null?void 0:C.isBeforeunloadDialogEnabled,Loader:h})})}):s.jsx(yw,{onLogin:v,userInputName:e.userInputName,components:{...e.components,Loader:h}})},Aw=Xe({message:Dt}),Pw=t=>{const n=th(),[e,o]=g.useState(void 0),[r,i]=rn("sessionStorage",Z1,Aw),a=g.useMemo(()=>n.user?(t==null?void 0:t(n.user))??{ok:!0}:null,[n.user,t]),c=(a==null?void 0:a.ok)===!1,l=n.isLoading||n.isAuthenticated&&!e,u=c||l,p=g.useMemo(()=>{var f;return a!=null&&a.ok&&((f=n.user)!=null&&f.email)&&e?{username:n.user.name,id:n.user.email,token:e}:null},[n.user,e,a==null?void 0:a.ok]);return g.useEffect(()=>{n.isAuthenticated&&n.getAccessTokenSilently().then(o).catch(console.warn)},[n]),g.useEffect(()=>{if(a){if(a.ok){i(null);return}i({message:a.message}),n.logout()}},[n,i,a]),{isLoading:u,validationError:r,user:p}},ss={POPUP:"popup",REDIRECT:"redirect"},Tw=({config:t})=>{var k,C,j,E;const n=th(),{setupFlow:e,login:o,launchpad:r,workspaces:i,getIOConnectConfig:a}=t,{isLoading:c,validationError:l,user:u}=Pw(o.validateUser),f=(o.loginType??ss.REDIRECT)===ss.REDIRECT?n.loginWithRedirect:n.loginWithPopup,[d]=rn("localStorage",yr,br),[h,m]=g.useState(null),{login:{isLoggingOut:v}}=Dn(),y=Bs(),b=((k=t.components)==null?void 0:k.SystemLoader)??Mn,S=((C=t.components)==null?void 0:C.IOInitErrorScreen)??nc;return v?s.jsx(b,{text:"Logging out..."}):u?!(d!=null&&d.isCompleted)&&(e==null?void 0:e.enabled)!==!1&&!y?s.jsx(tc,{settings:e==null?void 0:e.settings,components:{...e==null?void 0:e.components,Loader:b}}):h&&!h.message.includes("has already been started")?s.jsx(S,{errorMessage:h.message}):s.jsx(De.IOConnectProvider,{settings:a({type:"auth0",user:{...n.user,id:u.id,token:u.token}}),onInitError:m,fallback:s.jsx(b,{text:"Initializing the platform..."}),children:s.jsx(Ei,{launchpadMode:(j=r==null?void 0:r.settings)==null?void 0:j.mode,children:s.jsx(oc,{workspaces:i,launchpad:r,onLogout:n.logout,isBeforeunloadDialogEnabled:(E=t.settings)==null?void 0:E.isBeforeunloadDialogEnabled,Loader:b})})}):s.jsx(gw,{onLogin:f,isLoading:c,validationError:l,components:{...o.components,Loader:b}})},Ml=({config:t})=>{var v,y,b,S;const{setupFlow:n,launchpad:e,workspaces:o,getIOConnectConfig:r}=t,{onLogout:i,user:a}=t.login??{},{isPlatformWindow:c}=zs(),[l]=rn("localStorage",yr,br),[u,p]=g.useState(null),{login:{isLoggingOut:f}}=Dn(),d=Bs(),h=((v=t.components)==null?void 0:v.SystemLoader)??Mn,m=((y=t.components)==null?void 0:y.IOInitErrorScreen)??nc;return f?s.jsx(h,{text:"Logging out..."}):!(l!=null&&l.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&c&&!d?s.jsx(tc,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:h}}):u&&!u.message.includes("has already been started")?s.jsx(m,{errorMessage:u.message}):s.jsx(De.IOConnectProvider,{settings:r({type:"custom",user:a}),onInitError:p,fallback:s.jsx(h,{text:"Initializing the platform..."}),children:s.jsx(Ei,{launchpadMode:(b=e==null?void 0:e.settings)==null?void 0:b.mode,children:s.jsx(oc,{workspaces:o,launchpad:e,onLogout:i,isBeforeunloadDialogEnabled:(S=t.settings)==null?void 0:S.isBeforeunloadDialogEnabled,Loader:h})})})},hh=Xe({Logo:Me(jt().andThen(t=>zt(t,"Logo"))),Heading:Me(jt().andThen(t=>zt(t,"Heading")))}),Dw=dr(...Object.values(ss).map(t=>An(t))),Mw=Xe({type:An("auth0"),validateUser:Me(jt().andThen(t=>zt(t,"validateUser"))),loginType:Me(Dw),providerOptions:jt(),components:Me(hh)}),_w=Xe({type:An("simple"),onLogin:jt().andThen(t=>zt(t,"onLogin")),onLogout:Me(jt().andThen(t=>zt(t,"onLogout"))),userInputName:Me(Dt),components:Me(hh)}),Lw=Xe({id:Dt,username:Dt}),Rw=Xe({type:An("custom"),onLogout:jt().andThen(t=>zt(t,"onLogout")),user:Lw}),Fw=dr(Mw,_w,Rw),Bw=Xe({edgeNotificationsPermissionTimeout:Me(cy)}),Hw=Xe({Logo:Me(jt().andThen(t=>zt(t,"Logo")))}),Ww=Xe({enabled:Me(Ao()),components:Me(Hw),settings:Me(Bw)}),zw=Xe({components:Me(jt())}),$w=Xe({BeforeSearch:dr(An(null),Me(jt().andThen(t=>zt(t,"BeforeSearch")))),AfterSearch:dr(An(null),Me(jt().andThen(t=>zt(t,"AfterSearch"))))}),Uw=Xe({Component:jt().andThen(t=>zt(t,"Component")),placementId:Dt}),Vw=Xe({header:Me($w),sections:Me(ay(Uw))}),Gw=Xe({showHeader:Me(Ao()),showSearch:Me(Ao())}),Yw=Xe({header:Me(Gw),mode:Me(dr(An("pinned"),An("default")))}),Zw=Xe({components:Me(Vw),settings:Me(Yw)}),Kw=Xe({SystemLoader:Me(jt().andThen(t=>zt(t,"SystemLoader"))),IOInitErrorScreen:Me(jt().andThen(t=>zt(t,"IOInitErrorScreen")))}),qw=Xe({isBeforeunloadDialogEnabled:Me(Ao())}),Jw=Xe({getIOConnectConfig:jt().andThen(t=>zt(t,"getIOConnectConfig")),login:Me(Fw),setupFlow:Me(Ww),workspaces:Me(zw),launchpad:Me(Zw),components:Me(Kw),settings:Me(qw)}),Xw=({config:t})=>{var i;const n=g.useMemo(()=>Jw.runWithException(t),[t]),e=n.login,{isPlatformWindow:o}=zs();if(!e||!o){const{login:a,...c}=n;return s.jsx(Ml,{config:c})}if(e.type==="custom")return s.jsx(Ml,{config:n});if(e.type==="simple")return s.jsx(Iw,{config:n});const{providerOptions:r}=e;return s.jsx(ow,{...r,authorizationParams:{...r.authorizationParams,redirect_uri:((i=r.authorizationParams)==null?void 0:i.redirect_uri)??window.location.origin},children:s.jsx(Tw,{config:n})})};const Qw=({config:t})=>s.jsx(hb,{children:s.jsx(Xw,{config:t})});exports.ApplicationsSection=Tp;exports.FavoritesSection=Dp;exports.IOConnectHome=Qw;exports.Launchpad=Hp;exports.LaunchpadAccess=Vp;exports.LaunchpadPinButton=_p;exports.NotificationSettingsPanel=sh;exports.NotificationsPanel=fh;exports.NotificationsPanelButton=dh;exports.NotificationsPanelWithToggleButton=ph;exports.PanelWithToggleButton=Zs;exports.PlatformPrefsProvider=Ei;exports.PreferencesPanel=ch;exports.ProfilePanel=lh;exports.Section=Fi;exports.SystemLoader=Mn;exports.SystemMenu=uh;exports.WorkspacesSection=Fp;exports.useFavorites=_i;exports.usePlatformPref=Ht;exports.usePlatformPrefs=ed;
60
+ `)})(),n.cache&&n.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),n.cache)o=n.cache;else{if(e=n.cacheLocation||"memory",!Al(e))throw new Error(`Invalid cache location "${e}"`);o=Al(e)()}this.httpTimeoutMs=n.httpTimeoutInSeconds?1e3*n.httpTimeoutInSeconds:1e4,this.cookieStorage=n.legacySameSiteCookie===!1?mo:Hb,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(a=>`auth0.${a}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=n.sessionCheckExpiryDays||1;const r=n.useCookiesForTransactions?this.cookieStorage:Wb;var i;this.scope=Fr("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Lb(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Yp,this.cacheManager=new _b(o,o.allKeys?void 0:new Ub(o,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((a,c)=>a?a.startsWith("https://")?a:`https://${a}/`:`${c}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&e==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new $b)}_url(n){const e=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Gp)));return`${this.domainUrl}${n}&auth0Client=${e}`}_authorizeUrl(n){return this._url(`/authorize?${ss(n)}`)}async _verifyIdToken(n,e,o){const r=await this.nowProvider();return Fb({iss:this.tokenIssuer,aud:this.options.clientId,id_token:n,nonce:e,organization:o,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:r});var i}_processOrgHint(n){n?this.cookieStorage.save(this.orgHintCookieName,n,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(n,e,o){const r=El(ga()),i=El(ga()),a=ga(),c=(f=>{const p=new Uint8Array(f);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,m=>h[m])})(window.btoa(String.fromCharCode(...Array.from(p))))})(await(async f=>await Yr().subtle.digest({name:"SHA-256"},new TextEncoder().encode(f)))(a)),l=((f,p,d,h,m,v,y,b)=>Object.assign(Object.assign(Object.assign({client_id:f.clientId},f.authorizationParams),d),{scope:Fr(p,d.scope),response_type:"code",response_mode:b||"query",state:h,nonce:m,redirect_uri:y||f.authorizationParams.redirect_uri,code_challenge:v,code_challenge_method:"S256"}))(this.options,this.scope,n,r,i,c,n.redirect_uri||this.options.authorizationParams.redirect_uri||o,e==null?void 0:e.response_mode),u=this._authorizeUrl(l);return{nonce:i,code_verifier:a,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:r,url:u}}async loginWithPopup(n,e){var o;if(n=n||{},!(e=e||{}).popup&&(e.popup=(c=>{const l=window.screenX+(window.innerWidth-400)/2,u=window.screenY+(window.innerHeight-600)/2;return window.open(c,"auth0:authorize:popup",`left=${l},top=${u},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!e.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const r=await this._prepareAuthorizeUrl(n.authorizationParams||{},{response_mode:"web_message"},window.location.origin);e.popup.location.href=r.url;const i=await(c=>new Promise((l,u)=>{let f;const p=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(p),clearTimeout(d),window.removeEventListener("message",f,!1),u(new ec(c.popup)))},1e3),d=setTimeout(()=>{clearInterval(p),u(new Qs(c.popup)),window.removeEventListener("message",f,!1)},1e3*(c.timeoutInSeconds||60));f=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(p),window.removeEventListener("message",f,!1),c.popup.close(),h.data.response.error)return u(St.fromPayload(h.data.response));l(h.data.response)}},window.addEventListener("message",f)}))(Object.assign(Object.assign({},e),{timeoutInSeconds:e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==i.state)throw new St("state_mismatch","Invalid state");const a=((o=n.authorizationParams)===null||o===void 0?void 0:o.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:a})}async getUser(){var n;const e=await this._getIdTokenFromCache();return(n=e==null?void 0:e.decodedToken)===null||n===void 0?void 0:n.user}async getIdTokenClaims(){var n;const e=await this._getIdTokenFromCache();return(n=e==null?void 0:e.decodedToken)===null||n===void 0?void 0:n.claims}async loginWithRedirect(n={}){var e;const o=Pl(n),{openUrl:r,fragment:i,appState:a}=o,c=Qt(o,["openUrl","fragment","appState"]),l=((e=c.authorizationParams)===null||e===void 0?void 0:e.organization)||this.options.authorizationParams.organization,u=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:f}=u,p=Qt(u,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},p),{appState:a}),l&&{organization:l}));const d=i?`${f}#${i}`:f;r?await r(d):window.location.assign(d)}async handleRedirectCallback(n=window.location.href){const e=n.split("?").slice(1);if(e.length===0)throw new Error("There are no query params available for parsing.");const{state:o,code:r,error:i,error_description:a}=(p=>{p.indexOf("#")>-1&&(p=p.substring(0,p.indexOf("#")));const d=new URLSearchParams(p);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(e.join("")),c=this.transactionManager.get();if(!c)throw new St("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new Xs(i,a||i,o,c.appState);if(!c.code_verifier||c.state&&c.state!==o)throw new St("state_mismatch","Invalid state");const l=c.organization,u=c.nonce,f=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:r},f?{redirect_uri:f}:{}),{nonceIn:u,organization:l}),{appState:c.appState}}async checkSession(n){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(n)}catch{}}async getTokenSilently(n={}){var e;const o=Object.assign(Object.assign({cacheMode:"on"},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:Fr(this.scope,(e=n.authorizationParams)===null||e===void 0?void 0:e.scope)})}),r=await((i,a)=>{let c=ya[a];return c||(c=i().finally(()=>{delete ya[a],c=null}),ya[a]=c),c})(()=>this._getTokenSilently(o),`${this.options.clientId}::${o.authorizationParams.audience}::${o.authorizationParams.scope}`);return n.detailedResponse?r:r==null?void 0:r.access_token}async _getTokenSilently(n){const{cacheMode:e}=n,o=Qt(n,["cacheMode"]);if(e!=="off"){const r=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(r)return r}if(e!=="cache-only"){if(!await(async(r,i=3)=>{for(let a=0;a<i;a++)if(await r())return!0;return!1})(()=>ba.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new pr;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),e!=="off"){const u=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(u)return u}const r=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),{id_token:i,access_token:a,oauthTokenScope:c,expires_in:l}=r;return Object.assign(Object.assign({id_token:i,access_token:a},c?{scope:c}:null),{expires_in:l})}finally{await ba.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(n={},e={}){var o;const r=Object.assign(Object.assign({},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:Fr(this.scope,(o=n.authorizationParams)===null||o===void 0?void 0:o.scope)})});return e=Object.assign(Object.assign({},Nb),e),await this.loginWithPopup(r,e),(await this.cacheManager.get(new en({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(n){n.clientId!==null?n.clientId=n.clientId||this.options.clientId:delete n.clientId;const e=n.logoutParams||{},{federated:o}=e,r=Qt(e,["federated"]),i=o?"&federated":"";return this._url(`/v2/logout?${ss(Object.assign({clientId:n.clientId},r))}`)+i}async logout(n={}){const e=Pl(n),{openUrl:o}=e,r=Qt(e,["openUrl"]);n.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(n.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(r);o?await o(i):o!==!1&&window.location.assign(i)}async _getTokenFromIFrame(n){const e=Object.assign(Object.assign({},n.authorizationParams),{prompt:"none"}),o=this.cookieStorage.get(this.orgHintCookieName);o&&!e.organization&&(e.organization=o);const{url:r,state:i,nonce:a,code_verifier:c,redirect_uri:l,scope:u,audience:f}=await this._prepareAuthorizeUrl(e,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new St("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const p=n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((m,v,y=60)=>new Promise((b,S)=>{const w=window.document.createElement("iframe");w.setAttribute("width","0"),w.setAttribute("height","0"),w.style.display="none";const x=()=>{window.document.body.contains(w)&&(window.document.body.removeChild(w),window.removeEventListener("message",E,!1))};let E;const O=setTimeout(()=>{S(new pr),x()},1e3*y);E=function(M){if(M.origin!=v||!M.data||M.data.type!=="authorization_response")return;const B=M.source;B&&B.close(),M.data.response.error?S(St.fromPayload(M.data.response)):b(M.data.response),clearTimeout(O),window.removeEventListener("message",E,!1),setTimeout(x,2e3)},window.addEventListener("message",E,!1),window.document.body.appendChild(w),w.setAttribute("src",m)}))(r,this.domainUrl,p);if(i!==d.state)throw new St("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},n.authorizationParams),{code_verifier:c,code:d.code,grant_type:"authorization_code",redirect_uri:l,timeout:n.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:a,organization:e.organization});return Object.assign(Object.assign({},h),{scope:u,oauthTokenScope:h.scope,audience:f})}catch(p){throw p.error==="login_required"&&this.logout({openUrl:!1}),p}}async _getTokenUsingRefreshToken(n){const e=await this.cacheManager.get(new en({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(e&&e.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(n);throw new Hi(n.authorizationParams.audience||"default",n.authorizationParams.scope)}const o=n.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r=typeof n.timeoutInSeconds=="number"?1e3*n.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},n.authorizationParams),{grant_type:"refresh_token",refresh_token:e&&e.refresh_token,redirect_uri:o}),r&&{timeout:r}));return Object.assign(Object.assign({},i),{scope:n.authorizationParams.scope,oauthTokenScope:i.scope,audience:n.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(n);throw i}}async _saveEntryInCache(n){const{id_token:e,decodedToken:o}=n,r=Qt(n,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:e,decodedToken:o}),await this.cacheManager.setIdToken(this.options.clientId,n.id_token,n.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const n=this.options.authorizationParams.audience||"default",e=await this.cacheManager.getIdToken(new en({clientId:this.options.clientId,audience:n,scope:this.scope})),o=this.userCache.get("@@user@@");return e&&e.id_token===(o==null?void 0:o.id_token)?o:(this.userCache.set("@@user@@",e),e)}async _getEntryFromCache({scope:n,audience:e,clientId:o}){const r=await this.cacheManager.get(new en({scope:n,audience:e,clientId:o}),60);if(r&&r.access_token){const{access_token:i,oauthTokenScope:a,expires_in:c}=r,l=await this._getIdTokenFromCache();return l&&Object.assign(Object.assign({id_token:l.id_token,access_token:i},a?{scope:a}:null),{expires_in:c})}}async _requestToken(n,e){const{nonceIn:o,organization:r}=e||{},i=await Db(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},n),this.worker),a=await this._verifyIdToken(i.id_token,o,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:a,scope:n.scope,audience:n.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||a.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:a})}}var Jp={isAuthenticated:!1,isLoading:!0},ln=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},Yb=yt(yt({},Jp),{buildAuthorizeUrl:ln,buildLogoutUrl:ln,getAccessTokenSilently:ln,getAccessTokenWithPopup:ln,getIdTokenClaims:ln,loginWithRedirect:ln,loginWithPopup:ln,logout:ln,handleRedirectCallback:ln}),Xp=g.createContext(Yb),Tl=function(t){Eb(n,t);function n(e,o){var r=t.call(this,o||e)||this;return r.error=e,r.error_description=o,Object.setPrototypeOf(r,n.prototype),r}return n}(Error),Zb=/[?&]code=[^&]+/,Kb=/[?&]state=[^&]+/,qb=/[?&]error=[^&]+/,Jb=function(t){return t===void 0&&(t=window.location.search),(Zb.test(t)||qb.test(t))&&Kb.test(t)},Qp=function(t){return function(n){return n instanceof Error?n:n!==null&&typeof n=="object"&&"error"in n&&typeof n.error=="string"?"error_description"in n&&typeof n.error_description=="string"?new Tl(n.error,n.error_description):new Tl(n.error):new Error(t)}},Dl=Qp("Login failed"),wa=Qp("Get access token failed"),eh=function(t){var n;t!=null&&t.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),t.authorizationParams=t.authorizationParams||{},t.authorizationParams.redirect_uri=t.redirectUri,delete t.redirectUri),!((n=t==null?void 0:t.authorizationParams)===null||n===void 0)&&n.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),t.authorizationParams.redirect_uri=t.authorizationParams.redirectUri,delete t.authorizationParams.redirectUri)},Xb=function(t,n){switch(n.type){case"LOGIN_POPUP_STARTED":return yt(yt({},t),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return yt(yt({},t),{isAuthenticated:!!n.user,user:n.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return t.user===n.user?t:yt(yt({},t),{isAuthenticated:!!n.user,user:n.user});case"LOGOUT":return yt(yt({},t),{isAuthenticated:!1,user:void 0});case"ERROR":return yt(yt({},t),{isLoading:!1,error:n.error})}},Qb=function(t){return eh(t),yt(yt({},t),{auth0Client:{name:"auth0-react",version:"2.3.0"}})},ew=function(t){window.history.replaceState({},document.title,(t==null?void 0:t.returnTo)||window.location.pathname)},tw=function(t){var n=t.children,e=t.skipRedirectCallback,o=t.onRedirectCallback,r=o===void 0?ew:o,i=t.context,a=i===void 0?Xp:i,c=jb(t,["children","skipRedirectCallback","onRedirectCallback","context"]),l=g.useState(function(){return new Gb(Qb(c))})[0],u=g.useReducer(Xb,Jp),f=u[0],p=u[1],d=g.useRef(!1),h=g.useCallback(function(O){return p({type:"ERROR",error:O}),O},[]);g.useEffect(function(){d.current||(d.current=!0,function(){return uo(void 0,void 0,void 0,function(){var O,M,B;return fo(this,function($){switch($.label){case 0:return $.trys.push([0,7,,8]),O=void 0,Jb()&&!e?[4,l.handleRedirectCallback()]:[3,3];case 1:return M=$.sent().appState,[4,l.getUser()];case 2:return O=$.sent(),r(M,O),[3,6];case 3:return[4,l.checkSession()];case 4:return $.sent(),[4,l.getUser()];case 5:O=$.sent(),$.label=6;case 6:return p({type:"INITIALISED",user:O}),[3,8];case 7:return B=$.sent(),h(Dl(B)),[3,8];case 8:return[2]}})})}())},[l,r,e,h]);var m=g.useCallback(function(O){return eh(O),l.loginWithRedirect(O)},[l]),v=g.useCallback(function(O,M){return uo(void 0,void 0,void 0,function(){var B,$;return fo(this,function(Z){switch(Z.label){case 0:p({type:"LOGIN_POPUP_STARTED"}),Z.label=1;case 1:return Z.trys.push([1,3,,4]),[4,l.loginWithPopup(O,M)];case 2:return Z.sent(),[3,4];case 3:return B=Z.sent(),h(Dl(B)),[2];case 4:return[4,l.getUser()];case 5:return $=Z.sent(),p({type:"LOGIN_POPUP_COMPLETE",user:$}),[2]}})})},[l]),y=g.useCallback(function(O){return O===void 0&&(O={}),uo(void 0,void 0,void 0,function(){return fo(this,function(M){switch(M.label){case 0:return[4,l.logout(O)];case 1:return M.sent(),(O.openUrl||O.openUrl===!1)&&p({type:"LOGOUT"}),[2]}})})},[l]),b=g.useCallback(function(O){return uo(void 0,void 0,void 0,function(){var M,B,$,Z;return fo(this,function(_){switch(_.label){case 0:return _.trys.push([0,2,3,5]),[4,l.getTokenSilently(O)];case 1:return M=_.sent(),[3,5];case 2:throw B=_.sent(),wa(B);case 3:return $=p,Z={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return $.apply(void 0,[(Z.user=_.sent(),Z)]),[7];case 5:return[2,M]}})})},[l]),S=g.useCallback(function(O,M){return uo(void 0,void 0,void 0,function(){var B,$,Z,_;return fo(this,function(I){switch(I.label){case 0:return I.trys.push([0,2,3,5]),[4,l.getTokenWithPopup(O,M)];case 1:return B=I.sent(),[3,5];case 2:throw $=I.sent(),wa($);case 3:return Z=p,_={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return Z.apply(void 0,[(_.user=I.sent(),_)]),[7];case 5:return[2,B]}})})},[l]),w=g.useCallback(function(){return l.getIdTokenClaims()},[l]),x=g.useCallback(function(O){return uo(void 0,void 0,void 0,function(){var M,B,$;return fo(this,function(Z){switch(Z.label){case 0:return Z.trys.push([0,2,3,5]),[4,l.handleRedirectCallback(O)];case 1:return[2,Z.sent()];case 2:throw M=Z.sent(),wa(M);case 3:return B=p,$={type:"HANDLE_REDIRECT_COMPLETE"},[4,l.getUser()];case 4:return B.apply(void 0,[($.user=Z.sent(),$)]),[7];case 5:return[2]}})})},[l]),E=g.useMemo(function(){return yt(yt({},f),{getAccessTokenSilently:b,getAccessTokenWithPopup:S,getIdTokenClaims:w,loginWithRedirect:m,loginWithPopup:v,logout:y,handleRedirectCallback:x})},[f,b,S,w,m,v,y,x]);return g.createElement(a.Provider,{value:E},n)},th=function(t){return t===void 0&&(t=Xp),g.useContext(t)};const nh=({className:t,children:n,Logo:e})=>s.jsxs("div",{className:ot("info-page-container",t),children:[s.jsx(e,{className:"info-page-logo"}),s.jsx("div",{className:"info-page-wrapper",children:n})]}),nw={value:"data:image/svg+xml,%3Csvg width='5041' height='1232' viewBox='0 0 5041 1232' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_879_362)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M548.6 178H439.6C368.7 178 310 199.5 269.3 244.5C228.6 289.3 206.7 356 206.7 444.3C206.7 532.6 228.6 599.5 269.3 644.2C310.2 689.2 368.7 710.7 439.6 710.7H548.6C619 710.7 677.6 689.2 718.6 644.2C759.5 599.4 781.6 532.6 781.6 444.2C781.6 355.8 759.5 289 718.6 244.2C677.7 199.3 619 177.7 548.6 177.7V178ZM449.5 293.8H538.9C582.2 293.8 611.9 305.2 631.1 328.3C650.5 351.8 660.5 389.2 660.5 444.4C660.5 499.6 650.5 536.7 631.1 560C612 583 582.2 594.1 538.9 594.1H449.5C405.6 594.1 375.9 583 356.9 560C337.6 536.8 327.7 499.7 327.7 444.5C327.7 389.3 337.4 351.9 356.8 328.4C375.9 305.2 405.6 293.8 449.5 293.8Z' fill='white'/%3E%3Cpath d='M0.700195 189.8C0.700195 183.1 6.10017 177.7 12.8002 177.7H108.6C115.3 177.7 120.7 183.1 120.7 189.8V698.6C120.7 705.3 115.3 710.7 108.6 710.7H12.8002C6.10017 710.7 0.700195 705.3 0.700195 698.6V189.8Z' fill='white'/%3E%3Cpath d='M0.700195 11.9002C0.700195 5.7002 5.70018 0.700195 11.9002 0.700195H109.6C115.7 0.700195 120.7 5.7002 120.7 11.9002V109.5C120.7 115.7 115.7 120.7 109.5 120.7H11.9002C5.70018 120.7 0.700195 115.7 0.700195 109.5V11.9002Z' fill='%23007BE5'/%3E%3Cpath d='M827.7 601.9C827.7 595.7 832.7 590.7 838.9 590.7H936.6C942.8 590.7 947.8 595.7 947.8 601.9V699.5C947.8 705.7 942.8 710.7 936.6 710.7H838.9C832.7 710.7 827.7 705.7 827.7 699.5V601.9Z' fill='%23007BE5'/%3E%3Cpath d='M4363.9 293.2C4320.2 293.2 4290.6 304.6 4271.6 327.8C4252.3 351.4 4242.5 388.8 4242.5 444C4242.5 499.2 4252.3 536.4 4271.5 559.7C4290.5 582.6 4320 593.8 4363.8 593.8H4614.7C4622.4 593.8 4628.7 600.1 4628.7 607.8V696.7C4628.7 704.4 4622.4 710.7 4614.7 710.7H4354.1C4283.3 710.7 4224.9 689.1 4184.1 644.1C4143.5 599.3 4121.6 532.4 4121.6 444C4121.6 355.6 4143.5 288.7 4184.1 243.9C4224.8 199 4283.3 177.3 4354.1 177.3H4614.7C4622.4 177.3 4628.7 183.6 4628.7 191.3V279.3C4628.7 287 4622.4 293.3 4614.7 293.3H4363.9V293.2Z' fill='white'/%3E%3Cpath d='M1302.6 165.3C1240.1 165.3 1197 180.9 1169.3 213.3C1141.3 246 1127.4 297.6 1127.4 372.9C1127.4 447.7 1141.1 499 1169 531.6C1196.6 563.9 1239.7 579.5 1302.7 579.5H1552.5C1560.2 579.5 1566.5 585.8 1566.5 593.5V697.1C1566.5 704.8 1560.2 711.1 1552.5 711.1H1302.7C1204.7 711.1 1127.5 683.4 1075 626.4C1022.4 569.7 995.7 484.8 995.7 372.9C995.7 260.5 1022.7 175.4 1075.2 118.4C1127.9 61.3001 1205 33.6001 1302.6 33.6001H1552.4C1560.1 33.6001 1566.4 39.9001 1566.4 47.6001V151.2C1566.4 158.9 1560.1 165.2 1552.4 165.2H1302.6V165.3Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1953.6 177.7H1844.8C1774 177.7 1715.6 199.3 1674.8 244.3C1634.2 289.1 1612.3 356 1612.3 444.4C1612.3 532.8 1634.2 599.7 1674.8 644.5C1715.5 689.4 1774 711.1 1844.8 711.1H1953.6C2023.9 711.1 2082.4 689.5 2123.2 644.5C2163.9 599.7 2186 532.8 2186 444.3C2186 355.8 2163.9 289 2123.2 244.1C2082.3 199.3 2023.9 177.7 1953.6 177.7ZM1854.6 293.7H1943.8C1987 293.7 2016.6 305.1 2035.8 328.3C2055.2 351.9 2065.2 389.3 2065.2 444.5C2065.2 499.7 2055.2 536.8 2035.8 560.2C2016.7 583.2 1987.1 594.3 1943.8 594.3H1854.6C1810.8 594.3 1781.3 583.1 1762.3 560.2C1743 536.9 1733.3 499.8 1733.3 444.5C1733.3 389.3 1743.1 351.9 1762.4 328.3C1781.3 305 1810.9 293.7 1854.6 293.7Z' fill='white'/%3E%3Cpath d='M2679.7 411.6C2679.7 372.5 2668.5 343.5 2645.4 324C2622.1 304.3 2585.3 293.2 2531.9 293.2H2378.4C2375.5 293.2 2374.9 293.9 2374.8 294C2374.5 294.4 2373.6 295.8 2373.6 299.8V696.7C2373.6 704.4 2367.3 710.7 2359.6 710.7H2267.7C2260 710.7 2253.7 704.4 2253.7 696.7V265.6C2253.7 234.7 2258.8 212 2272.6 197.2C2286.5 182.2 2307.5 177.3 2334.2 177.3H2531.8C2620.7 177.3 2688 198.4 2733.3 238.9C2778.7 279.5 2800.5 338.6 2800.5 411.7V696.7C2800.5 704.4 2794.2 710.7 2786.5 710.7H2693.7C2686 710.7 2679.7 704.4 2679.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M3304.7 411.6C3304.7 372.5 3293.5 343.5 3270.4 324C3247.1 304.3 3210.3 293.2 3156.9 293.2H3003.4C3000.5 293.2 2999.9 293.9 2999.8 294C2999.5 294.4 2998.6 295.8 2998.6 299.8V696.7C2998.6 704.4 2992.3 710.7 2984.6 710.7H2892.7C2885 710.7 2878.7 704.4 2878.7 696.7V265.6C2878.7 234.7 2883.8 212 2897.6 197.2C2911.5 182.2 2932.5 177.3 2959.2 177.3H3156.8C3245.7 177.3 3313 198.4 3358.3 238.9C3403.7 279.5 3425.5 338.6 3425.5 411.7V696.7C3425.5 704.4 3419.2 710.7 3411.5 710.7H3318.7C3311 710.7 3304.7 704.4 3304.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M4906.1 292.2C4898.4 292.2 4892.1 298.5 4892.1 306.2V529.2C4892.1 557.5 4897.2 574.3 4906.4 584.1C4915.4 593.8 4930 598.6 4953.7 598.6H5019.2C5026.9 598.6 5033.2 604.9 5033.2 612.6V695.7C5033.2 703.4 5026.9 709.7 5019.2 709.7H4932.1C4877.9 709.7 4836.8 698.8 4809.7 668.6C4782.8 638.6 4771.3 591.5 4771.3 523.4V306.2C4771.3 298.5 4765 292.2 4757.3 292.2H4714.7C4707 292.2 4700.7 285.9 4700.7 278.2V190.2C4700.7 182.5 4707 176.2 4714.7 176.2H4757.3C4765 176.2 4771.3 169.9 4771.3 162.2V67.7002C4771.3 60.0002 4777.6 53.7002 4785.3 53.7002H4878.2C4885.9 53.7002 4892.2 60.0002 4892.2 67.7002V162.2C4892.2 169.9 4898.5 176.2 4906.2 176.2H5021.3C5029 176.2 5035.3 182.5 5035.3 190.2V278.2C5035.3 285.9 5029 292.2 5021.3 292.2H4906.1Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4024.4 607.2C4024.4 599.5 4018.1 593.2 4010.4 593.2H3699.9C3672.9 593.2 3655.3 586 3644.6 575.2C3633.8 564.4 3628.6 548.8 3628.6 529.7V514.5C3628.6 506.8 3634.9 500.5 3642.6 500.5H3866.6C3931.2 500.5 3977.4 486.9 4007.5 459.6C4037.7 432.2 4050.1 392.3 4050.1 343.5C4050.1 292.2 4036.8 250.1 4006.4 220.9C3976.1 191.7 3930.1 176.8 3867.7 176.8H3700.1C3633.9 176.8 3586.5 195.4 3555.6 227.8C3524.8 260.1 3511.8 305 3511.8 355.3V531.7C3511.8 582 3524.9 626.9 3555.6 659.2C3586.5 691.6 3633.9 710.2 3700.1 710.2H4010.6C4018.3 710.2 4024.6 703.9 4024.6 696.2V607.2H4024.4ZM3863.5 403.1H3642.5C3634.8 403.1 3628.5 396.8 3628.5 389.1V356.2C3628.5 337.6 3633.7 321.9 3644.6 311C3655.4 300.1 3672.9 292.7 3699.9 292.7H3866.5C3890.7 292.7 3906.9 298.8 3916.9 308.2C3926.9 317.5 3932 331.3 3932 349.4C3932 367.1 3927.3 380 3917.4 388.6C3907.4 397.4 3890.5 403.1 3863.5 403.1Z' fill='white'/%3E%3Cpath d='M2918.9 872.3C3001.9 872.3 3036.9 909.9 3036.9 966.3C3036.9 1012.2 3013.9 1036.8 2973.2 1047.2C3014.4 1058.2 3037.9 1083.7 3037.9 1129.7C3037.9 1186.1 3003.5 1224.7 2920.5 1224.7H2755.6C2741.5 1224.7 2734.2 1217.9 2734.2 1203.8V893.2C2734.2 879.1 2741.5 872.3 2755.6 872.3H2918.9ZM2765.4 1033.1H2918.9C2976.8 1033.1 3005 1014.8 3005 970.5C3005 929.8 2979.4 903.7 2919.4 903.7H2771.2C2767.5 903.7 2765.5 905.3 2765.5 909.4V1033.1H2765.4ZM2765.4 1187.6C2765.4 1191.8 2767.5 1193.3 2771.1 1193.3H2921C2979.5 1193.3 3006.1 1168.2 3006.1 1125.4C3006.1 1081 2976.9 1060.2 2921 1060.2H2765.5V1187.6H2765.4Z' fill='white'/%3E%3Cpath d='M3294 956.9V985.6H3182.8C3148.9 985.6 3135.3 1000.7 3135.3 1033.6V1224.6H3106.1V1029.9C3106.1 979.8 3125.4 956.8 3176.6 956.8H3294V956.9Z' fill='white'/%3E%3Cpath d='M3489.1 956.9C3562.2 956.9 3608.6 1001.3 3608.6 1091C3608.6 1181.3 3562.1 1224.6 3489.1 1224.6H3431.2C3357.6 1224.6 3311.7 1181.3 3311.7 1091C3311.7 1001.2 3357.6 956.9 3431.2 956.9H3489.1ZM3433.3 985.6C3374.3 985.6 3340.9 1019 3340.9 1091C3340.9 1163.5 3374.3 1196.4 3433.3 1196.4H3487.1C3546.1 1196.4 3579.5 1163.5 3579.5 1091C3579.5 1019 3546.1 985.6 3487.1 985.6H3433.3Z' fill='white'/%3E%3Cpath d='M3674.4 956.9L3706.8 1176.6C3709.4 1195.4 3716.2 1204.3 3737.1 1204.3C3758.5 1204.3 3767.4 1195.4 3771.5 1180.3L3821.6 995.5C3829.4 966.8 3849.3 951.7 3884.2 951.7C3919.1 951.7 3937.4 966.8 3945.3 995.5L3994.9 1180.3C3999.1 1195.4 4007.9 1204.3 4029.3 1204.3C4050.2 1204.3 4056.4 1195.4 4059.6 1176.6L4093.5 956.9H4125.3L4089.3 1179.8C4084.6 1210.6 4069.5 1231 4028.2 1231C3992.7 1231 3975 1216.4 3966.6 1185.1L3917 1000.9C3912.8 985.2 3900.8 978.5 3883.6 978.5C3865.9 978.5 3854.9 985.3 3850.7 1000.9L3799.6 1185.1C3790.7 1216.4 3773.5 1231 3737.5 1231C3695.2 1231 3682.2 1210.1 3677.5 1179.8L3643.1 956.9H3674.4Z' fill='white'/%3E%3Cpath d='M4417.6 956.9V985.6H4260C4219.8 985.6 4203.6 1003.3 4203.6 1032.1C4203.6 1057.2 4216.1 1077.5 4263.6 1077.5H4338.8C4410.8 1077.5 4428.6 1110.9 4428.6 1149.5C4428.6 1194.9 4404.6 1224.7 4344 1224.7H4178V1196.5H4344C4384.2 1196.5 4399.8 1178.2 4399.8 1149.5C4399.8 1124.4 4387.8 1103.6 4339.8 1103.6H4264.6C4193.1 1103.6 4174.8 1069.2 4174.8 1030C4174.8 985.1 4198.8 956.9 4259.4 956.9H4417.6Z' fill='white'/%3E%3Cpath d='M4685.4 956.9C4749.1 956.9 4775.7 986.6 4775.7 1036.8C4775.7 1084.8 4751.2 1111.4 4684.9 1111.4H4526.2V1135.9C4526.2 1170.3 4545 1196.4 4593.5 1196.4H4762.1V1224.6H4593.5C4524.6 1224.6 4497.5 1187.5 4497.5 1136.4V1045.1C4497.5 995 4524.6 956.9 4593.5 956.9H4685.4ZM4526.2 1087.4H4684.3C4729.7 1087.4 4746.9 1069.7 4746.9 1037.8C4746.9 1005.4 4728.6 985.6 4685.3 985.6H4593.4C4544.9 985.6 4526.1 1011.2 4526.1 1045.6V1087.4H4526.2Z' fill='white'/%3E%3Cpath d='M5040.3 956.9V985.6H4929.1C4895.2 985.6 4881.6 1000.7 4881.6 1033.6V1224.6H4852.4V1029.9C4852.4 979.8 4871.7 956.8 4922.9 956.8H5040.3V956.9Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_879_362'%3E%3Crect width='5041' height='1231' fill='white' transform='translate(0 0.700195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"},ow={loginPageLogo:nw},rw="200px",wr=({logoSrc:t=ow.loginPageLogo.value,width:n=rw,className:e="logo"})=>s.jsx("img",{width:n,src:t,className:e,alt:"Login logo"}),oh=()=>s.jsx("span",{className:"spinner"});const Mn=({Logo:t=wr,text:n="Loading..."})=>s.jsx("div",{className:"system-loader-background",children:s.jsxs("div",{className:"system-loader-container flex flex-column ai-center",children:[s.jsx(t,{}),s.jsx("h1",{className:"system-loader-text io-title",children:n}),s.jsx(oh,{})]})});const rh=({children:t,description:n,heading:e,Image:o,title:r,className:i})=>s.jsxs("div",{className:ot("info-card",i),children:[r&&s.jsx("h1",{className:"info-card-title io-title-large",children:r}),o&&s.jsx("div",{className:"info-card-image",children:s.jsx(o,{})}),e&&s.jsx("h3",{className:"info-card-heading io-title",children:e}),s.jsx("p",{className:"info-card-description io-text-default-lh16",children:n}),t]}),iw=({activeStepName:t,showWarnIcon:n,stepsStatuses:e})=>s.jsx("ul",{className:"setup-flow-list io-text-default-lh16",children:Gr.map(({name:o,label:r},i)=>{const a=o===t,c=e[o].state,l=n&&a?s.jsx(et,{variant:"exclamation-mark",size:"12"}):s.jsxs("span",{children:[i+1,"."]});return s.jsx("li",{className:ot(a&&"active"),children:s.jsxs("div",{className:"setup-flow-list-item",children:[s.jsxs("div",{className:"setup-flow-list-item-icon-wrapper",children:[c==="prompt"&&l,c==="granted"&&s.jsx(et,{variant:"check-solid",size:"12"}),c==="denied"&&s.jsx(et,{variant:"close",size:"12"})]}),r]})},o)})}),aw=({edgeNotificationsPermissionTimeout:t,isNotificationsPermissionPromptOpen:n})=>{const{name:e}=by(),[o,r]=g.useState(!1);return g.useEffect(()=>{if(!n||e!=="Edge")return;const i=setTimeout(()=>r(!0),t);return()=>clearTimeout(i)},[e,t,n]),g.useEffect(()=>{n&&!o||r(!1)},[n,o,r]),{hasEdgeNotificationsPermissionError:o}},sw=(t,n)=>{const{type:e,payload:o}=n;switch(e){case"completed":return{...t,[o.stepName]:{...t[o.stepName],isCompleted:!0}};case"skipped":return{...t,[o.stepName]:{isCompleted:!0,state:"denied"}};case"stateUpdated":{if(!o.state)throw Error('"stateUpdated" action invoked without state in payload');return{...t,[o.stepName]:{isCompleted:o.stepName===Qe.POPUPS?o.state==="granted":o.state!=="prompt",state:o.state}}}default:throw Error("Unknown action: "+e)}},cw=t=>{const{handleDeferredStep:n,handleOperationComplete:e}=t;window.getScreenDetails().catch(async()=>{const{state:o}=await navigator.permissions.query({name:On.WINDOW_MANAGEMENT});o==="prompt"&&n()}).finally(e)},lw=t=>{const{handleDeferredStep:n,handleOperationComplete:e}=t;Notification.requestPermission().then(async()=>{const{state:o}=await navigator.permissions.query({name:On.NOTIFICATIONS});o==="prompt"&&n()}).finally(e)},uw=t=>{const{handleDeferredStep:n,handleOperationComplete:e,dispatchAction:o}=t,r="about:blank",i="popup,width=1,height=1,top=9999,left=9999",a=window.open(r,void 0,i),c=window.open(r,void 0,i);a==null||a.close(),c==null||c.close();const l=!(a&&c);l&&n(),o({type:"stateUpdated",payload:{stepName:Qe.POPUPS,state:l?"denied":"granted"}}),e()},dw=t=>{const{dispatchAction:n}=t;n({type:"completed",payload:{stepName:Qe.PWA_INSTALL}})},fw={[Qe.WINDOW_MANAGEMENT]:cw,[Qe.NOTIFICATIONS]:lw,[Qe.POPUPS]:uw,[Qe.PWA_INSTALL]:dw},pw=({settings:t})=>{const{permission:n}=Dn(),[e,o]=rn("localStorage",yr,br),[r,i]=g.useReducer(sw,kb),[a,c]=g.useState(!1),[l,u]=g.useState(!1),f=Gr.find(y=>!r[y.name].isCompleted);if(!f)throw new Error("All setup steps are completed. The SetupSteps component should not be used in such case.");const p=f.name,d=Gr[Gr.length-1].name,{hasEdgeNotificationsPermissionError:h}=aw({edgeNotificationsPermissionTimeout:t.edgeNotificationsPermissionTimeout,isNotificationsPermissionPromptOpen:l&&p===On.NOTIFICATIONS}),m=()=>{c(!1),u(!0),fw[p]({handleDeferredStep:()=>c(!0),handleOperationComplete:()=>u(!1),dispatchAction:y=>i(y)}),p===d&&o({isCompleted:!0})},v=()=>{c(!1),i({type:"skipped",payload:{stepName:p}})};return g.useEffect(()=>{h&&(u(!1),c(!0))},[h]),g.useEffect(()=>{var y,b;c(!1),i({type:"stateUpdated",payload:{stepName:Qe.WINDOW_MANAGEMENT,state:Bi?(y=n.statuses[Qe.WINDOW_MANAGEMENT])==null?void 0:y.state:"denied"}}),i({type:"stateUpdated",payload:{stepName:Qe.NOTIFICATIONS,state:(b=n.statuses[Qe.NOTIFICATIONS])==null?void 0:b.state}})},[n.statuses]),s.jsxs(rh,{description:f.description,heading:f.heading,Image:f.Image,title:"Platform Setup",children:[s.jsx(iw,{activeStepName:p,showWarnIcon:a&&p!==Qe.POPUPS,stepsStatuses:r}),s.jsx("p",{className:"io-text-default-lh16",children:a?f.instructions.additional:f.instructions.initial}),s.jsxs(Re,{children:[s.jsx(ci,{className:"io-btn io-btn-lg io-btn-primary setup-flow-btn",disabled:l,onClick:m,children:f.actionBtnText}),p!==d&&p!==Qe.WINDOW_MANAGEMENT&&s.jsx(ci,{className:"io-btn io-btn-lg io-btn-outline setup-flow-btn",disabled:l,onClick:v,children:"Skip"})]}),l&&s.jsx(oh,{})]})};const nc=({components:{Logo:t=wr,Loader:n=Mn}={},settings:e={}})=>{const{permission:o}=Dn();return o.isLoading?s.jsx(n,{text:"Checking browser permissions..."}):s.jsx(nh,{Logo:t,children:s.jsx(pw,{settings:{...yb,...e}})})};const oc=({errorMessage:t})=>{const n="https://support.interop.io",e=s.jsxs(s.Fragment,{children:["It seems that the following error prevents io.Connect Browser",s.jsx("br",{}),"from operating properly:",s.jsxs("span",{className:"browser-start-failed-error",children:["“",t,"”"]}),s.jsxs("span",{className:"help-center-info",children:["For further assistance, visit our"," ",s.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"help center"}),"."]}),s.jsx("span",{className:"thank-you",children:"Thank you for your cooperation."})]});return s.jsx(nh,{Logo:wr,children:s.jsx(rh,{className:"io-init-error-card",heading:"Oops! io.Connect Browser couldn't start...",description:e,Image:vb,children:s.jsx(ci,{className:"io-btn io-btn-lg io-btn-primary",onClick:()=>window.open(n,"_blank","noopener,noreferrer"),children:"Visit the interop.io Help Center"})})})},ih=()=>s.jsxs(s.Fragment,{children:[s.jsx(nn,{tag:"h1",className:"login-title",text:"Making Your Work Flow",size:"large"}),s.jsxs("p",{className:"io-text-default-lh16 login-description",children:["Integrate apps, simplify user experiences and accelerate",s.jsx("br",{}),"digital transformation."]})]}),ah=({Logo:t,children:n,className:e})=>s.jsx("div",{className:"login-page-background",children:s.jsxs("div",{className:ot(e,"login-form-container flex flex-column ai-center"),children:[s.jsx(t,{}),n]})}),hw=({onLogin:t,isLoading:n,validationError:e,components:{Logo:o=wr,Heading:r=ih,Loader:i=Mn}={}})=>n?s.jsx(i,{text:"Verifying credentials..."}):s.jsxs(ah,{Logo:o,children:[s.jsx(r,{}),s.jsx(Ge,{className:"auth0-login-btn",onClick:t,size:"large",variant:"primary",children:"Log In"}),e&&s.jsx(yh,{variant:"critical",text:e.message})]}),Ml=(t,n)=>{const e=n.value,o=e.trim().length>3;return{value:e,isValid:o}},mw=({onLogin:t,setIsLoading:n,loginError:e,setLoginError:o,userInputName:r="email"})=>{const[i,a]=g.useReducer(Ml,{value:"",isValid:!1}),[c,l]=g.useReducer(Ml,{value:"",isValid:!1}),[u,f]=g.useState(!1),[p,d]=g.useState(!1),{isValid:h}=i,{isValid:m}=c,v=h&&m,y=E=>a({value:E.target.value}),b=E=>l({value:E.target.value}),S=()=>{h||f(!0)},w=()=>{m||d(!0)},x=async E=>{if(E.preventDefault(),!!v){n(!0);try{await t(i.value,c.value)}catch(O){o(O)}n(!1)}};return s.jsxs("form",{className:"simple-login-form",onSubmit:x,children:[s.jsx(Qn,{id:"user",errorMessage:u?`The ${r} is too short`:void 0,autoFocus:!0,autoComplete:"off",type:"text",placeholder:`Enter your ${r}`,value:i.value,onChange:y,onBlur:S,onFocus:()=>f(!1)}),s.jsx(Qn,{id:"password",errorMessage:p?"The password is too short":void 0,autoComplete:"off",type:"password",placeholder:"Enter your password",value:c.value,onChange:b,onBlur:w,onFocus:()=>d(!1)}),s.jsx(Ge,{type:"submit",size:"large",variant:"primary",children:"Log In"}),e&&s.jsxs("div",{className:"login-error-feedback",children:[s.jsx(et,{className:"error-icon",variant:"close",size:"12"}),e.message]})]})};const gw=({onLogin:t,userInputName:n,components:{Logo:e=wr,Heading:o=ih,Loader:r=Mn}={}})=>{const[i,a]=g.useState(!1),[c,l]=g.useState(null);return i?s.jsx(r,{text:"Verifying credentials..."}):s.jsxs(ah,{Logo:e,children:[s.jsx(o,{}),s.jsx(mw,{onLogin:t,setIsLoading:a,loginError:c,setLoginError:l,userInputName:n})]})};function vw(t,n){const[e,o]=g.useState(!0),r=g.useContext(De.IOConnectContext);return g.useEffect(()=>{let i;return(async()=>{if(!r.workspaces)return;let a;try{a=await r.workspaces.getWorkspaceById(t)}catch(l){console.warn(l);return}const c=a.getAllGroups().find(l=>l.id===n);c&&(i=await c.onLockConfigurationChanged(({showAddWindowButton:l})=>{l!==void 0&&o(l)}),o(!!c.showAddWindowButton))})(),()=>i==null?void 0:i()},[t,n,r.workspaces]),e}const yw=({groupId:t,workspaceId:n})=>{const e=vw(n,t),o=g.useCallback(r=>{Co.showAddApplicationPopup({bounds:r,groupId:t,workspaceId:n})},[t,n]);return e&&s.jsx(Co.AddWindowButton,{title:"Add App",visible:e,showPopup:o})},bw=t=>s.jsx(Co.GroupHeaderButtons,{...t,addWindow:{visible:!1,showPopup:t.addWindow.showPopup}}),ww=()=>null;const sh=({className:t,components:n,onClose:e,title:o})=>{const{NotificationsProvider:r,NotificationsPanelProvider:i,SettingsPanel:a}=kf;return s.jsx(r,{children:s.jsx(i,{children:s.jsx(a,{className:t,components:n,onClose:e,title:o})})})};const ch=y0.Panel;const lh=({className:t,components:n,onClose:e,title:o})=>{const r=g.useContext(De.IOConnectContext),{onLogout:i}=zp(),[a,c]=rn("sessionStorage",gp,vp),{login:{setIsLoggingOut:l}}=Dn(),u=g.useCallback(async()=>{var f;if("modals"in r&&r.modals){const p="log-out",{isEnterPressed:d,responseButtonClicked:h}=await r.modals.dialogs.request({templateName:To.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:"Logging out of io.Connect Browser",text:"This will terminate your session.",actionButtons:[{variant:"primary",text:"Log out",id:p,autofocus:!0},{variant:"outline",text:"Cancel",id:"cancel"}]}});if(!(d||(h==null?void 0:h.id)===p))return}Un.flushSync(()=>l(!0));try{i==null||i()}catch(p){console.error(p)}c(null),await((f=r.webPlatform)==null?void 0:f.system.shutdown()),window.location.reload()},[r,i]);return s.jsx(v0.Panel,{className:t,components:n,onClose:e,onLogout:u,title:o})},xw=[{name:"platformPreferences",displayName:"Platform Preferences",icon:"cog",onClick:t=>t(ch)},{name:"notificationSettingsPanel",displayName:"Notification Settings",icon:"bell",onClick:t=>t(sh),separatorAfter:!0},{name:"profile",displayName:"Profile",icon:"user",onClick:t=>t(lh)}],Cw=t=>({onClose:n})=>s.jsx(t,{className:"system-menu-panel",onClose:n});const uh=({actions:t,panelWrapperClassName:n})=>{const[e,o]=g.useState(),r=g.useRef(null),i=Us(),a=g.useCallback(()=>o(void 0),[]),c=!!e;g.useEffect(()=>{!c||i!=="Escape"||a()},[c,i]);const l=g.useCallback((u,f)=>{const p=t.find(({name:h})=>h===f.name);if(!p){console.error(`Action named ${f.name} is not part of the provided list of actions: ${JSON.stringify(t)}!`);return}const d=h=>{const m=Cw(h);o(()=>m)};p.onClick(d)},[t]);return zs({eventType:"mouseup",handler:a,ref:r,skip:!c}),Ws({handler:a,skip:!c}),s.jsxs(s.Fragment,{children:[s.jsx(Ys,{buttonSize:"32",iconSize:"16",actions:t,onActionItemClick:l,icon:"ellipsis-vertical",buttonVariant:"circle",placement:"bottom-end",offset:[0,8]}),s.jsx(Up,{className:ot("system-menu-panel-wrapper",n),isOpen:c,onClose:a,Panel:e,position:"right",ref:r})]})},kw=()=>s.jsx("li",{className:"default-header-system-menu",children:s.jsx(uh,{actions:xw})}),Sw=()=>{const{showNotificationBadge:t}=wy(),n=Ep(),o=g.useMemo(()=>n.filter(({state:r})=>r==="Active"||r==="Stale"),[n]).length;return o>0&&t?s.jsx("div",{className:"io-badge io-badge-primary notifications-badge",children:o<100?o:"99+"}):null};const dh=t=>{const{className:n,active:e,...o}=t;return s.jsxs("div",{className:ot(n,"notifications-panel-button"),...o,children:[s.jsx(Ue,{icon:"bell",size:"32",iconSize:"16",variant:"circle"}),s.jsx(Sw,{})]})},fh=({className:t,components:n,onClose:e,settings:o,title:r})=>{const{NotificationsProvider:i,NotificationsPanelProvider:a,Panel:c}=kf;return s.jsx(i,{children:s.jsx(a,{children:s.jsx(c,{className:t,components:n,onClose:e,settings:o,title:r})})})},ph=({Button:t=dh,Panel:n=fh,position:e="right",...o})=>{const r=Ep(),i=g.useContext(De.IOConnectContext),a=g.useCallback(async()=>{await Promise.all(r.map(({id:c})=>i.notifications.setState(c,"Seen")))},[r]);return s.jsx(Ks,{Button:t,Panel:n,position:e,onClose:a,...o})};const Ew=()=>s.jsxs(s.Fragment,{children:[s.jsx(ph,{tag:"li"}),s.jsx(kw,{})]}),rc=({onLogout:t,workspaces:n,launchpad:e,Loader:o=Mn,isBeforeunloadDialogEnabled:r})=>{var v,y,b,S;const{LogoComponent:i,SystemButtonsComponent:a}=((v=n==null?void 0:n.components)==null?void 0:v.header)??{},{setPlatformWindow:c}=$s(),{isInitialSetupCompleted:l}=td(),u=(y=window.iobrowser)==null?void 0:y.platformStarted,f=i??(u?Vp:ww),p=a??(u?Ew:void 0),d=gy(),{login:{isLoggingOut:h}}=Dn();M1(r===!1||h),g.useEffect(()=>{u&&c({name:window.name})},[u,c]);const m=g.useMemo(()=>({onLogout:t,launchpadSettings:e==null?void 0:e.settings,launchpadComponents:e==null?void 0:e.components}),[t,e==null?void 0:e.settings,e==null?void 0:e.components]);return s.jsxs(Wp.Provider,{value:m,children:[(!d||!l)&&s.jsx(o,{text:"Loading io.Connect Home..."}),s.jsx(Co,{components:{...n==null?void 0:n.components,header:{...(b=n==null?void 0:n.components)==null?void 0:b.header,LogoComponent:f,SystemButtonsComponent:p},groupHeader:{AfterTabsComponent:yw,ButtonsComponent:bw,...(S=n==null?void 0:n.components)==null?void 0:S.groupHeader}}})]})},jw=Xe({id:Dt,username:Me(Dt),email:Me(Dt),firstName:Me(Dt),lastName:Me(Dt),token:Me(Dt),password:Me(Dt)}),Ow=({config:t})=>{var b,S,w,x;const{setupFlow:n,login:e,workspaces:o,launchpad:r,getIOConnectConfig:i}=t,[a,c]=rn("localStorage",Y1,jw),[l]=rn("localStorage",yr,br),[u,f]=g.useState(null),{login:{isLoggingOut:p}}=Dn(),d=Hs(),h=((b=t.components)==null?void 0:b.SystemLoader)??Mn,m=((S=t.components)==null?void 0:S.IOInitErrorScreen)??oc,v=g.useCallback(async(E,O)=>{const M=await e.onLogin(E,O);c(M)},[e,c]),y=g.useCallback(()=>{var E;(E=e.onLogout)==null||E.call(e),c(null)},[e.onLogout,c]);return p?s.jsx(h,{text:"Logging out..."}):a?!(l!=null&&l.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&!d?s.jsx(nc,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:h}}):u&&!u.message.includes("has already been started")?s.jsx(m,{errorMessage:u.message}):s.jsx(De.IOConnectProvider,{settings:i({type:"simple",user:a}),onInitError:f,fallback:s.jsx(h,{text:"Initializing the platform..."}),children:s.jsx(Ei,{launchpadMode:(w=r==null?void 0:r.settings)==null?void 0:w.mode,children:s.jsx(rc,{workspaces:o,launchpad:r,onLogout:y,isBeforeunloadDialogEnabled:(x=t.settings)==null?void 0:x.isBeforeunloadDialogEnabled,Loader:h})})}):s.jsx(gw,{onLogin:v,userInputName:e.userInputName,components:{...e.components,Loader:h}})},Nw=Xe({message:Dt}),Iw=t=>{const n=th(),[e,o]=g.useState(void 0),[r,i]=rn("sessionStorage",G1,Nw),a=g.useMemo(()=>n.user?(t==null?void 0:t(n.user))??{ok:!0}:null,[n.user,t]),c=(a==null?void 0:a.ok)===!1,l=n.isLoading||n.isAuthenticated&&!e,u=c||l,f=g.useMemo(()=>{var p;return a!=null&&a.ok&&((p=n.user)!=null&&p.email)&&e?{username:n.user.name,id:n.user.email,token:e}:null},[n.user,e,a==null?void 0:a.ok]);return g.useEffect(()=>{n.isAuthenticated&&n.getAccessTokenSilently().then(o).catch(console.warn)},[n]),g.useEffect(()=>{if(a){if(a.ok){i(null);return}i({message:a.message}),n.logout()}},[n,i,a]),{isLoading:u,validationError:r,user:f}},cs={POPUP:"popup",REDIRECT:"redirect"},Aw=({config:t})=>{var w,x,E,O;const n=th(),{setupFlow:e,login:o,launchpad:r,workspaces:i,getIOConnectConfig:a}=t,{isLoading:c,validationError:l,user:u}=Iw(o.validateUser),p=(o.loginType??cs.REDIRECT)===cs.REDIRECT?n.loginWithRedirect:n.loginWithPopup,[d]=rn("localStorage",yr,br),[h,m]=g.useState(null),{login:{isLoggingOut:v}}=Dn(),y=Hs(),b=((w=t.components)==null?void 0:w.SystemLoader)??Mn,S=((x=t.components)==null?void 0:x.IOInitErrorScreen)??oc;return v?s.jsx(b,{text:"Logging out..."}):u?!(d!=null&&d.isCompleted)&&(e==null?void 0:e.enabled)!==!1&&!y?s.jsx(nc,{settings:e==null?void 0:e.settings,components:{...e==null?void 0:e.components,Loader:b}}):h&&!h.message.includes("has already been started")?s.jsx(S,{errorMessage:h.message}):s.jsx(De.IOConnectProvider,{settings:a({type:"auth0",user:{...n.user,id:u.id,token:u.token}}),onInitError:m,fallback:s.jsx(b,{text:"Initializing the platform..."}),children:s.jsx(Ei,{launchpadMode:(E=r==null?void 0:r.settings)==null?void 0:E.mode,children:s.jsx(rc,{workspaces:i,launchpad:r,onLogout:n.logout,isBeforeunloadDialogEnabled:(O=t.settings)==null?void 0:O.isBeforeunloadDialogEnabled,Loader:b})})}):s.jsx(hw,{onLogin:p,isLoading:c,validationError:l,components:{...o.components,Loader:b}})},_l=({config:t})=>{var v,y,b,S;const{setupFlow:n,launchpad:e,workspaces:o,getIOConnectConfig:r}=t,{onLogout:i,user:a}=t.login??{},{isPlatformWindow:c}=$s(),[l]=rn("localStorage",yr,br),[u,f]=g.useState(null),{login:{isLoggingOut:p}}=Dn(),d=Hs(),h=((v=t.components)==null?void 0:v.SystemLoader)??Mn,m=((y=t.components)==null?void 0:y.IOInitErrorScreen)??oc;return p?s.jsx(h,{text:"Logging out..."}):!(l!=null&&l.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&c&&!d?s.jsx(nc,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:h}}):u&&!u.message.includes("has already been started")?s.jsx(m,{errorMessage:u.message}):s.jsx(De.IOConnectProvider,{settings:r({type:"custom",user:a}),onInitError:f,fallback:s.jsx(h,{text:"Initializing the platform..."}),children:s.jsx(Ei,{launchpadMode:(b=e==null?void 0:e.settings)==null?void 0:b.mode,children:s.jsx(rc,{workspaces:o,launchpad:e,onLogout:i,isBeforeunloadDialogEnabled:(S=t.settings)==null?void 0:S.isBeforeunloadDialogEnabled,Loader:h})})})},hh=Xe({Logo:Me(jt().andThen(t=>zt(t,"Logo"))),Heading:Me(jt().andThen(t=>zt(t,"Heading")))}),Pw=dr(...Object.values(cs).map(t=>An(t))),Tw=Xe({type:An("auth0"),validateUser:Me(jt().andThen(t=>zt(t,"validateUser"))),loginType:Me(Pw),providerOptions:jt(),components:Me(hh)}),Dw=Xe({type:An("simple"),onLogin:jt().andThen(t=>zt(t,"onLogin")),onLogout:Me(jt().andThen(t=>zt(t,"onLogout"))),userInputName:Me(Dt),components:Me(hh)}),Mw=Xe({id:Dt,username:Dt}),_w=Xe({type:An("custom"),onLogout:jt().andThen(t=>zt(t,"onLogout")),user:Mw}),Lw=dr(Tw,Dw,_w),Rw=Xe({edgeNotificationsPermissionTimeout:Me(ay)}),Fw=Xe({Logo:Me(jt().andThen(t=>zt(t,"Logo")))}),Bw=Xe({enabled:Me(Ao()),components:Me(Fw),settings:Me(Rw)}),Hw=Xe({components:Me(jt())}),Ww=Xe({BeforeSearch:dr(An(null),Me(jt().andThen(t=>zt(t,"BeforeSearch")))),AfterSearch:dr(An(null),Me(jt().andThen(t=>zt(t,"AfterSearch"))))}),zw=Xe({Component:jt().andThen(t=>zt(t,"Component")),placementId:Dt}),$w=Xe({header:Me(Ww),sections:Me(ry(zw))}),Uw=Xe({showHeader:Me(Ao()),showSearch:Me(Ao())}),Vw=Xe({header:Me(Uw),mode:Me(dr(An("pinned"),An("default")))}),Gw=Xe({components:Me($w),settings:Me(Vw)}),Yw=Xe({SystemLoader:Me(jt().andThen(t=>zt(t,"SystemLoader"))),IOInitErrorScreen:Me(jt().andThen(t=>zt(t,"IOInitErrorScreen")))}),Zw=Xe({isBeforeunloadDialogEnabled:Me(Ao())}),Kw=Xe({getIOConnectConfig:jt().andThen(t=>zt(t,"getIOConnectConfig")),login:Me(Lw),setupFlow:Me(Bw),workspaces:Me(Hw),launchpad:Me(Gw),components:Me(Yw),settings:Me(Zw)}),qw=({config:t})=>{var i;const n=g.useMemo(()=>Kw.runWithException(t),[t]),e=n.login,{isPlatformWindow:o}=$s();if(!e||!o){const{login:a,...c}=n;return s.jsx(_l,{config:c})}if(e.type==="custom")return s.jsx(_l,{config:n});if(e.type==="simple")return s.jsx(Ow,{config:n});const{providerOptions:r}=e;return s.jsx(tw,{...r,authorizationParams:{...r.authorizationParams,redirect_uri:((i=r.authorizationParams)==null?void 0:i.redirect_uri)??window.location.origin},children:s.jsx(Aw,{config:n})})};const Jw=({config:t})=>s.jsx(fb,{children:s.jsx(qw,{config:t})});exports.ApplicationsSection=Tp;exports.FavoritesSection=Dp;exports.IOConnectHome=Jw;exports.Launchpad=Hp;exports.LaunchpadAccess=Vp;exports.LaunchpadPinButton=_p;exports.NotificationSettingsPanel=sh;exports.NotificationsPanel=fh;exports.NotificationsPanelButton=dh;exports.NotificationsPanelWithToggleButton=ph;exports.PanelWithToggleButton=Ks;exports.PlatformPrefsProvider=Ei;exports.PreferencesPanel=ch;exports.ProfilePanel=lh;exports.Section=Fi;exports.SystemLoader=Mn;exports.SystemMenu=uh;exports.WorkspacesSection=Fp;exports.useFavorites=_i;exports.usePlatformPref=Ht;exports.usePlatformPrefs=td;
61
61
  //# sourceMappingURL=index.js.map