/*! * 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;tn&&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;r0?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(null==c||131072&c.__u?0:1))for(;s>=0||a=0){if((c=t[s])&&!(131072&c.__u)&&o==c.key&&i===c.type)return s;s--}if(at=>(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{for(let n=0,r=e.length;n{const n=[];for(let r=0,o=e.length;r(ce(e,((e,r)=>{n=t(n,e,r)})),n),ue=(e,t)=>((e,t,n)=>{for(let r=0,o=e.length;r{for(let n=0,r=e.length;n{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;rge(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;nNumber(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{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`