/*!
 * Tiny Suggested Edits plugin
 *
 * Copyright (c) 2025 Ephox Corporation DBA Tiny Technologies, Inc.
 * Licensed under the Tiny commercial license. See https://www.tiny.cloud/legal/
 *
 * Version: 8.3.0-112
 */

/*!
 * This resource uses the code from the following libraries:
 *
 * visual-dom-diff
 *  https://github.com/Teamwork/visual-dom-diff
 *
 * preact
 *  Copyright (c) 2015-present Jason Miller
 *  https://github.com/preactjs/preact
 *
 * diff-match-patch
 *  Copyright 2018 The diff-match-patch Authors.
 *  https://github.com/google/diff-match-patch
 *
 * immer
 *  Copyright (c) 2017 Michel Weststrate
 *  https://github.com/immerjs/immer
 *
 */

!function(){"use strict";var e,t,n,r,o,i,s,a,c,l,d,u={},_=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function h(e,t){for(var n in t)e[n]=t[n];return e}function m(e){var t=e.parentNode;t&&t.removeChild(e)}function v(t,n,r){var o,i,s,a={};for(s in n)"key"==s?o=n[s]:"ref"==s?i=n[s]:a[s]=n[s];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof t&&null!=t.defaultProps)for(s in t.defaultProps)void 0===a[s]&&(a[s]=t.defaultProps[s]);return g(t,a,o,i,null)}function g(e,r,o,i,s){var a={type:e,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++n:s,__i:-1,__u:0};return null==s&&null!=t.vnode&&t.vnode(a),a}function y(e){return e.children}function b(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(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?k(e):null}function C(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 C(e)}}function x(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!w.__r++||o!==t.debounceRendering)&&((o=t.debounceRendering)||i)(w)}function w(){var e,n,o,i,a,c,l,d;for(r.sort(s);e=r.shift();)e.__d&&(n=r.length,i=void 0,c=(a=(o=e).__v).__e,l=[],d=[],o.__P&&((i=h({},a)).__v=a.__v+1,t.vnode&&t.vnode(i),T(o.__P,i,a,o.__n,o.__P.namespaceURI,32&a.__u?[c]:null,l,null==c?k(a):c,!!(32&a.__u),d),i.__v=a.__v,i.__.__k[i.__i]=i,E(l,i,d),i.__e!=c&&C(i)),r.length>n&&r.sort(s));w.__r=0}function S(e,t,n,r,o,i,s,a,c,l,d){var p,h,m,v,b,C=r&&r.__k||_,x=t.length;for(n.__d=c,function(e,t,n){var r,o,i,s,a,c=t.length,l=n.length,d=l,u=0;for(e.__k=[],r=0;r<c;r++)s=r+u,null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?g(null,o,null,null,null):f(o)?g(y,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?g(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,a=I(o,n,s,d),o.__i=a,i=null,-1!==a&&(d--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&u--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a==s-1?u=a-s:a==s+1?u++:a>s?d>c-s?u+=a-s:u--:a<s&&u++,a!==r+u&&(o.__u|=65536))):(i=n[s])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=k(i)),H(i,i,!1),n[s]=null,d--);if(d)for(r=0;r<l;r++)null!=(i=n[r])&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=k(i)),H(i,i))}(n,t,C),c=n.__d,p=0;p<x;p++)null!=(m=n.__k[p])&&"boolean"!=typeof m&&"function"!=typeof m&&(h=-1===m.__i?u:C[m.__i]||u,m.__i=p,T(e,m,h,o,i,s,a,c,l,d),v=m.__e,m.ref&&h.ref!=m.ref&&(h.ref&&L(h.ref,null,m),d.push(m.ref,m.__c||v,m)),null==b&&null!=v&&(b=v),65536&m.__u||h.__k===m.__k?c=B(m,c,e):"function"==typeof m.type&&void 0!==m.__d?c=m.__d:v&&(c=v.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=c,n.__e=b}function B(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=B(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=k(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function N(e,t){return t=t||[],null==e||"boolean"==typeof e||(f(e)?e.some((function(e){N(e,t)})):t.push(e)),t}function I(e,t,n,r){var o=e.key,i=e.type,s=n-1,a=n+1,c=t[n];if(null===c||c&&o==c.key&&i===c.type&&!(131072&c.__u))return n;if(r>(null==c||131072&c.__u?0:1))for(;s>=0||a<t.length;){if(s>=0){if((c=t[s])&&!(131072&c.__u)&&o==c.key&&i===c.type)return s;s--}if(a<t.length){if((c=t[a])&&!(131072&c.__u)&&o==c.key&&i===c.type)return a;a++}}return-1}function O(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||p.test(t)?n:n+"px"}function A(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||O(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||O(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?r?n.u=r.u:(n.u=a,e.addEventListener(t,i?l:c,i)):e.removeEventListener(t,i?l:c,i);else{if("http://www.w3.org/2000/svg"==o)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(n){if(this.l){var r=this.l[n.type+e];if(null==n.t)n.t=a++;else if(n.t<r.u)return;return r(t.event?t.event(n):n)}}}function T(e,n,r,o,i,s,a,c,l,d){var u,_,p,m,v,g,k,C,x,w,B,N,I,O,A,R,T=n.type;if(void 0!==n.constructor)return null;128&r.__u&&(l=!!(32&r.__u),s=[c=n.__e=r.__e]),(u=t.__b)&&u(n);e:if("function"==typeof T)try{if(C=n.props,x="prototype"in T&&T.prototype.render,w=(u=T.contextType)&&o[u.__c],B=u?w?w.props.value:u.__:o,r.__c?k=(_=n.__c=r.__c).__=_.__E:(x?n.__c=_=new T(C,B):(n.__c=_=new b(C,B),_.constructor=T,_.render=M),w&&w.sub(_),_.props=C,_.state||(_.state={}),_.context=B,_.__n=o,p=_.__d=!0,_.__h=[],_._sb=[]),x&&null==_.__s&&(_.__s=_.state),x&&null!=T.getDerivedStateFromProps&&(_.__s==_.state&&(_.__s=h({},_.__s)),h(_.__s,T.getDerivedStateFromProps(C,_.__s))),m=_.props,v=_.state,_.__v=n,p)x&&null==T.getDerivedStateFromProps&&null!=_.componentWillMount&&_.componentWillMount(),x&&null!=_.componentDidMount&&_.__h.push(_.componentDidMount);else{if(x&&null==T.getDerivedStateFromProps&&C!==m&&null!=_.componentWillReceiveProps&&_.componentWillReceiveProps(C,B),!_.__e&&(null!=_.shouldComponentUpdate&&!1===_.shouldComponentUpdate(C,_.__s,B)||n.__v===r.__v)){for(n.__v!==r.__v&&(_.props=C,_.state=_.__s,_.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.forEach((function(e){e&&(e.__=n)})),N=0;N<_._sb.length;N++)_.__h.push(_._sb[N]);_._sb=[],_.__h.length&&a.push(_);break e}null!=_.componentWillUpdate&&_.componentWillUpdate(C,_.__s,B),x&&null!=_.componentDidUpdate&&_.__h.push((function(){_.componentDidUpdate(m,v,g)}))}if(_.context=B,_.props=C,_.__P=e,_.__e=!1,I=t.__r,O=0,x){for(_.state=_.__s,_.__d=!1,I&&I(n),u=_.render(_.props,_.state,_.context),A=0;A<_._sb.length;A++)_.__h.push(_._sb[A]);_._sb=[]}else do{_.__d=!1,I&&I(n),u=_.render(_.props,_.state,_.context),_.state=_.__s}while(_.__d&&++O<25);_.state=_.__s,null!=_.getChildContext&&(o=h(h({},o),_.getChildContext())),x&&!p&&null!=_.getSnapshotBeforeUpdate&&(g=_.getSnapshotBeforeUpdate(m,v)),S(e,f(R=null!=u&&u.type===y&&null==u.key?u.props.children:u)?R:[R],n,r,o,i,s,a,c,l,d),_.base=n.__e,n.__u&=-161,_.__h.length&&a.push(_),k&&(_.__E=_.__=null)}catch(e){if(n.__v=null,l||null!=s){for(n.__u|=l?160:32;c&&8===c.nodeType&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,n.__e=c}else n.__e=r.__e,n.__k=r.__k;t.__e(e,n,r)}else null==s&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=P(r.__e,n,r,o,i,s,a,l,d);(u=t.diffed)&&u(n)}function E(e,n,r){n.__d=void 0;for(var o=0;o<r.length;o++)L(r[o],r[++o],r[++o]);t.__c&&t.__c(n,e),e.some((function(n){try{e=n.__h,n.__h=[],e.some((function(e){e.call(n)}))}catch(e){t.__e(e,n.__v)}}))}function P(t,n,r,o,i,s,a,c,l){var d,_,p,h,v,g,y,b=r.props,C=n.props,x=n.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!=s)for(d=0;d<s.length;d++)if((v=s[d])&&"setAttribute"in v==!!x&&(x?v.localName===x:3===v.nodeType)){t=v,s[d]=null;break}if(null==t){if(null===x)return document.createTextNode(C);t=document.createElementNS(i,x,C.is&&C),s=null,c=!1}if(null===x)b===C||c&&t.data===C||(t.data=C);else{if(s=s&&e.call(t.childNodes),b=r.props||u,!c&&null!=s)for(b={},d=0;d<t.attributes.length;d++)b[(v=t.attributes[d]).name]=v.value;for(d in b)if(v=b[d],"children"==d);else if("dangerouslySetInnerHTML"==d)p=v;else if("key"!==d&&!(d in C)){if("value"==d&&"defaultValue"in C||"checked"==d&&"defaultChecked"in C)continue;A(t,d,null,v,i)}for(d in C)v=C[d],"children"==d?h=v:"dangerouslySetInnerHTML"==d?_=v:"value"==d?g=v:"checked"==d?y=v:"key"===d||c&&"function"!=typeof v||b[d]===v||A(t,d,v,b[d],i);if(_)c||p&&(_.__html===p.__html||_.__html===t.innerHTML)||(t.innerHTML=_.__html),n.__k=[];else if(p&&(t.innerHTML=""),S(t,f(h)?h:[h],n,r,o,"foreignObject"===x?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:r.__k&&k(r,0),c,l),null!=s)for(d=s.length;d--;)null!=s[d]&&m(s[d]);c||(d="value",void 0!==g&&(g!==t[d]||"progress"===x&&!g||"option"===x&&g!==b[d])&&A(t,d,g,b[d],i),d="checked",void 0!==y&&y!==t[d]&&A(t,d,y,b[d],i))}return t}function L(e,n,r){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==n||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function H(e,n,r){var o,i;if(t.unmount&&t.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||L(o,null,n)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){t.__e(e,n)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&H(o[i],n,r||"function"!=typeof e.type);r||null==e.__e||m(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function M(e,t,n){return this.constructor(e,n)}function D(n,r,o){var i,s,a;t.__&&t.__(n,r),i=r.__k,s=[],a=[],T(r,n=r.__k=v(y,null,[n]),i||u,u,r.namespaceURI,i?null:r.firstChild?e.call(r.childNodes):null,s,i?i.__e:r.firstChild,!1,a),E(s,n,a)}function F(e,t){var n={__c:t="__cC"+d++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,x(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}e=_.slice,t={__e:function(e,t,n,r){for(var o,i,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},n=0,b.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},n),this.props)),e&&h(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),x(this))},b.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},b.prototype.render=y,r=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(e,t){return e.__v.__b-t.__v.__b},w.__r=0,a=0,c=R(!1),l=R(!0),d=0;var $=0;function U(e,n,r,o,i,s){n||(n={});var a,c,l=n;if("ref"in l)for(c in l={},n)"ref"==c?a=n[c]:l[c]=n[c];var d={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--$,__i:-1,__u:0,__source:i,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(c in a)void 0===l[c]&&(l[c]=a[c]);return t.vnode&&t.vnode(d),d}const W=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,j=e=>t=>typeof t===e,K=W("string"),V=W("array"),z=j("boolean"),q=e=>void 0===e,G=e=>!(e=>null==e)(e),J=j("function"),Y=j("number"),Z=()=>{},X=e=>()=>e,Q=e=>e,ee=X(!1),te=X(!0);class ne{tag;value;static singletonNone=new ne(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new ne(!0,e)}static none(){return ne.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?ne.some(e(this.value)):ne.none()}bind(e){return this.tag?e(this.value):ne.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:ne.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 G(e)?ne.some(e):ne.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 re=Array.prototype.slice,oe=Array.prototype.indexOf,ie=Array.prototype.push,se=(e,t)=>((e,t)=>oe.call(e,t))(e,t)>-1,ae=(e,t)=>{const n=e.length,r=new Array(n);for(let o=0;o<n;o++){const n=e[o];r[o]=t(n,o)}return r},ce=(e,t)=>{for(let n=0,r=e.length;n<r;n++)t(e[n],n)},le=(e,t)=>{const n=[];for(let r=0,o=e.length;r<o;r++){const o=e[r];t(o,r)&&n.push(o)}return n},de=(e,t,n)=>(ce(e,((e,r)=>{n=t(n,e,r)})),n),ue=(e,t)=>((e,t,n)=>{for(let r=0,o=e.length;r<o;r++){const o=e[r];if(t(o,r))return ne.some(o);if(n(o,r))break}return ne.none()})(e,t,ee),_e=(e,t)=>{for(let n=0,r=e.length;n<r;n++)if(t(e[n],n))return ne.some(n);return ne.none()},pe=e=>{const t=re.call(e,0);return t.reverse(),t},fe=Object.keys,he=Object.hasOwnProperty,me=(e,t)=>{const n=fe(e);for(let r=0,o=n.length;r<o;r++){const o=n[r];t(e[o],o)}},ve=(e,t)=>ge(e,((e,n)=>({k:n,v:t(e,n)}))),ge=(e,t)=>{const n={};return me(e,((e,r)=>{const o=t(e,r);n[o.k]=o.v})),n},ye=(e,t)=>{const n={};return((e,t,n,r)=>{me(e,((e,o)=>{(t(e,o)?n:r)(e,o)}))})(e,t,(e=>(t,n)=>{e[n]=t})(n),Z),n};let be=0;const ke=(e,t)=>e?ne.some(t):ne.none(),Ce=(e,t,n=0,r)=>{const o=e.indexOf(t,n);return-1!==o&&(!!q(r)||o+t.length<=r)},xe=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},we=xe,Se=(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")}},Be=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Ne=(e,t)=>e.dom===t.dom,Ie=()=>Oe(0,0),Oe=(e,t)=>({major:e,minor:t}),Ae={nu:Oe,detect:(e,t)=>{const n=String(t).toLowerCase();return 0===e.length?Ie():((e,t)=>{const n=((e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.test(t))return r}})(e,t);if(!n)return{major:0,minor:0};const r=e=>Number(t.replace(n,"$"+e));return Oe(r(1),r(2))})(e,n)},unknown:Ie},Re=(e,t)=>{const n=String(t).toLowerCase();return ue(e,(e=>e.search(n)))},Te=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ee=e=>t=>Ce(t,e),Pe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>Ce(e,"edge/")&&Ce(e,"chrome")&&Ce(e,"safari")&&Ce(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Te],search:e=>Ce(e,"chrome")&&!Ce(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>Ce(e,"msie")||Ce(e,"trident")},{name:"Opera",versionRegexes:[Te,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ee("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ee("firefox")},{name:"Safari",versionRegexes:[Te,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(Ce(e,"safari")||Ce(e,"mobile/"))&&Ce(e,"applewebkit")}],Le=[{name:"Windows",search:Ee("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>Ce(e,"iphone")||Ce(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ee("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Ee("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ee("linux"),versionRegexes:[]},{name:"Solaris",search:Ee("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ee("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Ee("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],He={browsers:X(Pe),oses:X(Le)},Me=e=>{const t=e.current,n=e.version,r=e=>()=>t===e;return{current:t,version:n,isEdge:r("Edge"),isChromium:r("Chromium"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r("Firefox"),isSafari:r("Safari")}},De=()=>Me({current:void 0,version:Ae.unknown()}),Fe=Me,$e=e=>{const t=e.current,n=e.version,r=e=>()=>t===e;return{current:t,version:n,isWindows:r("Windows"),isiOS:r("iOS"),isAndroid:r("Android"),isMacOS:r("macOS"),isLinux:r("Linux"),isSolaris:r("Solaris"),isFreeBSD:r("FreeBSD"),isChromeOS:r("ChromeOS")}},Ue=()=>$e({current:void 0,version:Ae.unknown()}),We=$e,je=(e,t,n)=>{const r=He.browsers(),o=He.oses(),i=t.bind((e=>((e,t)=>((e,t)=>{for(let n=0;n<e.length;n++){const r=t(e[n]);if(r.isSome())return r}return ne.none()})(t.brands,(t=>{const n=t.brand.toLowerCase();return ue(e,(e=>n===e.brand?.toLowerCase())).map((e=>({current:e.name,version:Ae.nu(parseInt(t.version,10),0)})))})))(r,e))).orThunk((()=>((e,t)=>Re(e,t).map((e=>{const n=Ae.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(r,e))).fold(De,Fe),s=((e,t)=>Re(e,t).map((e=>{const n=Ae.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(o,e).fold(Ue,We),a=((e,t,n,r)=>{const o=e.isiOS()&&!0===/ipad/i.test(n),i=e.isiOS()&&!o,s=e.isiOS()||e.isAndroid(),a=s||r("(pointer:coarse)"),c=o||!i&&s&&r("(min-device-width:768px)"),l=i||s&&!c,d=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),u=!l&&!c&&!d;return{isiPad:X(o),isiPhone:X(i),isTablet:X(c),isPhone:X(l),isTouch:X(a),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:X(d),isDesktop:X(u)}})(s,i,e,n);return{browser:i,os:s,deviceType:a}},Ke=e=>window.matchMedia(e).matches;let Ve=(e=>{let t,n=!1;return(...r)=>(n||(n=!0,t=e.apply(null,r)),t)})((()=>je(window.navigator.userAgent,ne.from(window.navigator.userAgentData),Ke)));const ze=()=>Ve(),qe=e=>t=>(e=>e.dom.nodeType)(t)===e,Ge=qe(3),Je=qe(11),Ye=e=>(e=>{const t=e.dom.childNodes;return ne.from(t[0]).map(we)})(e),Ze=e=>we(e.dom.getRootNode()),Xe=e=>we(e.dom.host),Qe=(e,t=!1)=>e.dom.focus({preventScroll:t}),et=(e,t)=>{const n=e.dom.getAttribute(t);return null===n?void 0:n},tt=(e,t)=>ne.from(et(e,t)),nt=()=>{const e=ze().os.isMacOS()||ze().os.isiOS();return`<script>(${(e=>{document.addEventListener("click",(t=>{for(let n=t.target;n;n=n.parentNode)if("A"===n.nodeName){const r=n.getAttribute("href");if(r&&r.startsWith("#")){t.preventDefault();const e=document.getElementById(r.substring(1));return void(e&&e.scrollIntoView({behavior:"smooth"}))}(e?t.metaKey:t.ctrlKey&&!t.altKey)||t.preventDefault()}}),!1)}).toString()})(${e})<\/script>`},rt=e=>void 0!==e.style&&J(e.style.getPropertyValue),ot=e=>{const t=Ge(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return(e=>{const t=Ze(e);return Je(n=t)&&G(n.dom.host)?ne.some(t):ne.none();var n})(we(t)).fold((()=>n.body.contains(t)),(r=ot,o=Xe,e=>r(o(e))));var r,o},it=(e,t)=>{const n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||ot(e)?r:st(n,t)},st=(e,t)=>rt(e)?e.style.getPropertyValue(t):"",at=(e=>{const t=t=>{const n=(e=>{const t=e.dom;return ot(e)?t.getBoundingClientRect().height:t.offsetHeight})(t);if(n<=0||null===n){const n=it(t,e);return parseFloat(n)||0}return n},n=(e,t)=>de(t,((t,n)=>{const r=it(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o}),0);return{set:(t,n)=>{if(!Y(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);const r=t.dom;rt(r)&&(r.style[e]=n+"px")},get:t,getOuter:t,aggregate:n,max:(e,t,r)=>{const o=n(e,r);return t>o?t-o:0}}})("height"),ct=e=>at.get(e),lt=e=>!(e=>e.offsetWidth<=0&&e.offsetHeight<=0)(e.dom),dt=(e,t)=>n=>"rtl"===ut(n)?t:e,ut=e=>"rtl"===it(e,"direction")?"rtl":"ltr",_t=(e,t,n)=>{const r=((e,t)=>{const n=et(e,t);return void 0===n||""===n?[]:n.split(" ")})(e,t);return((e,t,n)=>{((e,t,n)=>{if(!(K(n)||z(n)||Y(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)})(e,t,r.concat([n]).join(" ")),!0},pt=(e,t,n)=>((e,t,n)=>{let r=e.dom;const o=J(n)?n:ee;for(;r.parentNode;){r=r.parentNode;const e=we(r);if(t(e))return ne.some(e);if(o(e))break}return ne.none()})(e,(e=>Se(e,t)),n),ft=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return Be(n)?ne.none():ne.from(n.querySelector(e)).map(we)})(t,e),ht=(e,t,n)=>((e,t,n,r,o)=>e(n,r)?ne.some(n):J(o)&&o(n)?ne.none():t(n,r,o))(((e,t)=>Se(e,t)),pt,e,t,n),mt=e=>void 0!==e.dom.classList,vt=(e,t)=>mt(e)&&e.dom.classList.contains(t),gt=e=>e.dom.textContent,yt=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return Be(n)?[]:ae(n.querySelectorAll(e),we)})(t,e),bt=e=>e.hasOwnProperty("text"),kt=e=>e.hasOwnProperty("comment"),Ct=e=>e.hasOwnProperty("children")||e.hasOwnProperty("type")&&!kt(e),xt=e=>"type"in e&&"string"==typeof e.type&&wt.has(e.type),wt=new Set(["area","base","col","embed","br","img","hr","input","meta","link","param","source","track","wbr","iframe"]),St=()=>1e3*Math.floor((new Date).getTime()/1e3),Bt=(...e)=>e.join(" "),Nt=(...e)=>e.join(", "),It="full",Ot="feedback",At="Complete review",Rt="Cancel",Tt="Bulk actions",Et="replaced {0} with {1}",Pt="feedback-textarea",Lt={Base:"tox-collection",List:"tox-collection--list",Group:"tox-collection__group",Item:"tox-collection__item",ItemActive:"tox-collection__item--active",ItemLabel:"tox-collection__item-label"},Ht={Base:"tox-menu"},Mt={Base:"tox-tiered-menu"},Dt={Base:"tox-selected-menu"},Ft={Avatar:"tox-user__avatar"},$t={Js:"tox-menu-nav__js"},Ut={Base:"tox-icon",Success:"tox-icon--success",Error:"tox-icon--error"},Wt={Base:"tox-button",Secondary:"tox-button--secondary",SecondaryOutlined:"tox-button--secondary--outline",Icon:"tox-button--icon",IconText:"tox-button--icon-and-text",Stretch:"tox-button--stretch"},jt={Base:"tox-skeleton",Line:"tox-skeleton__line",Circle:"tox-skeleton__circle"},Kt={Base:"tox-toggle",Slider:"tox-toggle__slider"},Vt={Base:"tox-suggestededits",Annotation:{Base:"tox-suggestededits__annotation"},Sink:{Base:"tox-suggestededits__sink"},Container:{Base:"tox-suggestededits__container"},Pane:{Base:"tox-suggestededits__pane"},Content:{Base:"tox-suggestededits__content"},Model:{Base:"tox-suggestededits__model"},Iframe:{Base:"tox-suggestededits__iframe"},Resolution:{Base:"tox-suggestededits__resolution",Accepted:"tox-suggestededits__resolution--accepted",Rejected:"tox-suggestededits__resolution--rejected"},Card:{Base:"tox-suggestededits__card",Single:"tox-suggestededits__card--single",Resolved:"tox-suggestededits__card--resolved",Hidden:"tox-suggestededits__card--hidden",Active:"tox-suggestededits__card--active",Divider:"tox-suggestededits__card--divider",Header:"tox-suggestededits__card--header",Content:"tox-suggestededits__card--content",Editor:"tox-suggestededits__card--editor",TextArea:"tox-suggestededits__card--textarea",Feedback:"tox-suggestededits__card--feedback",FeedbackUser:"tox-suggestededits__card--feedback-user",Buttons:"tox-suggestededits__card--buttons",ReviewButtons:"tox-suggestededits__card--review-buttons",FeedbackButtons:"tox-suggestededits__card--feedback-buttons",User:"tox-suggestededits__card--user",Avatar:"tox-suggestededits__card--avatar",Details:"tox-suggestededits__card--details",Name:"tox-suggestededits__card--name",Timestamp:"tox-suggestededits__card--timestamp",Footer:"tox-suggestededits__card--footer"},Operations:{Base:"tox-suggestededits__operations",Bar:"tox-suggestededits__operations-bar",Insert:"tox-suggestededits__operations-bar--insert",Remove:"tox-suggestededits__operations-bar--remove",Modify:"tox-suggestededits__operations-bar--modify",Text:"tox-suggestededits__operations-text"},Sidebar:{Base:"tox-suggestededits__sidebar",Header:"tox-suggestededits__sidebar-header",Content:"tox-suggestededits__sidebar-content"}},zt={Toolbar:{Base:"tox-view__toolbar"},Align:{Right:"tox-view__align-right"},Label:{Base:"tox-view__label",Large:"tox-view__label--large"}},qt={Pagebreak:"mce-pagebreak"},Gt={insert:Vt.Operations.Insert,remove:Vt.Operations.Remove,modify:Vt.Operations.Modify},Jt={Header:`.${zt.Toolbar.Base}`,Sidebar:`.${Vt.Sidebar.Base}`,SidebarHeader:`.${Vt.Sidebar.Header}`,Card:`.${Vt.Card.Base}`,CardSingle:`.${Vt.Card.Single}`,Annotation:`.${Vt.Annotation.Base}`,Button:`.${Wt.Base}`,Toggle:`.${Kt.Base}`,ToggleInput:`.${Kt.Base} input`,MenuItem:`.${Lt.Item}`,TextArea:"textarea"},Yt={p:"paragraph",img:"image",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",table:"table",ul:"list",ol:"list",li:"list item",blockquote:"quote",a:"link",br:"line break",hr:"horizontal rule",pre:"code block"},Zt=(e,t,n)=>{const r=Ct(t)&&se(["tr","td","th","col","thead","tbody"],t.type),o=(e=>{var t,n;if(bt(e))return"text";if(kt(e))return"comment";if(Ct(e)&&"p"===e.type&&1===(null===(t=e.children)||void 0===t?void 0:t.length))return(n=e.children,(e=>0<e.length?ne.some(e[0]):ne.none())(n)).filter(Ct).bind((e=>ne.from(Yt[e.type]))).getOr(Yt[e.type]);if(Ct(e)||xt(e)){const t=Yt[e.type];if(!q(t))return t;if(e.type)return e.type}return"content"})(t),i=n.exists((e=>e!==o))?"content":o;return r?{modify:"table"}:{[e]:i}};var Xt,Qt,en,tn,nn=0,rn=[],on=t,sn=on.__b,an=on.__r,cn=on.diffed,ln=on.__c,dn=on.unmount,un=on.__;function _n(e,t){on.__h&&on.__h(Qt,e,nn||t),nn=0;var n=Qt.__H||(Qt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function pn(e){return nn=1,fn(Bn,e)}function fn(e,t,n){var r=_n(Xt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Bn(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Qt,!Qt.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return!!e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var s=!1;return o.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};Qt.u=!0;var i=Qt.shouldComponentUpdate,s=Qt.componentWillUpdate;Qt.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}s&&s.call(this,e,t,n)},Qt.shouldComponentUpdate=o}return r.__N||r.__}function hn(e,t){var n=_n(Xt++,3);!on.__s&&Sn(n.__H,t)&&(n.__=e,n.i=t,Qt.__H.__h.push(n))}function mn(e){return nn=5,vn((function(){return{current:e}}),[])}function vn(e,t){var n=_n(Xt++,7);return Sn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function gn(e,t){return nn=8,vn((function(){return e}),t)}function yn(e){var t=Qt.context[e.__c],n=_n(Xt++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Qt)),t.props.value):e.__}function bn(){for(var e;e=rn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(xn),e.__H.__h.forEach(wn),e.__H.__h=[]}catch(t){e.__H.__h=[],on.__e(t,e.__v)}}on.__b=function(e){Qt=null,sn&&sn(e)},on.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),un&&un(e,t)},on.__r=function(e){an&&an(e),Xt=0;var t=(Qt=e.__c).__H;t&&(en===Qt?(t.__h=[],Qt.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0}))):(t.__h.forEach(xn),t.__h.forEach(wn),t.__h=[],Xt=0)),en=Qt},on.diffed=function(e){cn&&cn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==rn.push(t)&&tn===on.requestAnimationFrame||((tn=on.requestAnimationFrame)||Cn)(bn)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.i=void 0}))),en=Qt=null},on.__c=function(e,t){t.some((function(e){try{e.__h.forEach(xn),e.__h=e.__h.filter((function(e){return!e.__||wn(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],on.__e(n,e.__v)}})),ln&&ln(e,t)},on.unmount=function(e){dn&&dn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{xn(e)}catch(e){t=e}})),n.__H=void 0,t&&on.__e(t,n.__v))};var kn="function"==typeof requestAnimationFrame;function Cn(e){var t,n=function(){clearTimeout(r),kn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);kn&&(t=requestAnimationFrame(n))}function xn(e){var t=Qt,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Qt=t}function wn(e){var t=Qt;e.__c=e.__(),Qt=t}function Sn(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Bn(e,t){return"function"==typeof t?t(e):t}const Nn=(e,t)=>ft(e,t).each(Qe),In=(e,t,n)=>ue(yt(e,t),(e=>gt(e)===n)).each(Qe),On=e=>{e.focus({preventScroll:!0})},An=e=>(t,n,r)=>{const o=e(t);return En(o,t,n,r)},Rn=(e,t)=>{const n=dt(e,t);return An(n)},Tn=(e,t)=>{const n=dt(t,e);return An(n)},En=(e,t,n,r)=>r.focusManager.get(t).bind((n=>e(t,n,r))).map((e=>(r.focusManager.set(t,e),!0))),Pn=(e,t,n)=>{const r=yt(e,n);return(e=>_e(e,(e=>Ne(e,t))).map((t=>({index:t,candidates:e}))))(le(r,lt))},Ln=(e,t,n,r,o)=>{const i=(e,t,n)=>o(e,t,r,0,n.length-1,n[t],(t=>{return"button"===(r=n[t]).dom.nodeName.toLowerCase()&&"disabled"===et(r,"disabled")?i(e,t,n):ne.from(n[t]);var r}));return Pn(e,n,t).bind((e=>{const t=e.index,n=e.candidates;return i(t,t,n)}))},Hn=(e,t,n,r)=>Ln(e,t,n,r,((e,t,n,r,o,i,s)=>{const a=((e,t,n)=>Math.min(Math.max(e,t),n))(t+n,r,o);return a===e?ne.from(i):s(a)})),Mn=(e,t,n,r)=>Ln(e,t,n,r,((e,t,n,r,o,i,s)=>{const a=((e,t,n,r)=>{const o=e+t;return o>r?n:o<n?r:o})(t,n,r,o);return a===e?ne.none():s(a)})),Dn=()=>({get:e=>{return((e=(()=>we(document))())=>ne.from(e.dom.activeElement).map(we))(Ze(t=e)).filter((e=>t.dom.contains(e.dom)));var t},set:(e,t)=>{t.dom.focus(),t.dom.dispatchEvent(new window.Event("Focus"))}});var Fn;!function(e){e.OnFocusMode="onFocus"}(Fn||(Fn={}));const $n=(e,t)=>({matches:e,classification:t}),Un=(e,t,n,r)=>{const o={...e,focusManager:Dn(),focusInside:Fn.OnFocusMode,focusIn:r},i=(e,t,n)=>((e,t)=>{const n=ue(e,(e=>e.matches(t)));return n.map((e=>e.classification))})(n(e,t,o),t).bind((n=>n(e,t,o)));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)=>{r(o).each((n=>{n(e,o),t.preventDefault(),t.stopPropagation()}))}}},Wn=e=>t=>se(e,t.which),jn=[9],Kn=[13],Vn=[37],zn=[38],qn=[39],Gn=[40],Jn=[32],Yn=[27],Zn=(e,t,n)=>{const r=pe(e.slice(0,t)),o=pe(e.slice(t+1));return ue(r.concat(o),n)},Xn=(e,t,n)=>{const r=pe(e.slice(0,t));return ue(r,n)},Qn=(e,t,n)=>{const r=e.slice(0,t),o=e.slice(t+1);return ue(o.concat(r),n)},er=(e,t,n)=>{const r=e.slice(t+1);return ue(r,n)},tr=(e,t)=>t.closest?t.focusManager.get(e).bind((e=>ht(e,t.selector))):t.focusManager.get(e),nr=(e,t)=>{((e,t)=>{const n=yt(e,t.selector),r=le(n,(e=>ct(e)>0));return ne.from(r[t.firstTabstop])})(e,t).each((n=>t.focusManager.set(e,n)))},rr=(e,t,n,r)=>{const o=yt(e,n.selector);return tr(e,n).bind((t=>_e(o,function(e,...t){return(...n)=>{const r=t.concat(n);return e.apply(null,r)}}(Ne,t)).bind((t=>((e,t,n,r,o)=>o(t,n,(e=>((e,t)=>e.useTabstopAt(t))(r,e))).fold((()=>r.cyclic?ne.some(!0):ne.none()),(t=>(r.focusManager.set(e,t),ne.some(!0)))))(e,o,t,n,r)))))},or=(e,t,n)=>{const r=n.cyclic?Zn:Xn;return rr(e,0,n,r)},ir=(e,t,n)=>{const r=n.cyclic?Qn:er;return rr(e,0,n,r)},sr=(e,t,n)=>tr(e,n).bind((e=>n.execute(e))),ar=X([$n((cr=[e=>!0===e.shiftKey,Wn(jn)],e=>((e,t)=>{for(let n=0,r=e.length;n<r;++n)if(!0!==t(e[n]))return!1;return!0})(cr,(t=>t(e)))),or),$n(Wn(jn),ir),$n(Wn(Kn),sr),$n(Wn(Jn),sr),$n(Wn(Yn),((e,t,n)=>tr(e,n).bind((e=>n.escape(e)))))]);var cr;const lr=X([$n(Wn(jn),((e,t,n)=>tr(e,n).filter((e=>!n.useTabstopAt(e))).bind((r=>((e=>{return(t=e,(e=>ne.from(e.dom.parentNode).map(we))(t)).bind(Ye).exists((t=>Ne(t,e)));var t})(r)?or:ir)(e,t,n)))))]),dr=(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)}),ur=e=>{hn((()=>{const{containerRef:t}=e;if(t.current){const n=((e,t)=>{const n={execute:X(ne.none()),escape:X(ne.none()),firstTabstop:0,useTabstopAt:te,cyclic:!0,focusIn:!1,closest:!0,...t},r=Un(n,ar,lr,(()=>ke(n.focusIn,nr)));return{keydown:t=>r.handleKeydown(e,t),keyup:t=>r.handleKeyup(e,t),focus:t=>r.handleFocus(e,t)}})(we(t.current),e);return dr(t.current,n)}return Z}),[])},_r=e=>{hn((()=>{const{containerRef:t}=e;if(t.current){const n=((e,t)=>{const n=(e,t)=>t.closest?t.focusManager.get(e).bind((e=>ht(e,t.selector))):t.focusManager.get(e),r=(e,t,r)=>n(e,r).bind((e=>r.execute(e))),o=(e,t,r)=>n(e,r).bind((e=>r.escape(e))),i=(e,t)=>{ft(e,t.selector).each((n=>{t.focusManager.set(e,n)}))},s=e=>(t,n,r)=>(r.cycles?Mn:Hn)(t,r.selector,n,e),a=s(-1),c=s(1),l=e=>(t,n,r)=>e(t,n,r),d=X([]),u={execute:e=>(e.dom.dispatchEvent(new window.Event("click")),ne.some(!0)),escape:X(ne.none()),allowVertical:!0,allowHorizontal:!0,cycles:!0,focusIn:!1,closest:!0,...t},_=Un(u,((e,t,n)=>{const i=[...n.allowHorizontal?Vn:[]].concat(n.allowVertical?zn:[]),s=[...n.allowHorizontal?qn:[]].concat(n.allowVertical?Gn:[]);return[$n(Wn(i),l(Rn(a,c))),$n(Wn(s),l(Tn(a,c))),$n(Wn(Kn),r),$n(Wn(Jn),r),$n(Wn(Yn),o)]}),d,(()=>ke(u.focusIn,i)));return{keydown:t=>_.handleKeydown(e,t),keyup:t=>_.handleKeyup(e,t),focus:t=>_.handleFocus(e,t)}})(we(t.current),e);return dr(t.current,n)}return Z}),[])},pr=e=>ye(e,K),fr=e=>Math.max(...ae(e,(({id:e})=>e)),0)+1,hr=e=>tt(we(e),"id").map((e=>e.split("-").slice(0,2).join("-"))),mr=e=>new Date(e).toLocaleString(navigator.language,{month:"short",day:"numeric",hour:"numeric",minute:"numeric"}),vr=(e,t)=>((e,t)=>(e=>{const t=[];for(let n=0,r=e.length;n<r;++n){if(!V(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);ie.apply(t,e[n])}return t})(ae(e,t)))(e,(e=>{if(e.opData){const{id:n,type:r}=e.opData,o=t[n];if(G(o)){const t=G(o.contentTypes[r]),n=Ct(e)&&se(["tr","td","th","col","thead","tbody"],e.type)&&G(o.contentTypes.modify);if(!t&&!n)return[]}}return Ct(e)&&e.children?[{...e,children:vr(e.children,t)}]:[e]})),gr=e=>(t,n)=>({...t,[n]:e}),yr=gr("accept"),br=gr("reject"),kr=gr("pending"),Cr=e=>t=>ve(t,X(e)),xr=Cr("accept"),wr=Cr("reject"),Sr=Cr("pending"),Br=(e,t,n,r)=>({id:e,uid:t,timestamp:n,feedback:r}),Nr=(e,t,n)=>({...e,[t]:[...ne.from(e[t]).getOr([]),n]});function Ir(e,t){for(var n in t)e[n]=t[n];return e}function Or(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Ar(e,t){this.props=e,this.context=t}(Ar.prototype=new b).isPureReactComponent=!0,Ar.prototype.shouldComponentUpdate=function(e,t){return Or(this.props,e)||Or(this.state,t)};var Rr=t.__b;t.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Rr&&Rr(e)};var Tr="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Er(e){function t(t){var n=Ir({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Tr,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Pr=t.__e;t.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);Pr(e,t,n,r)};var Lr=t.unmount;function Hr(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=Ir({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return Hr(e,t,n)}))),e}function Mr(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return Mr(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 Dr(){this.__u=0,this.t=null,this.__b=null}function Fr(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function $r(){this.u=null,this.o=null}t.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Lr&&Lr(e)},(Dr.prototype=new b).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Fr(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Mr(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Dr.prototype.componentWillUnmount=function(){this.t=[]},Dr.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Hr(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&v(y,null,e.fallback);return o&&(o.__u&=-33),[v(y,null,t.__a?null:e.children),o]};var Ur=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 Wr(e){return this.getChildContext=function(){return e.context},e.children}function jr(e){var t=this,n=e.i;t.componentWillUnmount=function(){D(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)}}),D(v(Wr,{context:t.context},e.__v),t.l)}($r.prototype=new b).__a=function(e){var t=this,n=Fr(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Ur(t,e,r)):o()};n?n(i):i()}},$r.prototype.render=function(e){this.u=null,this.o=new Map;var t=N(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},$r.prototype.componentDidUpdate=$r.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Ur(e,n,t)}))};var Kr="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Vr=/^(?: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]/,zr=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,qr=/[A-Z0-9]/g,Gr="undefined"!=typeof document,Jr=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};b.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(b.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Yr=t.event;function Zr(){}function Xr(){return this.cancelBubble}function Qr(){return this.defaultPrevented}t.event=function(e){return Yr&&(e=Yr(e)),e.persist=Zr,e.isPropagationStopped=Xr,e.isDefaultPrevented=Qr,e.nativeEvent=e};var eo={enumerable:!1,configurable:!0,get:function(){return this.class}},to=t.vnode;t.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={};for(var o in t){var i=t[o];if(!("value"===o&&"defaultValue"in t&&null==i||Gr&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var s=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===i?i="":"translate"===s&&"no"===i?i=!1:"ondoubleclick"===s?o="ondblclick":"onchange"!==s||"input"!==n&&"textarea"!==n||Jr(t.type)?"onfocus"===s?o="onfocusin":"onblur"===s?o="onfocusout":zr.test(o)?o=s:-1===n.indexOf("-")&&Vr.test(o)?o=o.replace(qr,"-$&").toLowerCase():null===i&&(i=void 0):s=o="oninput","oninput"===s&&r[o=s]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=N(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=N(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",eo)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Kr,to&&to(e)};var no=t.__r;t.__r=function(e){no&&no(e),e.__c};var ro=t.diffed;t.diffed=function(e){ro&&ro(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)};const oo=({container:e,children:t})=>function(e,t){var n=v(jr,{__v:e,i:t});return n.containerInfo=t,n}(t,e),io=F(null),so=()=>{const e=yn(io);if(null===e)throw new Error("AppContext used outside of the AppContext Provider");return e},ao=({encodedBaseURI:e,shouldUseCors:t,absoluteContentCSSUrls:n,contentStyle:r,componentScripts:o})=>U(y,{children:[U("base",{href:e}),ae(n,(e=>U("link",{type:"text/css",rel:"stylesheet",href:e,...t?{crossOrigin:"anonymous"}:{}}))),r.map((e=>U("style",{type:"text/css",children:e}))).getOr(null),U("style",{children:"table, table td, table th, table caption { border: 1px dashed #bbb }"}),ae(o,(({url:e,attributes:t})=>U("script",{type:"text/javascript",src:e,...t}))),U("script",{dangerouslySetInnerHTML:{__html:nt().replaceAll("<script>","").replaceAll("<\/script>","")}})]}),co=({headConfig:e,children:t,...n})=>{const{setActiveId:r}=so(),[o,i]=pn(null),[s,a]=pn(null),[c,l]=pn(null),d=gn((e=>{const t=e.target.closest(Jt.Annotation);G(t)?hr(t).each(r):r(null)}),[r]);return hn((()=>{if(o){const e=o.contentWindow;if(e){const t=e.document;return t&&(t.open(),t.write("<!DOCTYPE html><html><head></head><body></body></html>"),t.close(),a(t.head),l(t.body)),e.addEventListener("click",d),()=>e.removeEventListener("click",d)}}return Z}),[o]),U("iframe",{...n,class:Vt.Iframe.Base,ref:i,children:[s&&U(oo,{container:s,children:U(ao,{...e})}),c&&U(oo,{container:c,children:t})]})},lo=Er((({tag:e,props:t,children:n,innerRef:r},o)=>v(e,{...t,ref:r||o},n))),uo=Er((({node:e,opProps:t},n)=>{const{pagebreakSeparator:r,transparentSrc:o}=so();if("pagebreak"==(i=e.comment,r.exists((e=>`\x3c!--${i}--\x3e`===e))?"pagebreak":"none")){const e=`${t.class?t.class:""} ${qt.Pagebreak}`,r={...t,class:e,src:o};return U(lo,{ref:n,tag:"img",props:r})}return U(y,{});var i})),_o=Er((({node:e,opProps:t,useOld:n},r)=>{const o=ne.from(e.attrs),i=ne.from(e.oldAttrs),s=(n&&i.isSome()?i:o).map(pr).getOr({});switch(e.type){case"hr":return U(lo,{ref:r,tag:"div",props:t,children:U("hr",{...s})});case"br":return U(lo,{ref:r,tag:"span",props:t,children:["\u21b5",U("br",{...s})]});default:const n=[...t.class?[t.class]:[],...s.class?[s.class]:[]].join(" "),o={...s,...t,class:n};return U(lo,{ref:r,tag:e.type,props:o})}})),po=Er((({node:e,opProps:t,useOld:n},r)=>{const o=ne.from(e.attrs),i=ne.from(e.oldAttrs),s=(n?i:o).map(pr).getOr({}),a=[...t.class?[t.class]:[],...s.class?[s.class]:[]].join(" "),c={...s,...t,class:a},l=ne.from(e.children).map((e=>ae(e,(e=>U(ho,{node:e}))))).getOr([]);return U(lo,{ref:r,tag:e.type,props:c,children:l})})),fo=Er((({node:e,opProps:t,opType:n,useOld:r},o)=>{const{operationProps:i}=so(),s=ne.from(e.format),a=ne.from(e.oldFormat),c=U(y,{children:e.text}),l=(r?a:s).map((e=>{return t=c,((e,t)=>{for(let n=e.length-1;n>=0;n--)t(e[n])})(e,((e,n)=>{t=((e,t)=>{if(K(t))return U(lo,{tag:t,props:{},children:e});{const n=ne.from(t.attrs).map(pr).getOr({});return U(lo,{tag:t.type,props:n,children:e})}})(t,e)})),t;var t}));return n.map((e=>i[e].tag)).map((e=>U(lo,{ref:o,tag:e,props:t,children:l.getOr(c)}))).or(l).getOr(c)})),ho=({node:e})=>{const{appId:t,activeId:n,operationProps:r,reviewStatus:o,showChanges:i}=so(),s=mn(null),[a,c]=pn(!1),l=ne.from(e.opData),d=l.map((({type:e})=>e)),u=l.bind((({uid:e,type:a,id:l})=>ne.from(o[l]).map((o=>{const d=`${t}-${l}`,u=`${d}-operation`,_=n===d;hn((()=>{s.current&&_&&s.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}),[n]);const p="insert"===a&&"reject"===o||"remove"===a&&"accept"===o||!i&&"remove"===a&&"reject"!==o,f=i&&("pending"===o||_);c("modify"===a&&"reject"===o);const h=f?[`${r[a].class}__highlight`]:[],m=p&&!_?[`${r[a].class}__hidden`]:[],v=_?[`${r[a].class}__selected`]:[];return{id:(g={classes:[Vt.Annotation.Base,r[a].class,...h,...m,...v],uid:e,nodeId:u}).nodeId,class:g.classes.join(" "),"data-mce-uid":g.uid};var g})))).getOr({});if(xt(e))return U(_o,{ref:s,node:e,opProps:u,useOld:a});if(Ct(e))return U(po,{ref:s,node:e,opProps:u,useOld:a});if(bt(e))return U(fo,{ref:s,node:e,opProps:u,useOld:a,opType:d});if(kt(e))return U(uo,{ref:s,node:e,opProps:u});throw new Error("Unknown node type")},mo=({contents:e})=>U(y,{children:ae(e,(e=>U(ho,{node:e})))}),vo=({contents:e,headConfig:t})=>U("div",{className:Vt.Content.Base,children:U("div",{className:Vt.Model.Base,children:U(co,{headConfig:t,children:U(mo,{contents:e})})})}),go=e=>" "===e.key||"Space"===e.code||32===e.keyCode,yo=e=>"Enter"===e.key||"Enter"===e.code||13===e.keyCode,bo=e=>"Escape"===e.key||"Escape"===e.code||27===e.keyCode,ko=e=>"Tab"===e.key||"Tab"===e.code||9===e.keyCode,Co=(e,t)=>{switch(e){case"full":return"full"===t;case"feedback":return"full"===t||"feedback"===t;case"read":return"full"===t||"feedback"===t||"read"===t;case"none":return!0;default:return!1}},xo=Er((({onClick:e,disabled:t,children:n,...r},o)=>U("button",{ref:o,tabindex:-1,onClick:e,type:"button",disabled:t,...r,children:n}))),wo=Er((({onClick:e,onKeyDown:t,checked:n,name:r,children:o,...i},s)=>U("label",{className:Kt.Base,children:[U("input",{type:"checkbox",ref:s,tabIndex:-1,checked:n,name:r,onClick:e,onKeyDown:t,"aria-checked":n,...i}),U("span",{className:Kt.Slider}),o]}))),So=({complete:e,cancel:t})=>{const{universe:n,accessLevel:r,showChanges:o,toggleShowChanges:i}=so(),s=mn(null),a=gn((e=>{var t;ko(e)||bo(e)||(yo(e)||go(e)?(e.preventDefault(),e.stopPropagation(),i()):s.current&&(e.preventDefault(),e.stopPropagation(),"ArrowLeft"===(t=e).key||"ArrowLeft"===t.code||37===t.keyCode||(e=>"ArrowUp"===e.key||"ArrowUp"===e.code||38===e.keyCode)(e)?In(we(s.current),Jt.Button,Rt):((e=>"ArrowRight"===e.key||"ArrowRight"===e.code||39===e.keyCode)(e)||(e=>"ArrowDown"===e.key||"ArrowDown"===e.code||40===e.keyCode)(e))&&In(we(s.current),Jt.Button,At)))}),[]);return _r({containerRef:s,selector:Nt(Jt.Button,Jt.Toggle)}),U("div",{ref:s,className:zt.Toolbar.Base,children:[U("div",{class:Bt(zt.Label.Base,zt.Label.Large),children:n.translate("Review edits")}),U("div",{class:zt.Align.Right,children:U(wo,{onClick:i,onKeyDown:a,checked:o,name:"showchanges",children:n.translate("Show edits")})}),U(xo,{className:Wt.Base,onClick:e,disabled:!Co(It,r),children:n.translate(At)}),U(xo,{className:Bt(Wt.Base,Wt.Secondary),onClick:t,children:n.translate(Rt)})]})},Bo=F(null),No=()=>{const e=yn(Bo);if(null===e)throw new Error("SidebarContext used outside of the SidebarContext Provider");return e},Io=({iconHTML:e,iconClass:t})=>U("span",{className:t?Bt(Ut.Base,t):Ut.Base,dangerouslySetInnerHTML:{__html:e}}),Oo=F(null),Ao=()=>{const e=yn(Oo);if(null===e)throw new Error("CardContext used outside of the CardContext Provider");return e},Ro=({name:e,avatar:t})=>U("div",{class:Vt.Card.User,children:[U("div",{class:Vt.Card.Avatar,children:U("div",{class:Ft.Avatar,children:U("img",{alt:e,role:"presentation",src:t})})}),U("div",{class:Vt.Card.Details,children:U("div",{class:Vt.Card.Name,children:e})})]}),To=Er((({iconHTML:e,onClick:t,disabled:n,children:r,iconClass:o,...i},s)=>U(xo,{ref:s,onClick:t,disabled:n,...i,children:[U(Io,{iconHTML:e,iconClass:o}),r]}))),Eo=F(null),Po=()=>{const e=yn(Eo);if(null===e)throw new Error("DropdownContext used outside of the DropdownContext Provider");return e},Lo=({sinkRef:e,children:t})=>{const[n,r]=pn(!1),[o,i]=pn(null),s={buttonRef:mn(null),menuRef:mn(null),sinkRef:e,isOpen:n,open:gn((()=>r(!0)),[r]),close:gn((()=>{i(null),r(!1)}),[r]),activeId:o,setActiveId:i};return U(Eo.Provider,{value:s,children:t})},Ho=({children:e})=>{const{buttonRef:t,isOpen:n,open:r}=Po();return U(xo,{ref:t,className:Bt(Wt.Base,Wt.Secondary,Wt.IconText),"aria-haspopup":"true","aria-expanded":n,onClick:r,children:e})},Mo=({label:e,iconHTML:t})=>{const{buttonRef:n,isOpen:r,open:o}=Po();return U(To,{ref:n,className:Bt(Wt.Base,Wt.Secondary,Wt.Icon),"aria-haspopup":"true","aria-expanded":r,"aria-label":e,iconHTML:t,onClick:o})},Do=({align:e,children:t})=>{const{buttonRef:n,menuRef:r,sinkRef:o,isOpen:i,close:s}=Po();return hn((()=>{i&&r.current&&Nn(we(r.current),Jt.MenuItem)}),[i,r]),hn((()=>{const e=({clientX:e,clientY:t})=>{var o;if(i&&r.current){const i=r.current.getBoundingClientRect(),a=null===(o=n.current)||void 0===o?void 0:o.getBoundingClientRect();e>i.left&&e<i.right&&t>i.top&&t<i.bottom||a&&e>a.left&&e<a.right&&t>a.top&&t<a.bottom||s()}};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[i,r,s]),i&&o.current?U(oo,{container:o.current,children:U("div",{className:Mt.Base,children:U("div",{ref:r,role:"menu",className:Bt(Ht.Base,Lt.Base,Lt.List,Dt.Base),style:o.current&&n.current?((t,n)=>{const r=t.getBoundingClientRect(),o=n.getBoundingClientRect(),i=document.documentElement.scrollLeft,s=o.top+n.offsetHeight-r.top,a=o.left+i-r.left,c=r.right-(o.left+o.width);return{top:`${s}px`,..."left"===e?{left:`${a}px`}:{right:`${c}px`}}})(o.current,n.current):{},children:U("div",{className:Lt.Group,children:t})})})}):U(y,{})},Fo=({key:e,id:t,label:n,onClick:r})=>{const{buttonRef:o,close:i,activeId:s,setActiveId:a}=Po(),c=gn((()=>a(t)),[t,a]),l=gn((e=>{e.stopPropagation(),e.preventDefault(),r(),i()}),[r]),d=gn((e=>{yo(e)||go(e)?(o.current&&On(o.current),l(e)):bo(e)&&(e.preventDefault(),i(),o.current&&On(o.current))}),[o,l]);return U("div",{id:t,tabIndex:-1,role:"menuitem",className:Bt($t.Js,Lt.Item,...t===s?[Lt.ItemActive]:[]),onClick:l,onMouseOver:c,onFocusIn:c,onKeyDown:d,children:U("div",{className:Lt.ItemLabel,children:n})},e)},$o=({editFeedback:e,deleteFeedback:t})=>{const{sinkRef:n,universe:r}=so();return U(Lo,{sinkRef:n,children:[U(Mo,{label:r.translate("Feedback actions"),iconHTML:r.getIcon("image-options")}),U(Do,{align:"right",children:[U(Fo,{id:"edit-feedback",label:r.translate("Edit"),onClick:e},0),U(Fo,{id:"delete-feedback",label:r.translate("Delete"),onClick:t},1)]})]})},Uo=Er((({id:e,content:t,placeholder:n,onKeyDown:r},o)=>U("textarea",{ref:o,id:e,tabindex:-1,rows:2,placeholder:n,className:Vt.Card.TextArea,value:t,onKeyDown:r}))),Wo=({initialContent:e,autofocus:t=!1,cancel:n,save:r})=>{const{universe:o}=so(),{textareaMaxHeight:i}=No(),s=mn(null),a=gn((e=>{if(ko(e))return;if(e.stopPropagation(),bo(e))return e.preventDefault(),void n();if(yo(e)&&((t=e).metaKey||t.ctrlKey))return void r();var t;const o=e.currentTarget;o.style.height="inherit";const s=Math.max(o.offsetHeight,i?Math.min(o.scrollHeight,i):o.scrollHeight);o.style.height=`${s}px`}),[n,r]);return hn((()=>{t&&s.current&&s.current.focus()}),[s]),U(Uo,{ref:s,id:Pt,content:e,placeholder:o.translate("Provide feedback..."),onKeyDown:a})},jo=({name:e,avatar:t,timestamp:n})=>U("div",{class:Vt.Card.FeedbackUser,children:[U("div",{class:Vt.Card.Avatar,children:U("div",{class:Ft.Avatar,children:U("img",{alt:e,role:"presentation",src:t})})}),U("div",{class:Vt.Card.Details,children:[U("div",{class:Vt.Card.Name,children:e}),U("div",{class:Vt.Card.Timestamp,children:mr(n)})]})]}),Ko=Bt(Wt.Base,Wt.Secondary,Wt.IconText,Wt.Stretch),Vo=({onClick:e})=>{const{universe:t}=so();return U(To,{class:Ko,iconHTML:t.getIcon("checkmark"),iconClass:Ut.Success,onClick:e,children:t.translate("Accept")})},zo=({onClick:e})=>{const{universe:t}=so();return U(To,{class:Ko,iconHTML:t.getIcon("close"),iconClass:Ut.Error,onClick:e,children:t.translate("Reject")})},qo=({onClick:e})=>{const{universe:t}=so();return U(xo,{class:Bt(Wt.Base,Wt.Secondary,Wt.Stretch),onClick:e,children:t.translate("Revert")})},Go=({onClick:e})=>{const{universe:t}=so();return U(xo,{className:Bt(Wt.Base,Wt.Secondary),onClick:e,children:t.translate(Rt)})},Jo=({onClick:e})=>{const{universe:t}=so();return U(xo,{className:Wt.Base,onClick:e,children:t.translate("Save")})},Yo=({onClick:e})=>{const{universe:t}=so();return U(xo,{className:Bt(Wt.Base,Wt.Secondary,Wt.SecondaryOutlined,Wt.Stretch),onClick:e,children:t.translate("Provide feedback")})},Zo=({operationId:e,id:t,uid:n,feedback:r,timestamp:o})=>{const{accessLevel:i,dispatchFeedbacks:s}=so(),{currentUserId:a}=No(),{cardUsers:c,setEditingId:l}=Ao(),d=mn(null),u=gn((()=>l(t)),[t,l]),_=gn((()=>{var n;s({type:"delete",operationId:e,id:t}),d.current&&(n=we(d.current),pt(n,Jt.Card).each(Qe))}),[d,s]);return U("div",{ref:d,tabindex:-1,className:Vt.Card.Single,children:[U("div",{className:Vt.Card.Header,children:[U(jo,{...c[n],timestamp:o}),n===a&&Co(Ot,i)&&U($o,{editFeedback:u,deleteFeedback:_})]}),U("div",{className:Vt.Card.Content,children:U("div",{class:Vt.Card.Feedback,children:r})})]})},Xo=({operationId:e,uid:t,id:n,feedback:r,timestamp:o})=>{const{dispatchFeedbacks:i}=so(),{currentUserId:s}=No(),{cardRef:a,cardUsers:c,setEditingId:l,getFeedbackContent:d}=Ao(),u=gn((()=>{l(null),a.current&&On(a.current)}),[l]),_=gn((()=>{const t=d();t.length>0&&(i({type:"update",operationId:e,feedback:Br(n,s,St(),t)}),u())}),[d,i]);return U("div",{className:Vt.Card.Editor,children:[U("div",{className:Vt.Card.Header,children:U(jo,{...c[t],timestamp:o})}),U("div",{className:Vt.Card.Content,children:U(Wo,{initialContent:r,autofocus:!0,cancel:u,save:_})}),U("div",{className:Bt(Vt.Card.Buttons,Vt.Card.FeedbackButtons),children:[U(Go,{onClick:u}),U(Jo,{onClick:_})]})]})},Qo=({operationId:e,id:t})=>{const{dispatchFeedbacks:n}=so(),{currentUserId:r}=No(),{cardRef:o,setEditingId:i,getFeedbackContent:s}=Ao(),a=gn((()=>{i(null),o.current&&On(o.current)}),[i]),c=gn((()=>{const o=s();o.length>0&&(n({type:"add",operationId:e,feedback:Br(t,r,St(),o)}),a())}),[s,n]);return U("div",{className:Vt.Card.Editor,children:[U("div",{className:Vt.Card.Content,children:U(Wo,{initialContent:"",autofocus:!0,cancel:a,save:c})}),U("div",{className:Bt(Vt.Card.Buttons,Vt.Card.FeedbackButtons),children:[U(Go,{onClick:a}),U(Jo,{onClick:c})]})]})},ei=({id:e})=>{const{setEditingId:t}=Ao(),n=gn((()=>t(e)),[e,t]);return U("div",{className:Vt.Card.Editor,children:U("div",{className:Vt.Card.Buttons,children:U(Yo,{onClick:n})})})},ti=({contentTypes:e})=>{const{universe:t}=so(),n=le(["insert","remove","modify"],(t=>t in e)),r=ne.from(e.remove).map(t.translate),o=ne.from(e.insert).map(t.translate),i=ne.from(e.modify).map(t.translate),s=(a=r,c=o,a.isSome()&&c.isSome()?ne.some((l=a.getOrDie(),d=c.getOrDie(),t.translate([Et,l,d]))):ne.none()).getOr([...r.map((e=>t.translate(["deleted {0}",e]))).toArray(),...o.map((e=>t.translate(["added {0}",e]))).toArray(),...i.map((e=>t.translate(["modified {0}",e]))).toArray()].join("; "));var a,c,l,d;return U("div",{className:Vt.Operations.Base,children:[U("div",{className:Vt.Operations.Bar,children:ae(n,(e=>U("div",{className:Gt[e],style:`height: ${100/n.length}%`})))}),U("span",{className:Vt.Operations.Text,children:s})]})},ni=({resolution:e})=>{const{universe:t}=so();return U("div",{class:Bt(Vt.Resolution.Base,"accept"===e?Vt.Resolution.Accepted:Vt.Resolution.Rejected),children:U(Io,{iconHTML:t.getIcon("accept"===e?"checkmark-filled":"close-filled")})})},ri=()=>U("div",{tabindex:-1,className:Bt(Vt.Card.Base,jt.Base),children:U("div",{className:Vt.Card.Single,children:[U("div",{className:Vt.Card.Header,children:U("div",{class:Vt.Card.User,children:[U("div",{class:Vt.Card.Avatar,children:U("div",{class:Ft.Avatar,children:U("div",{class:jt.Circle})})}),U("div",{class:Vt.Card.Details,children:U("div",{class:jt.Line})})]})}),U("div",{className:Vt.Card.Content,children:U("div",{className:Vt.Operations.Base,children:[U("div",{className:Vt.Operations.Bar,children:U("div",{className:jt.Line,style:"height: 100%"})}),U("div",{class:jt.Line})]})}),U("div",{className:Vt.Card.Footer,children:U("div",{class:Vt.Card.Timestamp,children:U("div",{class:jt.Line})})})]})}),oi=({id:e,userId:t,timestamp:n,contentTypes:r})=>{var o;const{appId:i,accessLevel:s,showChanges:a,reviewStatus:c,setReviewStatus:l,activeId:d,universe:u}=so(),{cardRef:_,cardUsers:p,cardFeedbacks:f,newFeedbackId:h,active:m,setActive:v,editingId:g}=Ao(),b=`${i}-${e.toString()}`,k=null!==(o=c[e.toString()])&&void 0!==o?o:"pending",C=t=>()=>{l((n=>t(n,e))),_.current&&On(_.current)},x=gn(C(yr),[l]),w=gn(C(br),[l]),S=gn(C(kr),[l]);return hn((()=>v(d===b)),[d,b,k,v]),_r({containerRef:_,selector:Nt(Jt.CardSingle,Jt.Button,Jt.TextArea),escape:()=>(_.current&&On(_.current),ne.some(!0)),execute:e=>vt(e,Wt.Base)?(e.dom.click(),ne.some(!0)):ne.none()}),ur({containerRef:_,selector:Nt(Jt.CardSingle,Jt.Button,Jt.TextArea)}),U("div",{ref:_,tabindex:-1,id:`${b}-card`,className:Bt(Vt.Card.Base,...m?[Vt.Card.Active]:[],..."pending"!==k?[Vt.Card.Resolved]:[],...a?[]:[Vt.Card.Hidden]),children:[U("div",{tabindex:-1,className:Vt.Card.Single,children:[U("div",{className:Vt.Card.Header,children:[U(Ro,{...p[t]}),"pending"!==k&&U(ni,{resolution:k})]}),U("div",{className:Vt.Card.Content,children:U(ti,{contentTypes:r})}),U("div",{className:Vt.Card.Footer,children:U("div",{class:Vt.Card.Timestamp,"data-datetime":n.toString(),children:f.length>0?U(y,{children:[`${mr(n)} \u2022 ${f.length}`,U(Io,{iconHTML:u.getIcon("feedback")})]}):mr(n)})})]}),m&&Co(It,s)&&U("div",{class:Bt(Vt.Card.Buttons,Vt.Card.ReviewButtons),children:"pending"===k?U(y,{children:[U(zo,{onClick:w}),U(Vo,{onClick:x})]}):U(qo,{onClick:S})}),m&&"pending"===k&&U(y,{children:[f.length>0&&U(y,{children:[U("hr",{className:Vt.Card.Divider}),ae(f,(t=>g===t.id?U(Xo,{operationId:e,...t}):U(Zo,{operationId:e,...t})))]}),Co(Ot,s)&&(g===h?U(Qo,{operationId:e,id:h}):U(ei,{id:h}))]})]})},ii=({id:e,userId:t,timestamp:n,contentTypes:r})=>{const{reviewFeedback:o}=so(),{userCache:i}=No(),s=mn(null),[a,c]=fn(((e,t)=>({...e,[t.id]:t})),{}),[l,d]=pn((()=>ne.from(o[e]).getOr([]))),[u,_]=pn((()=>fr(l))),[p,f]=pn(!1),[h,m]=pn(null),v=gn((()=>ne.from(s.current).bind((e=>ft(we(e),`${Jt.TextArea}#${Pt}`))).map((e=>e.dom.value)).getOr("")),[s]),g={cardRef:s,cardUsers:a,cardFeedbacks:l,newFeedbackId:u,active:p,setActive:f,editingId:h,setEditingId:m,getFeedbackContent:v};return hn((()=>{p||m(null)}),[p,m]),hn((()=>{s.current&&p&&(s.current.scrollIntoView({behavior:"smooth",block:"nearest"}),On(s.current))}),[p,s]),hn((()=>{const e=((e,t)=>{const n=[],r=J(t)?e=>((e,t)=>{for(let n=0,r=e.length;n<r;n++)if(t(e[n]))return!0;return!1})(n,(n=>t(n,e))):e=>se(n,e);for(let t=0,o=e.length;t<o;t++){const o=e[t];r(o)||n.push(o)}return n})([i[t],...ae(l,(e=>i[e.uid]))]);Promise.all(ae(e,(e=>e.then(c)))).catch((e=>console.error(`Failed to fetch users ${ae(l,(({uid:e})=>e))}: ${e}`)))}),[i,l,e,c]),hn((()=>d(ne.from(o[e]).getOr([]))),[o,e]),hn((()=>_(fr(l))),[l,_]),U(Oo.Provider,{value:g,children:a[t]?U(oi,{id:e,timestamp:n,userId:t,contentTypes:r}):U(ri,{})})},si=({operationData:e})=>U("div",{className:Vt.Sidebar.Content,children:ae(e,(({id:e,userId:t,timestamp:n,contentTypes:r})=>U(ii,{id:e,userId:t,timestamp:n,contentTypes:r},e)))}),ai=()=>{const{universe:e,sinkRef:t,setReviewStatus:n}=so(),r=e=>gn((()=>n((t=>e(t)))),[n]),o=r(xr),i=r(wr),s=r(Sr);return U(Lo,{sinkRef:t,children:[U(Ho,{children:[U("div",{children:e.translate(Tt)}),U(Io,{iconHTML:e.getIcon("chevron-down")})]}),U(Do,{align:"left",children:[U(Fo,{id:"accept-all",label:e.translate("Accept all"),onClick:o},0),U(Fo,{id:"reject-all",label:e.translate("Reject all"),onClick:i},1),U(Fo,{id:"revert-all",label:e.translate("Revert all"),onClick:s},2)]})]})},ci=()=>{const{accessLevel:e}=so();return U("div",{className:Vt.Sidebar.Header,children:Co(It,e)&&U(ai,{})})},li=({reviewOperations:e,currentUserId:t,userCache:n})=>{const r=mn(null),[o,i]=pn(0),s={sidebarRef:r,textareaMaxHeight:o,currentUserId:t,userCache:n};return hn((()=>{if(r.current){const e=ct(we(r.current));i(e/3)}}),[r,i]),U(Bo.Provider,{value:s,children:U("div",{ref:r,className:Vt.Sidebar.Base,children:[U(ci,{}),U(si,{operationData:(a=e,((e,t)=>{const n=[];return me(e,((e,r)=>{n.push(t(e,r))})),n})(a,Q))})]})});var a},di=({universe:e,document:t,userId:n,userCache:r,accessLevel:o,headConfig:i,diffClasses:s,onComplete:a,onCancel:c,pagebreakSeparator:l,transparentSrc:d,padEmptyWithBr:u})=>{const[_]=pn((e=>{const t=(new Date).getTime(),n=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return be++,e+"_"+n+be+String(t)})("suggestededits")),p=((e,t={padEmptyWithBr:!1})=>{const n=e=>bt(e)&&"\xa0"===e.text||t.padEmptyWithBr&&Ct(e)&&"br"===e.type,r={},o=new Set,i=e=>ce(e,(e=>{if(e.opData){const t=e.opData,i=()=>({id:t.id,userId:t.uid,timestamp:t.timestamp,contentTypes:Zt(t.type,e,ne.none())}),s=n=>({...n,timestamp:Math.max(n.timestamp,t.timestamp),userId:n.timestamp>=t.timestamp?n.userId:t.uid,contentTypes:{...n.contentTypes,...Zt(t.type,e,ne.from(n.contentTypes[t.type]))}}),a=r[t.id],c=(n(e)||(e=>{var t;return Ct(e)&&1===(null===(t=e.children)||void 0===t?void 0:t.length)&&n(e.children[0])})(e))&&("remove"===t.type||"insert"===t.type);a?o.has(t.id)&&!c?(r[t.id]=i(),o.delete(t.id)):c&&!o.has(t.id)||(r[t.id]=s(a)):(r[t.id]=i(),c&&o.add(t.id))}Ct(e)&&e.children&&i(e.children)}));return i(e),r})(t.contents,{padEmptyWithBr:u}),[f,h]=pn((()=>(e=>ve(e,X("pending")))(p))),[m]=pn((()=>vr(t.contents,p))),[v,g]=fn(((e,t)=>{switch(t.type){case"add":return Nr(e,t.operationId,t.feedback);case"update":return((e,t,n)=>ne.from(e[t]).fold((()=>Nr(e,t,n)),(r=>({...e,[t]:de(r,((e,t)=>[...e,t.id===n.id?n:t]),[])}))))(e,t.operationId,t.feedback);case"delete":return((e,t,n)=>({...e,...ne.from(e[t]).map((e=>({[t]:le(e,(e=>e.id!==n))}))).getOr({})}))(e,t.operationId,t.id)}}),((e,t)=>ye(e,((e,n)=>{return r=t,o=n,he.call(r,o);var r,o})))(t.history,p)),[y,b]=pn(null),[k,C]=pn(!0),x=mn(null),w=mn(null),S={insert:{tag:"ins",class:s.addition},remove:{tag:"del",class:s.removal},modify:{tag:"ins",class:s.modification}},B=gn((()=>{x.current&&In(we(x.current),Jt.Button,Rt)}),[x]),N=gn((()=>a(f,v)),[f,v]),I=gn((()=>c(v)),[v]),O=gn((()=>C((e=>!e))),[C]),A={appId:_,sinkRef:w,universe:e,accessLevel:o,operationProps:S,reviewStatus:f,setReviewStatus:h,reviewFeedback:v,dispatchFeedbacks:g,activeId:y,setActiveId:b,showChanges:k,toggleShowChanges:O,pagebreakSeparator:l,transparentSrc:d},R=gn((e=>{const t=e.target;if(G(t.closest(Jt.Button)))return void e.stopPropagation();const n=t.closest(Jt.Card);G(n)?hr(n).each(b):b(null)}),[b]);return ur({containerRef:x,selector:Nt(`${Jt.Header} ${Jt.Button}`,`${Jt.Header} ${Jt.ToggleInput}`,`${Jt.Sidebar} ${Jt.SidebarHeader} ${Jt.Button}`,`${Jt.Sidebar} ${Jt.Card}`),useTabstopAt:e=>{if(vt(e,Vt.Card.Base)){if(vt(e,jt.Base))return!1;tt(e,"id").each((e=>b(e.split("-").slice(0,2).join("-"))))}else b(null);return!0},escape:t=>gt(t)===e.translate(Rt)?(I(),ne.none()):(B(),ne.some(!0)),execute:t=>{if(vt(t,Vt.Card.Base))return Nn(t,Jt.CardSingle),ne.some(!0);if(vt(t,Wt.Base)){switch(gt(t)){case e.translate(Rt):I();break;case e.translate(At):N();break;case e.translate(Tt):t.dom.click()}return ne.some(!0)}return ne.none()}}),_r({containerRef:w,selector:Jt.MenuItem}),hn(B,[]),U(io.Provider,{value:A,children:[U("div",{ref:w,className:Vt.Sink.Base}),U("div",{ref:x,className:Vt.Container.Base,onClick:R,children:[U(So,{complete:N,cancel:I}),U("div",{className:Vt.Base,children:[U(vo,{contents:m,headConfig:i}),U(li,{reviewOperations:p,currentUserId:n,userCache:r})]})]})]})};tinymce.Resource.add("tinymce.plugins.suggestededits.integration",(({root:e,universe:t,document:n,userId:r,userCache:o,accessLevel:i,headConfig:s,diffClasses:a,onComplete:c,onCancel:l,pagebreakSeparator:d,transparentSrc:u,padEmptyWithBr:_})=>{var p,f;return p=we(e),f=[Vt.Pane.Base],ce(f,(e=>{((e,t)=>{mt(e)?e.dom.classList.add(t):((e,t)=>{_t(e,"class",t)})(e,t)})(p,e)})),D(U(di,{universe:t,document:n,userId:r,userCache:o,accessLevel:i,headConfig:s,diffClasses:a,onComplete:c,onCancel:l,pagebreakSeparator:d,transparentSrc:u,padEmptyWithBr:_}),e),()=>{D(null,e)}}))}();