fuck-tiny-cloud/plugins/tinycomments/js/tinycomments-sidebar.min.js

10 lines
193 KiB
JavaScript

/*!
* Tiny Comments plugin
*
* Copyright (c) 2023 Ephox Corporation DBA Tiny Technologies, Inc.
* Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
*
* Version: 8.3.0-112
*/
!function(){"use strict";var e,t;!function(e){e[e.Before=0]="Before",e[e.QueryingDelete=1]="QueryingDelete",e[e.QueryingResolve=2]="QueryingResolve",e[e.PostDelete=3]="PostDelete",e[e.PostResolve=4]="PostResolve"}(e||(e={})),function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed",e[e.Closing=2]="Closing"}(t||(t={}));var n,o,r,i,a,s,c,l,u,d,f,p={},m=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function _(e,t){for(var n in t)e[n]=t[n];return e}function g(e){var t=e.parentNode;t&&t.removeChild(e)}function y(e,t,o){var r,i,a,s={};for(a in t)"key"==a?r=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?n.call(arguments,2):o),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return b(e,s,r,i,null)}function b(e,t,n,i,a){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++r:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function w(){return{current:null}}function x(e){return e.children}function C(e,t){this.props=e,this.context=t}function E(e,t){if(null==t)return e.__?E(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?E(e):null}function S(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return S(e)}}function T(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!M.__r++||a!==o.debounceRendering)&&((a=o.debounceRendering)||s)(M)}function M(){var e,t,n,r,a,s,l,u;for(i.sort(c);e=i.shift();)e.__d&&(t=i.length,r=void 0,s=(a=(n=e).__v).__e,l=[],u=[],n.__P&&((r=_({},a)).__v=a.__v+1,o.vnode&&o.vnode(r),L(n.__P,r,a,n.__n,n.__P.namespaceURI,32&a.__u?[s]:null,l,null==s?E(a):s,!!(32&a.__u),u),r.__v=a.__v,r.__.__k[r.__i]=r,I(l,r,u),r.__e!=s&&S(r)),i.length>t&&i.sort(c));M.__r=0}function k(e,t,n,o,r,i,a,s,c,l,u){var d,f,h,_,g,y=o&&o.__k||m,w=t.length;for(n.__d=c,function(e,t,n){var o,r,i,a,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],o=0;o<c;o++)a=o+d,null!=(r=e.__k[o]=null==(r=t[o])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?b(null,r,null,null,null):v(r)?b(x,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?b(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,s=D(r,n,a,u),r.__i=s,i=null,-1!==s&&(u--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof r.type&&(r.__u|=65536)):s!==a&&(s==a-1?d=s-a:s==a+1?d++:s>a?u>c-a?d+=s-a:d--:s<a&&d++,s!==o+d&&(r.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=E(i)),H(i,i,!1),n[a]=null,u--);if(u)for(o=0;o<l;o++)null!=(i=n[o])&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=E(i)),H(i,i))}(n,t,y),c=n.__d,d=0;d<w;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(f=-1===h.__i?p:y[h.__i]||p,h.__i=d,L(e,h,f,r,i,a,s,c,l,u),_=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&U(f.ref,null,h),u.push(h.ref,h.__c||_,h)),null==g&&null!=_&&(g=_),65536&h.__u||f.__k===h.__k?c=O(h,c,e):"function"==typeof h.type&&void 0!==h.__d?c=h.__d:_&&(c=_.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=c,n.__e=g}function O(e,t,n){var o,r;if("function"==typeof e.type){for(o=e.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=e,t=O(o[r],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=E(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function P(e,t){return t=t||[],null==e||"boolean"==typeof e||(v(e)?e.some((function(e){P(e,t)})):t.push(e)),t}function D(e,t,n,o){var r=e.key,i=e.type,a=n-1,s=n+1,c=t[n];if(null===c||c&&r==c.key&&i===c.type&&!(131072&c.__u))return n;if(o>(null==c||131072&c.__u?0:1))for(;a>=0||s<t.length;){if(a>=0){if((c=t[a])&&!(131072&c.__u)&&r==c.key&&i===c.type)return a;a--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&r==c.key&&i===c.type)return s;s++}}return-1}function A(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||h.test(t)?n:n+"px"}function N(e,t,n,o,r){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||A(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||A(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n.u=o.u:(n.u=l,e.addEventListener(t,i?d:u,i)):e.removeEventListener(t,i?d:u,i);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function R(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=l++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function L(e,t,n,r,i,a,s,c,l,u){var d,f,p,m,h,g,y,b,w,E,S,T,M,O,P,D,A=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),a=[c=t.__e=n.__e]),(d=o.__b)&&d(t);e:if("function"==typeof A)try{if(b=t.props,w="prototype"in A&&A.prototype.render,E=(d=A.contextType)&&r[d.__c],S=d?E?E.props.value:d.__:r,n.__c?y=(f=t.__c=n.__c).__=f.__E:(w?t.__c=f=new A(b,S):(t.__c=f=new C(b,S),f.constructor=A,f.render=W),E&&E.sub(f),f.props=b,f.state||(f.state={}),f.context=S,f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),w&&null==f.__s&&(f.__s=f.state),w&&null!=A.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=_({},f.__s)),_(f.__s,A.getDerivedStateFromProps(b,f.__s))),m=f.props,h=f.state,f.__v=t,p)w&&null==A.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),w&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(w&&null==A.getDerivedStateFromProps&&b!==m&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(b,S),!f.__e&&(null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(b,f.__s,S)||t.__v===n.__v)){for(t.__v!==n.__v&&(f.props=b,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[],f.__h.length&&s.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(b,f.__s,S),w&&null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(m,h,g)}))}if(f.context=S,f.props=b,f.__P=e,f.__e=!1,M=o.__r,O=0,w){for(f.state=f.__s,f.__d=!1,M&&M(t),d=f.render(f.props,f.state,f.context),P=0;P<f._sb.length;P++)f.__h.push(f._sb[P]);f._sb=[]}else do{f.__d=!1,M&&M(t),d=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++O<25);f.state=f.__s,null!=f.getChildContext&&(r=_(_({},r),f.getChildContext())),w&&!p&&null!=f.getSnapshotBeforeUpdate&&(g=f.getSnapshotBeforeUpdate(m,h)),k(e,v(D=null!=d&&d.type===x&&null==d.key?d.props.children:d)?D:[D],t,n,r,i,a,s,c,l,u),f.base=t.__e,t.__u&=-161,f.__h.length&&s.push(f),y&&(f.__E=f.__=null)}catch(e){if(t.__v=null,l||null!=a){for(t.__u|=l?160:32;c&&8===c.nodeType&&c.nextSibling;)c=c.nextSibling;a[a.indexOf(c)]=null,t.__e=c}else t.__e=n.__e,t.__k=n.__k;o.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=F(n.__e,t,n,r,i,a,s,l,u);(d=o.diffed)&&d(t)}function I(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)U(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function F(e,t,o,r,i,a,s,c,l){var u,d,f,m,h,_,y,b=o.props,w=t.props,x=t.type;if("svg"===x?i="http://www.w3.org/2000/svg":"math"===x?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(u=0;u<a.length;u++)if((h=a[u])&&"setAttribute"in h==!!x&&(x?h.localName===x:3===h.nodeType)){e=h,a[u]=null;break}if(null==e){if(null===x)return document.createTextNode(w);e=document.createElementNS(i,x,w.is&&w),a=null,c=!1}if(null===x)b===w||c&&e.data===w||(e.data=w);else{if(a=a&&n.call(e.childNodes),b=o.props||p,!c&&null!=a)for(b={},u=0;u<e.attributes.length;u++)b[(h=e.attributes[u]).name]=h.value;for(u in b)if(h=b[u],"children"==u);else if("dangerouslySetInnerHTML"==u)f=h;else if("key"!==u&&!(u in w)){if("value"==u&&"defaultValue"in w||"checked"==u&&"defaultChecked"in w)continue;N(e,u,null,h,i)}for(u in w)h=w[u],"children"==u?m=h:"dangerouslySetInnerHTML"==u?d=h:"value"==u?_=h:"checked"==u?y=h:"key"===u||c&&"function"!=typeof h||b[u]===h||N(e,u,h,b[u],i);if(d)c||f&&(d.__html===f.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=""),k(e,v(m)?m:[m],t,o,r,"foreignObject"===x?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:o.__k&&E(o,0),c,l),null!=a)for(u=a.length;u--;)null!=a[u]&&g(a[u]);c||(u="value",void 0!==_&&(_!==e[u]||"progress"===x&&!_||"option"===x&&_!==b[u])&&N(e,u,_,b[u],i),u="checked",void 0!==y&&y!==e[u]&&N(e,u,y,b[u],i))}return e}function U(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function H(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||U(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&H(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||g(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function W(e,t,n){return this.constructor(e,n)}function B(e,t,r){var i,a,s,c;o.__&&o.__(e,t),a=(i="function"==typeof r)?null:r&&r.__k||t.__k,s=[],c=[],L(t,e=(!i&&r||t).__k=y(x,null,[e]),a||p,p,t.namespaceURI,!i&&r?[r]:a?null:t.firstChild?n.call(t.childNodes):null,s,!i&&r?r:a?a.__e:t.firstChild,i,c),I(s,e,c)}function $(e,t){B(e,t,$)}function j(e,t,o){var r,i,a,s,c=_({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?r=t[a]:"ref"==a?i=t[a]:c[a]=void 0===t[a]&&void 0!==s?s[a]:t[a];return arguments.length>2&&(c.children=arguments.length>3?n.call(arguments,2):o),b(e.type,c,r||e.key,i||e.ref,null)}function K(e,t){var n={__c:t="__cC"+f++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,o;return this.getChildContext||(n=[],(o={})[t]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,T(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}n=m.slice,o={__e:function(e,t,n,o){for(var r,i,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},r=0,C.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=_({},this.state),"function"==typeof e&&(e=e(_({},n),this.props)),e&&_(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),T(this))},C.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},C.prototype.render=x,i=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},M.__r=0,l=0,u=R(!1),d=R(!0),f=0;var z=0;function V(e,t,n,r,i,a){t||(t={});var s,c,l=t;if("ref"in l)for(c in l={},t)"ref"==c?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--z,__i:-1,__u:0,__source:i,__self:a};if("function"==typeof e&&(s=e.defaultProps))for(c in s)void 0===l[c]&&(l[c]=s[c]);return o.vnode&&o.vnode(u),u}let Y=0,q=[],G=[],X=(e,t)=>{let n=[],o={get:()=>(o.lc||o.listen((()=>{}))(),o.value),l:t||0,lc:0,listen:(e,t)=>(o.lc=n.push(e,t||o.l)/2,()=>{let t=n.indexOf(e);~t&&(n.splice(t,2),--o.lc||o.off())}),notify(e,t){let r=!G.length;for(let r=0;r<n.length;r+=2)G.push(n[r],n[r+1],o.value,e,t);if(r){for(let e=0;e<G.length;e+=5){let t;for(let n=e+1;!t&&(n+=5)<G.length;)G[n]<G[e+1]&&(t=G.push(G[e],G[e+1],G[e+2],G[e+3],G[e+4]));t||G[e](G[e+2],G[e+3],G[e+4])}G.length=0}},off(){},set(e){let t=o.value;t!==e&&(o.value=e,o.notify(t))},subscribe(e,t){let n=o.listen(e,t);return e(o.value),n},value:e};return o},Z=(e,t,n,o)=>(e.events=e.events||{},e.events[n+10]||(e.events[n+10]=o((t=>{e.events[n].reduceRight(((e,t)=>(t(e),e)),{shared:{},...t})}))),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let o=e.events[n],r=o.indexOf(t);o.splice(r,1),o.length||(delete e.events[n],e.events[n+10](),delete e.events[n+10])}),Q=(e,t)=>Z(e,t,1,(t=>{let n=e.off;return e.off=()=>{t(),n()},()=>{e.off=n}})),J=(e={})=>{let t=X(e);return t.setKey=function(e,n){let o=t.value;void 0===n&&e in t.value?(t.value={...t.value},delete t.value[e],t.notify(o,e)):t.value[e]!==n&&(t.value={...t.value,[e]:n},t.notify(o,e))},t};var ee=function(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},te=function(e){return{eq:e}},ne=te((function(e,t){return e===t})),oe=ne,re=function(e){return te((function(t,n){if(t.length!==n.length)return!1;for(var o=t.length,r=0;r<o;r++)if(!e.eq(t[r],n[r]))return!1;return!0}))},ie=te((function(e,t){if(e===t)return!0;var n,o=ee(e);return o===ee(t)&&(function(e){return-1!==["undefined","boolean","number","string","function","xml","null"].indexOf(e)}(o)?e===t:"array"===o?re(ie).eq(e,t):"object"===o&&(n=ie,te((function(e,t){var o=Object.keys(e),r=Object.keys(t);if(!function(e,t){return function(e,t){return te((function(n,o){return e.eq(t(n),t(o))}))}(re(e),(function(e){return function(e,t){return Array.prototype.slice.call(e).sort(t)}(e,t)}))}(oe).eq(o,r))return!1;for(var i=o.length,a=0;a<i;a++){var s=o[a];if(!n.eq(e[s],t[s]))return!1}return!0}))).eq(e,t))})),ae=function(){return ae=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ae.apply(this,arguments)};function se(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}"function"==typeof SuppressedError&&SuppressedError;const ce=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&((e,t)=>!!((e,t)=>t.isPrototypeOf(e))(e,t.prototype)||e.constructor?.name===t.name)(e,String)?"string":t})(t)===e,le=e=>t=>typeof t===e,ue=ce("string"),de=ce("object"),fe=ce("array"),pe=le("boolean"),me=e=>void 0===e,he=e=>null==e,ve=e=>!he(e),_e=le("function"),ge=le("number"),ye=()=>{},be=e=>()=>e,we=e=>e,xe=(e,t)=>e===t;function Ce(e,...t){return(...n)=>{const o=t.concat(n);return e.apply(null,o)}}const Ee=e=>t=>!e(t),Se=e=>e(),Te=be(!1),Me=be(!0);class ke{tag;value;static singletonNone=new ke(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new ke(!0,e)}static none(){return ke.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?ke.some(e(this.value)):ke.none()}bind(e){return this.tag?e(this.value):ke.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:ke.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(e){return ve(e)?ke.some(e):ke.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}const Oe=Array.prototype.slice,Pe=Array.prototype.indexOf,De=Array.prototype.push,Ae=(e,t)=>((e,t)=>Pe.call(e,t))(e,t)>-1,Ne=(e,t)=>{for(let n=0,o=e.length;n<o;n++)if(t(e[n],n))return!0;return!1},Re=(e,t)=>{const n=e.length,o=new Array(n);for(let r=0;r<n;r++){const n=e[r];o[r]=t(n,r)}return o},Le=(e,t)=>{for(let n=0,o=e.length;n<o;n++)t(e[n],n)},Ie=(e,t)=>{const n=[];for(let o=0,r=e.length;o<r;o++){const r=e[o];t(r,o)&&n.push(r)}return n},Fe=(e,t,n)=>(((e,t)=>{for(let n=e.length-1;n>=0;n--)t(e[n],n)})(e,((e,o)=>{n=t(n,e,o)})),n),Ue=(e,t,n)=>(Le(e,((e,o)=>{n=t(n,e,o)})),n),He=(e,t)=>((e,t,n)=>{for(let o=0,r=e.length;o<r;o++){const r=e[o];if(t(r,o))return ke.some(r);if(n(r,o))break}return ke.none()})(e,t,Te),We=(e,t)=>(e=>{const t=[];for(let n=0,o=e.length;n<o;++n){if(!fe(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);De.apply(t,e[n])}return t})(Re(e,t)),Be=(e,t)=>t>=0&&t<e.length?ke.some(e[t]):ke.none(),$e=e=>Be(e,0),je=e=>Be(e,e.length-1),Ke=Object.keys,ze=Object.hasOwnProperty,Ve=(e,t)=>{const n=Ke(e);for(let o=0,r=n.length;o<r;o++){const r=n[o];t(e[r],r)}},Ye=(e,t)=>qe(e,t)?ke.from(e[t]):ke.none(),qe=(e,t)=>ze.call(e,t),Ge=e=>{if(!fe(e))throw new Error("cases must be an array");if(0===e.length)throw new Error("there must be at least one case");const t=[],n={};return Le(e,((o,r)=>{const i=Ke(o);if(1!==i.length)throw new Error("one and only one name per case");const a=i[0],s=o[a];if(void 0!==n[a])throw new Error("duplicate key detected:"+a);if("cata"===a)throw new Error("cannot have a case named cata (sorry)");if(!fe(s))throw new Error("case arguments must be an array");t.push(a),n[a]=(...n)=>{const o=n.length;if(o!==s.length)throw new Error("Wrong number of arguments to case "+a+". Expected "+s.length+" ("+s+"), got "+o);return{fold:(...t)=>{if(t.length!==e.length)throw new Error("Wrong number of arguments to fold. Expected "+e.length+", got "+t.length);return t[r].apply(null,n)},match:e=>{const o=Ke(e);if(t.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+t.join(",")+"\nActual: "+o.join(","));const r=(e=>{for(let n=0,r=e.length;n<r;++n)if(!0!==(t=e[n],Ae(o,t)))return!1;var t;return!0})(t);if(!r)throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+t.join(", "));return e[a].apply(null,n)},log:e=>{console.log(e,{constructors:t,constructor:a,params:n})}}}})),n},Xe=e=>{let t=ke.none(),n=[];const o=e=>{r()?i(e):n.push(e)},r=()=>t.isSome(),i=e=>{t.each((t=>{setTimeout((()=>{e(t)}),0)}))};return e((e=>{r()||(t=ke.some(e),Le(n,i),n=[])})),{get:o,map:e=>Xe((t=>{o((n=>{t(e(n))}))})),isReady:r}},Ze={nu:Xe,pure:e=>Xe((t=>{t(e)}))},Qe=e=>{setTimeout((()=>{throw e}),0)},Je=e=>{const t=t=>{e().then(t,Qe)};return{map:t=>Je((()=>e().then(t))),bind:t=>Je((()=>e().then((e=>t(e).toPromise())))),anonBind:t=>Je((()=>e().then((()=>t.toPromise())))),toLazy:()=>Ze.nu(t),toCached:()=>{let t=null;return Je((()=>(null===t&&(t=e()),t)))},toPromise:e,get:t}},et=e=>Je((()=>Promise.resolve(e))),tt=e=>{const t=t=>t(e),n=be(e),o=()=>r,r={tag:!0,inner:e,fold:(t,n)=>n(e),isValue:Me,isError:Te,map:t=>ot.value(t(e)),mapError:o,bind:t,exists:t,forall:t,getOr:n,or:o,getOrThunk:n,orThunk:o,getOrDie:n,each:t=>{t(e)},toOptional:()=>ke.some(e)};return r},nt=e=>{const t=()=>n,n={tag:!1,inner:e,fold:(t,n)=>t(e),isValue:Te,isError:Me,map:t,mapError:t=>ot.error(t(e)),bind:t,exists:Te,forall:Me,getOr:we,or:we,getOrThunk:Se,orThunk:Se,getOrDie:(o=String(e),()=>{throw new Error(o)}),each:ye,toOptional:ke.none};var o;return n},ot={value:tt,error:nt,fromOption:(e,t)=>e.fold((()=>nt(t)),tt)},rt=e=>({...e,toCached:()=>rt(e.toCached()),bindFuture:t=>rt(e.bind((e=>e.fold((e=>et(ot.error(e))),(e=>t(e)))))),bindResult:t=>rt(e.map((e=>e.bind(t)))),mapResult:t=>rt(e.map((e=>e.map(t)))),mapError:t=>rt(e.map((e=>e.mapError(t)))),foldResult:(t,n)=>e.map((e=>e.fold(t,n))),withTimeout:(t,n)=>{return rt((o=o=>{let r=!1;const i=setTimeout((()=>{r=!0,o(ot.error(n()))}),t);e.get((e=>{r||(clearTimeout(i),o(e))}))},Je((()=>new Promise(o)))));var o}}),it="undefined"!=typeof window?window:Function("return this;")(),at=(e,t,n)=>Math.min(Math.max(e,t),n);let st=0;const ct=e=>{const t=(new Date).getTime(),n=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return st++,e+"_"+n+st+String(t)},lt=(e,t)=>e?ke.some(t):ke.none(),ut=(e,t)=>((e,t)=>{let n=null!=t?t:it;for(let t=0;t<e.length&&null!=n;++t)n=n[e[t]];return n})(e.split("."),t),dt=(e,t)=>pt(e,t)?((e,t)=>e.substring(t))(e,t.length):e,ft=(e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!me(o)||r+t.length<=o)},pt=(e,t)=>((e,t)=>""===t||e.length>=t.length&&e.substr(0,0+t.length)===t)(e,t),mt=e=>t=>t.replace(e,""),ht=mt(/^\s+|\s+$/g),vt=mt(/^\s+/g),_t=e=>e.length>0,gt=()=>yt(0,0),yt=(e,t)=>({major:e,minor:t}),bt={nu:yt,detect:(e,t)=>{const n=String(t).toLowerCase();return 0===e.length?gt():((e,t)=>{const n=((e,t)=>{for(let n=0;n<e.length;n++){const o=e[n];if(o.test(t))return o}})(e,t);if(!n)return{major:0,minor:0};const o=e=>Number(t.replace(n,"$"+e));return yt(o(1),o(2))})(e,n)},unknown:gt},wt=(e,t)=>{const n=String(t).toLowerCase();return He(e,(e=>e.search(n)))},xt=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ct=e=>t=>ft(t,e),Et=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>ft(e,"edge/")&&ft(e,"chrome")&&ft(e,"safari")&&ft(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,xt],search:e=>ft(e,"chrome")&&!ft(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>ft(e,"msie")||ft(e,"trident")},{name:"Opera",versionRegexes:[xt,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ct("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ct("firefox")},{name:"Safari",versionRegexes:[xt,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(ft(e,"safari")||ft(e,"mobile/"))&&ft(e,"applewebkit")}],St=[{name:"Windows",search:Ct("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>ft(e,"iphone")||ft(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ct("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Ct("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ct("linux"),versionRegexes:[]},{name:"Solaris",search:Ct("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ct("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Ct("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Tt={browsers:be(Et),oses:be(St)},Mt=e=>{const t=e.current,n=e.version,o=e=>()=>t===e;return{current:t,version:n,isEdge:o("Edge"),isChromium:o("Chromium"),isIE:o("IE"),isOpera:o("Opera"),isFirefox:o("Firefox"),isSafari:o("Safari")}},kt=()=>Mt({current:void 0,version:bt.unknown()}),Ot=Mt,Pt=e=>{const t=e.current,n=e.version,o=e=>()=>t===e;return{current:t,version:n,isWindows:o("Windows"),isiOS:o("iOS"),isAndroid:o("Android"),isMacOS:o("macOS"),isLinux:o("Linux"),isSolaris:o("Solaris"),isFreeBSD:o("FreeBSD"),isChromeOS:o("ChromeOS")}},Dt=()=>Pt({current:void 0,version:bt.unknown()}),At=Pt,Nt=(e,t,n)=>{const o=Tt.browsers(),r=Tt.oses(),i=t.bind((e=>((e,t)=>((e,t)=>{for(let n=0;n<e.length;n++){const o=t(e[n]);if(o.isSome())return o}return ke.none()})(t.brands,(t=>{const n=t.brand.toLowerCase();return He(e,(e=>n===e.brand?.toLowerCase())).map((e=>({current:e.name,version:bt.nu(parseInt(t.version,10),0)})))})))(o,e))).orThunk((()=>((e,t)=>wt(e,t).map((e=>{const n=bt.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(o,e))).fold(kt,Ot),a=((e,t)=>wt(e,t).map((e=>{const n=bt.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(r,e).fold(Dt,At),s=((e,t,n,o)=>{const r=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),s=a||o("(pointer:coarse)"),c=r||!i&&a&&o("(min-device-width:768px)"),l=i||a&&!c,u=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),d=!l&&!c&&!u;return{isiPad:be(r),isiPhone:be(i),isTablet:be(c),isPhone:be(l),isTouch:be(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:be(u),isDesktop:be(d)}})(a,i,e,n);return{browser:i,os:a,deviceType:s}},Rt=e=>window.matchMedia(e).matches;let Lt=(e=>{let t,n=!1;return(...o)=>(n||(n=!0,t=e.apply(null,o)),t)})((()=>Nt(window.navigator.userAgent,ke.from(window.navigator.userAgentData),Rt)));const It=()=>Lt(),Ft=Object.getPrototypeOf,Ut=e=>{const t=ut("ownerDocument.defaultView",e);return de(e)&&((e=>((e,t)=>{const n=((e,t)=>ut(e,t))(e,t);if(null==n)throw new Error(e+" not available on this browser");return n})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Ft(e).constructor.name))},Ht=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Wt=Ht,Bt=(e,t)=>{const n=e.dom;if(1!==n.nodeType)return!1;{const e=n;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},$t=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,jt=e=>e.dom.nodeName.toLowerCase(),Kt=e=>t=>(e=>e.dom.nodeType)(t)===e,zt=e=>Vt(e)&&Ut(e.dom),Vt=Kt(1),Yt=Kt(3),qt=Kt(11),Gt=e=>Wt(e.dom.getRootNode()),Xt=e=>Wt(e.dom.host),Zt=e=>{const t=Wt((e=>{if(ve(e.target)){const t=Wt(e.target);if(Vt(t)&&ve(t.dom.shadowRoot)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return $e(t)}}return ke.from(e.target)})(e).getOr(e.target)),n=()=>e.stopPropagation(),o=()=>e.preventDefault(),r=(i=o,a=n,(...e)=>i(a.apply(null,e)));var i,a;return((e,t,n,o,r,i,a)=>({target:e,x:t,y:n,stop:o,prevent:r,kill:i,raw:a}))(t,e.clientX,e.clientY,n,o,r,e)},Qt=(e,t,n,o)=>{e.dom.removeEventListener(t,n,o)},Jt=Me,en=(e,t,n)=>((e,t,n,o)=>((e,t,n,o,r)=>{const i=((e,t)=>n=>{e(n)&&t(Zt(n))})(n,o);return e.dom.addEventListener(t,i,r),{unbind:Ce(Qt,e,t,i,r)}})(e,t,n,o,!1))(e,t,Jt,n),tn=(e,t=!1)=>e.dom.focus({preventScroll:t}),nn=(e,t,n)=>{((e,t,n)=>{if(!(ue(n)||pe(n)||ge(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")})(e.dom,t,n)},on=(e,t)=>{const n=e.dom.getAttribute(t);return null===n?void 0:n},rn=(e,t)=>ke.from(on(e,t)),an=(e,t)=>{e.dom.removeAttribute(t)},sn=e=>void 0!==e.style&&_e(e.style.getPropertyValue),cn=e=>{const t=Yt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return(e=>{const t=Gt(e);return qt(n=t)&&ve(n.dom.host)?ke.some(t):ke.none();var n})(Wt(t)).fold((()=>n.body.contains(t)),(o=cn,r=Xt,e=>o(r(e))));var o,r},ln=(e,t,n)=>{if(!ue(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);sn(e)&&e.style.setProperty(t,n)},un=(e,t,n)=>{const o=e.dom;ln(o,t,n)},dn=(e,t)=>{const n=e.dom;Ve(t,((e,t)=>{ln(n,t,e)}))},fn=(e,t)=>{const n=e.dom,o=window.getComputedStyle(n).getPropertyValue(t);return""!==o||cn(e)?o:pn(n,t)},pn=(e,t)=>sn(e)?e.style.getPropertyValue(t):"",mn=(e,t)=>{const n=n=>{const o=t(n);if(o<=0||null===o){const t=fn(n,e);return parseFloat(t)||0}return o},o=(e,t)=>Ue(t,((t,n)=>{const o=fn(e,n),r=void 0===o?0:parseInt(o,10);return isNaN(r)?t:t+r}),0);return{set:(t,n)=>{if(!ge(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);const o=t.dom;sn(o)&&(o.style[e]=n+"px")},get:n,getOuter:n,aggregate:o,max:(e,t,n)=>{const r=o(e,n);return t>r?t-r:0}}},hn=mn("height",(e=>{const t=e.dom;return cn(e)?t.getBoundingClientRect().height:t.offsetHeight})),vn=e=>hn.get(e),_n=e=>hn.getOuter(e),gn=mn("width",(e=>{const t=e.dom;return cn(e)?t.getBoundingClientRect().width:t.offsetWidth})),yn=e=>gn.getOuter(e),bn=(e,t)=>({left:e,top:t,translate:(n,o)=>bn(e+n,t+o)}),wn=bn,xn=(e,t)=>void 0!==e?e:void 0!==t?t:0,Cn=e=>{const t=e.dom.ownerDocument,n=t.body,o=t.defaultView,r=t.documentElement;if(n===e.dom)return wn(n.offsetLeft,n.offsetTop);const i=xn(o?.pageYOffset,r.scrollTop),a=xn(o?.pageXOffset,r.scrollLeft),s=xn(r.clientTop,n.clientTop),c=xn(r.clientLeft,n.clientLeft);return En(e).translate(a-c,i-s)},En=e=>{const t=e.dom,n=t.ownerDocument.body;return n===t?wn(n.offsetLeft,n.offsetTop):cn(e)?(e=>{const t=e.getBoundingClientRect();return wn(t.left,t.top)})(t):wn(0,0)},Sn=e=>{const t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,o=t.body.scrollTop||t.documentElement.scrollTop;return wn(n,o)};var Tn=(e,t,n,o,r)=>e(n,o)?ke.some(n):_e(r)&&r(n)?ke.none():t(n,o,r);const Mn=(e,t,n)=>{let o=e.dom;const r=_e(n)?n:Te;for(;o.parentNode;){o=o.parentNode;const e=Wt(o);if(t(e))return ke.some(e);if(r(e))break}return ke.none()},kn=(e,t,n)=>Mn(e,(e=>Bt(e,t)),n),On=(e,t)=>(e=>void 0!==e.dom.classList)(e)&&e.dom.classList.contains(t),Pn=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return $t(n)?[]:Re(n.querySelectorAll(e),Wt)})(t,e),Dn=e=>{const t=void 0===e?window:e;return It().browser.isFirefox()?ke.none():ke.from(t.visualViewport)},An=(e,t,n,o)=>({x:e,y:t,width:n,height:o,right:e+n,bottom:t+o}),Nn=e=>{const t=void 0===e?window:e,n=t.document,o=Sn(Wt(n));return Dn(t).fold((()=>{const e=t.document.documentElement,n=e.clientWidth,r=e.clientHeight;return An(o.left,o.top,n,r)}),(e=>An(Math.max(e.pageLeft,o.left),Math.max(e.pageTop,o.top),e.width,e.height)))};var Rn,Ln,In,Fn,Un=0,Hn=[],Wn=o,Bn=Wn.__b,$n=Wn.__r,jn=Wn.diffed,Kn=Wn.__c,zn=Wn.unmount,Vn=Wn.__;function Yn(e,t){Wn.__h&&Wn.__h(Ln,e,Un||t),Un=0;var n=Ln.__H||(Ln.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function qn(e){return Un=1,Gn(fo,e)}function Gn(e,t,n){var o=Yn(Rn++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):fo(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=Ln,!Ln.u)){var r=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var a=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&o.__c.props===e)&&(!i||i.call(this,e,t,n))};Ln.u=!0;var i=Ln.shouldComponentUpdate,a=Ln.componentWillUpdate;Ln.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}a&&a.call(this,e,t,n)},Ln.shouldComponentUpdate=r}return o.__N||o.__}function Xn(e,t){var n=Yn(Rn++,3);!Wn.__s&&uo(n.__H,t)&&(n.__=e,n.i=t,Ln.__H.__h.push(n))}function Zn(e,t){var n=Yn(Rn++,4);!Wn.__s&&uo(n.__H,t)&&(n.__=e,n.i=t,Ln.__h.push(n))}function Qn(e){return Un=5,eo((function(){return{current:e}}),[])}function Jn(e,t,n){Un=6,Zn((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function eo(e,t){var n=Yn(Rn++,7);return uo(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function to(e,t){return Un=8,eo((function(){return e}),t)}function no(e){var t=Ln.context[e.__c],n=Yn(Rn++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Ln)),t.props.value):e.__}function oo(e,t){Wn.useDebugValue&&Wn.useDebugValue(t?t(e):e)}function ro(){var e=Yn(Rn++,11);if(!e.__){for(var t=Ln.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function io(){for(var e;e=Hn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(co),e.__H.__h.forEach(lo),e.__H.__h=[]}catch(t){e.__H.__h=[],Wn.__e(t,e.__v)}}Wn.__b=function(e){Ln=null,Bn&&Bn(e)},Wn.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Vn&&Vn(e,t)},Wn.__r=function(e){$n&&$n(e),Rn=0;var t=(Ln=e.__c).__H;t&&(In===Ln?(t.__h=[],Ln.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(co),t.__h.forEach(lo),t.__h=[],Rn=0)),In=Ln},Wn.diffed=function(e){jn&&jn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Hn.push(t)&&Fn===Wn.requestAnimationFrame||((Fn=Wn.requestAnimationFrame)||so)(io)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),In=Ln=null},Wn.__c=function(e,t){t.some((function(e){try{e.__h.forEach(co),e.__h=e.__h.filter((function(e){return!e.__||lo(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Wn.__e(n,e.__v)}})),Kn&&Kn(e,t)},Wn.unmount=function(e){zn&&zn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{co(e)}catch(e){t=e}})),n.__H=void 0,t&&Wn.__e(t,n.__v))};var ao="function"==typeof requestAnimationFrame;function so(e){var t,n=function(){clearTimeout(o),ao&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);ao&&(t=requestAnimationFrame(n))}function co(e){var t=Ln,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Ln=t}function lo(e){var t=Ln;e.__c=e.__(),Ln=t}function uo(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function fo(e,t){return"function"==typeof t?t(e):t}function po(e,t={}){let[,n]=qn({}),[o]=qn(e.get());return Xn((()=>{o!==e.get()&&n({})}),[]),Xn((()=>{let o,r,i,a=()=>{o||(o=1,r=setTimeout((()=>{o=void 0,n({})})))};return i=t.keys?function(e,t,n){let o=new Set([...t,void 0]);return e.listen(((e,t,r)=>{o.has(r)&&n(e,t,r)}))}(e,t.keys,a):e.listen(a),()=>{i(),clearTimeout(r)}}),[e,""+t.keys]),e.get()}function mo(e,t){for(var n in t)e[n]=t[n];return e}function ho(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function vo(e,t){this.props=e,this.context=t}function _o(e,t){function n(e){var n=this.props.ref,o=n==e.ref;return!o&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!o:ho(this.props,e)}function o(t){return this.shouldComponentUpdate=n,y(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(vo.prototype=new C).isPureReactComponent=!0,vo.prototype.shouldComponentUpdate=function(e,t){return ho(this.props,e)||ho(this.state,t)};var go=o.__b;o.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),go&&go(e)};var yo="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function bo(e){function t(t){var n=mo({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=yo,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var wo=function(e,t){return null==e?null:P(P(e).map(t))},xo={map:wo,forEach:wo,count:function(e){return e?P(e).length:0},only:function(e){var t=P(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:P},Co=o.__e;o.__e=function(e,t,n,o){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);Co(e,t,n,o)};var Eo=o.unmount;function So(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=mo({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return So(e,t,n)}))),e}function To(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return To(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Mo(){this.__u=0,this.t=null,this.__b=null}function ko(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Oo(e){var t,n,o;function r(r){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return y(n,r)}return r.displayName="Lazy",r.__f=!0,r}function Po(){this.u=null,this.o=null}o.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Eo&&Eo(e)},(Mo.prototype=new C).__c=function(e,t){var n=t.__c,o=this;null==o.t&&(o.t=[]),o.t.push(n);var r=ko(o.__v),i=!1,a=function(){i||(i=!0,n.__R=null,r?r(s):s())};n.__R=a;var s=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=To(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.t.pop();)t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},Mo.prototype.componentWillUnmount=function(){this.t=[]},Mo.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=So(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&y(x,null,e.fallback);return r&&(r.__u&=-33),[y(x,null,t.__a?null:e.children),r]};var Do=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function Ao(e){return this.getChildContext=function(){return e.context},e.children}function No(e){var t=this,n=e.i;t.componentWillUnmount=function(){B(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],contains:function(){return!0},appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),B(y(Ao,{context:t.context},e.__v),t.l)}function Ro(e,t){var n=y(No,{__v:e,i:t});return n.containerInfo=t,n}(Po.prototype=new C).__a=function(e){var t=this,n=ko(t.__v),o=t.o.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),Do(t,e,o)):r()};n?n(i):i()}},Po.prototype.render=function(e){this.u=null,this.o=new Map;var t=P(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},Po.prototype.componentDidUpdate=Po.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Do(e,n,t)}))};var Lo="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Io=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Fo=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Uo=/[A-Z0-9]/g,Ho="undefined"!=typeof document,Wo=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function Bo(e,t,n){return null==t.__k&&(t.textContent=""),B(e,t),"function"==typeof n&&n(),e?e.__c:null}function $o(e,t,n){return $(e,t),"function"==typeof n&&n(),e?e.__c:null}C.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(C.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var jo=o.event;function Ko(){}function zo(){return this.cancelBubble}function Vo(){return this.defaultPrevented}o.event=function(e){return jo&&(e=jo(e)),e.persist=Ko,e.isPropagationStopped=zo,e.isDefaultPrevented=Vo,e.nativeEvent=e};var Yo,qo={enumerable:!1,configurable:!0,get:function(){return this.class}},Go=o.vnode;o.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={};for(var r in t){var i=t[r];if(!("value"===r&&"defaultValue"in t&&null==i||Ho&&"children"===r&&"noscript"===n||"class"===r||"className"===r)){var a=r.toLowerCase();"defaultValue"===r&&"value"in t&&null==t.value?r="value":"download"===r&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?r="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Wo(t.type)?"onfocus"===a?r="onfocusin":"onblur"===a?r="onfocusout":Fo.test(r)?r=a:-1===n.indexOf("-")&&Io.test(r)?r=r.replace(Uo,"-$&").toLowerCase():null===i&&(i=void 0):a=r="oninput","oninput"===a&&o[r=a]&&(r="oninputCapture"),o[r]=i}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=P(t.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=P(t.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",qo)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=Lo,Go&&Go(e)};var Xo=o.__r;o.__r=function(e){Xo&&Xo(e),Yo=e.__c};var Zo=o.diffed;o.diffed=function(e){Zo&&Zo(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),Yo=null};var Qo={ReactCurrentDispatcher:{current:{readContext:function(e){return Yo.__n[e.__c].props.value},useCallback:to,useContext:no,useDebugValue:oo,useDeferredValue:ur,useEffect:Xn,useId:ro,useImperativeHandle:Jn,useInsertionEffect:fr,useLayoutEffect:Zn,useMemo:eo,useReducer:Gn,useRef:Qn,useState:qn,useSyncExternalStore:mr,useTransition:dr}}};function Jo(e){return y.bind(null,e)}function er(e){return!!e&&e.$$typeof===Lo}function tr(e){return er(e)&&e.type===x}function nr(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function or(e){return er(e)?j.apply(null,arguments):e}function rr(e){return!!e.__k&&(B(null,e),!0)}function ir(e){return e&&(e.base||1===e.nodeType&&e)||null}var ar=function(e,t){return e(t)},sr=function(e,t){return e(t)},cr=x;function lr(e){e()}function ur(e){return e}function dr(){return[!1,lr]}var fr=Zn,pr=er;function mr(e,t){var n=t(),o=qn({h:{__:n,v:t}}),r=o[0].h,i=o[1];return Zn((function(){r.__=n,r.v=t,hr(r)&&i({h:r})}),[e,n,t]),Xn((function(){return hr(r)&&i({h:r}),e((function(){hr(r)&&i({h:r})}))}),[e]),n}function hr(e){var t,n,o=e.v,r=e.__;try{var i=o();return!((t=r)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var vr={useState:qn,useId:ro,useReducer:Gn,useEffect:Xn,useLayoutEffect:Zn,useInsertionEffect:fr,useTransition:dr,useDeferredValue:ur,useSyncExternalStore:mr,startTransition:lr,useRef:Qn,useImperativeHandle:Jn,useMemo:eo,useCallback:to,useContext:no,useDebugValue:oo,version:"17.0.2",Children:xo,render:Bo,hydrate:$o,unmountComponentAtNode:rr,createPortal:Ro,createElement:y,createContext:K,createFactory:Jo,cloneElement:or,createRef:w,Fragment:x,isValidElement:er,isElement:pr,isFragment:tr,isMemo:nr,findDOMNode:ir,Component:C,PureComponent:vo,memo:_o,forwardRef:bo,flushSync:sr,unstable_batchedUpdates:ar,StrictMode:cr,Suspense:Mo,SuspenseList:Po,lazy:Oo,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Qo},_r=Object.freeze({__proto__:null,Children:xo,Component:C,Fragment:x,PureComponent:vo,StrictMode:cr,Suspense:Mo,SuspenseList:Po,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Qo,cloneElement:or,createContext:K,createElement:y,createFactory:Jo,createPortal:Ro,createRef:w,default:vr,findDOMNode:ir,flushSync:sr,forwardRef:bo,hydrate:$o,isElement:pr,isFragment:tr,isMemo:nr,isValidElement:er,lazy:Oo,memo:_o,render:Bo,startTransition:lr,unmountComponentAtNode:rr,unstable_batchedUpdates:ar,useCallback:to,useContext:no,useDebugValue:oo,useDeferredValue:ur,useEffect:Xn,useErrorBoundary:function(e){var t=Yn(Rn++,10),n=qn();return t.__=e,Ln.componentDidCatch||(Ln.componentDidCatch=function(e,o){t.__&&t.__(e,o),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:ro,useImperativeHandle:Jn,useInsertionEffect:fr,useLayoutEffect:Zn,useMemo:eo,useReducer:Gn,useRef:Qn,useState:qn,useSyncExternalStore:mr,useTransition:dr,version:"17.0.2"}),gr=Object.defineProperty,yr=(e,t,n)=>((e,t,n)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const br=e=>t=>typeof t===e,wr=e=>void 0===e,xr=e=>!(e=>null==e)(e),Cr=br("function"),Er=br("number"),Sr=()=>{},Tr=e=>()=>e,Mr=Tr(!1),kr=Tr(!0),Or=class e{constructor(e,t){yr(this,"tag"),yr(this,"value"),this.tag=e,this.value=t}static some(t){return new e(!0,t)}static none(){return e.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?e.some(t(this.value)):e.none()}bind(t){return this.tag?t(this.value):e.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(t){return!this.tag||t(this.value)?this:e.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(e??"Called getOrDie on None")}static from(t){return xr(t)?e.some(t):e.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}};yr(Or,"singletonNone",new Or(!1));let Pr=Or;const Dr=Array.prototype.slice,Ar=(e,t)=>{for(let n=0,o=e.length;n<o;n++)if(t(e[n],n))return!0;return!1},Nr=(e,t)=>{const n=[];for(let o=0,r=e.length;o<r;o++){const r=e[o];t(r,o)&&n.push(r)}return n},Rr=(e,t)=>((e,t,n)=>{for(let o=0,r=e.length;o<r;o++){const r=e[o];if(t(r,o))return Pr.some(r);if(n(r,o))break}return Pr.none()})(e,t,Mr),Lr=(e,t)=>{for(let n=0,o=e.length;n<o;n++)if(t(e[n],n))return Pr.some(n);return Pr.none()},Ir=e=>{const t=Dr.call(e,0);return t.reverse(),t},Fr=Object.keys;typeof window<"u"?window:Function("return this;")();const Ur=(e,t)=>e?Pr.some(t):Pr.none(),Hr=e=>e.length>0,Wr=(e,t)=>wr(t)?e:((e,t,n)=>{const o=Nr(((e,t)=>{const n=[];return((e,t)=>{const n=Fr(e);for(let o=0,r=n.length;o<r;o++){const r=n[o];t(e[r],r)}})(e,((e,o)=>{n.push(t(e,o))})),n})(n,((e,n)=>e?`${t}--${n}`:"")),Hr);return[t,...o].join(" ")})(0,e,t),Br=(e,t)=>{switch(e){case"primary":default:return Wr("tox-button",t);case"secondary":return Wr("tox-button",{secondary:!0,...t});case"outlined":return Wr("tox-button",{"secondary--outline":!0,...t});case"naked":return Wr("tox-button",{naked:!0,...t})}},$r=bo((({children:e,type:t="button",variant:n="primary",active:o=!1,className:r,...i},a)=>V("button",{type:t,className:`${Br(n,{enabled:o})} ${r??""}`,ref:a,...i,children:e}))),jr={unit:"rows",value:1},Kr={unit:"rows",value:4};bo((({maxHeight:e=Kr,minHeight:t=jr,className:n,value:o,onChange:r,...i},a)=>{const s=Qn(null),[c,l]=qn(1);Zn((()=>{s.current&&l((e=>{const t=e.rows,n=e.value;e.value="",e.rows=1;const o=e.scrollHeight;return e.rows=t,e.value=n,o})(s.current))}),[]);const u=eo((()=>(({minHeight:e,singleRowHeight:t})=>{if("rows"===e.unit)return Math.max(e.value,1);const n=Math.ceil(e.value/t);return Math.max(n,1)})({minHeight:t,singleRowHeight:c})),[t,c]),d=eo((()=>(({maxHeight:e,singleRowHeight:t})=>{if("rows"===e.unit)return Math.max(e.value,1);const n=Math.floor(e.value/t);return Math.max(n,1)})({maxHeight:e,singleRowHeight:c})),[e,c]);return Zn((()=>{s.current&&(({minRows:e,maxRows:t,singleRowHeight:n,textarea:o})=>{o.rows=e;const{scrollHeight:r}=o,i=Math.min(Math.max(e,Math.ceil(r/n)),t);o.rows=i})({textarea:s.current,minRows:u,maxRows:d,singleRowHeight:c})}),[o,u,d,c]),V("textarea",{...i,className:`${Wr("tox-textarea")} ${n??""}`,value:o,onChange:e=>{r&&r(e.target.value)},ref:e=>{s.current=e,a&&("function"==typeof a?a(e):xr(a)&&(a.current=e))}})}));const zr=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},Vr=zr,Yr=(e,t)=>{const n=e.dom;if(1!==n.nodeType)return!1;{const e=n;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},qr=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Gr=(e,t)=>e.dom===t.dom,Xr=e=>t=>(e=>e.dom.nodeType)(t)===e,Zr=Xr(3),Qr=Xr(11),Jr=e=>(e=>{const t=e.dom.childNodes;return Pr.from(t[0]).map(Vr)})(e),ei=e=>Vr(e.dom.getRootNode()),ti=e=>Vr(e.dom.host),ni=(e,t=!1)=>e.dom.focus({preventScroll:t}),oi=e=>void 0!==e.style&&Cr(e.style.getPropertyValue),ri=e=>{const t=Zr(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return(e=>{const t=ei(e);return(e=>Qr(e)&&xr(e.dom.host))(t)?Pr.some(t):Pr.none()})(Vr(t)).fold((()=>n.body.contains(t)),((e,t)=>n=>e(t(n)))(ri,ti))},ii=(e,t)=>{const n=e.dom,o=window.getComputedStyle(n).getPropertyValue(t);return""!==o||ri(e)?o:ai(n,t)},ai=(e,t)=>oi(e)?e.style.getPropertyValue(t):"",si=(e=>{const t=t=>{const n=(e=>{const t=e.dom;return ri(e)?t.getBoundingClientRect().height:t.offsetHeight})(t);if(n<=0||null===n){const n=ii(t,e);return parseFloat(n)||0}return n},n=(e,t)=>((t,n,o)=>(((e,t)=>{for(let n=0,o=e.length;n<o;n++)t(e[n],n)})(t,((t,n)=>{o=((t,n)=>{const o=ii(e,n),r=void 0===o?0:parseInt(o,10);return isNaN(r)?t:t+r})(o,t)})),o))(t,0,0);return{set:(t,n)=>{if(!Er(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);const o=t.dom;oi(o)&&(o.style[e]=n+"px")},get:t,getOuter:t,aggregate:n,max:(e,t,o)=>{const r=n(e,o);return t>r?t-r:0}}})("height"),ci=e=>!(e=>e.offsetWidth<=0&&e.offsetHeight<=0)(e.dom),li=(e,t)=>n=>"rtl"===ui(n)?t:e,ui=e=>"rtl"===ii(e,"direction")?"rtl":"ltr",di=(e,t,n)=>((e,t,n)=>{let o=e.dom;const r=Cr(n)?n:Mr;for(;o.parentNode;){o=o.parentNode;const e=Vr(o);if(t(e))return Pr.some(e);if(r(e))break}return Pr.none()})(e,(e=>Yr(e,t)),n),fi=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return qr(n)?Pr.none():Pr.from(n.querySelector(e)).map(Vr)})(t,e),pi=(e,t,n)=>((e,t,n,o,r)=>((e,t)=>Yr(e,t))(n,o)?Pr.some(n):Cr(r)&&r(n)?Pr.none():t(n,o,r))(0,di,e,t,n),mi=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return qr(n)?[]:((e,t)=>{const n=e.length,o=new Array(n);for(let r=0;r<n;r++){const n=e[r];o[r]=t(n,r)}return o})(n.querySelectorAll(e),Vr)})(t,e),hi=e=>(t,n,o)=>{const r=e(t);return gi(r,t,n,o)},vi=(e,t)=>{const n=li(e,t);return hi(n)},_i=(e,t)=>{const n=li(t,e);return hi(n)},gi=(e,t,n,o)=>o.focusManager.get(t).bind((n=>e(t,n,o))).map((e=>(o.focusManager.set(t,e),!0))),yi=(e,t,n,o,r)=>{const i=(e,t,n)=>r(e,t,o,0,n.length-1,n[t],(t=>(e=>"button"===(e=>e.dom.nodeName.toLowerCase())(e)&&"disabled"===(e=>{const t=e.dom.getAttribute("disabled");return null===t?void 0:t})(e))(n[t])?i(e,t,n):Pr.from(n[t])));return((e,t,n)=>{const o=mi(e,n);return((e,t)=>Lr(e,t).map((t=>({index:t,candidates:e}))))(Nr(o,ci),(e=>Gr(e,t)))})(e,n,t).bind((e=>{const t=e.index,n=e.candidates;return i(t,t,n)}))},bi=(e,t,n,o)=>yi(e,t,n,o,((e,t,n,o,r,i,a)=>{const s=((e,t,n)=>Math.min(Math.max(e,t),n))(t+n,o,r);return s===e?Pr.from(i):a(s)})),wi=(e,t,n,o)=>yi(e,t,n,o,((e,t,n,o,r,i,a)=>{const s=((e,t,n,o)=>{const r=e+t;return r>o?n:r<n?o:r})(t,n,o,r);return s===e?Pr.none():a(s)})),xi=()=>({get:e=>(e=>((e=(()=>Vr(document))())=>Pr.from(e.dom.activeElement).map(Vr))(ei(e)).filter((t=>e.dom.contains(t.dom))))(e),set:(e,t)=>{t.dom.focus()}});var Ci=(e=>(e.OnFocusMode="onFocus",e))(Ci||{});const Ei=e=>t=>Ar(e,(e=>e.code===t.code||e.key===t.key||e.which===t.which)),Si=e=>t=>((e,t)=>{for(let n=0,o=e.length;n<o;++n)if(!0!==t(e[n]))return!1;return!0})(e,(e=>e(t))),Ti=e=>!0===e.shiftKey,Mi=e=>!Ti(e),ki=(e,t)=>({matches:e,classification:t}),Oi=(e,t,n,o)=>{const r={...e,focusManager:xi(),focusInside:Ci.OnFocusMode,focusIn:o},i=(e,t,n)=>((e,t)=>Rr(e,(e=>e.matches(t))).map((e=>e.classification)))(n(e,t,r),t).bind((n=>n(e,t,r)));return{handleKeydown:(e,n)=>i(e,n,t).each((e=>{n.preventDefault(),n.stopPropagation()})),handleKeyup:(e,t)=>i(e,t,n).each((()=>{t.preventDefault(),t.stopPropagation()})),handleFocus:(e,t)=>{o(r).each((n=>{n(e,r),t.preventDefault(),t.stopPropagation()}))}}},Pi=Object.freeze(Object.defineProperty({__proto__:null,typical:Oi},Symbol.toStringTag,{value:"Module"})),Di=[{code:"Tab",key:"Tab",which:9}],Ai=[{code:"Enter",key:"Enter",which:13}],Ni=[{code:"ArrowLeft",key:"ArrowLeft",which:37}],Ri=[{code:"ArrowUp",key:"ArrowUp",which:38}],Li=[{code:"ArrowRight",key:"ArrowRight",which:39}],Ii=[{code:"ArrowDown",key:"ArrowDown",which:40}],Fi=[{code:"Space",key:" ",which:32}],Ui=[{code:"Escape",key:"Escape",which:27}],Hi=(e,t)=>{const n=(e,t)=>t.closest?t.focusManager.get(e).bind((e=>pi(e,t.selector))):t.focusManager.get(e),o=(e,t,o)=>n(e,o).bind((e=>o.execute(e))),r=(e,t,o)=>n(e,o).bind((e=>o.escape(e))),i=(e,t)=>{fi(e,t.selector).each((n=>{t.focusManager.set(e,n)}))},a=e=>(t,n,o)=>(o.cycles?wi:bi)(t,o.selector,n,e),s=a(-1),c=a(1),l=e=>(t,n,o)=>e(t,n,o),u=Tr([]),d={execute:e=>(e.dom.click(),Pr.some(!0)),escape:Tr(Pr.none()),allowVertical:!0,allowHorizontal:!0,cycles:!0,focusIn:!1,closest:!0,...t},f=Oi(d,((e,t,n)=>{const i=[...n.allowHorizontal?Ni:[]].concat(n.allowVertical?Ri:[]),a=[...n.allowHorizontal?Li:[]].concat(n.allowVertical?Ii:[]);return[ki(Ei(i),l(vi(s,c))),ki(Ei(a),l(_i(s,c))),ki(Ei(Ai),o),ki(Ei(Fi),o),ki(Ei(Ui),r)]}),u,(()=>Ur(d.focusIn,i)));return{keydown:t=>f.handleKeydown(e,t),keyup:t=>f.handleKeyup(e,t),focus:t=>f.handleFocus(e,t)}},Wi=Object.freeze(Object.defineProperty({__proto__:null,create:Hi},Symbol.toStringTag,{value:"Module"})),Bi=(e,t)=>{const n=e=>()=>Cr(e)?(e(),Pr.some(!0)):Pr.none(),o={onSpace:n(t.onSpace),onEnter:n(t.onEnter),onShiftEnter:n(t.onShiftEnter),onTab:n(t.onTab),onShiftTab:n(t.onShiftTab),onLeft:n(t.onLeft),onRight:n(t.onRight),onUp:n(t.onUp),onDown:n(t.onDown),onEscape:n(t.onEscape)},r=Oi(o,((e,t,n)=>[ki(Si([Ti,Ei(Ai)]),n.onShiftEnter),ki(Si([Mi,Ei(Ai)]),n.onEnter),ki(Si([Ti,Ei(Di)]),n.onShiftTab),ki(Si([Mi,Ei(Di)]),n.onTab),ki(Ei(Ri),n.onUp),ki(Ei(Ii),n.onDown),ki(Ei(Ni),n.onLeft),ki(Ei(Li),n.onRight),ki(Ei(Fi),n.onSpace)]),((e,t,n)=>[ki(Ei(Ui),n.onEscape)]),(()=>Pr.none()));return{keydown:t=>r.handleKeydown(e,t),keyup:t=>r.handleKeyup(e,t),focus:t=>r.handleFocus(e,t)}},$i=Object.freeze(Object.defineProperty({__proto__:null,create:Bi,toBeHandled:e=>Ar([Si([Mi,Ei(Ai)]),Si([Ti,Ei(Ai)]),Si([Ti,Ei(Di)]),Si([Mi,Ei(Di)]),Ei(Ri),Ei(Ii),Ei(Ni),Ei(Li),Ei(Fi)],(t=>t(e)))},Symbol.toStringTag,{value:"Module"})),ji=(e,t,n)=>{const o=Ir(e.slice(0,t)),r=Ir(e.slice(t+1));return Rr(o.concat(r),n)},Ki=(e,t,n)=>{const o=Ir(e.slice(0,t));return Rr(o,n)},zi=(e,t,n)=>{const o=e.slice(0,t),r=e.slice(t+1);return Rr(r.concat(o),n)},Vi=(e,t,n)=>{const o=e.slice(t+1);return Rr(o,n)},Yi=(e,t)=>t.closest?t.focusManager.get(e).bind((e=>pi(e,t.selector))):t.focusManager.get(e),qi=(e,t)=>{((e,t)=>{const n=mi(e,t.selector),o=Nr(n,(e=>(e=>(e=>si.get(e))(e)>0)(e)));return Pr.from(o[t.firstTabstop])})(e,t).each((n=>t.focusManager.set(e,n)))},Gi=(e,t,n,o)=>{const r=mi(e,n.selector);return Yi(e,n).bind((t=>Lr(r,function(e,...t){return(...n)=>{const o=t.concat(n);return e.apply(null,o)}}(Gr,t)).bind((t=>((e,t,n,o,r)=>r(t,n,(e=>((e,t)=>e.useTabstopAt(t))(o,e))).fold((()=>o.cyclic?Pr.some(!0):Pr.none()),(t=>(o.focusManager.set(e,t),Pr.some(!0)))))(e,r,t,n,o)))))},Xi=(e,t,n)=>{const o=n.cyclic?ji:Ki;return Gi(e,0,n,o)},Zi=(e,t,n)=>{const o=n.cyclic?zi:Vi;return Gi(e,0,n,o)},Qi=(e,t,n)=>Yi(e,n).bind((e=>n.execute(e))),Ji=Tr([ki(Si([Ti,Ei(Di)]),Xi),ki(Ei(Di),Zi),ki(Ei(Ai),Qi),ki(Ei(Fi),Qi),ki(Ei(Ui),((e,t,n)=>Yi(e,n).bind((e=>n.escape(e)))))]),ea=Tr([ki(Ei(Di),((e,t,n)=>Yi(e,n).filter((e=>!n.useTabstopAt(e))).bind((o=>((e=>(e=>(e=>Pr.from(e.dom.parentNode).map(Vr))(e))(e).bind(Jr).exists((t=>Gr(t,e))))(o)?Xi:Zi)(e,t,n)))))]),ta=(e,t)=>{const n={execute:Tr(Pr.none()),escape:Tr(Pr.none()),firstTabstop:0,useTabstopAt:kr,cyclic:!0,focusIn:!1,closest:!0,...t},o=Oi(n,Ji,ea,(()=>Ur(n.focusIn,qi)));return{keydown:t=>o.handleKeydown(e,t),keyup:t=>o.handleKeyup(e,t),focus:t=>o.handleFocus(e,t)}},na=Object.freeze(Object.defineProperty({__proto__:null,create:ta},Symbol.toStringTag,{value:"Module"})),oa=(e,t)=>(null==e||e.addEventListener("keydown",t.keydown),null==e||e.addEventListener("keyup",t.keyup),null==e||e.addEventListener("focus",t.focus),()=>{null==e||e.removeEventListener("keydown",t.keydown),null==e||e.removeEventListener("keyup",t.keyup),null==e||e.removeEventListener("focus",t.focus)}),ra=Object.freeze(Object.defineProperty({__proto__:null,useFlowKeyNavigation:e=>{Xn((()=>{const{containerRef:t}=e;if(t.current){const n=Hi(Vr(t.current),e);return oa(t.current,n)}return Sr}),[])},useSpecialKeyNavigation:e=>{Xn((()=>{const{containerRef:t}=e;if(t.current){const n=Bi(Vr(t.current),e);return oa(t.current,n)}return Sr}),[e])},useTabKeyNavigation:e=>{Xn((()=>{const{containerRef:t}=e;if(t.current){const n=ta(Vr(t.current),e);return oa(t.current,n)}return Sr}),[])}},Symbol.toStringTag,{value:"Module"}));K(null);const ia=K(null),aa=e=>`translate3d(${e.x}px, ${e.y}px, 0px)`,sa=e=>"x"in e?{top:`${e.y}px`,left:`${e.x}px`}:e,ca=(e,t)=>t.fold(Tr(e),(({width:t,height:n})=>({top:`min(${e.top}, calc(100% - ${n}))`,left:`min(${e.left}, calc(100% - ${t}))`})));bo((({children:e,style:t,initialPosition:n={top:0,left:0},declaredSize:o,...r},i)=>{const[a,s]=qn({x:0,y:0}),[c,l]=qn(n),[u,d]=qn(!1),f=Qn(null),p=((e,t,n,o)=>n?{transform:aa(e),...ca(sa(t),o)}:ca(sa(t),o))(a,c,u,Pr.from(o)),m=eo((()=>({setShift:s,draggableRef:f,isDragging:u,setIsDragging:d,setPosition:l})),[u]),h=to((e=>{"function"==typeof i?i(e):i&&(i.current=e),f.current=e}),[i]);return V(ia.Provider,{value:m,children:V("div",{ref:h,style:{...t,...p},...r,children:e})})}));const la=Object.freeze(Object.defineProperty({__proto__:null,FlowType:Wi,KeyingType:Pi,SpecialType:$i,TabbingType:na},Symbol.toStringTag,{value:"Module"})),ua=Object.freeze(Object.defineProperty({__proto__:null,focusAncestor:(e,t)=>di(e,t).each(ni),focusDescendant:(e,t)=>fi(e,t).each(ni)},Symbol.toStringTag,{value:"Module"})),da=()=>(new Date).toISOString(),fa=36e5,pa=864e5,ma=6048e5,ha=24192e5,va=290304e5;var _a;!function(e){e[e.LessThanMinute=0]="LessThanMinute",e[e.Minute=1]="Minute",e[e.Hour=2]="Hour",e[e.Day=3]="Day",e[e.Week=4]="Week",e[e.Month=5]="Month",e[e.Year=6]="Year"}(_a||(_a={}));const ga=Ce(((e,t)=>{const n=e()-Date.parse(t);return n<6e4?{interval:_a.LessThanMinute,intervalUnits:n,intervalMs:n}:n<fa?{interval:_a.Minute,intervalUnits:Math.floor(n/6e4),intervalMs:n}:n<pa?{interval:_a.Hour,intervalUnits:Math.floor(n/fa),intervalMs:n}:n<ma?{interval:_a.Day,intervalUnits:Math.floor(n/pa),intervalMs:n}:n<ha?{interval:_a.Week,intervalUnits:Math.floor(n/ma),intervalMs:n}:n<va?{interval:_a.Month,intervalUnits:Math.floor(n/ha),intervalMs:n}:{interval:_a.Year,intervalUnits:Math.floor(n/va),intervalMs:n}}),(()=>Date.now())),ya=be("tinycomments"),ba=be("data-mce-annotation"),wa=be("data-mce-annotation-uid"),xa=be("tmp"),Ca=(e,t)=>Ye(e.annotator.getAll(ya()),t).map((t=>Re(t,(t=>((e,t)=>{const n="SPAN"===t.nodeName;return e.serialize(t,{getInner:n,selection:!0})})(e.serializer,t))).join(" "))).getOr(""),Ea=e=>pt(e,xa()),Sa=(e,t)=>{const n=Wt(t.commonAncestorContainer),o=zt(n)?ke.some(n):(r=n,ke.from(r.dom.parentElement).map(Wt));var r;const i=`[${ba()}="${ya()}"]`,a=o.map((e=>Pn(e,i))).getOr([]),s=(e=>{const t=Oe.call(e,0);return t.reverse(),t})(((t,n)=>((e,t,n)=>Ie(((e,t)=>{const n=_e(t)?t:Te;let o=e.dom;const r=[];for(;null!==o.parentNode&&void 0!==o.parentNode;){const e=o.parentNode,t=Wt(e);if(r.push(t),!0===n(t))break;o=e}return r})(e,n),t))(t,(e=>Bt(e,n)),(t=>t.dom===e.getBody())))(n,i));return Bt(n,i)&&s.push(n),Ie(s.concat(a),(e=>{return!(on(n=e,ba())===ya()&&rn(n,wa()).exists(Ea))&&((e,t)=>e.intersectsNode(t.dom))(t,e);var n}))},Ta=e=>{const t=e.selection.bookmarkManager.getBookmark();Ve(e.annotator.getAll(ya()),((t,n)=>{Ea(n)&&t.forEach((t=>{e.selection.select(t),e.annotator.remove(ya())}))})),e.selection.bookmarkManager.moveToBookmark(t)},Ma=(e,t)=>{Ye(e.annotator.getAll(ya()),t).each((t=>{const n=document.createRange();n.setStartBefore(t[0]),n.setEndAfter(t[t.length-1]),e.selection.setRng(n)}))},ka=e=>Vt(e)&&"hr"===jt(e);const Oa=(e,t)=>(e=>{const t=Wt(e.selection.getNode()),n=Wt(e.selection.getStart());return(e=>{let t=e.selection.getRng().commonAncestorContainer;return 3===t.nodeType&&(t=t.parentNode),!!ve(t)&&e.dom.isEmpty(t)})(e)||ka(t)||ka(n)})(e)||!(e=>{if(e.selection){const t=e.selection.getRng(),n=Sa(e,t);return $e(n).forall((e=>je(n).forall((o=>{const r=on(e,wa());if(Ne(n,(e=>on(e,wa())!==r)))return!1;const i=new window.Range;return i.setStartBefore(e.dom),i.setEndAfter(o.dom),i.compareBoundaryPoints(window.Range.START_TO_START,t)<=0&&i.compareBoundaryPoints(window.Range.END_TO_END,t)>=0}))))}return!1})(e)||!t.get().canWrite,Pa=((e,t)=>((e,t)=>{const n={};return Ve(e,((e,o)=>{const r=t(e,o);n[r.k]=r.v})),n})(e,((e,n)=>({k:n,v:t(e,n)}))))({tc_conversations_title:"Comments",tc_announce_sidebar_available:`Comment. Sidebar available. Press ${It().os.isMacOS()?"\u2318":"Ctrl"} + Alt + M to switch to sidebar`,tc_items_addcomment:"Add comment",tc_items_showcomments:"Show comments",tc_items_deleteall:"Delete all conversations",tc_edit_buttons_save:"Save",tc_edit_buttons_saving:"Saving",tc_edit_buttons_cancel:"Cancel",tc_reply_buttons_comment:"Comment",tc_reply_buttons_clear:"Clear",tc_reply_placeholders:"Add comment...",tc_reply_with_mentions_placeholders:"Comment or mention with @",tc_kebab_tooltip:"Comment Actions",tc_kebab_tooltip_conversation:"Conversation Actions",tc_kebab_delete_conversation:"Delete conversation",tc_kebab_resolve_conversation:"Resolve conversation",tc_kebab_delete:"Delete",tc_kebab_edit:"Edit",tc_edit_problem_comment:"An error occurred editing this comment. See the console for details.",tc_edit_unauthorised_comment:"You are not allowed to edit this comment",tc_delete_buttons_cancel:"Cancel",tc_delete_buttons_proceed:"Delete",tc_resolve_buttons_proceed:"Resolve",tc_resolve_buttons_cancel:"Cancel",tc_create_problem:"An error occurred while creating a comment. See the console for details",tc_reply_problem:"An error occurred while replying to a comment. See the console for details",tc_delete_prompts_conversation:"Delete this conversation?",tc_delete_prompts_conversation_detail_sing:"1 comment will be deleted. You can't undo this action.",tc_delete_prompts_conversation_detail_pl:"{0} comments will be deleted. You can't undo this action.",tc_delete_prompts_all:"Delete all conversations in the content? This cannot be undone.",tc_delete_prompts_comment:"Are you sure you want to delete this comment?",tc_resolve_prompts_conversation:"Resolve this conversation?",tc_resolve_prompts_conversation_detail_sing:"1 comment will be resolved. You can't undo this action.",tc_resolve_prompts_conversation_detail_pl:"{0} comments will be resolved. You can't undo this action.",tc_delete_problem_all:"An error occurred deleting all the conversations. See the console for details.",tc_delete_problem_conversation:"An error occurred deleting the conversation. See the console for details.",tc_delete_problem_comment:"An error occurred deleting the comment. See the console for details.",tc_delete_unauthorised_all:"You are not allowed to delete all the conversations",tc_delete_unauthorised_conversation:"You are not allowed to delete this conversation",tc_delete_unauthorised_comment:"You are not allowed to delete this comment",tc_resolve_unauthorised_conversation:"You are not allowed to resolve this conversation",tc_resolve_problem_conversation:"An error occurred resolving the conversation. See the console for details.",tc_date_less_than_a_minute_ago:"a moment ago",tc_date_1_minute_ago:"1 minute ago",tc_date_x_minutes_ago:"{0} minutes ago",tc_date_1_hour_ago:"1 hour ago",tc_date_x_hours_ago:"{0} hours ago",tc_date_1_day_ago:"1 day ago",tc_date_x_days_ago:"{0} days ago",tc_date_1_week_ago:"1 week ago",tc_date_x_weeks_ago:"{0} weeks ago",tc_date_1_month_ago:"1 month ago",tc_date_x_months_ago:"{0} months ago",tc_date_1_year_ago:"1 year ago",tc_date_x_years_ago:"{0} years ago",tc_date_comment_edited:" (edited)",tc_conversations_one_reply:"1 reply",tc_conversations_multiple_replies:"{0} replies",tc_dialog_delete_conversation:"Delete Conversation",tc_dialog_resolve_conversation:"Resolve Conversation",tc_dialog_delete_comment:"Delete Comment",tc_mentions_no_results:"No users found"},we),Da=(e,t,n)=>{e.notificationManager.open({text:t,type:"error"}),n&&console.error(ue(n)?n:n.message,n)},Aa=(e,t)=>{e.execCommand("tc-delete-conversation-at-cursor",!1,{conversationUid:t})},Na=e=>t=>t.options.get(e),Ra=Na("tinycomments_mentions_enabled"),La=Na("ui_mode"),Ia=Na("disabled"),Fa="tox-button--naked",Ua="tox-button--icon",Ha="tox-icon",Wa="tox-button--kebab",Ba="tox-comment",$a="tox-button",ja="tox-comment__single",Ka="tox-menu",za="tox-collection",Va="tox-collection--list",Ya="tox-collection__group",qa="tox-menu-nav__js",Ga="tox-collection__item-container",Xa="tox-collection__item",Za="tox-collection__item--state-disabled",Qa="tox-sidebar-content",Ja=e=>`.${e}`,es={kebab:Ja(Wa),card:Ja(Ba),comment:Ja(ja)},ts="tox-comment--selected",ns=e=>e.join(" "),os={skeleton:ns(["tox-skeleton"]),skeletonLine:ns(["tox-skeleton__line"]),skeletonCircle:ns(["tox-skeleton__circle"]),conversationsTitle:ns(["tox-sidebar-content__title"]),conversationsHead:ns(["tox-sidebar-content__header"]),outerContainer:ns([Qa]),date:ns(["tox-comment__date"]),replySection:ns(["tox-comment__reply"]),replyTextarea:ns(["tox-textarea"]),textarea:ns([]),editTextarea:ns([]),kebab:ns([Fa,Wa,$a,Ua]),kebabIcon:ns([Ha]),card:ns([Ba]),cardHead:ns(["tox-comment__header"]),cardHeadMeta:ns(["tox-comment__meta"]),cardBody:ns(["tox-comment__body"]),cardOverlay:ns(["tox-comment__overlay"]),cardOverlayText:ns(["tox-comment__overlaytext"]),cardOverlayButtons:ns(["tox-comment__buttonspacing"]),mentionsItem:ns(["tox-mentions-dropdown--menu-item"]),mentionsUser:ns(["tox-mentions-user"]),button:ns([$a]),secondaryButton:ns([$a,"tox-button--secondary"]),editActions:ns(["tox-comment__edit"]),outerScroll:ns(["tox-comment__scroll"]),commentList:ns(["tox-comment-thread"]),comment:ns([ja]),avatar:ns(["tox-user__avatar"]),username:ns(["tox-user__name"]),user:ns(["tox-user"]),showMoreLess:ns([]),kebabItem:ns([Xa]),kebabItemLabel:ns(["tox-collection__item-label"]),kebabDisabledItem:ns([Za]),kebabMenu:ns([Ka,za,Va]),kebabMenuGroup:ns([Ya]),roots:ns([Qa]),mentionsButton:ns([$a,Fa,Ua]),mentionsButtonIcon:ns([Ha]),mentionsDropdownContainer:ns(["tox-autocompleter"]),mentionsDropdownList:ns([Ka,za,Va]),mentionsDropdownGroup:ns([Ya]),mentionsDropdownItem:ns([qa,Xa]),mentionsDropdownItemActive:ns(["tox-collection__item--active"]),mentionsDropdownItemDisabled:ns([qa,Xa,Za]),mentionsDropdownItemRow:ns([Ga,"tox-collection__item-container--row"]),mentionsDropdownItemColumn:ns([Ga,"tox-collection__item-container--column","tox-collection__item-container--align-left","tox-collection__item-container--valign-middle"]),mentionsDropdownItemAvatar:ns(["tox-mentions__avatar"]),mentionsDropdownItemName:ns(["tox-mentions__username"]),mentionsDropdownItemDescription:ns(["tox-mentions__description"])},rs="tox-collection__item--active",is=["#E41B60","#AD1457","#1939EC","#001CB5","#648000","#465B00","#006CE7","#0054B4","#00838F","#006064","#00866F","#004D40","#51742F","#385021","#CF4900","#A84600","#CC0000","#6A1B9A","#9C27B0","#6A00AB","#3041BA","#0A1877","#774433","#452B24","#607D8B","#455A64"],as=({avatarInfo:e})=>{const t=eo((()=>ke.from(e.authorAvatar).getOrThunk((()=>((e,t={size:36})=>((e,t,n)=>"data:image/svg+xml,"+encodeURIComponent(((e,t,n)=>{const o=n/2;return`<svg height="${n}" width="${n}" xmlns="http://www.w3.org/2000/svg"><circle cx="${o}" cy="${o}" r="${o}" fill="${t}"/><text x="50%" y="50%" text-anchor="middle" dominant-baseline="central" fill="#FFF" font-family="sans-serif" font-size="${o}">`+e+"</text></svg>"})(e,t,n)))((e=>{if(Intl.Segmenter){const t=(new Intl.Segmenter).segment(e)[Symbol.iterator]();return`${t.next().value?.segment}`}return e.trim()[0]})(e.name),(e=>{const t=((e,t)=>{let n=5381;for(let t=0;t<e.length;t++)n=(n<<5)+n+e.charCodeAt(t);return(n>>>0)%(t+1)})(e??"",is.length-1);return is[t]})(e.id),t.size))({id:e.author,name:e.authorName})))),[e.authorAvatar,e.author,e.authorName]);return V("div",{class:os.avatar,children:V("img",{alt:"",role:"presentation",src:t})})},ss=K(null),cs=_a,ls={[cs.LessThanMinute]:[Pa.tc_date_less_than_a_minute_ago,Pa.tc_date_less_than_a_minute_ago],[cs.Minute]:[Pa.tc_date_1_minute_ago,Pa.tc_date_x_minutes_ago],[cs.Hour]:[Pa.tc_date_1_hour_ago,Pa.tc_date_x_hours_ago],[cs.Day]:[Pa.tc_date_1_day_ago,Pa.tc_date_x_days_ago],[cs.Week]:[Pa.tc_date_1_week_ago,Pa.tc_date_x_weeks_ago],[cs.Month]:[Pa.tc_date_1_month_ago,Pa.tc_date_x_months_ago],[cs.Year]:[Pa.tc_date_1_year_ago,Pa.tc_date_x_years_ago]},us=(e,t)=>{const n=ls[e.interval],o=1===e.intervalUnits?n[0]:n[1];return t.translate([o,e.intervalUnits])},ds=({details:e})=>{const{universe:t}=no(ss);return V("div",{class:os.user,children:[V(as,{avatarInfo:e}),V("div",{children:[V("div",{class:os.username,children:e.authorName}),V("div",{class:os.date,children:[us(ga(e.createdAt),t),V("span",{children:e.createdAt!==e.modifiedAt&&t.translate(Pa.tc_date_comment_edited)})]})]})]})},fs=e=>13===e.keyCode,ps=e=>32===e.keyCode,ms=()=>V("div",{class:"tox-ring-loader"}),hs=({onClick:e,disabled:t,...n})=>{const{universe:o}=no(ss);return V("button",{...n,type:"button",tabindex:-1,class:os.secondaryButton,style:{width:"100%"},disabled:t,onClick:e,children:o.translate(Pa.tc_reply_placeholders)})},vs=({length:e,...t})=>{const{universe:n}=no(ss);return V("button",{...t,type:"button",tabindex:-1,class:os.secondaryButton,style:{marginTop:"12px"},children:n.translate(2===e?Pa.tc_conversations_one_reply:[Pa.tc_conversations_multiple_replies,e-1])})},_s=({onClick:e,disabled:t,...n})=>{const{universe:o}=no(ss);return V("button",{...n,type:"button",tabindex:-1,class:os.secondaryButton,style:{marginLeft:"auto"},disabled:t,onClick:e,children:o.translate(Pa.tc_edit_buttons_cancel)})},gs=({onClick:e,disabled:t,saving:n,...o})=>{const{universe:r}=no(ss);return V($r,{...o,tabindex:-1,style:{marginLeft:"8px",display:"flex",alignItems:"center",justifyContent:"center"},disabled:t,onClick:e,children:[n&&V(ms,{}),V("span",{style:{marginLeft:"4px"},children:r.translate(n?Pa.tc_edit_buttons_saving:Pa.tc_edit_buttons_save)})]})},ys=K({highlightingId:"",setHighlightingId:ye}),bs=bo((({children:e,classes:t,inlineStyles:n,onMounted:o,onUnmounted:r,onMenuItemHighlighted:i,id:a,onBlur:s},c)=>{const l=Qn(null),[u,d]=qn(""),f=eo((()=>Ie(xo.toArray(e),(e=>{var t;return"TinyMCEMenuItem"===(null===(t=e.props)||void 0===t?void 0:t.InternalComponentName)}))),[e]),p=to((e=>{(e=>{for(let t=0,n=e.length;t<n;t++)if(e[t].props.id===u)return ke.some(t);return ke.none()})(f).map((t=>{const n=((e,t,n,o)=>{const r=e+t;return r>o?0:r<0?o:r})(t,e,0,f.length-1);return f[n]})).each((e=>{d(e.props.id)}))}),[f,u]),m=to((()=>{He(f,(e=>{var t;return(null===(t=e.props)||void 0===t?void 0:t.id)===u&&_e(e.props.onSelect)})).each((e=>{e.props.onSelect()}))}),[f,u]),h=eo((()=>({containerRef:l,selector:"",onDown:()=>{p(1)},onUp:()=>{p(-1)},onTab:()=>{p(1)},onShiftTab:()=>{p(-1)},onEnter:m,onShiftEnter:m,onEscape:ye,onSpace:ye})),[m,p]);return ra.useSpecialKeyNavigation(h),Xn((()=>{const e=He(f,(e=>{var t;return(null===(t=e.props)||void 0===t?void 0:t.id)===u})).orThunk((()=>$e(f))).fold(be(""),(e=>e.props.id));d(e)}),[f]),Jn(c,(()=>l.current),[l.current]),Xn((()=>(_e(o)&&o(),()=>{_e(r)&&r()})),[]),Xn((()=>{i(u)}),[u,i]),V("div",{style:n,className:null==t?void 0:t.container,ref:l,tabIndex:-1,id:a,role:"menu",onBlur:e=>{_e(s)&&s(e)},children:V(ys.Provider,{value:{highlightingId:u,setHighlightingId:d},children:e})})})),ws=({children:e,id:t,onSelect:n,classes:o})=>{const{highlightingId:r,setHighlightingId:i}=no(ys);return V("div",{className:ve(o)?[o.container,r===t?o.highlighted:""].join(" "):void 0,role:"menuitem",onMouseDown:n,onMouseEnter:()=>{i(t)},id:t,children:e})};ws.defaultProps={InternalComponentName:"TinyMCEMenuItem"};const xs=({children:e,container:t})=>null!==e&&null!==t?Ro(e,t):null,Cs=(e,t)=>e.view(t).fold(be([]),(t=>{const n=e.owner(t),o=Cs(e,n);return[t].concat(o)}));var Es=Object.freeze({__proto__:null,owner:e=>(e=>Wt(e.dom.ownerDocument))(e),view:e=>{var t;return(e.dom===document?ke.none():ke.from(null===(t=e.dom.defaultView)||void 0===t?void 0:t.frameElement)).map(Wt)}});const Ss=e=>{const t=Wt(document),n=Sn(t),o=((e,t)=>{const n=t.owner(e),o=Cs(t,n);return ke.some(o)})(e,Es);return o.fold(Ce(Cn,e),(t=>{const o=En(e),r=Fe(t,((e,t)=>{const n=En(t);return{left:e.left+n.left,top:e.top+n.top}}),{left:0,top:0});return wn(r.left+o.left+n.left,r.top+o.top+n.top)}))},Ts=(e,t,n,o)=>({x:e,y:t,width:n,height:o,right:e+n,bottom:t+o}),Ms=()=>Nn(window),ks=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Os=(e,t,n,o=1)=>{const r=e*o,i=t*o,a=e=>Ye(n,e).getOr([]),s=(e,t,n)=>{const o=(r=n,Ie(ks,(e=>!Ae(r,e))));var r;return{offset:wn(e,t),classesOn:We(n,a),classesOff:We(o,a)}};return{southeast:()=>s(-e,t,["top","alignLeft"]),southwest:()=>s(e,t,["top","alignRight"]),south:()=>s(-e/2,t,["top","alignCentre"]),northeast:()=>s(-e,-t,["bottom","alignLeft"]),northwest:()=>s(e,-t,["bottom","alignRight"]),north:()=>s(-e/2,-t,["bottom","alignCentre"]),east:()=>s(e,-t/2,["valignCentre","left"]),west:()=>s(-e,-t/2,["valignCentre","right"]),insetNortheast:()=>s(r,i,["top","alignLeft","inset"]),insetNorthwest:()=>s(-r,i,["top","alignRight","inset"]),insetNorth:()=>s(-r/2,i,["top","alignCentre","inset"]),insetSoutheast:()=>s(r,-i,["bottom","alignLeft","inset"]),insetSouthwest:()=>s(-r,-i,["bottom","alignRight","inset"]),insetSouth:()=>s(-r/2,-i,["bottom","alignCentre","inset"]),insetEast:()=>s(-r,-i/2,["valignCentre","right","inset"]),insetWest:()=>s(r,-i/2,["valignCentre","left","inset"])}},Ps=(e,t,n,o,r,i,a,s=!1)=>({x:e,y:t,bubble:n,direction:o,placement:r,restriction:i,label:`${a}-${r}`,alwaysFit:s}),Ds=Ge([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),As=Ds.southeast,Ns=Ds.southwest,Rs=Ds.northeast,Ls=Ds.northwest,Is=Ds.south,Fs=Ds.north;Ds.east,Ds.west;const Us=(e,t)=>(n=>{const o={};for(let r=0,i=n.length;r<i;r++){const i=n[r];o[String(i)]=Ye(t,i).map((t=>((e,t)=>{switch(t){case 1:return e.x;case 0:return e.x+e.width;case 2:return e.y;case 3:return e.y+e.height}})(e,t)))}return o})(["left","right","top","bottom"]),Hs="layout",Ws=e=>e.x,Bs=(e,t)=>e.x+e.width/2-t.width/2,$s=(e,t)=>e.x+e.width-t.width,js=(e,t)=>e.y-t.height,Ks=e=>e.y+e.height,zs=(e,t,n)=>Ps(Ws(e),Ks(e),n.southeast(),As(),"southeast",Us(e,{left:1,top:3}),Hs),Vs=(e,t,n)=>Ps($s(e,t),Ks(e),n.southwest(),Ns(),"southwest",Us(e,{right:0,top:3}),Hs),Ys=(e,t,n)=>Ps(Ws(e),js(e,t),n.northeast(),Rs(),"northeast",Us(e,{left:1,bottom:2}),Hs),qs=(e,t,n)=>Ps($s(e,t),js(e,t),n.northwest(),Ls(),"northwest",Us(e,{right:0,bottom:2}),Hs),Gs=(e,t,n)=>Ps(Bs(e,t),js(e,t),n.north(),Fs(),"north",Us(e,{bottom:2}),Hs),Xs=(e,t,n)=>Ps(Bs(e,t),Ks(e),n.south(),Is(),"south",Us(e,{top:3}),Hs),Zs=(e,t,n,o,r)=>{const i=e=>e+"px";return{position:e,left:t.map(i),top:n.map(i),right:o.map(i),bottom:r.map(i)}},Qs=Ge([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Js=(e,t,n,o,r,i)=>{const a=t.rect,s=a.x-n,c=a.y-o,l=r-(s+a.width),u=i-(c+a.height),d=ke.some(s),f=ke.some(c),p=ke.some(l),m=ke.some(u),h=ke.none();return v=()=>Zs(e,d,f,h,h),_=()=>Zs(e,h,f,p,h),g=()=>Zs(e,d,h,h,m),y=()=>Zs(e,h,h,p,m),b=()=>Zs(e,d,f,h,h),w=()=>Zs(e,d,h,h,m),x=()=>Zs(e,d,f,h,h),C=()=>Zs(e,h,f,p,h),t.direction.fold(v,_,g,y,b,w,x,C);var v,_,g,y,b,w,x,C},ec=(e,t)=>e.fold((()=>{const e=t.rect;return Zs("absolute",ke.some(e.x),ke.some(e.y),ke.none(),ke.none())}),((e,n,o,r)=>Js("absolute",t,e,n,o,r)),((e,n,o,r)=>Js("fixed",t,e,n,o,r))),tc=(e,t)=>t.fold((()=>e.fold(Ms,Ms,Ts)),(t=>e.fold(be(t),be(t),(()=>{const n=nc(e,t.x,t.y);return Ts(n.left,n.top,t.width,t.height)})))),nc=(e,t,n)=>{const o=wn(t,n);return e.fold(be(o),be(o),(()=>{const e=Sn();return o.translate(-e.left,-e.top)}))},oc=Qs.relative,rc=Qs.fixed,ic=we;var ac;!function(e){e.TopToBottom="toptobottom",e.BottomToTop="bottomtotop"}(ac||(ac={}));const sc=e=>{return((e,t,n)=>Tn(((e,t)=>t(e)),Mn,e,t,n))(e,(e=>Vt(e)&&on(e,"data-alloy-vertical-dir")===ac.BottomToTop),t).isSome();var t},cc=(e,t,n,o,r,i,a)=>{const s=a.map(sc).getOr(!1),c=t.layouts.map((t=>t.onLtr(e))),l=t.layouts.map((t=>t.onRtl(e))),u=s?t.layouts.bind((t=>t.onBottomLtr.map((t=>t(e))))).or(c).getOr(r):c.getOr(n),d=s?t.layouts.bind((t=>t.onBottomRtl.map((t=>t(e))))).or(l).getOr(i):l.getOr(o);var f,p;return(f=u,p=d,e=>"rtl"===(e=>"rtl"===fn(e,"direction")?"rtl":"ltr")(e)?p:f)(e)},lc=(e,t,n)=>{const o=Wt(t.hotspot),r=((e,t)=>{const n=Ce(Ss,t),o=e.fold(n,n,(()=>{const e=Sn();return Ss(t).translate(-e.left,-e.top)})),r=yn(t),i=_n(t);return Ts(o.left,o.top,r,i)})(n,o),i=cc(e,t,[zs,Vs,Ys,qs,Xs,Gs],[Vs,zs,qs,Ys,Xs,Gs],[Ys,qs,zs,Vs,Gs,Xs],[qs,Ys,Vs,zs,Gs,Xs],ke.some(o));return ke.some(ic({anchorBox:r,bubble:t.bubble.getOr(Os(0,0,{})),overrides:t.overrides,layouts:i}))},uc=Ge([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),dc=(e,t,n,o)=>{const r=e.bubble,i=r.offset,a=((e,t,n)=>{const o=(o,r)=>t[o].map((t=>{const i="top"===o||"bottom"===o,a=i?n.top:n.left,s=("left"===o||"top"===o?Math.max:Math.min)(t,r)+a;return i?at(s,e.y,e.bottom):at(s,e.x,e.right)})).getOr(r),r=o("left",e.x),i=o("top",e.y),a=o("right",e.right),s=o("bottom",e.bottom);return Ts(r,i,a-r,s-i)})(o,e.restriction,i),s=e.x+i.left,c=e.y+i.top,l=Ts(s,c,t,n),{originInBounds:u,sizeInBounds:d,visibleW:f,visibleH:p}=((e,t)=>{const{x:n,y:o,right:r,bottom:i}=t,{x:a,y:s,right:c,bottom:l,width:u,height:d}=e;return{originInBounds:a>=n&&a<=r&&s>=o&&s<=i,sizeInBounds:c<=r&&c>=n&&l<=i&&l>=o,visibleW:Math.min(u,a>=n?r-a:c-n),visibleH:Math.min(d,s>=o?i-s:l-o)}})(l,a),m=u&&d,h=m?l:((e,t)=>{const{x:n,y:o,right:r,bottom:i}=t,{x:a,y:s,width:c,height:l}=e,u=Math.max(n,r-c),d=Math.max(o,i-l),f=at(a,n,u),p=at(s,o,d),m=Math.min(f+c,r)-f,h=Math.min(p+l,i)-p;return Ts(f,p,m,h)})(l,a),v=h.width>0&&h.height>0,{maxWidth:_,maxHeight:g}=((e,t,n)=>{const o=be(t.bottom-n.y),r=be(n.bottom-t.y),i=(a=r,s=r,c=o,e.fold(a,a,c,c,a,c,s,s));var a,s,c;const l=be(t.right-n.x),u=be(n.right-t.x),d=((e,t,n,o)=>e.fold(t,o,t,o,n,n,t,o))(e,u,u,l);return{maxWidth:d,maxHeight:i}})(e.direction,h,o),y={rect:h,maxHeight:g,maxWidth:_,direction:e.direction,placement:e.placement,classes:{on:r.classesOn,off:r.classesOff},layout:e.label,testY:c};return m||e.alwaysFit?uc.fit(y):uc.nofit(y,f,p,v)},fc=be(((e,t)=>{((e,t)=>{((e,t)=>{const n=hn.max(e,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);un(e,"max-height",n+"px")})(e,Math.floor(t))})(e,t),dn(e,{"overflow-x":"hidden","overflow-y":"auto"})})),pc=(e,t,n)=>void 0===e[t]?n:e[t],mc=(e,t,n,o)=>((e,t,n,o,r,i)=>{pc(i,"maxHeightFunction",fc()),pc(i,"maxWidthFunction",ye);const a=e.anchorBox,s=e.origin,c={bounds:tc(s,r),origin:s,preference:o},l=((e,t,n,o)=>{const r=(e=>({width:yn(e),height:_n(e)}))(t);return((e,t,n,o,r,i)=>{const a=o.width,s=o.height,c=(t,c,l,u,d)=>{const f=t(n,o,r,e,i),p=dc(f,a,s,i);return p.fold(be(p),((e,t,n,o)=>(d===o?n>u||t>l:!d&&o)?p:uc.nofit(c,l,u,d)))},l=Ue(t,((e,t)=>{const n=Ce(c,t);return e.fold(be(e),n)}),uc.nofit({rect:n,maxHeight:o.height,maxWidth:o.width,direction:As(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:n.y},-1,-1,!1));return l.fold(we,we)})(t,o.preference,e,r,n,o.bounds)})(a,t,n,c);return{layout:l.layout,position:ec(c.origin,l),placement:l.placement,maxHeight:l.maxHeight,maxWidth:l.maxWidth}})(((e,t)=>((e,t)=>({anchorBox:e,origin:t}))(e,t))(t.anchorBox,e),o,t.bubble,t.layouts,n,t.overrides),hc=({text:e})=>V("div",{class:os.mentionsDropdownItemDisabled,style:{padding:"4px"},children:V("div",{class:os.mentionsDropdownItemRow,children:V("div",{class:os.mentionsDropdownItemColumn,children:V("div",{class:os.mentionsDropdownItemName,children:e})})})}),vc={padding:"4px",visibility:"hidden",position:"fixed",width:"100%"},_c=e=>e.map((e=>e.toString())).getOr(""),gc=bo((({onSelect:e,anchorRef:t,users:n,onBlur:o},r)=>{const{sinkRef:i,universe:a,editor:s,containerRef:c}=no(ss),l=Qn(null),u=Qn(ct("mentions-menu")),d=(e=!1)=>{const n=t.current;if(ve(n)){const t=Wt(n);return e?()=>{an(t,"aria-activedescendant"),an(t,"aria-owns")}:e=>{nn(t,"aria-activedescendant",e)}}return ye};Jn(r,(()=>({dropdownRef:l,passKeyboardEvent:e=>{if(ve(l.current)&&ve(e)&&(t=e,la.SpecialType.toBeHandled(t))){e.preventDefault(),e.stopPropagation();const t=new KeyboardEvent(e.type,{key:e.key,code:e.code,charCode:e.charCode,keyCode:e.keyCode,bubbles:!1,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,which:e.which});return l.current.dispatchEvent(t),ke.some(!0)}var t;return ke.none()}})),[]);const f=to((()=>{if(ve(i.current)&&ve(l.current)&&ve(t.current)){const e=Nn(),n=Dn().map((e=>e.pageTop)).getOr(0),o=(e=>{const t=Ss(e),n=yn(e),o=_n(e);return Ts(t.left,t.top,n,o)})(Wt(t.current)),r=Math.min(o.y,e.y);let a=e.height;o.y<n?a+=n-o.y:o.y>n+e.height&&(a=o.y-n);const s=Ts(o.x,r,o.width,a);((e,t,n,o)=>((e,t,n,o,r)=>{const i=o.anchor,a=Wt(n),s=t.useFixed()?(()=>{const e=document.documentElement;return rc(0,0,e.clientWidth,e.clientHeight)})():(e=>{const t=Wt(e),n=Cn(t),o=t.dom.getBoundingClientRect();return oc(n.left,n.top,o.width,o.height)})(e);return i.placement(Wt(e),i,s).map((e=>{const n=r.orThunk((()=>t.getBounds.map(Se)));return mc(s,e,n,a)}))})(t,{useFixed:Me,getBounds:ke.none()},n,{anchor:{hotspot:e,bubble:ke.none(),layouts:ke.none(),overrides:{},placement:lc}},ke.from(o)).map((t=>({"max-height":t.maxHeight+"px","max-width":Math.min(t.maxWidth,e.offsetWidth)+"px",position:t.position.position,bottom:_c(t.position.bottom),top:_c(t.position.top),left:_c(t.position.left),right:_c(t.position.right),overflow:"auto",width:"100%"}))))(t.current,i.current,l.current,s).each((e=>{var t;t={...e,visibility:"visible"},ve(l.current)&&dn(Wt(l.current),t)}))}}),[]);Xn((()=>{s.on("ResizeWindow",f),s.on("ScrollWindow",f),s.on("ResizeEditor",f),"split"===La(s)&&s.on("ElementScroll",f);let e=ke.none();return c.current&&(e=ke.from(en(Wt(c.current),"scroll",(()=>{f()})))),()=>{s.off("ResizeWindow",f),s.off("ScrollWindow",f),s.off("ResizeEditor",f),"split"===La(s)&&s.off("ElementScroll",f),e.each((e=>{e.unbind()}))}}),[]),Xn((()=>{ve(n)&&f()}),[n]);const p=eo((()=>ve(n)?Re(n,((t,n)=>{const o={authorAvatar:t.image,author:t.id,authorName:t.name};return V(ws,{id:ct("mentions-menuitem"),onSelect:()=>e(t),classes:{container:os.mentionsDropdownItem,highlighted:os.mentionsDropdownItemActive},children:V("div",{className:os.mentionsDropdownItemRow,children:[V(as,{avatarInfo:o}),V("div",{className:os.mentionsDropdownItemColumn,children:[V("div",{className:os.mentionsDropdownItemName,children:t.name}),t.description&&V("div",{style:"font-weight: 400; line-height: 16px;",className:os.mentionsDropdownItemDescription,children:t.description})]})]})},n)})):null),[n,e]);return V(xs,{container:i.current,children:ve(n)?V(bs,{id:u.current,onBlur:o,onMounted:()=>{const e=t.current;ve(e)&&nn(Wt(e),"aria-owns",u.current)},onUnmounted:()=>{d(!0)()},inlineStyles:vc,classes:{container:os.mentionsDropdownList},onSelect:e,onMenuItemHighlighted:e=>{d()(e)},ref:l,children:(m=n,m.length>0?p:V(hc,{text:a.translate(Pa.tc_mentions_no_results)}))}):V(x,{})});var m})),yc=e=>{e.stopPropagation(),e.preventDefault()},bc=(e,t,n,o)=>{const{mentionsApiOpt:r}=no(ss),[i,a]=qn(null),s=Qn(-1),c=Qn(-1),l=Qn(),u=Qn(""),d=()=>pt(u.current,"@"),f=e=>{u.current=e},p=()=>{a(null),f("")},m=()=>{c.current=-1,s.current=-1},h=to((e=>{if(pt(e,"@")){const t=dt(e,"@");r.each((e=>{e.getUsers(t,(e=>{d()&&a(e)}),10)}))}else p(),m()}),[r]),v=to((n=>{var o;if(n){const n=null===(o=e.current)||void 0===o?void 0:o.value;if(ve(n)){const e=[n.slice(0,c.current)," ",n.slice(c.current)].join("");c.current=c.current+1,t(e)}}else m();p()}),[t]),_=t=>{var n;if(ve(e.current)&&ve(l.current)){const o=t.relatedTarget,r=null===(n=l.current.dropdownRef)||void 0===n?void 0:n.current;!ve(r)||e.current.contains(o)||r.contains(o)||(p(),m())}},g=e=>{if(d()||"@"!==e.data?d()&&(c.current=e.currentTarget.selectionStart):(s.current=e.currentTarget.selectionStart-1,c.current=e.currentTarget.selectionStart),s.current>-1&&c.current>-1){const t=e.currentTarget.value.slice(s.current,c.current);h(t),f(t)}},y=to((e=>{if(d()){if(27===e.keyCode)return yc(e),p(),ke.some(!0);if(ve(l.current))return ve(i)&&0===i.length&&(ps(e)||fs(e))?(yc(e),v(ps(e)),ke.some(!0)):l.current.passKeyboardEvent(e)}return ke.none()}),[i,v]),b=()=>{d()&&ve(e.current)&&e.current.selectionStart!==c.current&&(p(),m())},w=n=>{var o;const r=null===(o=e.current)||void 0===o?void 0:o.value;if(ve(r)&&_t(r)){const e=s.current+1,o=r.slice(0,e)+n.id,i=vt(r.slice(c.current));c.current=e+n.id.length,t(`${o}${i}`),p()}};return Xn((()=>{r.isSome()&&!d()&&((()=>{if(c.current>-1&&ve(e.current)){const t=Wt(e.current);(e=>{const t=Gt(e).dom;return e.dom===t.activeElement})(t)||tn(t),t.dom.setSelectionRange(c.current,c.current,"none")}})(),m())}),[o]),r.fold((()=>({clearTypedMention:ye,onKeydownWithMentions:be(ke.none()),updateTypedMention:ye,onUserSelected:ye,onTargetMouseUpWithMentions:ye,hideMentionsDropdownWhenOutOfFocus:ye,mentionsDropdownRef:l,users:null})),(()=>({clearTypedMention:p,onKeydownWithMentions:y,updateTypedMention:g,onUserSelected:w,onTargetMouseUpWithMentions:b,hideMentionsDropdownWhenOutOfFocus:_,users:i,mentionsDropdownRef:l})))},wc=e=>e.dom.clientHeight,xc=(e,t)=>{const n=_e(t)?t:Te;let o=e.dom;const r=[];for(;null!==o.parentElement&&void 0!==o.parentElement;){const e=o.parentElement,t=Wt(e);if(r.push(t),!0===n(t))break;o=e}return r},Cc=(e,t)=>{const n=Wt(e),o=n.dom;((e,t)=>{((e,t)=>{sn(e)&&e.style.removeProperty(t)})(e.dom,t),((e,t,n=xe)=>e.exists((e=>n(e,t))))(rn(e,"style").map(ht),"")&&an(e,"style")})(n,"height"),(e=>{e.dom.offsetWidth})(n);const r=o.clientHeight,i=o.scrollHeight;if(i>r){const e=vn(n),o=t(i,e,e-r);un(n,"height",o+"px")}},Ec=e=>{Cc(e,((t,n,o)=>{const r=(i=Wt(e),He(xc(i),(e=>((e,t)=>Ne(t,(t=>On(e,t))))(e,os.cardBody.split(" ")))).bind((e=>Be(xc(e),3).bind((t=>(e=>{const t=e.dom.childNodes;return ke.from(t[1]).map(Wt)})(t).map((n=>{const o=vn(e)-wc(i);return.5*(wc(t)-wc(n)-o)}))))))).getOr(3*n);var i;if(r<n)return n;{const e=t+o;return e>r?r:e}}))},Sc={"data-gramm_editor":"false",rows:2},Tc={"white-space":"pre-wrap"},Mc=bo((({content:e="",editable:t,onCancel:n,onSave:o,autofocus:r=!0},i)=>{const{editor:a,universe:s,mentionsApiOpt:c}=no(ss),[l,u]=qn(e),[d,f]=qn(!1),p=Qn(null),m=Qn(null),h=to((()=>{p.current&&((e,t)=>{(e=>!_t(e))(e)?Ec(t):(e=>{Cc(e,((e,t,n)=>e+n))})(t)})(e,p.current)}),[e]),{onKeydownWithMentions:v,updateTypedMention:_,onUserSelected:g,onTargetMouseUpWithMentions:y,hideMentionsDropdownWhenOutOfFocus:b,users:w,mentionsDropdownRef:x}=bc(p,u,0,l),C=to((()=>{var e;ve((e=p).current)&&""===e.current.value.trim()||(f(!0),o(l))}),[l]),E=to((e=>{v(e).orThunk((()=>(ps(e)&&e.stopPropagation(),fs(e)&&(e.stopPropagation(),e.shiftKey||(e.preventDefault(),C())),ke.none())))}),[v,C]);return Zn((()=>{h()}),[h,l]),Xn((()=>{p.current&&r&&p.current.focus({preventScroll:!0})}),[r]),Xn((()=>(a.on("ResizeEditor",h),()=>a.off("ResizeEditor",h))),[a,h]),ra.useTabKeyNavigation({containerRef:m,selector:"textarea,button",escape:()=>(n(),ke.some(!0))}),ra.useFlowKeyNavigation({containerRef:m,selector:"button",execute:be(ke.none())}),V("div",{ref:e=>{m.current=e,"function"==typeof i?i(e):ve(i)&&(i.current=e)},class:os.cardBody,children:[V("textarea",{placeholder:s.translate(c.fold((()=>Pa.tc_reply_placeholders),(()=>Pa.tc_reply_with_mentions_placeholders))),ref:p,tabindex:-1,autofocus:!0,disabled:!t||d,class:os.replyTextarea,...Sc,onInput:e=>{_(e),u(e.currentTarget.value)},onKeyDown:E,value:l,style:Tc,onMouseUp:y,onBlur:b}),V("div",{class:os.editActions,children:[V(_s,{disabled:!t||d,onClick:n}),V(gs,{saving:d,disabled:!t||d,onClick:C})]}),c.isSome()?V(gc,{ref:x,onBlur:b,anchorRef:p,onSelect:g,users:w}):null]})}));function kc(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}function Oc(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function Pc(...e){return to(Oc(...e),e)}function Dc(e,t=[]){let n=[];const o=()=>{const t=n.map((e=>K(e)));return function(n){const o=n?.[e]||t;return eo((()=>({[`__scope${e}`]:{...n,[e]:o}})),[n,o])}};return o.scopeName=e,[function(t,o){const r=K(o),i=n.length;function a(t){const{scope:n,children:o,...a}=t,s=n?.[e][i]||r,c=eo((()=>a),Object.values(a));return V(s.Provider,{value:c,children:o})}return n=[...n,o],a.displayName=t+"Provider",[a,function(n,a){const s=no(a?.[e][i]||r);if(s)return s;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},Ac(o,...t)]}function Ac(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const o=n.reduce(((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]})),{});return eo((()=>({[`__scope${t.scopeName}`]:o})),[o])}};return n.scopeName=t.scopeName,n}function Nc(e){const t=Qn(e);return Xn((()=>{t.current=e})),eo((()=>(...e)=>t.current?.(...e)),[])}function Rc({prop:e,defaultProp:t,onChange:n=()=>{}}){const[o,r]=function({defaultProp:e,onChange:t}){const n=qn(e),[o]=n,r=Qn(o),i=Nc(t);return Xn((()=>{r.current!==o&&(i(o),r.current=o)}),[o,r,i]),n}({defaultProp:t,onChange:n}),i=void 0!==e,a=i?e:o,s=Nc(n);return[a,to((t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&s(n)}else r(t)}),[i,e,r,s])]}var Lc=bo(((e,t)=>{const{children:n,...o}=e,r=xo.toArray(n),i=r.find(Uc);if(i){const e=i.props.children,n=r.map((t=>t===i?xo.count(e)>1?xo.only(null):er(e)?e.props.children:null:t));return V(Ic,{...o,ref:t,children:er(e)?or(e,void 0,n):null})}return V(Ic,{...o,ref:t,children:n})}));Lc.displayName="Slot";var Ic=bo(((e,t)=>{const{children:n,...o}=e;if(er(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(n);return or(n,{...Hc(o,n.props),ref:t?Oc(t,e):e})}return xo.count(n)>1?xo.only(null):null}));Ic.displayName="SlotClone";var Fc=({children:e})=>V(x,{children:e});function Uc(e){return er(e)&&e.type===Fc}function Hc(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...e)=>{i(...e),r(...e)}:r&&(n[o]=r):"style"===o?n[o]={...r,...i}:"className"===o&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}var Wc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const n=bo(((e,n)=>{const{asChild:o,...r}=e,i=o?Lc:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),V(i,{...r,ref:n})}));return n.displayName=`Primitive.${t}`,{...e,[t]:n}}),{});function Bc(e,t){e&&sr((()=>e.dispatchEvent(t)))}function $c(e){const t=e+"CollectionProvider",[n,o]=Dc(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e=>{const{scope:t,children:n}=e,o=vr.useRef(null),i=vr.useRef(new Map).current;return V(r,{scope:t,itemMap:i,collectionRef:o,children:n})};a.displayName=t;const s=e+"CollectionSlot",c=vr.forwardRef(((e,t)=>{const{scope:n,children:o}=e,r=Pc(t,i(s,n).collectionRef);return V(Lc,{ref:r,children:o})}));c.displayName=s;const l=e+"CollectionItemSlot",u="data-radix-collection-item",d=vr.forwardRef(((e,t)=>{const{scope:n,children:o,...r}=e,a=vr.useRef(null),s=Pc(t,a),c=i(l,n);return vr.useEffect((()=>(c.itemMap.set(a,{ref:a,...r}),()=>{c.itemMap.delete(a)}))),V(Lc,{[u]:"",ref:s,children:o})}));return d.displayName=l,[{Provider:a,Slot:c,ItemSlot:d},function(t){const n=i(e+"CollectionConsumer",t),o=vr.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${u}]`)),o=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return o}),[n.collectionRef,n.itemMap]);return o},o]}var jc=K(void 0);function Kc(e){const t=no(jc);return e||t||"ltr"}function zc(e,t=globalThis?.document){const n=Nc(e);Xn((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}var Vc,Yc="dismissableLayer.update",qc=K({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Gc=bo(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...c}=e,l=no(qc),[u,d]=qn(null),f=u?.ownerDocument??globalThis?.document,[,p]=qn({}),m=Pc(t,(e=>d(e))),h=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(v),g=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=g>=_,w=function(e,t=globalThis?.document){const n=Nc(e),o=Qn(!1),r=Qn((()=>{}));return Xn((()=>{const e=e=>{if(e.target&&!o.current){let o=function(){Zc("dismissableLayer.pointerDownOutside",n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",r.current),r.current=o,t.addEventListener("click",r.current,{once:!0})):o()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",r.current)}}),[t,n]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...l.branches].some((e=>e.contains(t)));b&&!n&&(r?.(e),a?.(e),e.defaultPrevented||s?.())}),f),x=function(e,t=globalThis?.document){const n=Nc(e),o=Qn(!1);return Xn((()=>{const e=e=>{e.target&&!o.current&&Zc("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...l.branches].some((e=>e.contains(t)))||(i?.(e),a?.(e),e.defaultPrevented||s?.())}),f);return zc((e=>{g===l.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),f),Xn((()=>{if(u)return n&&(0===l.layersWithOutsidePointerEventsDisabled.size&&(Vc=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Xc(),()=>{n&&1===l.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=Vc)}}),[u,f,n,l]),Xn((()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Xc())}),[u,l]),Xn((()=>{const e=()=>p({});return document.addEventListener(Yc,e),()=>document.removeEventListener(Yc,e)}),[]),V(Wc.div,{...c,ref:m,style:{pointerEvents:y?b?"auto":"none":void 0,...e.style},onFocusCapture:kc(e.onFocusCapture,x.onFocusCapture),onBlurCapture:kc(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:kc(e.onPointerDownCapture,w.onPointerDownCapture)})}));function Xc(){const e=new CustomEvent(Yc);document.dispatchEvent(e)}function Zc(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Bc(r,i):r.dispatchEvent(i)}Gc.displayName="DismissableLayer",bo(((e,t)=>{const n=no(qc),o=Qn(null),r=Pc(t,o);return Xn((()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),V(Wc.div,{...e,ref:r})})).displayName="DismissableLayerBranch";var Qc=0;function Jc(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var el="focusScope.autoFocusOnMount",tl="focusScope.autoFocusOnUnmount",nl={bubbles:!1,cancelable:!0},ol=bo(((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...a}=e,[s,c]=qn(null),l=Nc(r),u=Nc(i),d=Qn(null),f=Pc(t,(e=>c(e))),p=Qn({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Xn((()=>{if(o){let e=function(e){if(p.paused||!s)return;const t=e.target;s.contains(t)?d.current=t:sl(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;const t=e.relatedTarget;null!==t&&(s.contains(t)||sl(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&sl(s)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return s&&o.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}}),[o,s,p.paused]),Xn((()=>{if(s){cl.add(p);const e=document.activeElement;if(!s.contains(e)){const t=new CustomEvent(el,nl);s.addEventListener(el,l),s.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(sl(o,{select:t}),document.activeElement!==n)return}(rl(s).filter((e=>"A"!==e.tagName)),{select:!0}),document.activeElement===e&&sl(s))}return()=>{s.removeEventListener(el,l),setTimeout((()=>{const t=new CustomEvent(tl,nl);s.addEventListener(tl,u),s.dispatchEvent(t),t.defaultPrevented||sl(e??document.body,{select:!0}),s.removeEventListener(tl,u),cl.remove(p)}),0)}}}),[s,l,u,p]);const m=to((e=>{if(!n&&!o)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,i]=function(e){const t=rl(e);return[il(t,e),il(t.reverse(),e)]}(t);o&&i?e.shiftKey||r!==i?e.shiftKey&&r===o&&(e.preventDefault(),n&&sl(i,{select:!0})):(e.preventDefault(),n&&sl(o,{select:!0})):r===t&&e.preventDefault()}}),[n,o,p.paused]);return V(Wc.div,{tabIndex:-1,...a,ref:f,onKeyDown:m})}));function rl(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function il(e,t){for(const n of e)if(!al(n,{upTo:t}))return n}function al(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function sl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}ol.displayName="FocusScope";var cl=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ll(e,t),e.unshift(t)},remove(t){e=ll(e,t),e[0]?.resume()}}}();function ll(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var ul=Boolean(globalThis?.document)?Zn:()=>{},dl=_r["useId".toString()]||(()=>{}),fl=0;function pl(e){const[t,n]=qn(dl());return ul((()=>{n((e=>e??String(fl++)))}),[e]),t?`radix-${t}`:""}const ml=["top","right","bottom","left"],hl=Math.min,vl=Math.max,_l=Math.round,gl=Math.floor,yl=e=>({x:e,y:e}),bl={left:"right",right:"left",bottom:"top",top:"bottom"},wl={start:"end",end:"start"};function xl(e,t,n){return vl(e,hl(t,n))}function Cl(e,t){return"function"==typeof e?e(t):e}function El(e){return e.split("-")[0]}function Sl(e){return e.split("-")[1]}function Tl(e){return"x"===e?"y":"x"}function Ml(e){return"y"===e?"height":"width"}function kl(e){return["top","bottom"].includes(El(e))?"y":"x"}function Ol(e){return Tl(kl(e))}function Pl(e){return e.replace(/start|end/g,(e=>wl[e]))}function Dl(e){return e.replace(/left|right|bottom|top/g,(e=>bl[e]))}function Al(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Nl(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Rl(e,t,n){let{reference:o,floating:r}=e;const i=kl(t),a=Ol(t),s=Ml(a),c=El(t),l="y"===i,u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[s]/2-r[s]/2;let p;switch(c){case"top":p={x:u,y:o.y-r.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-r.width,y:d};break;default:p={x:o.x,y:o.y}}switch(Sl(t)){case"start":p[a]-=f*(n&&l?-1:1);break;case"end":p[a]+=f*(n&&l?-1:1)}return p}async function Ll(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Cl(t,e),m=Al(p),h=s[f?"floating"===d?"reference":"floating":d],v=Nl(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),_="floating"===d?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),y=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},b=Nl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:g,strategy:c}):_);return{top:(v.top-b.top+m.top)/y.y,bottom:(b.bottom-v.bottom+m.bottom)/y.y,left:(v.left-b.left+m.left)/y.x,right:(b.right-v.right+m.right)/y.x}}function Il(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Fl(e){return ml.some((t=>e[t]>=0))}function Ul(e){return Bl(e)?(e.nodeName||"").toLowerCase():"#document"}function Hl(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Wl(e){var t;return null==(t=(Bl(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Bl(e){return e instanceof Node||e instanceof Hl(e).Node}function $l(e){return e instanceof Element||e instanceof Hl(e).Element}function jl(e){return e instanceof HTMLElement||e instanceof Hl(e).HTMLElement}function Kl(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Hl(e).ShadowRoot)}function zl(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Zl(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Vl(e){return["table","td","th"].includes(Ul(e))}function Yl(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function ql(e){const t=Gl(),n=Zl(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Gl(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Xl(e){return["html","body","#document"].includes(Ul(e))}function Zl(e){return Hl(e).getComputedStyle(e)}function Ql(e){return $l(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jl(e){if("html"===Ul(e))return e;const t=e.assignedSlot||e.parentNode||Kl(e)&&e.host||Wl(e);return Kl(t)?t.host:t}function eu(e){const t=Jl(e);return Xl(t)?e.ownerDocument?e.ownerDocument.body:e.body:jl(t)&&zl(t)?t:eu(t)}function tu(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=eu(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),a=Hl(r);return i?t.concat(a,a.visualViewport||[],zl(r)?r:[],a.frameElement&&n?tu(a.frameElement):[]):t.concat(r,tu(r,[],n))}function nu(e){const t=Zl(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=jl(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=_l(n)!==i||_l(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function ou(e){return $l(e)?e:e.contextElement}function ru(e){const t=ou(e);if(!jl(t))return yl(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=nu(t);let a=(i?_l(n.width):n.width)/o,s=(i?_l(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const iu=yl(0);function au(e){const t=Hl(e);return Gl()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:iu}function su(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=ou(e);let a=yl(1);t&&(o?$l(o)&&(a=ru(o)):a=ru(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Hl(e))&&t}(i,n,o)?au(i):yl(0);let c=(r.left+s.x)/a.x,l=(r.top+s.y)/a.y,u=r.width/a.x,d=r.height/a.y;if(i){const e=Hl(i),t=o&&$l(o)?Hl(o):o;let n=e,r=n.frameElement;for(;r&&o&&t!==n;){const e=ru(r),t=r.getBoundingClientRect(),o=Zl(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=i,l+=a,n=Hl(r),r=n.frameElement}}return Nl({width:u,height:d,x:c,y:l})}function cu(e){return su(Wl(e)).left+Ql(e).scrollLeft}function lu(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=Hl(e),o=Wl(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,s=0,c=0;if(r){i=r.width,a=r.height;const e=Gl();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,c=r.offsetTop)}return{width:i,height:a,x:s,y:c}}(e,n);else if("document"===t)o=function(e){const t=Wl(e),n=Ql(e),o=e.ownerDocument.body,r=vl(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=vl(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+cu(e);const s=-n.scrollTop;return"rtl"===Zl(o).direction&&(a+=vl(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:s}}(Wl(e));else if($l(t))o=function(e,t){const n=su(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=jl(e)?ru(e):yl(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=au(e);o={...t,x:t.x-n.x,y:t.y-n.y}}return Nl(o)}function uu(e,t){const n=Jl(e);return!(n===t||!$l(n)||Xl(n))&&("fixed"===Zl(n).position||uu(n,t))}function du(e,t,n){const o=jl(t),r=Wl(t),i="fixed"===n,a=su(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=yl(0);if(o||!o&&!i)if(("body"!==Ul(t)||zl(r))&&(s=Ql(t)),o){const e=su(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else r&&(c.x=cu(r));return{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function fu(e){return"static"===Zl(e).position}function pu(e,t){return jl(e)&&"fixed"!==Zl(e).position?t?t(e):e.offsetParent:null}function mu(e,t){const n=Hl(e);if(Yl(e))return n;if(!jl(e)){let t=Jl(e);for(;t&&!Xl(t);){if($l(t)&&!fu(t))return t;t=Jl(t)}return n}let o=pu(e,t);for(;o&&Vl(o)&&fu(o);)o=pu(o,t);return o&&Xl(o)&&fu(o)&&!ql(o)?n:o||function(e){let t=Jl(e);for(;jl(t)&&!Xl(t);){if(Yl(t))return null;if(ql(t))return t;t=Jl(t)}return null}(e)||n}const hu={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,a=Wl(o),s=!!t&&Yl(t.floating);if(o===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=yl(1);const u=yl(0),d=jl(o);if((d||!d&&!i)&&(("body"!==Ul(o)||zl(a))&&(c=Ql(o)),jl(o))){const e=su(o);l=ru(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}},getDocumentElement:Wl,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i="clippingAncestors"===n?Yl(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=tu(e,[],!1).filter((e=>$l(e)&&"body"!==Ul(e))),r=null;const i="fixed"===Zl(e).position;let a=i?Jl(e):e;for(;$l(a)&&!Xl(a);){const t=Zl(a),n=ql(a);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||zl(a)&&!n&&uu(e,a))?o=o.filter((e=>e!==a)):r=t,a=Jl(a)}return t.set(e,o),o}(t,this._c):[].concat(n),a=[...i,o],s=a[0],c=a.reduce(((e,n)=>{const o=lu(t,n,r);return e.top=vl(o.top,e.top),e.right=hl(o.right,e.right),e.bottom=hl(o.bottom,e.bottom),e.left=vl(o.left,e.left),e}),lu(t,s,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:mu,getElementRects:async function(e){const t=this.getOffsetParent||mu,n=this.getDimensions,o=await n(e.floating);return{reference:du(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=nu(e);return{width:t,height:n}},getScale:ru,isElement:$l,isRTL:function(e){return"rtl"===Zl(e).direction}};const vu=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),a=El(n),s=Sl(n),c="y"===kl(n),l=["left","top"].includes(a)?-1:1,u=i&&c?-1:1,d=Cl(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}},_u=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Cl(e,t),l={x:n,y:o},u=await Ll(t,c),d=kl(El(r)),f=Tl(d);let p=l[f],m=l[d];if(i){const e="y"===f?"bottom":"right";p=xl(p+u["y"===f?"top":"left"],p,p-u[e])}if(a){const e="y"===d?"bottom":"right";m=xl(m+u["y"===d?"top":"left"],m,m-u[e])}const h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-o}}}}},gu=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=Cl(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const _=El(r),g=kl(s),y=El(s)===s,b=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=f||(y||!h?[Dl(s)]:function(e){const t=Dl(e);return[Pl(e),t,Pl(t)]}(s)),x="none"!==m;!f&&x&&w.push(...function(e,t,n,o){const r=Sl(e);let i=function(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:a;default:return[]}}(El(e),"start"===n,o);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(Pl)))),i}(s,h,m,b));const C=[s,...w],E=await Ll(t,v),S=[];let T=(null==(o=i.flip)?void 0:o.overflows)||[];if(u&&S.push(E[_]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=Sl(e),r=Ol(e),i=Ml(r);let a="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Dl(a)),[a,Dl(a)]}(r,a,b);S.push(E[e[0]],E[e[1]])}if(T=[...T,{placement:r,overflows:S}],!S.every((e=>e<=0))){var M,k;const e=((null==(M=i.flip)?void 0:M.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:T},reset:{placement:t}};let n=null==(k=T.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=T.filter((e=>{if(x){const t=kl(e.placement);return t===g||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},yu=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:a=()=>{},...s}=Cl(e,t),c=await Ll(t,s),l=El(n),u=Sl(n),d="y"===kl(n),{width:f,height:p}=o.floating;let m,h;"top"===l||"bottom"===l?(m=l,h=u===(await(null==r.isRTL?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(h=l,m="end"===u?"top":"bottom");const v=p-c.top-c.bottom,_=f-c.left-c.right,g=hl(p-c[m],v),y=hl(f-c[h],_),b=!t.middlewareData.shift;let w=g,x=y;if(d?x=u||b?hl(y,_):_:w=u||b?hl(g,v):v,b&&!u){const e=vl(c.left,0),t=vl(c.right,0),n=vl(c.top,0),o=vl(c.bottom,0);d?x=f-2*(0!==e||0!==t?e+t:vl(c.left,c.right)):w=p-2*(0!==n||0!==o?n+o:vl(c.top,c.bottom))}await a({...t,availableWidth:x,availableHeight:w});const C=await r.getDimensions(i.floating);return f!==C.width||p!==C.height?{reset:{rects:!0}}:{}}}},bu=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Cl(e,t);switch(o){case"referenceHidden":{const e=Il(await Ll(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Fl(e)}}}case"escaped":{const e=Il(await Ll(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Fl(e)}}}default:return{}}}}},wu=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Cl(e,t)||{};if(null==l)return{};const d=Al(u),f={x:n,y:o},p=Ol(r),m=Ml(p),h=await a.getDimensions(l),v="y"===p,_=v?"top":"left",g=v?"bottom":"right",y=v?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-f[p]-i.floating[m],w=f[p]-i.reference[p],x=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let C=x?x[y]:0;C&&await(null==a.isElement?void 0:a.isElement(x))||(C=s.floating[y]||i.floating[m]);const E=b/2-w/2,S=C/2-h[m]/2-1,T=hl(d[_],S),M=hl(d[g],S),k=T,O=C-h[m]-M,P=C/2-h[m]/2+E,D=xl(k,P,O),A=!c.arrow&&null!=Sl(r)&&P!==D&&i.reference[m]/2-(P<k?T:M)-h[m]/2<0,N=A?P<k?P-k:P-O:0;return{[p]:f[p]+N,data:{[p]:D,centerOffset:P-D-N,...A&&{alignmentOffset:N}},reset:A}}}),xu=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Cl(e,t),u={x:n,y:o},d=kl(r),f=Tl(d);let p=u[f],m=u[d];const h=Cl(s,t),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+v.mainAxis,n=i.reference[f]+i.reference[e]-v.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){var _,g;const e="y"===f?"width":"height",t=["top","left"].includes(El(r)),n=i.reference[d]-i.floating[e]+(t&&(null==(_=a.offset)?void 0:_[d])||0)+(t?0:v.crossAxis),o=i.reference[d]+i.reference[e]+(t?0:(null==(g=a.offset)?void 0:g[d])||0)-(t?v.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[f]:p,[d]:m}}}},Cu=(e,t,n)=>{const o=new Map,r={platform:hu,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:d}=Rl(l,o,c),f=o,p={},m=0;for(let n=0;n<s.length;n++){const{name:i,fn:h}=s[n],{x:v,y:_,data:g,reset:y}=await h({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});u=null!=v?v:u,d=null!=_?_:d,p={...p,[i]:{...p[i],...g}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(f=y.placement),y.rects&&(l=!0===y.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):y.rects),({x:u,y:d}=Rl(l,f,c))),n=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var Eu="undefined"!=typeof document?Zn:Xn;function Su(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;0!=o--;)if(!Su(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!=o--;){const n=r[o];if(!("_owner"===n&&e.$$typeof||Su(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function Tu(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mu(e,t){const n=Tu(e);return Math.round(t*n)/n}function ku(e){const t=Qn(e);return Eu((()=>{t.current=e})),t}const Ou=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:o}="function"==typeof e?e(t):e;return n&&(r=n,{}.hasOwnProperty.call(r,"current"))?null!=n.current?wu({element:n.current,padding:o}).fn(t):{}:n?wu({element:n,padding:o}).fn(t):{};var r}}),Pu=(e,t)=>({...vu(e),options:[e,t]}),Du=(e,t)=>({..._u(e),options:[e,t]}),Au=(e,t)=>({...xu(e),options:[e,t]}),Nu=(e,t)=>({...gu(e),options:[e,t]}),Ru=(e,t)=>({...yu(e),options:[e,t]}),Lu=(e,t)=>({...bu(e),options:[e,t]}),Iu=(e,t)=>({...Ou(e),options:[e,t]});var Fu=bo(((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return V(Wc.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:V("polygon",{points:"0,0 30,0 15,10"})})}));Fu.displayName="Arrow";var Uu=Fu,Hu="Popper",[Wu,Bu]=Dc(Hu),[$u,ju]=Wu(Hu),Ku=e=>{const{__scopePopper:t,children:n}=e,[o,r]=qn(null);return V($u,{scope:t,anchor:o,onAnchorChange:r,children:n})};Ku.displayName=Hu;var zu="PopperAnchor",Vu=bo(((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=ju(zu,n),a=Qn(null),s=Pc(t,a);return Xn((()=>{i.onAnchorChange(o?.current||a.current)})),o?null:V(Wc.div,{...r,ref:s})}));Vu.displayName=zu;var Yu="PopperContent",[qu,Gu]=Wu(Yu),Xu=bo(((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...h}=e,v=ju(Yu,n),[_,g]=qn(null),y=Pc(t,(e=>g(e))),[b,w]=qn(null),x=function(e){const[t,n]=qn(void 0);return ul((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,i;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(b),C=x?.width??0,E=x?.height??0,S=o+("center"!==i?"-"+i:""),T="number"==typeof u?u:{top:0,right:0,bottom:0,left:0,...u},M=Array.isArray(l)?l:[l],k=M.length>0,O={padding:T,boundary:M.filter(ed),altBoundary:k},{refs:P,floatingStyles:D,placement:A,isPositioned:N,middlewareData:R}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=qn({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=qn(o);Su(f,o)||p(o);const[m,h]=qn(null),[v,_]=qn(null),g=to((e=>{e!==x.current&&(x.current=e,h(e))}),[]),y=to((e=>{e!==C.current&&(C.current=e,_(e))}),[]),b=i||m,w=a||v,x=Qn(null),C=Qn(null),E=Qn(u),S=null!=c,T=ku(c),M=ku(r),k=to((()=>{if(!x.current||!C.current)return;const e={placement:t,strategy:n,middleware:f};M.current&&(e.platform=M.current),Cu(x.current,C.current,e).then((e=>{const t={...e,isPositioned:!0};O.current&&!Su(E.current,t)&&(E.current=t,sr((()=>{d(t)})))}))}),[f,t,n,M]);Eu((()=>{!1===l&&E.current.isPositioned&&(E.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[l]);const O=Qn(!1);Eu((()=>(O.current=!0,()=>{O.current=!1})),[]),Eu((()=>{if(b&&(x.current=b),w&&(C.current=w),b&&w){if(T.current)return T.current(b,w,k);k()}}),[b,w,k,T,S]);const P=eo((()=>({reference:x,floating:C,setReference:g,setFloating:y})),[g,y]),D=eo((()=>({reference:b,floating:w})),[b,w]),A=eo((()=>{const e={position:n,left:0,top:0};if(!D.floating)return e;const t=Mu(D.floating,u.x),o=Mu(D.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+o+"px)",...Tu(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}}),[n,s,D.floating,u.x,u.y]);return eo((()=>({...u,update:k,refs:P,elements:D,floatingStyles:A})),[u,k,P,D,A])}({strategy:"fixed",placement:S,whileElementsMounted:(...e)=>function(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=o,l=ou(e),u=r||i?[...l?tu(l):[],...tu(t)]:[];u.forEach((e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=l&&s?function(e,t){let n,o=null;const r=Wl(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function a(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),i();const{left:l,top:u,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const p={rootMargin:-gl(u)+"px "+-gl(r.clientWidth-(l+d))+"px "+-gl(r.clientHeight-(u+f))+"px "+-gl(l)+"px",threshold:vl(0,hl(1,c))||1};let m=!0;function h(e){const t=e[0].intersectionRatio;if(t!==c){if(!m)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7)}),1e3)}m=!1}try{o=new IntersectionObserver(h,{...p,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(h,p)}o.observe(e)}(!0),i}(l,n):null;let f,p=-1,m=null;a&&(m=new ResizeObserver((e=>{let[o]=e;o&&o.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(t)}))),n()})),l&&!c&&m.observe(l),m.observe(t));let h=c?su(e):null;return c&&function t(){const o=su(e);!h||o.x===h.x&&o.y===h.y&&o.width===h.width&&o.height===h.height||n(),h=o,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(f)}}(...e,{animationFrame:"always"===p}),elements:{reference:v.anchor},middleware:[Pu({mainAxis:r+E,alignmentAxis:a}),c&&Du({mainAxis:!0,crossAxis:!1,limiter:"partial"===d?Au():void 0,...O}),c&&Nu({...O}),Ru({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${r}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),b&&Iu({element:b,padding:s}),td({arrowWidth:C,arrowHeight:E}),f&&Lu({strategy:"referenceHidden",...O})]}),[L,I]=nd(A),F=Nc(m);ul((()=>{N&&F?.()}),[N,F]);const U=R.arrow?.x,H=R.arrow?.y,W=0!==R.arrow?.centerOffset,[B,$]=qn();return ul((()=>{_&&$(window.getComputedStyle(_).zIndex)}),[_]),V("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:N?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[R.transformOrigin?.x,R.transformOrigin?.y].join(" "),...R.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:V(qu,{scope:n,placedSide:L,onArrowChange:w,arrowX:U,arrowY:H,shouldHideArrow:W,children:V(Wc.div,{"data-side":L,"data-align":I,...h,ref:y,style:{...h.style,animation:N?void 0:"none"}})})})}));Xu.displayName=Yu;var Zu="PopperArrow",Qu={top:"bottom",right:"left",bottom:"top",left:"right"},Ju=bo((function(e,t){const{__scopePopper:n,...o}=e,r=Gu(Zu,n),i=Qu[r.placedSide];return V("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:V(Uu,{...o,ref:t,style:{...o.style,display:"block"}})})}));function ed(e){return null!==e}Ju.displayName=Zu;var td=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,i=0!==r.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[c,l]=nd(n),u={start:"0%",center:"50%",end:"100%"}[l],d=(r.arrow?.x??0)+a/2,f=(r.arrow?.y??0)+s/2;let p="",m="";return"bottom"===c?(p=i?u:`${d}px`,m=-s+"px"):"top"===c?(p=i?u:`${d}px`,m=`${o.floating.height+s}px`):"right"===c?(p=-s+"px",m=i?u:`${f}px`):"left"===c&&(p=`${o.floating.width+s}px`,m=i?u:`${f}px`),{data:{x:p,y:m}}}});function nd(e){const[t,n="center"]=e.split("-");return[t,n]}var od=Ku,rd=Vu,id=Xu,ad=Ju,sd=bo(((e,t)=>{const{container:n,...o}=e,[r,i]=qn(!1);ul((()=>i(!0)),[]);const a=n||r&&globalThis?.document?.body;return a?vr.createPortal(V(Wc.div,{...o,ref:t}),a):null}));sd.displayName="Portal";var cd=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=qn(),o=Qn({}),r=Qn(e),i=Qn("none"),a=e?"mounted":"unmounted",[s,c]=function(e,t){return Gn(((e,n)=>t[e][n]??e),e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Xn((()=>{const e=ld(o.current);i.current="mounted"===s?e:"none"}),[s]),ul((()=>{const t=o.current,n=r.current;if(n!==e){const o=i.current,a=ld(t);c(e?"MOUNT":"none"===a||"none"===t?.display?"UNMOUNT":n&&o!==a?"ANIMATION_OUT":"UNMOUNT"),r.current=e}}),[e,c]),ul((()=>{if(t){const e=e=>{const n=ld(o.current).includes(e.animationName);e.target===t&&n&&sr((()=>c("ANIMATION_END")))},n=e=>{e.target===t&&(i.current=ld(o.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:to((e=>{e&&(o.current=getComputedStyle(e)),n(e)}),[])}}(t),r="function"==typeof n?n({present:o.isPresent}):xo.only(n),i=Pc(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(r));return"function"==typeof n||o.isPresent?or(r,{ref:i}):null};function ld(e){return e?.animationName||"none"}cd.displayName="Presence";var ud="rovingFocusGroup.onEntryFocus",dd={bubbles:!1,cancelable:!0},fd="RovingFocusGroup",[pd,md,hd]=$c(fd),[vd,_d]=Dc(fd,[hd]),[gd,yd]=vd(fd),bd=bo(((e,t)=>V(pd.Provider,{scope:e.__scopeRovingFocusGroup,children:V(pd.Slot,{scope:e.__scopeRovingFocusGroup,children:V(wd,{...e,ref:t})})})));bd.displayName=fd;var wd=bo(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=Qn(null),p=Pc(t,f),m=Kc(i),[h=null,v]=Rc({prop:a,defaultProp:s,onChange:c}),[_,g]=qn(!1),y=Nc(l),b=md(n),w=Qn(!1),[x,C]=qn(0);return Xn((()=>{const e=f.current;if(e)return e.addEventListener(ud,y),()=>e.removeEventListener(ud,y)}),[y]),V(gd,{scope:n,orientation:o,dir:m,loop:r,currentTabStopId:h,onItemFocus:to((e=>v(e)),[v]),onItemShiftTab:to((()=>g(!0)),[]),onFocusableItemAdd:to((()=>C((e=>e+1))),[]),onFocusableItemRemove:to((()=>C((e=>e-1))),[]),children:V(Wc.div,{tabIndex:_||0===x?-1:0,"data-orientation":o,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:kc(e.onMouseDown,(()=>{w.current=!0})),onFocus:kc(e.onFocus,(e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!_){const t=new CustomEvent(ud,dd);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=b().filter((e=>e.focusable));Sd([e.find((e=>e.active)),e.find((e=>e.id===h)),...e].filter(Boolean).map((e=>e.ref.current)),u)}}w.current=!1})),onBlur:kc(e.onBlur,(()=>g(!1)))})})})),xd="RovingFocusGroupItem",Cd=bo(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:i,...a}=e,s=pl(),c=i||s,l=yd(xd,n),u=l.currentTabStopId===c,d=md(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=l;return Xn((()=>{if(o)return f(),()=>p()}),[o,f,p]),V(pd.ItemSlot,{scope:n,id:c,focusable:o,active:r,children:V(Wc.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...a,ref:t,onMouseDown:kc(e.onMouseDown,(e=>{o?l.onItemFocus(c):e.preventDefault()})),onFocus:kc(e.onFocus,(()=>l.onItemFocus(c))),onKeyDown:kc(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void l.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const o=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(o)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)?void 0:Ed[o]}(e,l.orientation,l.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=d().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const i=r.indexOf(e.currentTarget);r=l.loop?(o=i+1,(n=r).map(((e,t)=>n[(o+t)%n.length]))):r.slice(i+1)}setTimeout((()=>Sd(r)))}var n,o}))})})}));Cd.displayName=xd;var Ed={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Sd(e,t=!1){const n=document.activeElement;for(const o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}var Td=bd,Md=Cd,kd=new WeakMap,Od=new WeakMap,Pd={},Dd=0,Ad=function(e){return e&&(e.host||Ad(e.parentNode))},Nd=function(e,t,n){void 0===n&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),function(e,t,n,o){var r=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=Ad(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);Pd[n]||(Pd[n]=new WeakMap);var i=Pd[n],a=[],s=new Set,c=new Set(r),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};r.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(o),r=null!==t&&"false"!==t,c=(kd.get(e)||0)+1,l=(i.get(e)||0)+1;kd.set(e,c),i.set(e,l),a.push(e),1===c&&r&&Od.set(e,!0),1===l&&e.setAttribute(n,"true"),r||e.setAttribute(o,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return u(t),s.clear(),Dd++,function(){a.forEach((function(e){var t=kd.get(e)-1,r=i.get(e)-1;kd.set(e,t),i.set(e,r),t||(Od.has(e)||e.removeAttribute(o),Od.delete(e)),r||e.removeAttribute(n)})),--Dd||(kd=new WeakMap,kd=new WeakMap,Od=new WeakMap,Pd={})}}(o,r,n,"aria-hidden")):function(){return null}},Rd="right-scroll-bar-position",Ld="width-before-scroll-bar";function Id(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Fd="undefined"!=typeof window?Zn:Xn,Ud=new WeakMap;function Hd(e){return e}var Wd=function(e){var t=e.sideCar,n=se(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return y(o,ae({},n))};Wd.isSideCarExport=!0;var Bd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Hd);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:null},useMedium:function(e){var r=t(e,o);return n.push(r),function(){n=n.filter((function(e){return e!==r}))}},assignSyncMedium:function(e){for(o=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){o=!0;var t=[];if(n.length){var r=n;n=[],r.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return r}();return t.options=ae({async:!0,ssr:!1},e),t}(),$d=function(){},jd=bo((function(e,t){var n=Qn(null),o=qn({onScrollCapture:$d,onWheelCapture:$d,onTouchMoveCapture:$d}),r=o[0],i=o[1],a=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,h=e.allowPinchZoom,v=e.as,_=void 0===v?"div":v,g=e.gapMode,b=se(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,C=function(e){var t,n,o=(t=function(t){return e.forEach((function(e){return Id(e,t)}))},n=qn((function(){return{value:null,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}}))[0],n.callback=t,n.facade);return Fd((function(){var t=Ud.get(o);if(t){var n=new Set(t),r=new Set(e),i=o.current;n.forEach((function(e){r.has(e)||Id(e,null)})),r.forEach((function(e){n.has(e)||Id(e,i)}))}Ud.set(o,e)}),[e]),o}([n,t]),E=ae(ae({},b),r);return y(x,null,u&&y(w,{sideCar:Bd,removeScrollBar:l,shards:d,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:g}),a?or(xo.only(s),ae(ae({},E),{ref:C})):y(_,ae({},E,{className:c,ref:C}),s))}));jd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},jd.classNames={fullWidth:Ld,zeroRight:Rd};var Kd=function(){var e=0,t=null;return{add:function(n){0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zd=function(){var e,t=(e=Kd(),function(t,n){Xn((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,o=e.dynamic;return t(n,o),null}},Vd={left:0,top:0,right:0,gap:0},Yd=function(e){return parseInt(e||"",10)||0},qd=zd(),Gd="data-scroll-locked",Xd=function(e,t,n,o){var r=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(o,";\n padding-right: ").concat(s,"px ").concat(o,";\n }\n body[").concat(Gd,"] {\n overflow: hidden ").concat(o,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(o,";"),"margin"===n&&"\n padding-left: ".concat(r,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(o,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(o,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Rd," {\n right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Ld," {\n margin-right: ").concat(s,"px ").concat(o,";\n }\n \n .").concat(Rd," .").concat(Rd," {\n right: 0 ").concat(o,";\n }\n \n .").concat(Ld," .").concat(Ld," {\n margin-right: 0 ").concat(o,";\n }\n \n body[").concat(Gd,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Zd=function(){var e=parseInt(document.body.getAttribute(Gd)||"0",10);return isFinite(e)?e:0},Qd=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=void 0===o?"margin":o;Xn((function(){return document.body.setAttribute(Gd,(Zd()+1).toString()),function(){var e=Zd()-1;e<=0?document.body.removeAttribute(Gd):document.body.setAttribute(Gd,e.toString())}}),[]);var i=eo((function(){return function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Vd;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],o=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[Yd(n),Yd(o),Yd(r)]}(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}}(r)}),[r]);return y(qd,{styles:Xd(i,!t,r,n?"":"!important")})},Jd=!1;if("undefined"!=typeof window)try{var ef=Object.defineProperty({},"passive",{get:function(){return Jd=!0,!0}});window.addEventListener("test",ef,ef),window.removeEventListener("test",ef,ef)}catch(e){Jd=!1}var tf=!!Jd&&{passive:!1},nf=function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},of=function(e,t){var n=t.ownerDocument,o=t;do{if("undefined"!=typeof ShadowRoot&&o instanceof ShadowRoot&&(o=o.host),rf(e,o)){var r=af(e,o);if(r[1]>r[2])return!0}o=o.parentNode}while(o&&o!==n.body);return!1},rf=function(e,t){return"v"===e?function(e){return nf(e,"overflowY")}(t):function(e){return nf(e,"overflowX")}(t)},af=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},sf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cf=function(e){return[e.deltaX,e.deltaY]},lf=function(e){return e&&"current"in e?e.current:e},uf=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},df=0,ff=[];function pf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var mf,hf=(mf=function(e){var t=Qn([]),n=Qn([0,0]),o=Qn(),r=qn(df++)[0],i=qn(zd)[0],a=Qn(e);Xn((function(){a.current=e}),[e]),Xn((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var t=function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(lf),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(r))})),function(){document.body.classList.remove("block-interactivity-".concat(r)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(r))}))}}}),[e.inert,e.lockRef.current,e.shards]);var s=to((function(e,t){if("touches"in e&&2===e.touches.length)return!a.current.allowPinchZoom;var r,i=sf(e),s=n.current,c="deltaX"in e?e.deltaX:s[0]-i[0],l="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=of(d,u);if(!f)return!0;if(f?r=d:(r="v"===d?"h":"v",f=of(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(c||l)&&(o.current=r),!r)return!0;var p=o.current||r;return function(e,t,n,o){var r=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=r*o,a=n.target,s=t.contains(a),c=!1,l=i>0,u=0,d=0;do{var f=af(e,a),p=f[0],m=f[1]-f[2]-r*p;(p||m)&&rf(e,a)&&(u+=m,d+=p),a=a instanceof ShadowRoot?a.host:a.parentNode}while(!s&&a!==document.body||s&&(t.contains(a)||t===a));return(l&&Math.abs(u)<1||!l&&Math.abs(d)<1)&&(c=!0),c}(p,t,e,"h"===p?c:l)}),[]),c=to((function(e){var n=e;if(ff.length&&ff[ff.length-1]===i){var o="deltaY"in n?cf(n):sf(n),r=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,o)}))[0];if(r&&r.should)n.cancelable&&n.preventDefault();else if(!r){var c=(a.current.shards||[]).map(lf).filter(Boolean).filter((function(e){return e.contains(n.target)}));(c.length>0?s(n,c[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),l=to((function(e,n,o,r){var i={name:e,delta:n,target:o,should:r,shadowParent:pf(o)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),u=to((function(e){n.current=sf(e),o.current=void 0}),[]),d=to((function(t){l(t.type,cf(t),t.target,s(t,e.lockRef.current))}),[]),f=to((function(t){l(t.type,sf(t),t.target,s(t,e.lockRef.current))}),[]);Xn((function(){return ff.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,tf),document.addEventListener("touchmove",c,tf),document.addEventListener("touchstart",u,tf),function(){ff=ff.filter((function(e){return e!==i})),document.removeEventListener("wheel",c,tf),document.removeEventListener("touchmove",c,tf),document.removeEventListener("touchstart",u,tf)}}),[]);var p=e.removeScrollBar;return y(x,null,e.inert?y(i,{styles:uf(r)}):null,p?y(Qd,{gapMode:e.gapMode}):null)},Bd.useMedium(mf),Wd),vf=bo((function(e,t){return y(jd,ae({},e,{ref:t,sideCar:hf}))}));vf.classNames=jd.classNames;var _f=["Enter"," "],gf=["ArrowUp","PageDown","End"],yf=["ArrowDown","PageUp","Home",...gf],bf={ltr:[..._f,"ArrowRight"],rtl:[..._f,"ArrowLeft"]},wf={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xf="Menu",[Cf,Ef,Sf]=$c(xf),[Tf,Mf]=Dc(xf,[Sf,Bu,_d]),kf=Bu(),Of=_d(),[Pf,Df]=Tf(xf),[Af,Nf]=Tf(xf),Rf=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:i,modal:a=!0}=e,s=kf(t),[c,l]=qn(null),u=Qn(!1),d=Nc(i),f=Kc(r);return Xn((()=>{const e=()=>{u.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),V(od,{...s,children:V(Pf,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:V(Af,{scope:t,onClose:to((()=>d(!1)),[d]),isUsingKeyboardRef:u,dir:f,modal:a,children:o})})})};Rf.displayName=xf;var Lf=bo(((e,t)=>{const{__scopeMenu:n,...o}=e,r=kf(n);return V(rd,{...r,...o,ref:t})}));Lf.displayName="MenuAnchor";var If="MenuPortal",[Ff,Uf]=Tf(If,{forceMount:void 0}),Hf=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,i=Df(If,t);return V(Ff,{scope:t,forceMount:n,children:V(cd,{present:n||i.open,children:V(sd,{asChild:!0,container:r,children:o})})})};Hf.displayName=If;var Wf="MenuContent",[Bf,$f]=Tf(Wf),jf=bo(((e,t)=>{const n=Uf(Wf,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,i=Df(Wf,e.__scopeMenu),a=Nf(Wf,e.__scopeMenu);return V(Cf.Provider,{scope:e.__scopeMenu,children:V(cd,{present:o||i.open,children:V(Cf.Slot,{scope:e.__scopeMenu,children:a.modal?V(Kf,{...r,ref:t}):V(zf,{...r,ref:t})})})})})),Kf=bo(((e,t)=>{const n=Df(Wf,e.__scopeMenu),o=Qn(null),r=Pc(t,o);return Xn((()=>{const e=o.current;if(e)return Nd(e)}),[]),V(Vf,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:kc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})})),zf=bo(((e,t)=>{const n=Df(Wf,e.__scopeMenu);return V(Vf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),Vf=bo(((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,v=Df(Wf,n),_=Nf(Wf,n),g=kf(n),y=Of(n),b=Ef(n),[w,C]=qn(null),E=Qn(null),S=Pc(t,E,v.onContentChange),T=Qn(0),M=Qn(""),k=Qn(0),O=Qn(null),P=Qn("right"),D=Qn(0),A=m?vf:x,N=m?{as:Lc,allowPinchZoom:!0}:void 0;Xn((()=>()=>window.clearTimeout(T.current)),[]),Xn((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jc()),document.body.insertAdjacentElement("beforeend",e[1]??Jc()),Qc++,()=>{1===Qc&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Qc--}}),[]);const R=to((e=>P.current===O.current?.side&&function(e,t){if(!t)return!1;return function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e].x,s=t[e].y,c=t[i].x,l=t[i].y;s>o!=l>o&&n<(c-a)*(o-s)/(l-s)+a&&(r=!r)}return r}({x:e.clientX,y:e.clientY},t)}(e,O.current?.area)),[]);return V(Bf,{scope:n,searchRef:M,onItemEnter:to((e=>{R(e)&&e.preventDefault()}),[R]),onItemLeave:to((e=>{R(e)||(E.current?.focus(),C(null))}),[R]),onTriggerLeave:to((e=>{R(e)&&e.preventDefault()}),[R]),pointerGraceTimerRef:k,onPointerGraceIntentChange:to((e=>{O.current=e}),[]),children:V(A,{...N,children:V(ol,{asChild:!0,trapped:r,onMountAutoFocus:kc(i,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:a,children:V(Gc,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:V(Td,{asChild:!0,...y,dir:_.dir,orientation:"vertical",loop:o,currentTabStopId:w,onCurrentTabStopIdChange:C,onEntryFocus:kc(c,(e=>{_.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:V(id,{role:"menu","aria-orientation":"vertical","data-state":gp(v.open),"data-radix-menu-content":"",dir:_.dir,...g,...h,ref:S,style:{outline:"none",...h.style},onKeyDown:kc(h.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,o=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&o&&(e=>{const t=M.current+e,n=b().filter((e=>!e.disabled)),o=document.activeElement,r=n.find((e=>e.ref.current===o))?.textValue,i=function(e,t,n){const o=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,r=n?e.indexOf(n):-1;let i=(a=e,s=Math.max(r,0),a.map(((e,t)=>a[(s+t)%a.length])));var a,s;1===o.length&&(i=i.filter((e=>e!==n)));const c=i.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(n.map((e=>e.textValue)),t,r),a=n.find((e=>e.textValue===i))?.ref.current;!function e(t){M.current=t,window.clearTimeout(T.current),""!==t&&(T.current=window.setTimeout((()=>e("")),1e3))}(t),a&&setTimeout((()=>a.focus()))})(e.key));const r=E.current;if(e.target!==r)return;if(!yf.includes(e.key))return;e.preventDefault();const i=b().filter((e=>!e.disabled)).map((e=>e.ref.current));gf.includes(e.key)&&i.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(i)})),onBlur:kc(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),M.current="")})),onPointerMove:kc(e.onPointerMove,wp((e=>{const t=e.target,n=D.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>D.current?"right":"left";P.current=t,D.current=e.clientX}})))})})})})})})}));jf.displayName=Wf;var Yf=bo(((e,t)=>{const{__scopeMenu:n,...o}=e;return V(Wc.div,{role:"group",...o,ref:t})}));Yf.displayName="MenuGroup";var qf=bo(((e,t)=>{const{__scopeMenu:n,...o}=e;return V(Wc.div,{...o,ref:t})}));qf.displayName="MenuLabel";var Gf="MenuItem",Xf="menu.itemSelect",Zf=bo(((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,i=Qn(null),a=Nf(Gf,e.__scopeMenu),s=$f(Gf,e.__scopeMenu),c=Pc(t,i),l=Qn(!1);return V(Qf,{...r,ref:c,disabled:n,onClick:kc(e.onClick,(()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(Xf,{bubbles:!0,cancelable:!0});e.addEventListener(Xf,(e=>o?.(e)),{once:!0}),Bc(e,t),t.defaultPrevented?l.current=!1:a.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:kc(e.onPointerUp,(e=>{l.current||e.currentTarget?.click()})),onKeyDown:kc(e.onKeyDown,(e=>{const t=""!==s.searchRef.current;n||t&&" "===e.key||_f.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));Zf.displayName=Gf;var Qf=bo(((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...i}=e,a=$f(Gf,n),s=Of(n),c=Qn(null),l=Pc(t,c),[u,d]=qn(!1),[f,p]=qn("");return Xn((()=>{const e=c.current;e&&p((e.textContent??"").trim())}),[i.children]),V(Cf.ItemSlot,{scope:n,disabled:o,textValue:r??f,children:V(Md,{asChild:!0,...s,focusable:!o,children:V(Wc.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:l,onPointerMove:kc(e.onPointerMove,wp((e=>{o?a.onItemLeave(e):(a.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))}))),onPointerLeave:kc(e.onPointerLeave,wp((e=>a.onItemLeave(e)))),onFocus:kc(e.onFocus,(()=>d(!0))),onBlur:kc(e.onBlur,(()=>d(!1)))})})})})),Jf=bo(((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return V(sp,{scope:e.__scopeMenu,checked:n,children:V(Zf,{role:"menuitemcheckbox","aria-checked":yp(n)?"mixed":n,...r,ref:t,"data-state":bp(n),onSelect:kc(r.onSelect,(()=>o?.(!!yp(n)||!n)),{checkForDefaultPrevented:!1})})})}));Jf.displayName="MenuCheckboxItem";var ep="MenuRadioGroup",[tp,np]=Tf(ep,{value:void 0,onValueChange:()=>{}}),op=bo(((e,t)=>{const{value:n,onValueChange:o,...r}=e,i=Nc(o);return V(tp,{scope:e.__scopeMenu,value:n,onValueChange:i,children:V(Yf,{...r,ref:t})})}));op.displayName=ep;var rp="MenuRadioItem",ip=bo(((e,t)=>{const{value:n,...o}=e,r=np(rp,e.__scopeMenu),i=n===r.value;return V(sp,{scope:e.__scopeMenu,checked:i,children:V(Zf,{role:"menuitemradio","aria-checked":i,...o,ref:t,"data-state":bp(i),onSelect:kc(o.onSelect,(()=>r.onValueChange?.(n)),{checkForDefaultPrevented:!1})})})}));ip.displayName=rp;var ap="MenuItemIndicator",[sp,cp]=Tf(ap,{checked:!1}),lp=bo(((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,i=cp(ap,n);return V(cd,{present:o||yp(i.checked)||!0===i.checked,children:V(Wc.span,{...r,ref:t,"data-state":bp(i.checked)})})}));lp.displayName=ap;var up=bo(((e,t)=>{const{__scopeMenu:n,...o}=e;return V(Wc.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})}));up.displayName="MenuSeparator";var dp=bo(((e,t)=>{const{__scopeMenu:n,...o}=e,r=kf(n);return V(ad,{...r,...o,ref:t})}));dp.displayName="MenuArrow";var[fp,pp]=Tf("MenuSub"),mp="MenuSubTrigger",hp=bo(((e,t)=>{const n=Df(mp,e.__scopeMenu),o=Nf(mp,e.__scopeMenu),r=pp(mp,e.__scopeMenu),i=$f(mp,e.__scopeMenu),a=Qn(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=i,l={__scopeMenu:e.__scopeMenu},u=to((()=>{a.current&&window.clearTimeout(a.current),a.current=null}),[]);return Xn((()=>u),[u]),Xn((()=>{const e=s.current;return()=>{window.clearTimeout(e),c(null)}}),[s,c]),V(Lf,{asChild:!0,...l,children:V(Qf,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":gp(n.open),...e,ref:Oc(t,r.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:kc(e.onPointerMove,wp((t=>{i.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||a.current||(i.onPointerGraceIntentChange(null),a.current=window.setTimeout((()=>{n.onOpenChange(!0),u()}),100))}))),onPointerLeave:kc(e.onPointerLeave,wp((e=>{u();const t=n.content?.getBoundingClientRect();if(t){const o=n.content?.dataset.side,r="right"===o,a=r?-5:5,c=t[r?"left":"right"],l=t[r?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:o}),window.clearTimeout(s.current),s.current=window.setTimeout((()=>i.onPointerGraceIntentChange(null)),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}}))),onKeyDown:kc(e.onKeyDown,(t=>{const r=""!==i.searchRef.current;e.disabled||r&&" "===t.key||bf[o.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())}))})})}));hp.displayName=mp;var vp="MenuSubContent",_p=bo(((e,t)=>{const n=Uf(Wf,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,i=Df(Wf,e.__scopeMenu),a=Nf(Wf,e.__scopeMenu),s=pp(vp,e.__scopeMenu),c=Qn(null),l=Pc(t,c);return V(Cf.Provider,{scope:e.__scopeMenu,children:V(cd,{present:o||i.open,children:V(Cf.Slot,{scope:e.__scopeMenu,children:V(Vf,{id:s.contentId,"aria-labelledby":s.triggerId,...r,ref:l,align:"start",side:"rtl"===a.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{a.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:kc(e.onFocusOutside,(e=>{e.target!==s.trigger&&i.onOpenChange(!1)})),onEscapeKeyDown:kc(e.onEscapeKeyDown,(e=>{a.onClose(),e.preventDefault()})),onKeyDown:kc(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=wf[a.dir].includes(e.key);t&&n&&(i.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())}))})})})})}));function gp(e){return e?"open":"closed"}function yp(e){return"indeterminate"===e}function bp(e){return yp(e)?"indeterminate":e?"checked":"unchecked"}function wp(e){return t=>"mouse"===t.pointerType?e(t):void 0}_p.displayName=vp;var xp=Rf,Cp=Lf,Ep=Hf,Sp=jf,Tp=Yf,Mp=qf,kp=Zf,Op=Jf,Pp=op,Dp=ip,Ap=lp,Np=up,Rp=dp,Lp=hp,Ip=_p,Fp="DropdownMenu",[Up,Hp]=Dc(Fp,[Mf]),Wp=Mf(),[Bp,$p]=Up(Fp),jp=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=Wp(t),l=Qn(null),[u=!1,d]=Rc({prop:r,defaultProp:i,onChange:a});return V(Bp,{scope:t,triggerId:pl(),triggerRef:l,contentId:pl(),open:u,onOpenChange:d,onOpenToggle:to((()=>d((e=>!e))),[d]),modal:s,children:V(xp,{...c,open:u,onOpenChange:d,dir:o,modal:s,children:n})})};jp.displayName=Fp;var Kp="DropdownMenuTrigger",zp=bo(((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,i=$p(Kp,n),a=Wp(n);return V(Cp,{asChild:!0,...a,children:V(Wc.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:Oc(t,i.triggerRef),onPointerDown:kc(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())})),onKeyDown:kc(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));zp.displayName=Kp;var Vp=e=>{const{__scopeDropdownMenu:t,...n}=e,o=Wp(t);return V(Ep,{...o,...n})};Vp.displayName="DropdownMenuPortal";var Yp="DropdownMenuContent",qp=bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=$p(Yp,n),i=Wp(n),a=Qn(!1);return V(Sp,{id:r.contentId,"aria-labelledby":r.triggerId,...i,...o,ref:t,onCloseAutoFocus:kc(e.onCloseAutoFocus,(e=>{a.current||r.triggerRef.current?.focus(),a.current=!1,e.preventDefault()})),onInteractOutside:kc(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;r.modal&&!o||(a.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));qp.displayName=Yp;var Gp=bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(Tp,{...r,...o,ref:t})}));Gp.displayName="DropdownMenuGroup";var Xp=bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(Mp,{...r,...o,ref:t})}));Xp.displayName="DropdownMenuLabel";var Zp=bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(kp,{...r,...o,ref:t})}));Zp.displayName="DropdownMenuItem",bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(Op,{...r,...o,ref:t})})).displayName="DropdownMenuCheckboxItem",bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(Pp,{...r,...o,ref:t})})).displayName="DropdownMenuRadioGroup",bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(Dp,{...r,...o,ref:t})})).displayName="DropdownMenuRadioItem",bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(Ap,{...r,...o,ref:t})})).displayName="DropdownMenuItemIndicator",bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(Np,{...r,...o,ref:t})})).displayName="DropdownMenuSeparator",bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(Rp,{...r,...o,ref:t})})).displayName="DropdownMenuArrow",bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(Lp,{...r,...o,ref:t})})).displayName="DropdownMenuSubTrigger",bo(((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Wp(n);return V(Ip,{...r,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})})).displayName="DropdownMenuSubContent";var Qp=jp,Jp=zp,em=Vp,tm=qp,nm=Gp,om=Xp,rm=Zp;function im(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const o=n.reduce(((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]})),{});return eo((()=>({[`__scope${t.scopeName}`]:o})),[o])}};return n.scopeName=t.scopeName,n}var am,sm="dismissableLayer.update",cm=K({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lm=bo(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:a,onDismiss:s,...c}=e,l=no(cm),[u,d]=qn(null),f=u?.ownerDocument??globalThis?.document,[,p]=qn({}),m=Pc(t,(e=>d(e))),h=Array.from(l.layers),[v]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(v),g=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=g>=_,w=function(e,t=globalThis?.document){const n=Nc(e),o=Qn(!1),r=Qn((()=>{}));return Xn((()=>{const e=e=>{if(e.target&&!o.current){let o=function(){dm("dismissableLayer.pointerDownOutside",n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",r.current),r.current=o,t.addEventListener("click",r.current,{once:!0})):o()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",r.current)}}),[t,n]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...l.branches].some((e=>e.contains(t)));b&&!n&&(r?.(e),a?.(e),e.defaultPrevented||s?.())}),f),x=function(e,t=globalThis?.document){const n=Nc(e),o=Qn(!1);return Xn((()=>{const e=e=>{e.target&&!o.current&&dm("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...l.branches].some((e=>e.contains(t)))||(i?.(e),a?.(e),e.defaultPrevented||s?.())}),f);return zc((e=>{g===l.layers.size-1&&(o?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))}),f),Xn((()=>{if(u)return n&&(0===l.layersWithOutsidePointerEventsDisabled.size&&(am=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),um(),()=>{n&&1===l.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=am)}}),[u,f,n,l]),Xn((()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),um())}),[u,l]),Xn((()=>{const e=()=>p({});return document.addEventListener(sm,e),()=>document.removeEventListener(sm,e)}),[]),V(Wc.div,{...c,ref:m,style:{pointerEvents:y?b?"auto":"none":void 0,...e.style},onFocusCapture:kc(e.onFocusCapture,x.onFocusCapture),onBlurCapture:kc(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:kc(e.onPointerDownCapture,w.onPointerDownCapture)})}));function um(){const e=new CustomEvent(sm);document.dispatchEvent(e)}function dm(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Bc(r,i):r.dispatchEvent(i)}lm.displayName="DismissableLayer",bo(((e,t)=>{const n=no(cm),o=Qn(null),r=Pc(t,o);return Xn((()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),V(Wc.div,{...e,ref:r})})).displayName="DismissableLayerBranch";var fm=bo(((e,t)=>{const{container:n,...o}=e,[r,i]=qn(!1);ul((()=>i(!0)),[]);const a=n||r&&globalThis?.document?.body;return a?vr.createPortal(V(Wc.div,{...o,ref:t}),a):null}));fm.displayName="Portal";var pm=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=qn(),o=Qn({}),r=Qn(e),i=Qn("none"),a=e?"mounted":"unmounted",[s,c]=function(e,t){return Gn(((e,n)=>t[e][n]??e),e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return Xn((()=>{const e=mm(o.current);i.current="mounted"===s?e:"none"}),[s]),ul((()=>{const t=o.current,n=r.current;if(n!==e){const o=i.current,a=mm(t);c(e?"MOUNT":"none"===a||"none"===t?.display?"UNMOUNT":n&&o!==a?"ANIMATION_OUT":"UNMOUNT"),r.current=e}}),[e,c]),ul((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,a=i=>{const a=mm(o.current).includes(i.animationName);if(i.target===t&&a&&(c("ANIMATION_END"),!r.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)}))}},s=e=>{e.target===t&&(i.current=mm(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:to((e=>{e&&(o.current=getComputedStyle(e)),n(e)}),[])}}(t),r="function"==typeof n?n({present:o.isPresent}):xo.only(n),i=Pc(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(r));return"function"==typeof n||o.isPresent?or(r,{ref:i}):null};function mm(e){return e?.animationName||"none"}pm.displayName="Presence";var hm=bo(((e,t)=>V(Wc.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));hm.displayName="VisuallyHidden";var vm=hm,[_m,gm]=function(e,t=[]){let n=[];const o=()=>{const t=n.map((e=>K(e)));return function(n){const o=n?.[e]||t;return eo((()=>({[`__scope${e}`]:{...n,[e]:o}})),[n,o])}};return o.scopeName=e,[function(t,o){const r=K(o),i=n.length;n=[...n,o];const a=t=>{const{scope:n,children:o,...a}=t,s=n?.[e]?.[i]||r,c=eo((()=>a),Object.values(a));return V(s.Provider,{value:c,children:o})};return a.displayName=t+"Provider",[a,function(n,a){const s=no(a?.[e]?.[i]||r);if(s)return s;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},im(o,...t)]}("Tooltip",[Bu]),ym=Bu(),bm="TooltipProvider",wm=700,xm="tooltip.open",[Cm,Em]=_m(bm),Sm=e=>{const{__scopeTooltip:t,delayDuration:n=wm,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:i}=e,[a,s]=qn(!0),c=Qn(!1),l=Qn(0);return Xn((()=>{const e=l.current;return()=>window.clearTimeout(e)}),[]),V(Cm,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:to((()=>{window.clearTimeout(l.current),s(!1)}),[]),onClose:to((()=>{window.clearTimeout(l.current),l.current=window.setTimeout((()=>s(!0)),o)}),[o]),isPointerInTransitRef:c,onPointerInTransitChange:to((e=>{c.current=e}),[]),disableHoverableContent:r,children:i})};Sm.displayName=bm;var Tm="Tooltip",[Mm,km]=_m(Tm),Om=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,c=Em(Tm,e.__scopeTooltip),l=ym(t),[u,d]=qn(null),f=pl(),p=Qn(0),m=a??c.disableHoverableContent,h=s??c.delayDuration,v=Qn(!1),[_=!1,g]=Rc({prop:o,defaultProp:r,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(xm))):c.onClose(),i?.(e)}}),y=eo((()=>_?v.current?"delayed-open":"instant-open":"closed"),[_]),b=to((()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,g(!0)}),[g]),w=to((()=>{window.clearTimeout(p.current),p.current=0,g(!1)}),[g]),x=to((()=>{window.clearTimeout(p.current),p.current=window.setTimeout((()=>{v.current=!0,g(!0),p.current=0}),h)}),[h,g]);return Xn((()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)}),[]),V(od,{...l,children:V(Mm,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:to((()=>{c.isOpenDelayed?x():b()}),[c.isOpenDelayed,x,b]),onTriggerLeave:to((()=>{m?w():(window.clearTimeout(p.current),p.current=0)}),[w,m]),onOpen:b,onClose:w,disableHoverableContent:m,children:n})})};Om.displayName=Tm;var Pm="TooltipTrigger",Dm=bo(((e,t)=>{const{__scopeTooltip:n,...o}=e,r=km(Pm,n),i=Em(Pm,n),a=ym(n),s=Pc(t,Qn(null),r.onTriggerChange),c=Qn(!1),l=Qn(!1),u=to((()=>c.current=!1),[]);return Xn((()=>()=>document.removeEventListener("pointerup",u)),[u]),V(rd,{asChild:!0,...a,children:V(Wc.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:s,onPointerMove:kc(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(l.current||i.isPointerInTransitRef.current||(r.onTriggerEnter(),l.current=!0))})),onPointerLeave:kc(e.onPointerLeave,(()=>{r.onTriggerLeave(),l.current=!1})),onPointerDown:kc(e.onPointerDown,(()=>{c.current=!0,document.addEventListener("pointerup",u,{once:!0})})),onFocus:kc(e.onFocus,(()=>{c.current||r.onOpen()})),onBlur:kc(e.onBlur,r.onClose),onClick:kc(e.onClick,r.onClose)})})}));Dm.displayName=Pm;var Am="TooltipPortal",[Nm,Rm]=_m(Am,{forceMount:void 0}),Lm=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,i=km(Am,t);return V(Nm,{scope:t,forceMount:n,children:V(pm,{present:n||i.open,children:V(fm,{asChild:!0,container:r,children:o})})})};Lm.displayName=Am;var Im="TooltipContent",Fm=bo(((e,t)=>{const n=Rm(Im,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...i}=e,a=km(Im,e.__scopeTooltip);return V(pm,{present:o||a.open,children:a.disableHoverableContent?V(Bm,{side:r,...i,ref:t}):V(Um,{side:r,...i,ref:t})})})),Um=bo(((e,t)=>{const n=km(Im,e.__scopeTooltip),o=Em(Im,e.__scopeTooltip),r=Qn(null),i=Pc(t,r),[a,s]=qn(null),{trigger:c,onClose:l}=n,u=r.current,{onPointerInTransitChange:d}=o,f=to((()=>{s(null),d(!1)}),[d]),p=to(((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}(o,function(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,o,r,i)){case i:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,n.getBoundingClientRect())),i=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}(t.getBoundingClientRect())]);s(i),d(!0)}),[d]);return Xn((()=>()=>f()),[f]),Xn((()=>{if(c&&u){const e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener("pointerleave",e),u.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),u.removeEventListener("pointerleave",t)}}}),[c,u,p,f]),Xn((()=>{if(a){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=c?.contains(t)||u?.contains(t),r=!function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){const a=t[e].x,s=t[e].y,c=t[i].x,l=t[i].y;s>o!=l>o&&n<(c-a)*(o-s)/(l-s)+a&&(r=!r)}return r}(n,a);o?f():r&&(f(),l())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[c,u,a,l,f]),V(Bm,{...e,ref:i})})),[Hm,Wm]=_m(Tm,{isInside:!1}),Bm=bo(((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,c=km(Im,n),l=ym(n),{onClose:u}=c;return Xn((()=>(document.addEventListener(xm,u),()=>document.removeEventListener(xm,u))),[u]),Xn((()=>{if(c.trigger){const e=e=>{const t=e.target;t?.contains(c.trigger)&&u()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[c.trigger,u]),V(lm,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:V(id,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[V(Fc,{children:o}),V(Hm,{scope:n,isInside:!0,children:V(vm,{id:c.contentId,role:"tooltip",children:r||o})})]})})}));Fm.displayName=Im;var $m="TooltipArrow";bo(((e,t)=>{const{__scopeTooltip:n,...o}=e,r=ym(n);return Wm($m,n).isInside?null:V(ad,{...r,...o,ref:t})})).displayName=$m;var jm=Sm,Km=Om,zm=Dm,Vm=Lm,Ym=Fm;const qm=[Pa.tc_delete_prompts_comment],Gm=(e,t)=>({type:e,text:t,context:"any"}),Xm=({commentType:e,numComments:t,editComment:n,deleteComment:o=ye,resolveConversation:r=ye,deleteConversation:i=ye,dialogOnCancel:a,disabled:s})=>{const{backend:c,editor:l,sinkRef:u,universe:d,$shouldFocusSidebar:f}=no(ss),p=Qn(null),m=Qn(null),h=Qn(null),[v,_]=qn(!1),[g,y]=(({defaultOpen:e=!1,menuTriggerRef:t,contentContainerRef:n})=>{const[o,r]=qn(e);return[o,e=>{var o,i;!1===e&&(null===(o=n.current)||void 0===o?void 0:o.contains(document.activeElement))&&(null===(i=t.current)||void 0===i||i.focus()),r(e)}]})({menuTriggerRef:m,contentContainerRef:h});Xn((()=>{const e=()=>{y(!1)},t=en(Wt(document),"mousedown",(e=>{var t,n;(t=e.target,n=`.${os.kebabItem.split(" ").join(".")}`,Tn(((e,t)=>Bt(e,t)),kn,t,n,undefined)).fold((()=>{y(!1)}),ye)}));l.on("mousedown",e),l.on("remove",(()=>{l.off("mousedown",e),t.unbind()}))}),[l,y]);const b=({text:e,shouldReceiveFocus:t,callback:n})=>{const[o,r]=qn(t);return Xn((()=>{o&&p.current&&(p.current.focus(),r(!1))}),[o]),V(rm,{ref:t?p:null,class:`${os.kebabItem} ${s?os.kebabDisabledItem:""}`,onFocus:({currentTarget:e})=>e.classList.add(rs),onBlur:({currentTarget:e})=>e.classList.remove(rs),disabled:s,onClick:()=>{s||n()},children:V(om,{class:os.kebabItemLabel,children:d.translate(e)})})},w=e=>[Gm("cancel",d.translate(Pa.tc_delete_buttons_cancel)),Gm("submit",d.translate("delete"===e?Pa.tc_delete_buttons_proceed:Pa.tc_resolve_buttons_proceed))],x=(e,t,n,o)=>()=>{const r=((e,t)=>Fe(e,((e,n)=>`${e}<div><p>${t.translate(ue(n)?n:[n.pattern].concat(n.targets))}</p></div>`),""))(t,d),i=((e,t,n,o,r)=>({title:e,body:{type:"panel",items:[{type:"htmlpanel",html:t}]},buttons:n,onCancel:o,onSubmit:e=>{r(),e.close()}}))(d.translate(e),r,n,a,o);l.windowManager.open(i)},C=x(Pa.tc_dialog_delete_comment,qm,w("delete"),(()=>{o(),f.set(!0)})),E=x(Pa.tc_dialog_delete_conversation,(e=>[Pa.tc_delete_prompts_conversation,1===e?Pa.tc_delete_prompts_conversation_detail_sing:{pattern:Pa.tc_delete_prompts_conversation_detail_pl,targets:[e]}])(t),w("delete"),i),S=x(Pa.tc_dialog_resolve_conversation,(e=>[Pa.tc_resolve_prompts_conversation,1===e?Pa.tc_resolve_prompts_conversation_detail_sing:{pattern:Pa.tc_resolve_prompts_conversation_detail_pl,targets:[e]}])(t),w("resolve"),r),T={class:os.kebabIcon,dangerouslySetInnerHTML:{__html:d.getIcon("image-options")}},M=eo((()=>{const t=[];return"conversation"===e&&t.push({text:Pa.tc_kebab_delete_conversation,callback:E}),c.resolveConversation.isSome()&&"conversation"===e&&t.push({text:Pa.tc_kebab_resolve_conversation,callback:S}),t.push({text:Pa.tc_kebab_edit,callback:n}),"reply"===e&&t.push({text:Pa.tc_kebab_delete,callback:C}),t}),[n,S,c.resolveConversation,e,C,E]);return V(Qp,{open:g,onOpenChange:y,modal:!1,children:[V(jm,{children:V(Km,{open:v,onOpenChange:_,children:[V(Jp,{"aria-label":d.translate("conversation"===e?Pa.tc_kebab_tooltip_conversation:Pa.tc_kebab_tooltip),disabled:s,"data-mce-tooltip":d.translate("conversation"===e?Pa.tc_kebab_tooltip_conversation:Pa.tc_kebab_tooltip),asChild:!0,ref:m,children:V(zm,{asChild:!0,children:V("button",{type:"button",tabindex:-1,class:os.kebab,children:V("div",{...T})})})}),V(Vm,{container:u.current,children:V(Ym,{children:V("div",{class:"tox-tooltip tox-tooltip--up",children:V("div",{class:"tox-tooltip__body",children:d.translate("conversation"===e?Pa.tc_kebab_tooltip_conversation:Pa.tc_kebab_tooltip)})})})})]})}),V(em,{container:u.current,children:V(tm,{loop:!0,align:"end",class:os.kebabMenu,ref:h,children:V(nm,{class:os.kebabMenuGroup,children:M.map((({text:e,callback:t},n)=>V(b,{shouldReceiveFocus:0===n,text:e,callback:t},e)))})})})]})},Zm="displaying",Qm=K({state:Zm,dispatch:ye}),Jm=e=>{const t=()=>new RegExp(/(@[\p{L}\p{M}\p{N}.,\-'\u2019]+)/gu);return e.split(t()).map((e=>({text:e,isMention:t().test(e)})))},eh=e=>ke.from(e.match(/(@[\p{L}\p{M}\p{N}.,\-'\u2019]+)/gu)).filter((e=>e.length>0)),th=e=>dt(e,"@"),nh=e=>Re(e,th),oh=bo((({spanElementOpt:e,mentionsApi:t,setHovering:n,position:o},r)=>{const[i,a]=qn(0),[s,c]=qn(),l=Qn(null),[u,d]=qn(!0);return Jn(r,(()=>({contains:e=>!!ve(l.current)&&l.current.contains(e)}))),Xn((()=>{e.each((e=>{t.selectCard(e,(e=>{c(e)}))}))}),[t,e]),Xn((()=>{(()=>{if(ve(l.current)&&ve(s)){l.current.appendChild(s);const e=Pn(Wt(s),"img"),t=Re(e,(async e=>{return t=e,new Promise(((e,n)=>{const o=()=>{i(),e(t)},r=[en(t,"load",o),en(t,"error",(()=>{i(),n("Unable to load data from image: "+t.dom.src)}))],i=()=>Le(r,(e=>e.unbind()));t.dom.complete&&o()}));var t}));Promise.allSettled(t).then((()=>a(o.y-s.getBoundingClientRect().height))).finally((()=>d(!1)))}})()}),[s,o.y]),s?V("div",{ref:l,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{visibility:u?"hidden":"visible",position:"absolute",top:i,left:o.x,zIndex:100}}):null}));let rh=()=>({emit(e,...t){for(let n=0,o=this.events[e]||[],r=o.length;n<r;n++)o[n](...t)},events:{},on(e,t){return(this.events[e]||=[]).push(t),()=>{this.events[e]=this.events[e]?.filter((e=>t!==e))}}});const ih=(e,t)=>{"undefined"==typeof window||addEventListener(e,t)},ah=(([e,t,n])=>{function o(e){return"string"==typeof e||"number"==typeof e||!0===e}const r=e=>{if(o(e))return[X([""+e,[e]]),()=>{}];const t=[],n=X(null),r=new Map,i=()=>{t.some((e=>null==e||!1===e))?n.set(null):n.set([t.join(""),t])};for(let n=0;n<e.length;n++){const i=e[n];o(i)?t.push(i):(t.push(null),r.set(i,n))}const s=[...r.keys()],c=((e,t)=>{let n;Array.isArray(e)||(e=[e]);let o,r=0,i=()=>{let o=e.map((e=>e.get()));if(void 0===n||o.some(((e,t)=>e!==n[t]))){let e=++r;n=o;let i=t(...o);i&&i.then&&i.t?i.then((t=>{e===r&&a.set(t)})):a.set(i)}},a=X(void 0,Math.max(...e.map((e=>e.l)))+1),s=()=>{clearTimeout(o),o=setTimeout(i)};var c,l;return l=()=>{let t=e.map((e=>e.listen(s,-1/a.l)));return i(),()=>{for(let e of t)e()}},Z(c=a,(e=>{let t=l();t&&c.events[6].push(t)}),5,(e=>{let t=c.listen;c.listen=(...n)=>(c.lc||c.active||(c.active=!0,e()),t(...n));let n=c.off;return c.events[6]=[],c.off=()=>{n(),setTimeout((()=>{if(c.active&&!c.lc){c.active=!1;for(let e of c.events[6])e();c.events[6]=[]}}),1e3)},()=>{c.listen=t,c.off=n}})),a})(s,((...e)=>{for(let n=0;n<e.length;n++){const o=s[n],i=r.get(o);t[i]=o._===l?o.value&&"data"in o.value?o.key:null:e[n]}i()}));return i(),[n,c.subscribe(a)]};function i({retryCount:e}){return 2e3*~~((Math.random()+.5)*(1<<(e<8?e:8)))}function a(){}const s=(e,t)=>Array.isArray(t)?t.includes(e):"function"==typeof t?t(e):e===t,c=()=>(new Date).getTime(),l=Symbol(),u={loading:!0},d={loading:!1};return({cache:o=new Map,fetcher:a,...f}={})=>{const p=rh();let m=!0;t((()=>{m=e(),m&&p.emit(1)})),n((()=>p.emit(2)));const h=new Map,v=new Map,_=new Map;let g={};const y=e=>{const t=o.get(e);return t&&(t.expires||0)>c()?[t.data,t.error]:[]},b=async([e,t],n,r)=>{if(!m)return;const a=t=>{n.key===e&&(n.set(t),p.emit(5,e,t,!0))},s=t=>{a({...void 0===t?{}:{data:t},...u,promise:_.get(e)})};let{dedupeTime:l=4e3,cacheLifetime:f=1/0,fetcher:h,onErrorRetry:b=i}={...r,...g};f<l&&(f=l);const w=c();if(_.has(e))return void(n.value.loading||s(y(e)[0]));let C,E;const S=o.get(e);if((void 0!==S?.data||S?.error)&&([C,E]=y(e),(S.created||0)+l>w))return void(n.value.data==C&&n.value.error==E||a({...d,data:C,error:E}));const T=(Y+=1,()=>{if(Y-=1,0===Y){let e=q;q=[];for(let t of e)t()}});try{clearTimeout(v.get(e));const n=h(...t);_.set(e,n),s(C);const r=await n;o.set(e,{data:r,created:c(),expires:c()+f}),a({data:r,...d})}catch(t){r.onError?.(t);const i=(o.get(e)?.retryCount||0)+1;if(o.set(e,{error:t,created:c(),expires:c()+f,retryCount:i}),b){const n=b({error:t,key:e,retryCount:i});n&&v.set(e,setTimeout((()=>x(e)),n))}a({data:n.value.data,error:t,...d})}finally{T(),_.delete(e)}},w=(e,t)=>{for(const n of o.keys())s(n,e)&&t(n)},x=e=>{w(e,(e=>{o.delete(e)})),p.emit(3,e)},C=e=>{w(e,(e=>{const t=o.get(e);t&&o.set(e,{...t,created:-1/0})})),p.emit(4,e)},E=(e,t)=>{w(e,(e=>{void 0===t?o.delete(e):o.set(e,{data:t,created:c(),expires:c()+(f.cacheLifetime??8e3)})})),p.emit(5,e,t)};return[(e,{fetcher:t=a,...n}={})=>{const o=J({...d}),i={...f,...n,fetcher:t};let c,u,m,v,_;o._=l,o.invalidate=()=>{const{key:e}=o;e&&x(e)},o.revalidate=()=>{const{key:e}=o;e&&C(e)},o.mutate=e=>{const{key:t}=o;t&&E(t,e)},o.fetch=async()=>{let e;const t=new Promise((t=>e=t)),n=o.listen((({error:t,data:n})=>{t&&e({error:t}),n&&e({data:n})}));return t.finally(n)};let g=[];var y;Z(y=o,(()=>{const t=!c;[_,c]=r(e),v=_.subscribe((e=>{if(e){const[t,n]=e;o.key=t,b([t,n],o,i),u=t,m=n}else o.key=u=m=void 0,o.set({...d})}));const n=_.get();n&&([u,m]=n,t&&w());const{revalidateInterval:a=0,revalidateOnFocus:l,revalidateOnReconnect:f}=i,y=()=>{u&&b([u,m],o,i)};a>0&&h.set(e,setInterval(y,a)),l&&g.push(p.on(1,y)),f&&g.push(p.on(2,y));const x=e=>{u&&s(u,e)&&b([u,m],o,i)};g.push(p.on(3,x),p.on(4,x),p.on(5,((e,t,n)=>{u&&s(u,e)&&o.value!==t&&o.value.data!==t&&o.set(n?t:{data:t,...d})})))}),0,(e=>{let t=y.listen;return y.listen=n=>(y.lc||y.starting||(y.starting=!0,e(),delete y.starting),t(n)),()=>{y.listen=t}}));const w=()=>{u&&m&&b([u,m],o,i)},S=o.listen;return o.listen=e=>{const t=S(e);return e(o.value),w(),t},Q(o,(()=>{o.value={...d},c?.(),g.forEach((e=>e())),g=[],v?.(),clearInterval(h.get(e))})),o},function(e,t){const{throttleCalls:n,onError:r}=t??{throttleCalls:!0,onError:f?.onError},i=async t=>{if(n&&a.value?.loading)return;const s=g.fetcher??e,c=[],l=[],d=(e,t)=>{a.lc&&a.setKey(e,t)};try{a.set({error:void 0,data:void 0,mutate:i,...u});const e=await s({data:t,invalidate:e=>{c.push(e)},revalidate:e=>{l.push(e)},getCacheUpdater:(e,t=!0)=>[n=>{E(e,n),t&&l.push(e)},o.get(e)?.data]});return d("data",e),e}catch(e){r?.(e),d("error",e),a.setKey("error",e)}finally{d("loading",!1),c.forEach(x),l.forEach(C)}},a=J({mutate:i,...d});return Q(a,(()=>a.set({mutate:i,...d}))),a.mutate=i,a},{__unsafeOverruleSettings:e=>{console.warn("You should only use __unsafeOverruleSettings in test environment"),g=e},invalidateKeys:x,revalidateKeys:C,mutateCache:E}]}})([()=>!document.hidden,e=>ih("visibilitychange",e),e=>ih("online",e)]),[sh,ch]=ah({fetcher:()=>Promise.reject("Please provide the fetcher property")}),lh={},uh=(e,t)=>sh(e.id+"/author",{fetcher:async()=>t.fetchAuthorInfo().toPromise().then((e=>e.fold((e=>Promise.reject(e)),(e=>Promise.resolve(ke.some(e)))))).catch((t=>(Da(e,ue(t)?t:t.message,t),Promise.reject(t)))),dedupeTime:1/0}),dh=(e,t,n,o,r)=>ch((async({data:i,getCacheUpdater:a})=>{const s=da();return t.create({content:i,createdAt:s}).bindFuture((({conversationUid:n,onSuccess:o,onError:i})=>{return Oa(e,r)?(i&&i(new Error("Unable to create a new conversation")),a=new Error("Unable to create a new conversation"),rt(et(ot.error(a)))):(o&&o(n),t.lookup({conversationUid:n}));var a})).mapResult((({conversation:t})=>{Ta(e),e.annotator.remove(ya()),e.annotator.annotate(ya(),{uid:t.uid});const r=(e=>Ke(e.annotator.getAll(ya())))(e);o.set(r);const[c,l]=a(e.id,!1);c(We(r,(e=>e===t.uid?[t]:He(null!=l?l:[],(t=>t.uid===e)).toArray()))),$e(t.comments).each((({author:o,authorName:r})=>n({type:"create",timestamp:s,conversationUid:t.uid,conversationContext:Ca(e,t.uid),conversationContent:i,conversationAuthor:{author:o,authorName:r},...eh(i).map(nh).map((e=>({mentionedUids:e}))).getOr({})})))})).foldResult((e=>Promise.reject(e)),(()=>Promise.resolve())).toPromise().catch((t=>{Da(e,ue(t)?t:t.message,t)}))})),fh=({mentionUserTerm:e,mentionsApi:t})=>{var n;const{sinkRef:o,editor:r}=no(ss),i=null!==(n=o.current)&&void 0!==n?n:(e=>{const t=e.dom.body;if(null==t)throw new Error("Body is not available yet");return Wt(t)})(Wt(document)).dom,a=((e,t,n)=>{const o=e.id+"/mentions/"+n;return he(lh[o])&&(lh[o]=sh(o,{fetcher:async()=>new Promise(((e,o)=>{t.getUsers(n,(t=>{He(t,(e=>e.name===n||e.id===n)).fold(o,e)}))})),dedupeTime:1/0}),lh[o].listen(ye)),lh[o]})(r,t,e),{data:s}=po(a),c=Qn(null),l=Qn(null),[u,d]=qn(!1),[f,p]=qn({x:0,y:0}),[m,h]=qn(ke.from(s).map(t.getMention));return Xn((()=>{if(ve(s)&&m.isNone()){const e=t.getMention(s);ve(e)&&h(ke.from(e))}}),[s,t,m]),Xn((()=>{if(ve(l.current)){const e=i.getBoundingClientRect(),t=l.current.getBoundingClientRect();p({y:t.top-e.top,x:t.left-e.left})}}),[i,u]),m.fold((()=>V(x,{children:["@",e]})),(e=>V(x,{children:[V("span",{ref:l,onMouseEnter:()=>d(!0),onMouseLeave:e=>{var t,n;const o=e.relatedTarget;(null===(t=l.current)||void 0===t?void 0:t.contains(o))||(null===(n=c.current)||void 0===n?void 0:n.contains(o))||d(!1)},dangerouslySetInnerHTML:{__html:e.outerHTML}}),u&&V(xs,{container:o.current,children:V(oh,{ref:c,spanElementOpt:m,mentionsApi:t,position:f,setHovering:d})})]})))},ph=({text:e,mentionsApi:t})=>V("div",{children:Jm(e).map((({text:e,isMention:n})=>n?V(fh,{mentionsApi:t,mentionUserTerm:th(e)},th(e)):e))}),mh=(e,t,n="top")=>{const o=t.getBoundingClientRect(),r=e.getBoundingClientRect();"bottom"===n||r.bottom>o.bottom&&r.top>o.top&&r.height<o.height?t.scrollTop+=r.bottom-o.bottom+8:t.scrollTop+=r.top-o.top-8},hh=({comment:e,commentType:t,conversationUid:n,numComments:o,selected:r})=>{const{backend:i,editor:a,mentionsApiOpt:s,logger:c,$accessPermission:l,containerRef:u}=no(ss),{dispatch:d}=no(Qm),[f,p]=qn(!1),[m,h]=qn(!1),[v,_]=qn(!1),g=Qn(null),y=Qn(null),b=po(l),w=to((e=>{p(e),d(e?"start-edit-comment":"finish-edit-comment")}),[d,p]),x=eo((()=>((e,t,n,o,r)=>ch((async({data:i,getCacheUpdater:a})=>{const s=da();return t.editComment({commentUid:o,content:i,modifiedAt:s,conversationUid:n}).foldResult((e=>Promise.reject(e)),(t=>{var c;if(t.canEdit){const[t,c]=a(e.id,!1);return t(null==c?void 0:c.map((e=>e.uid===n?{...e,comments:e.comments.map((e=>e.uid===o?{...e,content:i,modifiedAt:s}:e))}:e))),e.undoManager.dispatchChange(),ke.from(c).each((t=>{He(t,(e=>e.uid===n)).each((t=>{He(t.comments,(e=>e.uid===o)).each((({author:a,authorName:s})=>{$e(t.comments).each((({author:t,authorName:c,content:l,createdAt:u})=>{r({type:"edit-comment",timestamp:da(),conversationUid:n,commentUid:o,conversationContext:Ca(e,n),conversationContent:l,conversationCreatedAt:u,commentContent:i,commentAuthor:{author:a,authorName:s},conversationAuthor:{author:t,authorName:c},...eh(i).map(nh).map((e=>({mentionedUids:e}))).getOr({})})}))}))}))})),Promise.resolve()}return Promise.reject({message:Pa.tc_edit_unauthorised_comment,reason:null!==(c=t.reason)&&void 0!==c?c:""})})).toPromise().catch((t=>{Da(e,ue(t)?t:t.message,t)}))})))(a,i,n,e.uid,c)),[a,i,e.uid,n,c]),C=eo((()=>((e,t,n,o,r)=>ch((async({getCacheUpdater:i})=>t.deleteComment({commentUid:o,conversationUid:n}).foldResult((e=>Promise.reject(e)),(t=>{var a;if(t.canDelete){const[t,a]=i(e.id,!1);return t(null==a?void 0:a.map((e=>e.uid===n?{...e,comments:Ie(e.comments,(e=>e.uid!==o))}:e))),e.undoManager.dispatchChange(),ke.from(a).each((t=>{He(t,(e=>e.uid===n)).each((t=>{He(t.comments,(e=>e.uid===o)).each((({author:i,authorName:a,content:s})=>{$e(t.comments).each((({author:t,authorName:c,content:l,createdAt:u})=>{r({type:"delete-comment",timestamp:da(),conversationUid:n,commentUid:o,conversationContext:Ca(e,n),conversationContent:l,conversationCreatedAt:u,commentContent:s,commentAuthor:{author:i,authorName:a},conversationAuthor:{author:t,authorName:c},...eh(s).map(nh).map((e=>({mentionedUids:e}))).getOr({})})}))}))}))})),Promise.resolve()}return Promise.reject({message:Pa.tc_delete_unauthorised_comment,reason:null!==(a=t.reason)&&void 0!==a?a:""})})).toPromise().catch((t=>{Da(e,ue(t)?t:t.message,t)})))))(a,i,n,e.uid,c)),[a,i,n,e.uid,c]),E=eo((()=>((e,t,n,o)=>ch((async({getCacheUpdater:r})=>t.deleteConversation({conversationUid:n}).foldResult((e=>Promise.reject(e)),(t=>{var i;if(t.canDelete){const[t,i]=r(e.id,!1),a=Ca(e,n);return t(null==i?void 0:i.filter((e=>e.uid!==n))),Aa(e,n),ke.from(i).each((e=>{He(e,(e=>e.uid===n)).each((e=>{$e(e.comments).each((({author:e,authorName:t,content:r,createdAt:i})=>{o({type:"delete",timestamp:da(),conversationUid:n,conversationContext:a,conversationContent:r,conversationAuthor:{author:e,authorName:t},conversationCreatedAt:i,...eh(r).map(nh).map((e=>({mentionedUids:e}))).getOr({})})}))}))})),Promise.resolve()}return Promise.reject({message:Pa.tc_delete_unauthorised_conversation,reason:null!==(i=t.reason)&&void 0!==i?i:""})})).toPromise().catch((t=>{Da(e,ue(t)?t:t.message,t)})))))(a,i,n,c)),[i,a,n,c]),S=eo((()=>((e,t,n,o)=>ch((async({getCacheUpdater:r})=>t.resolveConversation.each((t=>{t({conversationUid:n}).foldResult((e=>Promise.reject(e)),(t=>{var i;if(t.canResolve){const[t,i]=r(e.id,!1),a=Ca(e,n);return t(null==i?void 0:i.filter((e=>e.uid!==n))),Aa(e,n),ke.from(i).each((e=>{He(e,(e=>e.uid===n)).each((e=>{$e(e.comments).each((({author:e,authorName:t,content:r,createdAt:i})=>{o({type:"resolve",timestamp:da(),conversationUid:n,conversationContext:a,conversationContent:r,conversationAuthor:{author:e,authorName:t},conversationCreatedAt:i,...eh(r).map(nh).map((e=>({mentionedUids:e}))).getOr({})})}))}))})),Promise.resolve()}return Promise.reject({message:Pa.tc_resolve_unauthorised_conversation,reason:null!==(i=t.reason)&&void 0!==i?i:""})})).toPromise().catch((t=>{Da(e,ue(t)?t:t.message,t)}))})))))(a,i,n,c)),[a,i,n,c]),{mutate:T}=po(x),{mutate:M}=po(C),{mutate:k}=po(E),{mutate:O}=po(S);Xn((()=>{v&&g.current&&r&&(g.current.focus(),_(!1))}),[v,r]),Xn((()=>{f&&ve(y.current)&&ve(u.current)&&mh(y.current,u.current,"bottom")}),[f,u,y]);const P=e=>(ua.focusAncestor(e,"[tabindex]"),ke.some(!0));return ra.useTabKeyNavigation({containerRef:g,selector:"button",escape:P}),ra.useFlowKeyNavigation({containerRef:g,selector:"button",escape:P}),V("div",{ref:g,tabindex:-1,class:os.comment,children:[V("div",{class:os.cardHead,children:[V("div",{class:os.cardHeadMeta,children:V(ds,{details:e})}),r&&V(Xm,{commentType:t,numComments:o,editComment:()=>w(!0),deleteComment:M,deleteConversation:k,resolveConversation:O,dialogOnCancel:()=>{_(!0)},disabled:!b.canWrite})]}),f?V(Mc,{ref:y,content:e.content,editable:f&&!m&&b.canWrite,onSave:e=>{var t;null===(t=g.current)||void 0===t||t.focus({preventScroll:!0}),h(!0),T(e).finally((()=>{w(!1),h(!1)}))},onCancel:()=>{var e;w(!1),null===(e=g.current)||void 0===e||e.focus()}}):V("div",{class:os.cardBody,children:s.fold((()=>V("div",{class:os.editTextarea,children:e.content})),(t=>V(ph,{text:e.content,mentionsApi:t})))})]})},vh=(e,t)=>{switch(t){case"start-reply":return"replying";case"start-edit-comment":return"editing-comment";default:return"displaying"}},_h=({conversation:e})=>{const{mentionsApiOpt:t}=no(ss),n=e.comments[0];return V(x,{children:[V("div",{children:[V("div",{class:os.cardHead,children:V("div",{class:os.cardHeadMeta,children:V(ds,{details:n})})}),V("div",{class:os.cardBody,children:t.fold((()=>V("div",{children:n.content})),(e=>V(ph,{text:n.content,mentionsApi:e})))})]}),e&&e.comments&&e.comments.length>1&&V(vs,{length:e.comments.length})]})},gh=({conversation:e,selectedConversationRef:t})=>{const{editor:n,backend:o,logger:r,$shouldReply:i,$accessPermission:a,containerRef:s}=no(ss),[c,l]=Gn(vh,Zm),u=eo((()=>((e,t,n,o)=>ch((async({data:r,getCacheUpdater:i})=>{const a=da();return t.reply({conversationUid:n.uid,content:r,createdAt:a}).bindFuture((({commentUid:i,author:a,authorName:s})=>($e(n.comments).each((({author:t,authorName:c,content:l,createdAt:u})=>{o({type:"reply",timestamp:u,conversationUid:n.uid,commentUid:i,conversationContext:Ca(e,n.uid),conversationContent:l,conversationCreatedAt:n.comments[0].createdAt,commentContent:r,commentAuthor:{author:a,authorName:s},conversationAuthor:{author:t,authorName:c},...eh(r).map(nh).map((e=>({mentionedUids:e}))).getOr({})})})),t.lookup({conversationUid:n.uid})))).mapResult((({conversation:t})=>{const[o,r]=i(e.id,!1);o(null==r?void 0:r.map((e=>e.uid===n.uid?t:e))),e.undoManager.dispatchChange()})).foldResult((e=>Promise.reject(e)),(()=>Promise.resolve())).toPromise().catch((t=>{Da(e,ue(t)?t:t.message,t)}))})))(n,o,e,r)),[e,o,n,r]),{mutate:d,loading:f}=po(u),p=Qn(null),m=po(a),h=()=>{if(l("finish-reply"),p.current){const t=Ie((e=Wt(p.current),Re(e.dom.childNodes,Wt)),zt);je(t).each(tn)}var e},v=e=>On(e,"tox-comment__single")?(ua.focusDescendant(e,"button"),ke.some(!0)):On(e,"tox-comment")?(ua.focusDescendant(e,`${es.comment},button:not(${es.kebab})`),lt("textarea"!==jt(e),!0)):ke.none(),_=e=>On(e,"tox-comment")?(n.focus(),ke.some(!0)):("replying"!==c||"textarea"!==jt(e)&&"button"!==jt(e)?ua.focusAncestor(e,"[tabindex]"):h(),ke.some(!0)),g=`${es.comment}, button:not(${es.kebab})`;return ra.useTabKeyNavigation({containerRef:t,selector:g,execute:v,escape:_}),ra.useFlowKeyNavigation({containerRef:t,selector:g,execute:v,escape:_}),Xn((()=>{i.subscribe((e=>{e&&(i.set(!1),l("start-reply"))}))}),[i]),Xn((()=>{"replying"===c&&t.current&&s.current&&mh(t.current,s.current,"bottom")}),[c,t,s]),V(x,{children:[V(Qm.Provider,{value:{state:c,dispatch:l},children:e&&V("div",{ref:p,children:Re(e.comments,((t,n)=>V(hh,{comment:t,numComments:e.comments.length,conversationUid:e.uid,commentType:0===n?"conversation":"reply",selected:!0},t.uid)))})}),"displaying"===c&&V(hs,{disabled:!m.canWrite,onClick:()=>{var e;null===(e=t.current)||void 0===e||e.focus({preventScroll:!0}),l("start-reply")}}),"replying"===c&&V(Mc,{editable:!f&&m.canWrite,onSave:e=>{var n;null===(n=t.current)||void 0===n||n.focus({preventScroll:!0}),d(e).finally((()=>l("finish-reply")))},onCancel:h})]})},yh=({conversation:e,selected:t})=>{const{editor:n,$shouldFocusSidebar:o,containerRef:r}=no(ss),i=Qn(null),a=po(o);return Xn((()=>{t&&i.current&&r.current&&mh(i.current,r.current)}),[t,e.comments,r]),Xn((()=>{a&&t&&i.current&&r.current&&(o.set(!1),mh(i.current,r.current),i.current.focus({preventScroll:!0}))}),[a,t,o,r]),V("div",t?{ref:i,tabindex:-1,class:`${os.card} ${ts}`,children:V(gh,{conversation:e,selectedConversationRef:i})}:{tabindex:-1,class:os.card,onFocus:()=>{((e,t)=>Ye(e.annotator.getAll(ya()),t).bind($e))(n,e.uid).each((t=>{t.scrollIntoView({block:"nearest"}),Ma(n,e.uid)}))},children:V(_h,{conversation:e})})},bh=()=>V("div",{class:os.skeletonLine}),wh=()=>V("div",{class:os.skeletonCircle}),xh=()=>V("div",{class:`${os.card} ${os.skeleton}`,style:{width:"100%"},children:[V("div",{style:{width:"100%"},class:os.cardHead,children:V("div",{style:{width:"100%"},class:os.cardHeadMeta,children:V("div",{style:{width:"100%"},class:os.user,children:[V("div",{class:os.avatar,children:V(wh,{})}),V("div",{style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"stretch",gap:"4px"},children:[V("div",{class:os.username,style:{width:"50%"},children:[" ",V(bh,{})]}),V("div",{style:{width:"30%"},class:os.date,children:V(bh,{})})]})]})})}),V("div",{class:os.cardBody,children:V("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:"4px"},children:[V(bh,{}),V(bh,{})]})})]}),Ch=({length:e})=>V("div",{class:os.commentList,children:Array.from(Array(e)).map(((e,t)=>V(xh,{},t)))}),Eh={author:"Anon",authorName:"Anon"},Sh=({selected:e,uid:t})=>{var n,o,r;const{editor:i,backend:a,logger:s,$conversationUids:c,$shouldFocusSidebar:l,$accessPermission:u,containerRef:d}=no(ss),f=eo((()=>dh(i,a,s,c,u)),[i,a,s,c,u]),p=eo((()=>uh(i,a)),[i,a]),{mutate:m}=po(f),h=po(l),v=Qn(null),_=()=>{i.annotator.remove(ya()),c.set(Ie(c.get(),Ee(Ea))),i.focus()};ra.useTabKeyNavigation({containerRef:v,selector:"button,textarea",escape:()=>(_(),ke.some(!0))}),Xn((()=>{e&&v.current&&d.current&&mh(v.current,d.current)}),[e,d]),Xn((()=>{var t,n;h&&e&&v.current&&d.current&&(l.set(!1),mh(v.current,d.current),(t=Wt(v.current),n="textarea",((e,t)=>{const n=void 0===t?document:t.dom;return $t(n)?ke.none():ke.from(n.querySelector(e)).map(Wt)})(n,t)).each(tn))}),[h,e,l,d]);const g=po(u),{data:y}=po(p);return V("div",{tabindex:-1,ref:v,class:os.card+(e?` ${ts}`:""),onFocus:()=>{Ma(i,t)},children:[V("div",{class:os.cardHead,children:V("div",{class:os.cardHeadMeta,children:V("div",{class:os.user,children:[V(as,{avatarInfo:null!==(n=null==y?void 0:y.getOrUndefined())&&void 0!==n?n:Eh}),V("div",{children:V("div",{class:os.username,children:null!==(r=null===(o=null==y?void 0:y.getOrUndefined())||void 0===o?void 0:o.authorName)&&void 0!==r?r:Eh.authorName})})]})})}),V(Mc,{content:"",editable:g.canWrite,onCancel:_,onSave:e=>{i.focus(),m(e).then((()=>{l.set(!0)}))},autofocus:!0})]})},Th=It().os.isMacOS(),Mh=e=>t=>{t.altKey&&t.metaKey===Th&&t.ctrlKey===!Th&&"KeyM"===t.code&&!Ia(e)&&(t.preventDefault(),(e=>{e.execCommand("ToggleSidebar",!1,"showcomments")})(e))},kh=({backend:e,editor:t,universe:n,logger:o,$conversationUids:r,$shouldFocusSidebar:i,$shouldReply:a,$forcedUpdate:s,$accessPermission:c})=>{const l=Qn(null),u=Qn(null),d=t.plugins.mentions,f=lt(Ra(t)&&ve(d),d),p=eo((()=>({backend:e,editor:t,universe:n,sinkRef:l,containerRef:u,logger:o,mentionsApiOpt:f,$shouldFocusSidebar:i,$shouldReply:a,$conversationUids:r,$accessPermission:c})),[e,t,n,o,f,i,a,r,c,u]),m=()=>(t.focus(),ke.some(!0)),h=e=>u.current&&On(e,"tox-comment")?(ua.focusDescendant(e,es.comment),ke.some(!0)):ke.none();ra.useTabKeyNavigation({containerRef:u,closest:!1,selector:es.card,escape:m,execute:h}),ra.useFlowKeyNavigation({containerRef:u,closest:!1,selector:es.card,escape:m,execute:h});const v=po(r),_=eo((()=>v.findIndex(Ea)),[v]),g=eo((()=>((e,t,n)=>sh(e.id,{fetcher:async()=>{const o=n.get(),r=o.findIndex(Ea),i=r>=0?o.filter(((e,t)=>t!==r)):o;return t.fetchConversations.fold((()=>Promise.all(i.map((e=>t.lookup({conversationUid:e}).foldResult((e=>Promise.reject(e)),(e=>Promise.resolve(e.conversation))).toPromise())).filter(ve))),(async e=>e(o).foldResult((e=>Promise.reject(e)),(({conversations:e})=>Promise.resolve(i.map((t=>e[t])).filter(ve)))).toPromise().then(we))).catch((t=>(Da(e,ue(t)?t:t.message,t),Promise.reject(t))))}}))(t,e,r)),[t,e,r]),y=eo((()=>uh(t,e)),[t,e]);Xn((()=>{y.listen(ye)}),[y]),Xn((()=>r.subscribe(((e,n)=>{(0===e.length||n&&!((e,t,n=ie)=>re(n).eq(e,t))(Ie(e,Ee(Ea)),n,oe))&&g.revalidate(t.id)}))),[r,g,t.id]);const{data:b,loading:w}=po(g),[x,C]=qn(ke.none());Xn((()=>{t.annotator.annotationChanged(ya(),((e,n,o)=>{e||(Ta(t),r.set(Ie(r.get(),Ee(Ea)))),a.set(!1),C(ke.from(null==o?void 0:o.uid))}))}),[t,a,r]),Xn((()=>{s.subscribe((()=>{g.invalidate(t.id)}))}),[s,g,t.id]),Xn((()=>{const e=()=>{g.revalidate(t.id)};return t.on("SetContent",e),()=>{t.off("SetContent",e)}}),[t,g]);const[E,S]=qn(!0);Xn((()=>{E&&b&&b.length>0&&!t.removed&&($e(Ke((e=>((e,t)=>{const n={};return((e,t,n,o)=>{Ve(e,((e,r)=>{(t(e,r)?n:o)(e,r)}))})(e,t,(e=>(t,n)=>{e[n]=t})(n),ye),n})(e.annotator.getAll(ya()),(t=>Ae(t,e.selection.getNode()))))(t))).each((e=>C(ke.from(e)))),S(!1))}),[E,t,b]);const T=eo((()=>{if(b){const e=b.map((e=>V(yh,{selected:x.exists((t=>t===e.uid)),conversation:e},e.uid)));return _>=0&&e.splice(_,0,V(Sh,{uid:v[_],selected:x.exists(Ea)})),e}}),[b,_,x,v]),M=Qn(null);return V(ss.Provider,{value:p,children:[V("div",{ref:l,class:"tox-comments-sink",style:"position: relative; z-index: 100;"}),V("div",{class:os.conversationsHead,children:V("div",{class:os.conversationsTitle,children:n.translate(Pa.tc_conversations_title)})}),V("div",{ref:u,class:os.outerScroll,onKeyDown:Mh(t),children:!b&&w?V(Ch,{length:v.length}):V("div",{ref:M,class:os.commentList,children:T})})]})};tinymce.Resource.add("tinymce.plugins.tinycomments.sidebar",((e,t,n,o,r,i,a,s,c)=>{const l=X(0);return e.on("mce-tinycomments-update",(()=>{l.set(l.get()+1)})),B(V(kh,{editor:e,backend:t,universe:n,logger:o,$conversationUids:r,$shouldFocusSidebar:i,$shouldReply:a,$forcedUpdate:l,$accessPermission:s}),c),()=>{B(null,c)}}))}();