/*! * Tiny Revision History plugin * * Copyright (c) 2024 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 * */ !function(){"use strict";var e=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},t=function(e){return{eq:e}},n=t((function(e,t){return e===t})),r=n,o=function(e){return t((function(t,n){if(t.length!==n.length)return!1;for(var r=t.length,o=0;o!!n(e,t.prototype)||e.constructor?.name===t.name,l=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&a(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,c=e=>t=>typeof t===e,u=l("string"),h=l("object"),f=e=>((e,t)=>h(e)&&a(e,t,((e,t)=>s(e)===t)))(e,Object),d=c("boolean"),g=e=>void 0===e,_=e=>null==e,p=e=>!_(e),m=c("function"),v=c("number"),y=()=>{},b=e=>()=>e,w=e=>e,x=(e,t)=>e===t,C=e=>e(),S=b(!1),k=b(!0);class M{tag;value;static singletonNone=new M(!1);constructor(e,t){this.tag=e,this.value=t}static some(e){return new M(!0,e)}static none(){return M.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?M.some(e(this.value)):M.none()}bind(e){return this.tag?e(this.value):M.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:M.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 p(e)?M.some(e):M.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 E=Array.prototype.slice,A=Array.prototype.indexOf,N=(e,t)=>((e,t)=>A.call(e,t))(e,t)>-1,R=(e,t)=>{for(let n=0,r=e.length;n{const n=e.length,r=new Array(n);for(let o=0;o{for(let n=0,r=e.length;n{const n=[],r=[];for(let o=0,i=e.length;o{const n=[];for(let r=0,o=e.length;r(D(e,((e,r)=>{n=t(n,e,r)})),n),L=(e,t)=>((e,t,n)=>{for(let r=0,o=e.length;r{for(let n=0,r=e.length;n{for(let n=0,r=e.length;no(n).eq(e,t),H=e=>{const t=E.call(e,0);return t.reverse(),t},B=(e,t)=>t>=0&&tB(e,0),V=e=>B(e,e.length-1),q=m(Array.from)?Array.from:e=>E.call(e),z=Object.keys,K=Object.hasOwnProperty,W=(e,t)=>{const n=z(e);for(let r=0,o=n.length;rQ(e,((e,n)=>({k:n,v:t(e,n)}))),Q=(e,t)=>{const n={};return W(e,((e,r)=>{const o=t(e,r);n[o.k]=o.v})),n},J=(e,t)=>{const n=[];return W(e,((e,r)=>{n.push(t(e,r))})),n},X=(e,t)=>Y(e,t)?M.from(e[t]):M.none(),Y=(e,t)=>K.call(e,t),Z=e=>{let t=e;return{get:()=>t,set:e=>{t=e}}},ee=e=>{const t=t=>t(e),n=b(e),r=()=>o,o={tag:!0,inner:e,fold:(t,n)=>n(e),isValue:k,isError:S,map:t=>ne.value(t(e)),mapError:r,bind:t,exists:t,forall:t,getOr:n,or:r,getOrThunk:n,orThunk:r,getOrDie:n,each:t=>{t(e)},toOptional:()=>M.some(e)};return o},te=e=>{const t=()=>n,n={tag:!1,inner:e,fold:(t,n)=>t(e),isValue:S,isError:k,map:t,mapError:t=>ne.error(t(e)),bind:t,exists:S,forall:k,getOr:w,or:w,getOrThunk:C,orThunk:C,getOrDie:(r=String(e),()=>{throw new Error(r)}),each:y,toOptional:M.none};var r;return n},ne={value:ee,error:te,fromOption:(e,t)=>e.fold((()=>te(t)),ee)};let re=0;const oe=e=>{const t=(new Date).getTime(),n=Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9);return re++,e+"_"+n+re+String(t)},ie=(se=(e,t)=>f(e)&&f(t)?ie(e,t):t,(...e)=>{if(0===e.length)throw new Error("Can't merge zero objects");const t={};for(let n=0;ne?M.some(t):M.none(),le=e=>{const t=Z(M.none()),n=()=>t.get().each(e);return{clear:()=>{n(),t.set(M.none())},isSet:()=>t.get().isSome(),get:()=>t.get(),set:e=>{n(),t.set(M.some(e))}}},ce=(e,t,n=0,r)=>{const o=e.indexOf(t,n);return-1!==o&&(!!g(r)||o+t.length<=r)},ue=e=>e.length>0,he=(e,t)=>{const{type:n,message:r}=t;e.notificationManager.open({type:n,text:r})},fe=e=>{(e=>{switch(e){case"error":return console.error;case"info":return console.info;case"warn":return console.warn;default:return console.log}})(e.type)(e.message)},de=(e,t)=>{const{protect:n,allowList:r=[],blockList:o=[]}=null!=e?e:{};let i;return i=p(n)?n:r.length>0||o.length>0||t,{protect:i,allowList:r,blockList:o}},ge=e=>{const{protect:t,allowList:n,blockList:r}=null!=e?e:{};return e=>{const o=e.toLowerCase();return n.length>0?!R(n,(e=>e.toLowerCase()===o)):r.length>0?R(r,(e=>e.toLowerCase()===o)):t}},_e=e=>{const t=ge(e);return(e,n)=>{const r=((e,t)=>`${e}:${t}`)(n,e.toLowerCase());return t(r)}},pe=(e,t,n,r)=>{const o=Reflect.get(e,"on"),i={protectedEventHandlers:[],cleanupScheduled:!1},s=(e,t)=>{r&&console.log(`[EventsProxy] ${e}`,t||"")},a=t=>{"invalid"===t&&i.protectedEventHandlers.length>0&&(s("Removing event handlers",i.protectedEventHandlers),D(i.protectedEventHandlers,(t=>{e.off(t.name,t.callback)})),i.protectedEventHandlers=[])},l=t.onStatusChange(a);return e.on("remove",l),(r,l,c)=>{s(`Adding event listener: ${r}`,{shouldProtect:n(r)});const u=((e,r)=>{const o=n(e),s=t.getStatus(),a=o&&"invalid"===s?y:r;return o&&i.protectedEventHandlers.push({name:e,callback:a}),a})(r,l);return i.cleanupScheduled||(i.cleanupScheduled=!0,window.setTimeout((()=>{a(t.getStatus()),i.cleanupScheduled=!1}),0)),Reflect.apply(o,e,[r,u,c])}},me=(e,t,n)=>r=>{const o="invalid"!==t.getStatus()&&p(n)?n(r):y,i=((e,t,n)=>{const r=e=>{"invalid"===e&&n.setEnabled(!1)},o=()=>r(t.getStatus());r(t.getStatus()),e.on("NodeChange",o);const i=t.onStatusChange(r);return()=>{e.off("NodeChange",o),i()}})(e,t,r);return e=>{null==o||o(e),i()}},ve=(e,t,n)=>(...r)=>{var o;return"invalid"===e.getStatus()?n:null!==(o=null==t?void 0:t(...r))&&void 0!==o?o:n},ye=(e,t)=>ve(e,t,Promise.resolve([])),be=(e,t)=>ve(e,t,[]),we=(e,t)=>ve(e,t,!1),xe=(e,t,n,r)=>{const o=t=>{const{command:o,value:i}=t,s=M.from(i).filter(u).map((e=>e.toLowerCase())),a=o.toLowerCase()===r.toLowerCase(),l=s.exists((e=>n.has(e))),c=s.exists((t=>t===e.queryCommandValue(r)));a&&l&&!c&&t.preventDefault()},i=t.onStatusChange((t=>{if("invalid"===t){e.on("BeforeExecCommand",o);const t=()=>{const t=e.queryCommandValue(r);n.has(t.toLowerCase())&&e.execCommand(r,!1,t)};e.initialized?t():e.on("init",t)}}));e.on("remove",(()=>{i(),e.off("BeforeExecCommand",o)}))},Ce=(e,t,n,r,o,i=!1)=>{const s=new Set,a=new Set,l=(e,t)=>{i&&console.log(`[UiProxy] ${e}`,t||"")};((e,t,n)=>{xe(e,t,n,"ToggleView")})(e,n,s),((e,t,n)=>{xe(e,t,n,"ToggleSidebar")})(e,n,a);const c=(t,i,s,a)=>{const c=o(t,s);return l(`${a}: ${t}`,{spec:i,context:r,shouldProtect:c}),c?{...i,onSetup:me(e,n,i.onSetup)}:i};return new Proxy(t,{get:(e,t,i)=>{const h=Reflect.get(e,t,i);if(!u(t))return h;switch(t){case"addButton":case"addGroupToolbarButton":case"addToggleButton":case"addMenuButton":case"addSplitButton":return(...n)=>{const[r,o,...i]=n,s=c(r,o,"button",String(t));return Reflect.apply(h,e,[r,s,...i])};case"addMenuItem":case"addToggleMenuItem":case"addNestedMenuItem":return(...n)=>{const[r,o,...i]=n,s=c(r,o,"menuitem",String(t));return Reflect.apply(h,e,[r,s,...i])};case"addAutocompleter":return(...i)=>{const[s,a,...c]=i,u=o(s,"autocompleter");if(l(`${String(t)}: ${s}`,{spec:a,context:r,shouldProtect:u}),u){const t={...a,fetch:ye(n,a.fetch)};return Reflect.apply(h,e,[s,t,...c])}return Reflect.apply(h,e,[s,a,...c])};case"addSidebar":return(...n)=>{const[i,s,...c]=n,u=o(i,"sidebar");if(l(`${String(t)}: ${i}`,{spec:s,context:r,shouldProtect:u}),u){a.add(i.toLowerCase());const t={...s};return Reflect.apply(h,e,[i,t,...c])}return Reflect.apply(h,e,[i,s,...c])};case"addView":return(...n)=>{const[i,a,...c]=n,u=o(i,"view");if(l(`${String(t)}: ${i}`,{spec:a,context:r,shouldProtect:u}),u){s.add(i.toLowerCase());const t={...a};return Reflect.apply(h,e,[i,t,...c])}return Reflect.apply(h,e,[i,a,...c])};case"addContextMenu":return(...i)=>{const[s,a,...c]=i,u=o(s,"contextmenu");if(l(`${String(t)}: ${s}`,{spec:a,context:r,shouldProtect:u}),u){const t={...a,update:be(n,a.update)};return Reflect.apply(h,e,[s,t,...c])}return Reflect.apply(h,e,[s,a,...c])};case"addContextToolbar":case"addContextForm":return(...i)=>{const[s,a,...c]=i,u=o(s,"contexttoolbar");if(l(`${String(t)}: ${s}`,{spec:a,context:r,shouldProtect:u}),u){const t={...a,predicate:we(n,a.predicate)};return Reflect.apply(h,e,[s,t,...c])}return Reflect.apply(h,e,[s,a,...c])};case"addIcon":case"getAll":case"addContext":return h}}})},Se=new Set(["addCommand","addCommands","addQueryStateHandler","addQueryValueHandler"]),ke=e=>(t,n)=>{e&&console.log(`[EditorProxy] ${t}`,n||"")},Me=(e,t)=>{const{statusProvider:n,uiContext:r,protection:o,debug:i=!1}=t,{events:s,commands:a,ui:l}=o;ke(i)("Creating enhanced editor with options:",{hasStatusProvider:!!n,uiContext:r,debug:i,protection:o});const{editorUiProxy:c,editorCommandsProxy:u,editorEventListenerProxy:h}=((e,t,n,r,o,i,s)=>{const a=i.protect?{...e.ui,registry:Ce(e,e.ui.registry,t,n,_e(i),s)}:e.ui,l=r.protect?((e,t,n,r,o)=>{const i={protectedCommands:[],cleanupScheduled:!1},s=(e,t)=>{o&&console.log(`[CommandsProxy] ${e}`,t||"")},a=(e,t)=>{const o=r(e),s=n.getStatus();return o&&i.protectedCommands.push(e),o&&"invalid"===s?y:t},l=t=>{"invalid"===t&&i.protectedCommands.length>0&&(s("Removing commands",i.protectedCommands),D(i.protectedCommands,(t=>{e.editorCommands.removeCommand(t)})),i.protectedCommands=[])},c=()=>{i.cleanupScheduled||(i.cleanupScheduled=!0,window.setTimeout((()=>{l(n.getStatus()),i.cleanupScheduled=!1}),0))},u=n.onStatusChange(l);return e.on("remove",u),new Proxy(t,{get:(e,n,o)=>{if(s(`Accessing property: ${String(n)}`),"addCommand"===n){const i=Reflect.get(e,n,o);return(e,n,...o)=>{s(`Adding command: ${e}`,{shouldProtect:r(e)});const l=a(e,n);return c(),Reflect.apply(i,t,[e,l,...o])}}if("addCommands"===n){const r=Reflect.get(e,n,o);return(e,n="exec")=>{s(`Adding commands (${n})`,{commandCount:Object.keys(e).length,willApplyEnforcement:"exec"===n});const o="exec"!==n?e:G(e,((e,t)=>a(t,e)));return c(),Reflect.apply(r,t,[o,n])}}return Reflect.get(e,n,o)}})})(e,e.editorCommands,t,ge(r),s):e.editorCommands;return{editorUiProxy:a,editorCommandsProxy:l,editorEventListenerProxy:o.protect?pe(e,t,ge(o),s):e.on.bind(e)}})(e,n,r||"",a,s,l,i),f=((e,t,n,r)=>(o,i,s)=>{const a=String(i);if("on"===i)return ke(r)("on intercepted"),n;if(Se.has(a))return ke(r)(`${a} intercepted`),t[a].bind(t);if("editorCommands"===i)return ke(r)("editorCommands accessed"),t;if("ui"===i)return ke(r)("ui accessed"),e;const l=Reflect.get(o,i,s);return m(l)?l.bind(o):l})(c,u,h,i);return new Proxy(e,{get:f,set:(e,t,n,r)=>Reflect.set(e,t,n,r),has:(e,t)=>Reflect.has(e,t),ownKeys:e=>Reflect.ownKeys(e),getOwnPropertyDescriptor:(e,t)=>Reflect.getOwnPropertyDescriptor(e,t),defineProperty:(e,t,n)=>Reflect.defineProperty(e,t,n),deleteProperty:(e,t)=>Reflect.deleteProperty(e,t),isExtensible:e=>Reflect.isExtensible(e),preventExtensions:e=>Reflect.preventExtensions(e),getPrototypeOf:e=>Reflect.getPrototypeOf(e),setPrototypeOf:(e,t)=>Reflect.setPrototypeOf(e,t)})},Ee=e=>parseInt(e,10),Ae=(e,t)=>{const n=e-t;return 0===n?0:n>0?1:-1},Ne=(e,t,n)=>({major:e,minor:t,patch:n}),Re=e=>{const t=/([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(e);return t?Ne(Ee(t[1]),Ee(t[2]),Ee(t[3])):Ne(0,0,0)},Te=(e,t)=>!!e&&-1===((e,t)=>{const n=Ae(e.major,t.major);if(0!==n)return n;const r=Ae(e.minor,t.minor);if(0!==r)return r;const o=Ae(e.patch,t.patch);return 0!==o?o:0})((e=>Re((e=>[e.majorVersion,e.minorVersion].join(".").split(".").slice(0,3).join("."))(e)))(e),Re(t)),De=Re("8.3.0"),Oe=`${De.major}.${De.minor}.0`,Pe=`${De.major+1}.0.0`,Ie=(e,t)=>{const{setup:n,protection:r}=t;return(o,i)=>{if(!((e,t)=>Te(e,Oe)?(console.error(`The "${t}" plugin requires at least version ${Oe} of TinyMCE.`),!1):!!Te(e,Pe)||(console.error(`The "${t}" plugin requires at least version ${Oe} of TinyMCE but less than ${Pe}.`),!1))(tinymce,e)||((e,t)=>!!(e=>{var t;const n=null===(t=e.options.get("license_key"))||void 0===t?void 0:t.toLowerCase(),r=e.options.get("online_license_key");return _(r)&&"gpl"===n})(e)&&(((e,t)=>{const{console:n,editor:r}=t;p(r)&&(e._skinLoaded?he(e,r):e.on("SkinLoaded",(()=>{he(e,r)}))),p(n)&&fe(n)})(e,{console:{type:"error",message:[`The "${t}" plugin requires a valid TinyMCE license key.`,"Read more: https://www.tiny.cloud/docs/tinymce/latest/license-key/"].join(" ")}}),!0))(o,e))return{};const s=(e=>{const{protect:t=!0,events:n,commands:r,ui:o,api:i}=null!=e?e:{};return{protect:t,events:de(n,false),commands:de(r,true),ui:de(o,true),api:de(i,true)}})(r),a=((e="pre-validation")=>{const t=Z(e),n=new Set;let r=!1;const{enableLogging:o=!1}={},i=(e,...t)=>{o&&console.log(`[StatusProvider] ${e}`,...t)};return{setStatus:e=>{const r=t.get();if(r===e)return i("Status unchanged:",e),!1;t.set(e),i("Status changed:",r,"->",e);const o={currentStatus:e,previousStatus:r},s=Array.from(n);return D(s,(e=>{e(o.currentStatus,o.previousStatus)})),!0},onStatusChange:e=>(n.add(e),i("Callback registered, total listeners:",n.size),()=>{n.delete(e)&&i("Callback unregistered, remaining listeners:",n.size)}),getStatus:t.get,hasListeners:()=>n.size>0,destroy:()=>{r||(i("Destroying StatusProvider, clearing",n.size,"listeners"),n.clear(),r=!0)}}})(),l=((e,t,n)=>{const r=`commercial-license-${t}`;return e.ui.registry.addContext(r,(()=>"invalid"!==n.getStatus()&&!e.mode.isReadOnly())),e.licenseKeyManager.validate({plugin:t}).then((e=>{n.setStatus(e?"valid":"invalid")}),(e=>{console.error(e),console.error(`An unknown error occurred when trying to validate "${t}" plugin.`),n.setStatus("invalid")})),{ui:{context:r}}})(o,e,a),c=s.protect?Me(o,{statusProvider:a,uiContext:l.ui.context,debug:t.debug||!1,protection:s}):o,u=((e,t)=>({pluginCode:e,enforcer:{isInvalid:()=>"invalid"===t.getStatus(),onInvalid:e=>t.onStatusChange(((t,n)=>{"invalid"===t&&e(t,n)}))}}))(e,a);return((e,t,n,r)=>{if(t.protect&&t.api.protect&&p(e)){const i=ge(t.api);return(o=e=>"invalid"===n.getStatus()&&i(e),(e,t)=>G(e,((e,n)=>m(e)?(...r)=>{if(o(n.toLowerCase())){const e=`Method "${p(t)?`${t}.`:""}${n}" is not available due to license key restrictions.`,r=new Error(e);throw console.error(e),r}return e(...r)}:e)))(e,r)}var o;return e})(n(c,i,u),s,a,e)}},Le=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},$e=(e,t)=>{const n=(t||document).createElement(e);return Le(n)},je=Le,Ue=(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")}},He=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,Be=(e,t)=>e.dom===t.dom,Fe=()=>Ve(0,0),Ve=(e,t)=>({major:e,minor:t}),qe={nu:Ve,detect:(e,t)=>{const n=String(t).toLowerCase();return 0===e.length?Fe():((e,t)=>{const n=((e,t)=>{for(let n=0;nNumber(t.replace(n,"$"+e));return Ve(r(1),r(2))})(e,n)},unknown:Fe},ze=(e,t)=>{const n=String(t).toLowerCase();return L(e,(e=>e.search(n)))},Ke=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,We=e=>t=>ce(t,e),Ge=[{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]+).*/,Ke],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:[Ke,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:We("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:We("firefox")},{name:"Safari",versionRegexes:[Ke,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(ce(e,"safari")||ce(e,"mobile/"))&&ce(e,"applewebkit")}],Qe=[{name:"Windows",search:We("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:We("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:We("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:We("linux"),versionRegexes:[]},{name:"Solaris",search:We("sunos"),versionRegexes:[]},{name:"FreeBSD",search:We("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:We("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Je={browsers:b(Ge),oses:b(Qe)},Xe=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")}},Ye=()=>Xe({current:void 0,version:qe.unknown()}),Ze=Xe,et=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")}},tt=()=>et({current:void 0,version:qe.unknown()}),nt=et,rt=(e,t,n)=>{const r=Je.browsers(),o=Je.oses(),i=t.bind((e=>((e,t)=>((e,t)=>{for(let n=0;n{const n=t.brand.toLowerCase();return L(e,(e=>n===e.brand?.toLowerCase())).map((e=>({current:e.name,version:qe.nu(parseInt(t.version,10),0)})))})))(r,e))).orThunk((()=>((e,t)=>ze(e,t).map((e=>{const n=qe.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(r,e))).fold(Ye,Ze),s=((e,t)=>ze(e,t).map((e=>{const n=qe.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(o,e).fold(tt,nt),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)"),l=o||!i&&s&&r("(min-device-width:768px)"),c=i||s&&!l,u=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),h=!c&&!l&&!u;return{isiPad:b(o),isiPhone:b(i),isTablet:b(l),isPhone:b(c),isTouch:b(a),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:b(u),isDesktop:b(h)}})(s,i,e,n);return{browser:i,os:s,deviceType:a}},ot=e=>window.matchMedia(e).matches;let it=(e=>{let t,n=!1;return(...r)=>(n||(n=!0,t=e.apply(null,r)),t)})((()=>rt(window.navigator.userAgent,M.from(window.navigator.userAgentData),ot)));const st=()=>it(),at=e=>t=>(e=>e.dom.nodeType)(t)===e,lt=at(3),ct=at(11),ut=e=>(e=>{const t=e.dom.childNodes;return M.from(t[0]).map(je)})(e),ht=e=>je(e.dom.getRootNode()),ft=e=>je(e.dom.host),dt=(e,t,n)=>{((e,t,n)=>{if(!(u(n)||d(n)||v(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)},gt=(e,t)=>{const n=e.dom.getAttribute(t);return null===n?void 0:n},_t=(e,t)=>{e.dom.removeAttribute(t)},pt=e=>{const t=$e("div");return((e,t)=>{e.dom.appendChild(t.dom)})(t,je(e.dom.cloneNode(!0))),(e=>e.dom.innerHTML)(t)},mt=e=>void 0!==e.style&&m(e.style.getPropertyValue),vt=e=>{const t=lt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return(e=>{const t=ht(e);return ct(n=t)&&p(n.dom.host)?M.some(t):M.none();var n})(je(t)).fold((()=>n.body.contains(t)),(r=vt,o=ft,e=>r(o(e))));var r,o},yt=(e,t)=>{const n=e.dom,r=window.getComputedStyle(n).getPropertyValue(t);return""!==r||vt(e)?r:bt(n,t)},bt=(e,t)=>mt(e)?e.style.getPropertyValue(t):"",wt=(e=>{const t=t=>{const n=(e=>{const t=e.dom;return vt(e)?t.getBoundingClientRect().height:t.offsetHeight})(t);if(n<=0||null===n){const n=yt(t,e);return parseFloat(n)||0}return n},n=(e,t)=>I(t,((t,n)=>{const r=yt(e,n),o=void 0===r?0:parseInt(r,10);return isNaN(o)?t:t+o}),0);return{set:(t,n)=>{if(!v(n)&&!n.match(/^[0-9]+$/))throw new Error(e+".set accepts only positive integer values. Value was "+n);const r=t.dom;mt(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"),xt=e=>!(e=>e.offsetWidth<=0&&e.offsetHeight<=0)(e.dom),Ct=(e,t)=>n=>"rtl"===St(n)?t:e,St=e=>"rtl"===yt(e,"direction")?"rtl":"ltr",kt=(e,t)=>{const n=gt(e,t);return void 0===n||""===n?[]:n.split(" ")},Mt=(e,t,n)=>((e,t,n)=>{let r=e.dom;const o=m(n)?n:S;for(;r.parentNode;){r=r.parentNode;const e=je(r);if(t(e))return M.some(e);if(o(e))break}return M.none()})(e,(e=>Ue(e,t)),n),Et=(e,t,n)=>((e,t,n,r,o)=>e(n,r)?M.some(n):m(o)&&o(n)?M.none():t(n,r,o))(((e,t)=>Ue(e,t)),Mt,e,t,n),At=e=>void 0!==e.dom.classList,Nt=(e,t)=>{D(t,(t=>{((e,t)=>{At(e)?e.dom.classList.add(t):((e,t)=>{((e,t,n)=>{const r=kt(e,t).concat([n]);dt(e,t,r.join(" "))})(e,"class",t)})(e,t)})(e,t)}))},Rt=(e,t)=>{D(t,(t=>{((e,t)=>{At(e)?e.dom.classList.remove(t):((e,t)=>{((e,t,n)=>{const r=P(kt(e,t),(e=>e!==n));r.length>0?dt(e,t,r.join(" ")):_t(e,t)})(e,"class",t)})(e,t),(e=>{const t=At(e)?e.dom.classList:(e=>kt(e,"class"))(e);0===t.length&&_t(e,"class")})(e)})(e,t)}))},Tt=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return He(n)?[]:T(n.querySelectorAll(e),je)})(t,e),Dt=(e,t)=>{const n=e.getAttribute(t);return null===n?void 0:n},Ot=(e,t)=>M.from(Dt(e,t)),Pt=(e,t,n)=>{const r=((e,t)=>{const n=Dt(e,t);return void 0===n||""===n?[]:n.split(" ")})(e,t);return((e,t,n)=>{((e,t,n)=>{if(!(u(n)||d(n)||v(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,t,n)})(e,t,r.concat([n]).join(" ")),!0},It=e=>void 0!==e.classList,Lt=(e,t)=>{It(e)?e.classList.add(t):((e,t)=>{Pt(e,"class",t)})(e,t)},$t=(e,t)=>(t||document).createElement(e),jt=(e,t)=>(t||document).createTextNode(e),Ut=e=>e.nodeName.toLowerCase(),Ht=e=>t=>t.nodeType===e,Bt=e=>8===e.nodeType||"#comment"===Ut(e),Ft=Ht(1),Vt=Ht(3),qt=Ht(9),zt=Ht(11),Kt=e=>e.ownerDocument,Wt=e=>qt(e)?e:Kt(e),Gt=e=>M.from(e.parentNode),Qt=e=>Gt(e),Jt=(e,t)=>{const n=m(t)?t:S;let r=e;const o=[];for(;null!==r.parentNode&&void 0!==r.parentNode;){const e=r.parentNode,t=e;if(o.push(t),!0===n(t))break;r=e}return o},Xt=e=>M.from(e.previousSibling),Yt=e=>M.from(e.nextSibling),Zt=e=>q(e.childNodes),en=e=>!e.hasChildNodes(),tn=(e,t)=>{const n=(t||document).createElement("div");return n.innerHTML=e,Zt(n)},nn=(e,t)=>{const n=(t||document).createDocumentFragment();return D(e,(e=>{n.appendChild(e)})),n},rn=(e,t)=>{var n;null===(n=e.parentNode)||void 0===n||n.insertBefore(t,e),t.appendChild(e)},on=(e,t)=>e.cloneNode(t),sn=e=>on(e,!1),an=e=>on(e,!0),ln=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},cn=-1;(ln.Diff=function(e,t){this[0]=e,this[1]=t}).prototype.length=2,ln.Diff.prototype.toString=function(){return this[0]+","+this[1]},ln.Diff.prototype[Symbol.iterator]=function*(){yield this[0],yield this[1]},ln.prototype.diff_main=function(e,t,n,r){void 0===r&&(r=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var o=r;if(null==e||null==t)throw new Error("Null input. (diff_main)");if(e==t)return e?[new ln.Diff(0,e)]:[];void 0===n&&(n=!0);var i=n,s=this.diff_commonPrefix(e,t),a=e.substring(0,s);e=e.substring(s),t=t.substring(s),s=this.diff_commonSuffix(e,t);var l=e.substring(e.length-s);e=e.substring(0,e.length-s),t=t.substring(0,t.length-s);var c=this.diff_compute_(e,t,i,o);return a&&c.unshift(new ln.Diff(0,a)),l&&c.push(new ln.Diff(0,l)),this.diff_cleanupMerge(c),c},ln.prototype.diff_compute_=function(e,t,n,r){var o;if(!e)return[new ln.Diff(1,t)];if(!t)return[new ln.Diff(cn,e)];var i=e.length>t.length?e:t,s=e.length>t.length?t:e,a=i.indexOf(s);if(-1!=a)return o=[new ln.Diff(1,i.substring(0,a)),new ln.Diff(0,s),new ln.Diff(1,i.substring(a+s.length))],e.length>t.length&&(o[0][0]=o[2][0]=cn),o;if(1==s.length)return[new ln.Diff(cn,e),new ln.Diff(1,t)];var l=this.diff_halfMatch_(e,t);if(l){var c=l[0],u=l[1],h=l[2],f=l[3],d=l[4],g=this.diff_main(c,h,n,r),_=this.diff_main(u,f,n,r);return g.concat([new ln.Diff(0,d)],_)}return n&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,r):this.diff_bisect_(e,t,r)},ln.prototype.diff_lineMode_=function(e,t,n){var r=this.diff_linesToChars_(e,t);e=r.chars1,t=r.chars2;var o=r.lineArray,i=this.diff_main(e,t,!1,n);this.diff_charsToLines_(i,o),this.diff_cleanupSemantic(i),i.push(new ln.Diff(0,""));for(var s=0,a=0,l=0,c="",u="";s=1&&l>=1){i.splice(s-a-l,a+l),s=s-a-l;for(var h=this.diff_main(c,u,!1,n),f=h.length-1;f>=0;f--)i.splice(s,0,h[f]);s+=h.length}l=0,a=0,c="",u=""}s++}return i.pop(),i},ln.prototype.diff_bisect_=function(e,t,n){for(var r=e.length,o=t.length,i=Math.ceil((r+o)/2),s=i,a=2*i,l=new Array(a),c=new Array(a),u=0;un);m++){for(var v=-m+d;v<=m-g;v+=2){for(var y=s+v,b=(k=v==-m||v!=m&&l[y-1]r)g+=2;else if(b>o)d+=2;else if(f&&(C=s+h-v)>=0&&C=(x=r-c[C]))return this.diff_bisectSplit_(e,t,k,b,n)}for(var w=-m+_;w<=m-p;w+=2){for(var x,C=s+w,S=(x=w==-m||w!=m&&c[C-1]r)p+=2;else if(S>o)_+=2;else if(!f){var k;if((y=s+h-w)>=0&&y=(x=r-x))return this.diff_bisectSplit_(e,t,k,b,n)}}}return[new ln.Diff(cn,e),new ln.Diff(1,t)]},ln.prototype.diff_bisectSplit_=function(e,t,n,r,o){var i=e.substring(0,n),s=t.substring(0,r),a=e.substring(n),l=t.substring(r),c=this.diff_main(i,s,!1,o),u=this.diff_main(a,l,!1,o);return c.concat(u)},ln.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function o(e){for(var t="",o=0,s=-1,a=n.length;sr?e=e.substring(n-r):nt.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,i,s,a,u]:null}var s,a,l,c,u,h=i(n,r,Math.ceil(n.length/4)),f=i(n,r,Math.ceil(n.length/2));return h||f?(s=f?h&&h[4].length>f[4].length?h:f:h,e.length>t.length?(a=s[0],l=s[1],c=s[2],u=s[3]):(c=s[0],u=s[1],a=s[2],l=s[3]),[a,l,c,u,s[4]]):null},ln.prototype.diff_cleanupSemantic=function(e){for(var t=!1,n=[],r=0,o=null,i=0,s=0,a=0,l=0,c=0;i0?n[r-1]:-1,s=0,a=0,l=0,c=0,o=null,t=!0)),i++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),i=1;i=d?(f>=u.length/2||f>=h.length/2)&&(e.splice(i,0,new ln.Diff(0,h.substring(0,f))),e[i-1][1]=u.substring(0,u.length-f),e[i+1][1]=h.substring(f),i++):(d>=u.length/2||d>=h.length/2)&&(e.splice(i,0,new ln.Diff(0,u.substring(0,d))),e[i-1][0]=1,e[i-1][1]=h.substring(0,h.length-d),e[i+1][0]=cn,e[i+1][1]=u.substring(d),i++),i++}i++}},ln.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var n=e.charAt(e.length-1),r=t.charAt(0),o=n.match(ln.nonAlphaNumericRegex_),i=r.match(ln.nonAlphaNumericRegex_),s=o&&n.match(ln.whitespaceRegex_),a=i&&r.match(ln.whitespaceRegex_),l=s&&n.match(ln.linebreakRegex_),c=a&&r.match(ln.linebreakRegex_),u=l&&e.match(ln.blanklineEndRegex_),h=c&&t.match(ln.blanklineStartRegex_);return u||h?5:l||c?4:o&&!s&&a?3:s||a?2:o||i?1:0}for(var n=1;n=h&&(h=f,l=r,c=o,u=i)}e[n-1][1]!=l&&(l?e[n-1][1]=l:(e.splice(n-1,1),n--),e[n][1]=c,u?e[n+1][1]=u:(e.splice(n+1,1),n--))}n++}},ln.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,ln.whitespaceRegex_=/\s/,ln.linebreakRegex_=/[\r\n]/,ln.blanklineEndRegex_=/\n\r?\n$/,ln.blanklineStartRegex_=/^\r?\n\r?\n/,ln.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,n=[],r=0,o=null,i=0,s=!1,a=!1,l=!1,c=!1;i0?n[r-1]:-1,l=c=!1),t=!0)),i++;t&&this.diff_cleanupMerge(e)},ln.prototype.diff_cleanupMerge=function(e){e.push(new ln.Diff(0,""));for(var t,n=0,r=0,o=0,i="",s="";n1?(0!==r&&0!==o&&(0!==(t=this.diff_commonPrefix(s,i))&&(n-r-o>0&&0==e[n-r-o-1][0]?e[n-r-o-1][1]+=s.substring(0,t):(e.splice(0,0,new ln.Diff(0,s.substring(0,t))),n++),s=s.substring(t),i=i.substring(t)),0!==(t=this.diff_commonSuffix(s,i))&&(e[n][1]=s.substring(s.length-t)+e[n][1],s=s.substring(0,s.length-t),i=i.substring(0,i.length-t))),n-=r+o,e.splice(n,r+o),i.length&&(e.splice(n,0,new ln.Diff(cn,i)),n++),s.length&&(e.splice(n,0,new ln.Diff(1,s)),n++),n++):0!==n&&0==e[n-1][0]?(e[n-1][1]+=e[n][1],e.splice(n,1)):n++,o=0,r=0,i="",s=""}""===e[e.length-1][1]&&e.pop();var a=!1;for(n=1;n=55296&&t<=56319},ln.prototype.isLowSurrogate=function(e){var t=e.charCodeAt(0);return t>=56320&&t<=57343},ln.prototype.digit16=function(e){switch(e){case"0":return 0;case"1":return 1;case"2":return 2;case"3":return 3;case"4":return 4;case"5":return 5;case"6":return 6;case"7":return 7;case"8":return 8;case"9":return 9;case"A":case"a":return 10;case"B":case"b":return 11;case"C":case"c":return 12;case"D":case"d":return 13;case"E":case"e":return 14;case"F":case"f":return 15;default:throw new Error("Invalid hex-code")}},ln.prototype.decodeURI=function(e){try{return decodeURI(e)}catch(l){for(var t=0,n="";t=65536&&a<=1114111){n+=String.fromCharCode((65535&a)>>>10&1023|55296),n+=String.fromCharCode(56320|1023&a),t+=12;continue}}throw new URIError("URI malformed")}n+=String.fromCharCode((15&r)<<12|o<<6|i),t+=9}else n+=String.fromCharCode((31&r)<<6|o),t+=6}else n+=String.fromCharCode(r),t+=3}else n+=e[t++];return n}},ln.prototype.diff_xIndex=function(e,t){var n,r=0,o=0,i=0,s=0;for(n=0;nt));n++)i=r,s=o;return e.length!=n&&e[n][0]===cn?s:s+(t-i)},ln.prototype.diff_prettyHtml=function(e){e=this.diff_cleanupSplitSurrogates(e);for(var t=[],n=/&/g,r=//g,i=/\n/g,s=0;s");switch(a){case 1:t[s]=''+l+"";break;case cn:t[s]=''+l+"";break;case 0:t[s]=""+l+""}}return t.join("")},ln.prototype.diff_text1=function(e){for(var t=[],n=0;nthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),o=this;function i(e,r){var i=e/t.length,s=Math.abs(n-r);return o.Match_Distance?i+s/o.Match_Distance:s?1:i}var s=this.Match_Threshold,a=e.indexOf(t,n);-1!=a&&(s=Math.min(i(0,a),s),-1!=(a=e.lastIndexOf(t,n+t.length))&&(s=Math.min(i(0,a),s)));var l,c,u=1<=g;m--){var v=r[e.charAt(m-1)];if(p[m]=0===d?(p[m+1]<<1|1)&v:(p[m+1]<<1|1)&v|(h[m+1]|h[m])<<1|1|h[m+1],p[m]&u){var y=i(d,m-1);if(y<=s){if(s=y,!((a=m-1)>n))break;g=Math.max(1,2*n-a)}}}if(i(d+1,n)>s)break;h=p}return a},ln.prototype.match_alphabet_=function(e){for(var t={},n=0;n0&&ln.prototype.isLowSurrogate(t[e.start2-r])&&r++;var o=t.substring(e.start2-r,e.start2);o&&e.diffs.unshift(new ln.Diff(0,o)),e.start2+e.length1+r2&&(this.diff_cleanupSemantic(o),this.diff_cleanupEfficiency(o));else if(e&&"object"==typeof e&&void 0===t&&void 0===n)o=e,r=this.diff_text1(o);else if("string"==typeof e&&t&&"object"==typeof t&&void 0===n)r=e,o=t;else{if("string"!=typeof e||"string"!=typeof t||!n||"object"!=typeof n)throw new Error("Unknown call format to patch_make.");r=e,o=n}if(0===o.length)return[];o=this.diff_cleanupSplitSurrogates(o);for(var i=[],s=new ln.patch_obj,a=0,l=0,c=0,u=r,h=r,f=0;f=2*this.Patch_Margin&&a&&(this.patch_addContext_(s,u),i.push(s),s=new ln.patch_obj,a=0,u=h,l=c)}1!==d&&(l+=g.length),d!==cn&&(c+=g.length)}return a&&(this.patch_addContext_(s,u),i.push(s)),i},ln.prototype.patch_deepCopy=function(e){for(var t=[],n=0;nthis.Match_MaxBits?-1!=(s=this.match_main(t,c.substring(0,this.Match_MaxBits),l))&&(-1==(u=this.match_main(t,c.substring(c.length-this.Match_MaxBits),l+c.length-this.Match_MaxBits))||s>=u)&&(s=-1):s=this.match_main(t,c,l),-1==s)o[i]=!1,r-=e[i].length2-e[i].length1;else if(o[i]=!0,r=s-l,c==(a=-1==u?t.substring(s,s+c.length):t.substring(s,u+this.Match_MaxBits)))t=t.substring(0,s)+this.diff_text2(e[i].diffs)+t.substring(s+c.length);else{var h=this.diff_main(c,a,!1);if(c.length>this.Match_MaxBits&&this.diff_levenshtein(h)/c.length>this.Patch_DeleteThreshold)o[i]=!1;else{this.diff_cleanupSemanticLossless(h);for(var f,d=0,g=0;gi[0][1].length){var s=t-i[0][1].length;i[0][1]=n.substring(i[0][1].length)+i[0][1],o.start1-=s,o.start2-=s,o.length1+=s,o.length2+=s}return 0==(i=(o=e[e.length-1]).diffs).length||0!=i[i.length-1][0]?(i.push(new ln.Diff(0,n)),o.length1+=t,o.length2+=t):t>i[i.length-1][1].length&&(s=t-i[i.length-1][1].length,i[i.length-1][1]+=n.substring(0,s),o.length1+=s,o.length2+=s),n},ln.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,n=0;n2*t?(a.length1+=u.length,o+=u.length,l=!1,a.diffs.push(new ln.Diff(c,u)),r.diffs.shift()):(u=u.substring(0,t-a.length1-this.Patch_Margin),a.length1+=u.length,o+=u.length,0===c?(a.length2+=u.length,i+=u.length):l=!1,a.diffs.push(new ln.Diff(c,u)),u==r.diffs[0][1]?r.diffs.shift():r.diffs[0][1]=r.diffs[0][1].substring(u.length))}s=(s=this.diff_text2(a.diffs)).substring(s.length-this.Patch_Margin);var h=this.diff_text1(r.diffs).substring(0,this.Patch_Margin);""!==h&&(a.length1+=h.length,a.length2+=h.length,0!==a.diffs.length&&0===a.diffs[a.diffs.length-1][0]?a.diffs[a.diffs.length-1][1]+=h:a.diffs.push(new ln.Diff(0,h))),l||e.splice(++n,0,a)}}},ln.prototype.patch_toText=function(e){for(var t=[],n=0;n{const n=Ut(e);return n===Ut(t)&&N(["img","iframe","audio","video","embed","source"],n)&&((e,t,n=x)=>((e,t,n)=>e.isSome()&&t.isSome()?M.some(n(e.getOrDie(),t.getOrDie())):M.none())(e,t,n).getOr(e.isNone()&&t.isNone()))(Ot(e,"src"),Ot(t,"src"))},hn=(e,t)=>{const n=new Set(t);return P(e.trim().split(/\s+/),(e=>!n.has(e)&&e.length>0))},fn=(e,t,n,r)=>{var o;const i=null===(o=r[e.toLowerCase()])||void 0===o?void 0:o[t];return!_(i)&&(!0===i.ignore||(i.predicate?i.predicate(n):!!i.ignoreTokens&&0===hn(n,i.ignoreTokens).length))},dn=(e,t)=>{if(!Ft(e))return!1;const n=Array.from(e.attributes);return 0!==n.length&&j(n,(({name:n,value:r})=>fn(e.tagName,n,r,t)))},gn=(e,t,n)=>{const r=e.tagName.toLowerCase(),o=n[r];return!!_(o)||j(z(o),(r=>_n(r,e,t,n)))},_n=(e,t,n,r)=>{var o,i;const s=null!==(o=t.getAttribute(e))&&void 0!==o?o:"",a=null!==(i=n.getAttribute(e))&&void 0!==i?i:"",l=(r[t.tagName.toLowerCase()]||{})[e];if(g(l))return s===a;if(null==l?void 0:l.predicate){const e=l.predicate(s),t=l.predicate(a);return!e&&!t||s===a}if(null==l?void 0:l.ignoreTokens){const e=hn(s,l.ignoreTokens),t=hn(a,l.ignoreTokens);return e.length===t.length&&U(e,t)}return s===a},pn=(e,t,r=!1,o={})=>{if(e===t)return!0;if(e.nodeType!==t.nodeType||Ut(e)!==Ut(t))return!1;if(Vt(e)||Bt(e)){if(e.data!==t.data)return!1}else if(Ft(e)){const r=e=>(e=>{const t=E.call(e,0);return t.sort(void 0),t})(e.getAttributeNames?e.getAttributeNames():Object.keys(I(e.attributes,((e,t)=>(e[t.name]=t.value,e)),{}))),i=e=>P(r(e),(t=>{var n;return!fn(e.tagName,t,null!==(n=e.getAttribute(t))&&void 0!==n?n:"",o)})),s=i(e),a=i(t);if(!U(s,a,n))return!1;for(let n=0,r=s.length;npn(e,t,!0,o)})}return!0},mn=(e,t=M.none())=>t.fold((()=>Jt(e)),(t=>e===t?[]:Jt(e,(e=>e===t)))),vn=(e="visual-dom-diff: An error occurred when trying to calculate the diff between content")=>{throw new Error(e)},yn=(e,t)=>L(t,(t=>Ft(e)&&e.matches(t))),bn=e=>String.fromCharCode(57344+Math.abs((e=>{let t=0;for(let n=0;n{for(let t=0;t="\uf900"||l===bn("col")||l===bn("colgroup")?t++:(n[1]=i.substring(0,i.length-1),r[1]=l+s.substring(0,s.length-1),o[1]=l+a,0===n[1].length&&e.splice(t,1))}},xn=(e,t,n)=>{const r=(e=>{const t=new ln;return t.Diff_EditCost=null!=e?e:8,t.Diff_Timeout=10,t})(n),o=r.diff_main(e,t),i=[],s=[];wn(o);for(let e=0,t=o.length;ee[0].length)).getOr(0);if(oe[0].length)).getOr(0);o>0&&s.push(new ln.Diff(0,e.substring(0,o))),r.diff_cleanupSemantic(s),r.diff_cleanupEfficiency(s),Cn(i,s),s.length=0,i.push(new ln.Diff(0,e.substring(o,n-t))),t>0&&s.push(new ln.Diff(0,e.substring(n-t)))}else s.push(t)}else s.push(t)}return r.diff_cleanupSemantic(s),r.diff_cleanupEfficiency(s),Cn(i,s),s.length=0,r.diff_cleanupMerge(i),wn(i),i},Cn=(e,t)=>{Array.prototype.push.apply(e,t)},Sn=(e,t,n)=>{if(Ft(e))Lt(e,n);else{const r=Wt(e);Xt(e).filter((e=>{return Ut(e)===t&&(o=n,It(r=e)&&r.classList.contains(o));var r,o})).fold((()=>{const o=$t(t,r);Lt(o,n),rn(e,o)}),(t=>t.appendChild(e)))}},kn=(e,t)=>{let n;const r=e=>{const t=Ut(e);return"th"===t||"td"===t},o=e=>{const o=e.nodeName.toLowerCase(),i=Zt(e);return("tbody"!==o||0!==i.length)&&j(i,((e,o)=>((e,o)=>{const i=Ut(e),s=Zt(e);if("tr"!==i||0===s.length)return!1;const a=e=>I(e,((e,t)=>{if(!Ft(t))return{columns:e.columns+1,rowspan:e.rowspan+1};const n=Ot(t,"colspan").map((e=>parseInt(e,10))).getOr(1);return{columns:e.columns+n,rowspan:e.rowspan+Ot(t,"rowspan").map((e=>parseInt(e,10)-1)).getOr(0)*n}}),{columns:0,rowspan:0});if(t)if(g(n))n=a(s);else{const e=a(s);if(n.rowspan>0){const t=e.columns+n.rowspan-n.columns<0,r=o&&n.rowspan+e.columns>n.columns;if(t||r)return!1;{const t=n.columns-e.columns;n={columns:n.columns,rowspan:n.rowspan-t+e.rowspan}}}else{if(n.columns!==e.columns)return!1;n=e}}return j(s,r)})(e,i.length-1===o)))};return(e=>{const t=Zt(e),n=t.length;let r=0;if(r{if(!Ft(e))return!1;const t=e=>Ot(e,"span").map((e=>parseInt(e,10))).getOr(1),n=Zt(e),r=t(e);return(0===n.length||j(n,(e=>!(!Ft(e)||"col"!==e.nodeName.toLowerCase())&&1===t(e))))&&1===r})(t[r]))return!1;r++}if(rM.from(e.get(t)).exists((e=>e===n)),En=(e,t)=>L(Array.from(e.entries()),(([e])=>e===t)).map((([,e])=>e)),An=new Set(["img","iframe","object","svg","br","hr","wbr","area","base","basefont","embed","frame","link","meta","param","source","track"]),Nn=new Set(["bdo","bdi","q","cite","code","data","time","var","dfn","abbr","strong","em","big","small","mark","sub","sup","samp","kbd","b","i","s","u","span","a"]);class Rn{constructor(e,t){this.descend=!0,this.nextNode=e,this.rootNode=e,this.config=t,this.skipSelf(this.nextNode)&&this.next()}toArray(){const e=[];let t=this.next();for(;!t.done;){const{value:n}=t;e.push(n),t=this.next()}return e}forEach(e){let t=0,n=this.next();for(;!n.done;)e(n.value,t),n=this.next(),t++}reduce(e,t){let n=t,r=this.next();for(;!r.done;)n=e(n,r.value),r=this.next();return n}some(e){let t=this.next();for(;!t.done;){if(e(t.value))return!0;t=this.next()}return!1}next(){const e=this.nextNode;if(!e)return{done:!0,value:this.rootNode};let t;do{t=this.nextImpl()}while(t.skip&&!t.done);return t.done?{done:!0,value:this.rootNode}:{done:!1,value:e}}nextImpl(){const e=this.nextNode;if(!e)return{done:!0,skip:!1};if(this.descend&&e.firstChild&&!this.skipChildren(e))this.nextNode=(t=e,(e=>{const t=e.childNodes;return M.from(t[0])})(t)).getOrNull();else if(e===this.rootNode)this.nextNode=null;else{if(!Yt(e).isSome())return this.nextNode=Gt(e).getOrNull(),this.descend=!1,{done:!1,skip:!0};this.nextNode=Yt(e).getOrNull(),this.descend=!0}var t;return{done:!1,skip:this.skipSelf(this.nextNode)}}skipSelf(e){return!!(e&&this.config&&this.config.skipSelf)&&this.config.skipSelf(e)}skipChildren(e){return!(!this.config||!this.config.skipChildren)&&this.config.skipChildren(e)}}const Tn=e=>{const t=e.toLowerCase();return"th"===t?"td":t},Dn=(e,t)=>{const n={},r=t.normaliseNbsp?e=>e.replace("\xa0"," "):w;return new Rn(e,t).reduce(((e,o)=>{const i=yn(o,t.atomicSelectors);return i.fold((()=>{switch(!0){case Vt(o):return e+r(o.data);case Ft(o):const n=bn(Tn(o.nodeName.toLowerCase()));return e+n;case Bt(o):const i=o.nodeName.toLowerCase()+(t.trackComment(o)?o.data:""),s=bn(Tn(i));return e+s;default:return e}}),(t=>{n[t]=(n[t]||0)+1;const r=o.nodeName+i+n[t];return e+bn(r)}))}),"")},On=e=>Vt(e)?e.length:1,Pn=e=>"tr"===e.nodeName.toLowerCase(),In={skipChildren:Pn,skipSelf:e=>!Pn(e)},Ln=e=>"colgroup"===e.nodeName.toLowerCase(),$n={skipChildren:Ln,skipSelf:e=>!Ln(e)},jn=(e,t,n)=>{const r=Wt(t),{diffText:o,skipSelf:i,skipChildren:s}=n,a=e=>!i(e),l=(e,t)=>P(mn(e,M.from(t)),a).length,c=e=>Ft(e)&&i(e),u=(e,t)=>H(P(mn(e,M.from(t)),c)),h=e=>Ft(e)&&yn(e,n.atomicSelectors).isSome(),f=o(Dn(e,n),Dn(t,n));let d=0;const g=new Rn(e,n),_=new Rn(t,n);let m,v,y,b,w,x=0,C=0,S=0;y=f[d++],({done:m,value:b}=g.next()),({done:v,value:w}=_.next());const k=nn([],r);let E=k,A=0,N=k,T=0,$=M.none(),U=M.none();const B=new Map,F=new Map,V=new Array,z=new Map,K=new Map,W=new Set,G=new Set,Q=e=>Vt(e)||Ft(e)&&en(e),J=(e,t)=>{const r=u(b,e),o=u(w,t),{pass:i,fail:s}=O(r,(e=>!dn(e,n.ignoreAttributes))),{pass:a,fail:l}=O(o,(e=>!dn(e,n.ignoreAttributes))),c=s.length!==l.length||R(s,((e,t)=>{const r=l[t];return Ft(e)&&Ft(r)&&!gn(e,r,n.ignoreAttributes)}));return{nonIgnoredChanged:i.length!==a.length||R(i,((e,t)=>!pn(e,a[t],!1,n.ignoreAttributes))),ignoredChanged:c,formatsToStore:o}},X={table:e=>V.push({newTable:w,oldTable:b,outputTable:e}),tr:e=>z.set(e,{newRow:w,oldRow:b}),colgroup:e=>K.set(e,{newRow:w,oldRow:b})},Y=()=>{const t=l(b,e);for(;A>t;)Gt(E).fold((()=>{vn()}),(e=>{$.each((e=>{E===e&&($=M.none())})),E=e,A--}));A!==t&&vn()},Z=()=>{const e=l(w,t);for(;T>e;)Gt(N).fold((()=>{vn()}),(e=>{U.each((e=>{N===e&&(U=M.none())})),N=e,T--}));T!==e&&vn()},ee=r=>{if((E!==N||U.isSome()||$.isSome())&&vn(),Vt(r)){const{nonIgnoredChanged:n,formatsToStore:o,ignoredChanged:i}=J(e,t);o.length>0&&F.set(r,o),n?B.set(r,"modify"):i&&W.add(r)}else if(!Ft(r)||h(b)||h(w))Bt(r)&&(n.trackComment(r)||W.add(r));else{const{nonIgnoredChanged:o,formatsToStore:i,ignoredChanged:s}=J(e,t);i.length>0&&en(w)&&F.set(r,i);const a=!pn(b,w,!1,n.ignoreAttributes)||en(w)&&o,l=Ft(b)&&Ft(w)&&!gn(b,w,n.ignoreAttributes);a||o?B.set(r,"modify"):(s||l)&&W.add(r);const c=b.nodeName.toLowerCase();X[c]&&X[c](r)}N.appendChild(r),E=r,N=r,A++,T++},te=t=>{$.isNone()&&($=M.from(t),B.set(t,"remove"));const n=u(b,e);n.length>0&&Q(t)&&F.set(t,n),E.appendChild(t),E=t,A++},ne=e=>{U.isNone()&&(U=M.from(e),B.set(e,"insert"));const n=u(w,t);n.length>0&&Q(e)&&F.set(e,n),N.appendChild(e),N=e,T++},re=e=>{const t=y[1].length;x+=e,x===t?(y=f[d++],x=0):x>t&&vn()},oe=e=>{const t=On(b);C+=e,C===t?(({done:m,value:b}=g.next()),C=0):C>t&&vn()},ie=e=>{const t=On(w);S+=e,S===t?(({done:v,value:w}=_.next()),S=0):S>t&&vn()};for(;y;){let e,t;switch(y[0]){case cn:m&&vn(),Y(),e=Math.min(y[1].length-x,On(b)-C),t=y[1].substring(x,x+e),te(Vt(b)?jt(t,r):h(b)?an(b):sn(b)),re(e),oe(e);break;case 1:v&&vn(),Z(),e=Math.min(y[1].length-x,On(w)-S),t=y[1].substring(x,x+e),ne(Vt(w)?jt(t,r):h(w)?an(w):sn(w)),re(e),ie(e);break;default:(m||v)&&vn(),Y(),Z(),e=Math.min(y[1].length-x,On(b)-C,On(w)-S),t=y[1].substring(x,x+e);const o=()=>E===N,i=()=>Vt(b)&&Vt(w),a=()=>Tn(b.nodeName)===Tn(w.nodeName),l=()=>!s(b)&&!s(w);if(h(b)&&h(w)){const e=an(w);ee(e),G.add(e)}else o()&&(i()||a()&&l()||pn(b,w,!1,n.ignoreAttributes)||un(b,w))?ee(Vt(w)?jt(t,r):sn(w)):(te(Vt(b)?jt(t,r):sn(b)),ne(Vt(w)?jt(t,r):sn(w)));re(e),oe(e),ie(e)}}B.forEach(((e,t)=>{var r,o;if(t.nodeType!==Node.COMMENT_NODE||n.trackComment(t)){if("remove"===e){const e=t;let n=Xt(e).getOrNull();for(;p(n)&&Mn(B,n,"insert");)null===(o=n.parentNode)||void 0===o||o.insertBefore(e,n),n=Xt(e).getOrNull()}}else"remove"===e&&(null===(r=t.parentNode)||void 0===r||r.removeChild(t)),W.add(t),B.delete(t)})),V.forEach((e=>{var t,r,o;const{newTable:i,oldTable:s,outputTable:a}=e,l=e=>{return(t=e,(e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount)(t)?[]:q(t.querySelectorAll("td[colspan],th[colspan],td[rowspan],th[rowspan]"))).length>0;var t};if(!kn(s,!0)||!kn(i,!0)||!kn(a,!1)||(l(i)||l(s))&&(c=z,!j(Array.from(c.values()),(({oldRow:e,newRow:t})=>((e,t)=>{const n=Zt(e),r=Zt(t);for(let e=0;e{B.delete(e),F.delete(e)}));const e=an(s),n=an(i);return null===(t=a.parentNode)||void 0===t||t.insertBefore(e,a),null===(r=a.parentNode)||void 0===r||r.insertBefore(n,a),null===(o=a.parentNode)||void 0===o||o.removeChild(a),B.set(e,"remove"),void B.set(n,"insert")}var c;const u=()=>{const e={rowsChanges:[],colGroupChanges:[]},t=(e,t,r)=>{const o=En(t,e);return o.each((e=>{const{oldRow:t,newRow:o}=e,i=jn(t,o,n),s=Zt(t),a=Zt(o),l=s.length,c=a.length,u=Math.max(l,c),h=Math.min(l,c),f=i.rootOutputNode.firstElementChild,d=f?Zt(f):[];if(d.length===u)D(d,(e=>{Mn(i.combinedMap,e,"insert")?r.push(1):Mn(i.combinedMap,e,"remove")?r.push(cn):r.push(0)}));else{let e=0,t=0;for(;et(n,K,e.colGroupChanges)));const r=new Rn(a,In).toArray(),o=P(r,(e=>En(z,e).isSome())),i=L(o,(e=>{var t,n;return(null!==(n=null===(t=e.textContent)||void 0===t?void 0:t.replace(/\s+/g,""))&&void 0!==n?n:"").length>0})).orThunk((()=>M.from(o[0])));return i.fold((()=>e.rowsChanges.push(0)),(n=>t(n,z,e.rowsChanges))),e},h=e=>{const t=new Rn(e);for(t.next(),t.forEach((e=>{B.delete(e),F.delete(e)}));e.firstChild;)e.removeChild(e.firstChild)},f=(e,t,n,r)=>{if(!n||t.length>=n.length)return;const o=r?cn:1;for(let i=0;i{let i=0,s=0;for(const a of o)if(1===a){if(s{const e=e=>Mn(B,e,"insert")?1:Mn(B,e,"remove")?cn:0;if(l(i)||l(s)){const t=(e=>{const t=(e=>{const t=[];return new Rn(a,In).forEach((n=>{En(z,n).each((r=>{const{oldRow:o,newRow:i}=r,s=Zt(o),a=Zt(i),l=s.length,c=a.length,u=Math.max(l,c),h=Math.min(l,c),f=[],d=Zt(n);if(d.length===u)for(let t=0;t{const o=Zt(n);Qt(n).each((i=>{if(Mn(B,n,"insert")||Mn(B,i,"insert"))f(n,o,t[r],!0);else if(Mn(B,n,"remove")||Mn(B,i,"remove"))f(n,o,t[r],!1);else{const i=t=>j(o,((n,r)=>!p(t)||e(n)===t[r]));i(t[r])||(h(n),En(z,n).each((({newRow:e,oldRow:o})=>{const i=Zt(e),s=Zt(o);d(n,s,i,t[r])})))}}))})),t})(e);u().colGroupChanges.length>0&&(e=>{new Rn(a,$n).forEach((t=>{j(e[0],(e=>0===e))||(h(t),En(K,t).each((({newRow:n,oldRow:r})=>{const o=Zt(n),i=Zt(r),s=I(e,((e,t)=>t.length>e.length?t:e),[]);d(t,i,o,s)})))}))})(t)}else{const n=(e=>{const t=u();return 0===t.rowsChanges.length&&vn(),new Rn(a,In).forEach((n=>{const r=Zt(n);Qt(n).each((o=>{if(Mn(B,n,"insert")||Mn(B,o,"insert"))f(n,r,t.rowsChanges,!0);else if(Mn(B,n,"remove")||Mn(B,o,"remove"))f(n,r,t.rowsChanges,!1);else{const o=j(r,((n,r)=>e(n)===t.rowsChanges[r]));o||(h(n),En(z,n).each((({newRow:e,oldRow:r})=>{const o=Zt(e),i=Zt(r);d(n,i,o,t.rowsChanges)})))}}))})),t})(e);n.colGroupChanges.length>0&&(t=n.rowsChanges,new Rn(a,$n).forEach((e=>{j(t,(e=>0===e))||(h(e),En(K,e).each((({newRow:n,oldRow:r})=>{const o=Zt(n),i=Zt(r);d(e,i,o,t)})))})))}var t})()}));const se=e=>{W.add(e),D(Zt(e),se)};return G.forEach((e=>{W.add(e),D(Zt(e),se)})),{ignoreSet:W,rootOutputNode:k,combinedMap:B,formattingMap:F}},Un=(e,t)=>{const n=[`pre ins.${t.addedClass}`,`pre del.${t.removedClass}`].join(","),r=q(e.querySelectorAll(n));D(r,(e=>{const t=e.innerHTML.replace(/\n/g,' \n');((e,t)=>{const n=Kt(e),r=n.createDocumentFragment();((e,t)=>{D(t,(t=>{e.appendChild(t)}))})(r,tn(t,n)),e.textContent="",e.appendChild(r)})(e,t)}))},Hn=(e,t,n)=>((e,t)=>(D([Un],(n=>{n(e,t)})),e))(((e,t,n)=>((e,t)=>{const{rootOutputNode:n,combinedMap:r,formattingMap:o}=e;return r.forEach(((e,n)=>{switch(e){case"remove":Sn(n,"del",t.removedClass);break;case"insert":Sn(n,"ins",t.addedClass);break;case"modify":t.skipModified||Sn(n,"ins",t.modifiedClass)}})),o.forEach(((e,t)=>{e.forEach((e=>{Xt(t).filter((t=>pn(t,e))).fold((()=>{const n=sn(e);rn(t,n)}),(e=>e.appendChild(t)))}))})),n})(jn(e,t,n),n))(e,t,(({addedClass:e="vdd-added",modifiedClass:t="vdd-modified",removedClass:n="vdd-removed",skipModified:r=!1,skipChildren:o,skipSelf:i,diffText:s=xn,normaliseNbsp:a=!1,atomicSelectors:l,ignoreAttributes:c,trackComment:u}={})=>({addedClass:e,diffText:s,modifiedClass:t,removedClass:n,skipModified:r,skipChildren:e=>{var t;return!Ft(e)&&!zt(e)&&!qt(e)&&!Bt(e)||(null!==(t=null==o?void 0:o(e))&&void 0!==t?t:An.has(e.nodeName.toLowerCase()))||!(!Ft(e)||!p(l))&&R(l,(t=>e.matches(t)))},skipSelf:e=>{var t;return!Vt(e)&&!Ft(e)&&!Bt(e)||(null!==(t=null==i?void 0:i(e))&&void 0!==t?t:Nn.has(e.nodeName.toLowerCase())&&!en(e))},normaliseNbsp:a,trackComment:e=>m(u)&&u(e),atomicSelectors:null!=l?l:[],ignoreAttributes:null!=c?c:{}}))(n)),n),Bn=(e,t,n)=>je(((e,t,n)=>{const r={addedClass:n.addition,removedClass:n.removal,modifiedClass:n.modification},o=nn(tn(e)),i=nn(tn(t));return Hn(o,i,r)})(e,t,n));var Fn;!function(e){e[e.Error=0]="Error",e[e.Value=1]="Value"}(Fn||(Fn={}));const Vn=(e,t,n)=>e.stype===Fn.Error?t(e.serror):n(e.svalue),qn=e=>({stype:Fn.Value,svalue:e}),zn=e=>({stype:Fn.Error,serror:e}),Kn=Vn,Wn=e=>h(e)&&z(e).length>100?" removed due to size":JSON.stringify(e,null,2),Gn=(e,t)=>zn([{path:e,getErrorInfo:t}]),Qn=(Jn=u,(e=>({extract:(t,n)=>((e,t)=>e.stype===Fn.Error?t(e.serror):e)(e(n),(e=>((e,t)=>Gn(e,b(t)))(t,e))),toString:b("val")}))((e=>{const t=typeof e;return Jn(e)?qn(e):zn(`Expected type: string but got: ${t}`)})));var Jn;const Xn=(e,t,n)=>{switch(e.tag){case"field":return t(e.key,e.newKey,e.presence,e.prop);case"custom":return n(e.newKey,e.instantiator)}},Yn=(e,t,n,r)=>r(X(e,t).getOrThunk((()=>n(e)))),Zn=(e,t,n,r,o)=>{const i=e=>o.extract(t.concat([r]),e),s=e=>e.fold((()=>qn(M.none())),(e=>((e,t)=>e.stype===Fn.Value?{stype:Fn.Value,svalue:t(e.svalue)}:e)(o.extract(t.concat([r]),e),M.some)));switch(e.tag){case"required":return((e,t,n,r)=>X(t,n).fold((()=>((e,t,n)=>Gn(e,(()=>'Could not find valid *required* value for "'+t+'" in '+Wn(n))))(e,n,t)),r))(t,n,r,i);case"defaultedThunk":return Yn(n,r,e.process,i);case"option":return((e,t,n)=>n(X(e,t)))(n,r,s);case"defaultedOptionThunk":return((e,t,n,r)=>r(X(e,t).map((t=>!0===t?n(e):t))))(n,r,e.process,s);case"mergeWithThunk":return Yn(n,r,b({}),(t=>{const r=ie(e.process(n),t);return i(r)}))}},er=(e,t,n)=>{return r=((e,t,n)=>((e,t)=>e.stype===Fn.Error?{stype:Fn.Error,serror:t(e.serror)}:e)(t.extract([e],n),(e=>({input:n,errors:e}))))(e,t,n),Vn(r,ne.error,ne.value);var r},tr=(e,t,n,r)=>({tag:"field",key:e,newKey:t,presence:n,prop:r}),nr=e=>((e,t)=>tr(e,e,{tag:"option",process:{}},t))(e,Qn),rr=["#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"],or=(e,t={size:36})=>{return 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),r=(e=>{const t=((e,t)=>{let n=5381;for(let t=0;t>>0)%(t+1)})(e??"",rr.length-1);return rr[t]})(e.id),o=t.size,"data:image/svg+xml,"+encodeURIComponent(((e,t,n)=>{const r=n/2;return``+e+""})(n,r,o));var n,r,o},ir=(ar=[(sr=Qn,tr("id","id",{tag:"required",process:{}},sr)),nr("name"),nr("avatar")],{extract:(e,t)=>((e,t,n)=>{const r={},o=[];for(const i of n)Xn(i,((n,i,s,a)=>{const l=Zn(s,e,t,n,a);Kn(l,(e=>{o.push(...e)}),(e=>{r[i]=e}))}),((e,n)=>{r[e]=n(t)}));return o.length>0?zn(o):qn(r)})(e,t,ar),toString:()=>{const e=T(ar,(e=>Xn(e,((e,t,n,r)=>e+" -> "+r.toString()),((e,t)=>"state("+e+")"))));return"obj{\n"+e.join("\n")+"}"}});var sr,ar;const lr=()=>({id:"anonymous",name:"Anonymous",avatar:or({id:"anonymous",name:"Anonymous"})}),cr=e=>er("revisionhistory_author",ir,e).fold((e=>{return{valid:!1,message:(t=e,"Errors: \n"+(e=>{const t=e.length>10?e.slice(0,10).concat([{path:[],getErrorInfo:b("... (only showing first ten failures)")}]):e;return T(t,(e=>"Failed path: ("+e.path.join(" > ")+")\n"+e.getErrorInfo()))})(t.errors).join("\n")+"\n\nInput object: "+Wn(t.input))};var t}),(e=>({valid:!0,value:e}))),ur=e=>{const t=e.id,n=e.name.filter(ue).getOr("Anonymous"),r=e.avatar.filter(ue).getOrThunk((()=>or({id:t,name:n})));return{id:t,name:n,avatar:r}},hr=e=>{if(!("author"in e)||_(e.author)){const{revisionId:t,content:n,createdAt:r}=e;return{revisionId:t,content:n,createdAt:r,author:lr()}}const t=cr(e.author),n=t.valid?ur(t.value):lr();return{...e,author:n}},fr={addition:"tox-revisionhistory__annotation--added",removal:"tox-revisionhistory__annotation--removed",modification:"tox-revisionhistory__annotation--modified"},dr=e=>t=>t.options.get(e),gr=e=>t=>M.from(dr(e)(t)).filter(m),_r=(pr="revisionhistory_fetch",e=>gr(pr)(e).getOrDie(pr+" has not been implemented."));var pr;const mr=gr("revisionhistory_fetch_revision"),vr=dr("revisionhistory_css_url"),yr=e=>{const t=M.from(e.options.get("revisionhistory_diff_classes")).getOr({});return G(fr,((e,n)=>X(t,n).getOr(e)))},br=dr("revisionhistory_display_author"),wr=dr("body_class"),xr=dr("content_style"),Cr=dr("content_css_cors"),Sr=dr("revisionhistory_allow_restore"),kr=(e,t)=>tinymce.html.Serializer({validate:!0},e.schema).serialize(e.parser.parse(t)),Mr=async(e,t)=>{const n=(e=>kr(e,e.getContent()))(e),r=await(async e=>{if(e.options.isSet("revisionhistory_author")){const t=e.options.get("revisionhistory_author");return ur(t)}return(async e=>{try{const t=e.userLookup.userId;return e.userLookup.fetchUsers([t])[t]}catch(e){return console.warn("Failed to generate fallback user:",e),lr()}})(e)})(e);return{content:n,createdAt:(new Date).toISOString(),revisionId:oe("tinymce"),internalType:t,author:r}};var Er,Ar,Nr,Rr,Tr,Dr,Or,Pr,Ir,Lr,$r,jr={},Ur=[],Hr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Br=Array.isArray;function Fr(e,t){for(var n in t)e[n]=t[n];return e}function Vr(e){var t=e.parentNode;t&&t.removeChild(e)}function qr(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++Nr:o,__i:-1,__u:0};return null==o&&null!=Ar.vnode&&Ar.vnode(i),i}function zr(e){return e.children}function Kr(e,t){this.props=e,this.context=t}function Wr(e,t){if(null==t)return e.__?Wr(e.__,e.__i+1):null;for(var n;tt&&Rr.sort(Or));Jr.__r=0}function Xr(e,t,n,r,o,i,s,a,l,c,u){var h,f,d,g,_,p=r&&r.__k||Ur,m=t.length;for(n.__d=l,Yr(n,t,p),l=n.__d,h=0;h0?qr(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,a=eo(o,n,s,u),o.__i=a,i=null,-1!==a&&(u--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&h--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a===s+1?h++:a>s?u>l-s?h+=a-s:h--:a(null==l||131072&l.__u?0:1))for(;s>=0||a=0){if((l=t[s])&&!(131072&l.__u)&&o==l.key&&i===l.type)return s;s--}if(a2&&(s.children=arguments.length>3?Er.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===s[i]&&(s[i]=e.defaultProps[i]);return qr(e,s,r,o,null)}(zr,null,[e]),r||jr,jr,void 0!==t.ownerSVGElement,r?null:t.firstChild?Er.call(t.childNodes):null,o,r?r.__e:t.firstChild,!1,i),io(o,e,i)}Er=Ur.slice,Ar={__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}},Nr=0,Kr.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Fr({},this.state),"function"==typeof e&&(e=e(Fr({},n),this.props)),e&&Fr(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Qr(this))},Kr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Qr(this))},Kr.prototype.render=zr,Rr=[],Dr="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Or=function(e,t){return e.__v.__b-t.__v.__b},Jr.__r=0,Pr=0,Ir=ro(!1),Lr=ro(!0),$r=0;var ho=0;function fo(e,t,n,r,o,i){var s,a,l={};for(a in t)"ref"==a?s=t[a]:l[a]=t[a];var c={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--ho,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(s=e.defaultProps))for(a in s)void 0===l[a]&&(l[a]=s[a]);return Ar.vnode&&Ar.vnode(c),c}var go,_o,po,mo,vo=0,yo=[],bo=[],wo=Ar,xo=wo.__b,Co=wo.__r,So=wo.diffed,ko=wo.__c,Mo=wo.unmount,Eo=wo.__;function Ao(e,t){wo.__h&&wo.__h(_o,e,vo||t),vo=0;var n=_o.__H||(_o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:bo}),n.__[e]}function No(e){return vo=1,function(e,t){var n=Ao(go++,2);if(n.t=e,!n.__c&&(n.__=[Ho(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=_o,!_o.u)){var r=function(e,t,r){if(!n.__c.__H)return!0;var i=n.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,r);var s=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),!(!s&&n.__c.props===e)&&(!o||o.call(this,e,t,r))};_o.u=!0;var o=_o.shouldComponentUpdate,i=_o.componentWillUpdate;_o.componentWillUpdate=function(e,t,n){if(this.__e){var s=o;o=void 0,r(e,t,n),o=s}i&&i.call(this,e,t,n)},_o.shouldComponentUpdate=r}return n.__N||n.__}(Ho,e)}function Ro(e,t){var n=Ao(go++,3);!wo.__s&&Uo(n.__H,t)&&(n.__=e,n.i=t,_o.__H.__h.push(n))}function To(e){return vo=5,Do((function(){return{current:e}}),[])}function Do(e,t){var n=Ao(go++,7);return Uo(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Oo(e){var t=_o.context[e.__c],n=Ao(go++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(_o)),t.props.value):e.__}function Po(){for(var e;e=yo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach($o),e.__H.__h.forEach(jo),e.__H.__h=[]}catch(t){e.__H.__h=[],wo.__e(t,e.__v)}}wo.__b=function(e){_o=null,xo&&xo(e)},wo.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Eo&&Eo(e,t)},wo.__r=function(e){Co&&Co(e),go=0;var t=(_o=e.__c).__H;t&&(po===_o?(t.__h=[],_o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=bo,e.__N=e.i=void 0}))):(t.__h.forEach($o),t.__h.forEach(jo),t.__h=[],go=0)),po=_o},wo.diffed=function(e){So&&So(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==yo.push(t)&&mo===wo.requestAnimationFrame||((mo=wo.requestAnimationFrame)||Lo)(Po)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==bo&&(e.__=e.__V),e.i=void 0,e.__V=bo}))),po=_o=null},wo.__c=function(e,t){t.some((function(e){try{e.__h.forEach($o),e.__h=e.__h.filter((function(e){return!e.__||jo(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],wo.__e(n,e.__v)}})),ko&&ko(e,t)},wo.unmount=function(e){Mo&&Mo(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{$o(e)}catch(e){t=e}})),n.__H=void 0,t&&wo.__e(t,n.__v))};var Io="function"==typeof requestAnimationFrame;function Lo(e){var t,n=function(){clearTimeout(r),Io&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Io&&(t=requestAnimationFrame(n))}function $o(e){var t=_o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),_o=t}function jo(e){var t=_o;e.__c=e.__(),_o=t}function Uo(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Ho(e,t){return"function"==typeof t?t(e):t}const Bo=e=>{const t=new Date(e),n=t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),r=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!0});return`${n.replace(",","")}, ${r}`},Fo=e=>p(e.content)?e.content:"",Vo=({children:e,politenessSetting:t="polite",className:n})=>fo("div",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px"},"aria-live":t,className:n,children:e});var qo=function(e,t){var n={__c:t="__cC"+$r++,__: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.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,Qr(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}(M.none());const zo=e=>(t,n,r)=>{const o=e(t);return Go(o,t,n,r)},Ko=(e,t)=>{const n=Ct(e,t);return zo(n)},Wo=(e,t)=>{const n=Ct(t,e);return zo(n)},Go=(e,t,n,r)=>r.focusManager.get(t).bind((n=>e(t,n,r))).map((e=>(r.focusManager.set(t,e),!0))),Qo=(e,t,n)=>{const r=Tt(e,n);return(e=>$(e,(e=>Be(e,t))).map((t=>({index:t,candidates:e}))))(P(r,xt))},Jo=(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"===gt(r,"disabled")?i(e,t,n):M.from(n[t]);var r}));return Qo(e,n,t).bind((e=>{const t=e.index,n=e.candidates;return i(t,t,n)}))},Xo=(e,t,n,r)=>Jo(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?M.from(i):s(a)})),Yo=(e,t,n,r)=>Jo(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({get:e=>{return((e=(()=>je(document))())=>M.from(e.dom.activeElement).map(je))(ht(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 ei;!function(e){e.OnFocusMode="onFocus"}(ei||(ei={}));const ti=(e,t)=>({matches:e,classification:t}),ni=(e,t,n,r)=>{const o={...e,focusManager:Zo(),focusInside:ei.OnFocusMode,focusIn:r},i=(e,t,n)=>((e,t)=>{const n=L(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()}))}}},ri=e=>t=>N(e,t.which),oi=[9],ii=[13],si=[37],ai=[38],li=[39],ci=[40],ui=[32],hi=(e,t)=>{const n=(e,t,n)=>((e,t)=>t.focusManager.get(e).bind((e=>Et(e,t.selector))))(e,n).bind((e=>n.execute(e))),r=(e,t)=>{((e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return He(n)?M.none():M.from(n.querySelector(e)).map(je)})(t,e))(e,t.selector).each((n=>{t.focusManager.set(e,n)}))},o=(e,t,n)=>(n.cycles?Yo:Xo)(e,n.selector,t,-1),i=(e,t,n)=>(n.cycles?Yo:Xo)(e,n.selector,t,1),s=e=>(t,n,r)=>e(t,n,r),a=b([]),l=ni({selector:t,execute:e=>(e.dom.dispatchEvent(new window.Event("click")),M.some(!0)),allowVertical:!0,allowHorizontal:!0,cycles:!0},((e,t,r)=>{const a=[...r.allowHorizontal?si:[]].concat(r.allowVertical?ai:[]),l=[...r.allowHorizontal?li:[]].concat(r.allowVertical?ci:[]);return[ti(ri(a),s(Ko(o,i))),ti(ri(l),s(Wo(o,i))),ti(ri(ii),n),ti(ri(ui),n)]}),a,(()=>M.some(r)));return{keydown:t=>l.handleKeydown(e,t),keyup:t=>l.handleKeyup(e,t),focus:t=>l.handleFocus(e,t)}},fi=(e,t,n)=>{const r=H(e.slice(0,t)),o=H(e.slice(t+1));return L(r.concat(o),n)},di=(e,t,n)=>{const r=H(e.slice(0,t));return L(r,n)},gi=(e,t,n)=>{const r=e.slice(0,t),o=e.slice(t+1);return L(o.concat(r),n)},_i=(e,t,n)=>{const r=e.slice(t+1);return L(r,n)},pi=(e,t)=>t.focusManager.get(e).bind((e=>Et(e,t.selector))),mi=(e,t)=>{((e,t)=>{const n=Tt(e,t.selector),r=P(n,(e=>(e=>wt.get(e))(e)>0));return M.from(r[t.firstTabstop])})(e,t).each((n=>t.focusManager.set(e,n)))},vi=(e,t,n,r)=>{const o=Tt(e,n.selector);return pi(e,n).bind((t=>$(o,function(e,...t){return(...n)=>{const r=t.concat(n);return e.apply(null,r)}}(Be,t)).bind((t=>((e,t,n,r,o)=>o(t,n,(e=>((e,t)=>e.useTabstopAt(t))(r,e))).fold((()=>r.cyclic?M.some(!0):M.none()),(t=>(r.focusManager.set(e,t),M.some(!0)))))(e,o,t,n,r)))))},yi=(e,t,n)=>{const r=n.cyclic?fi:di;return vi(e,0,n,r)},bi=(e,t,n)=>{const r=n.cyclic?gi:_i;return vi(e,0,n,r)},wi=b([ti((xi=[e=>!0===e.shiftKey,ri(oi)],e=>j(xi,(t=>t(e)))),yi),ti(ri(oi),bi)]);var xi;const Ci=b([ti(ri(oi),((e,t,n)=>pi(e,n).filter((e=>!n.useTabstopAt(e))).bind((r=>((e=>{return(t=e,(e=>M.from(e.dom.parentNode).map(je))(t)).bind(ut).exists((t=>Be(t,e)));var t})(r)?yi:bi)(e,t,n)))))]),Si=(e,t)=>{const n=ni({selector:t,firstTabstop:0,useTabstopAt:k,cyclic:!0},wi,Ci,(()=>M.some(mi)));return{keydown:t=>n.handleKeydown(e,t),keyup:t=>n.handleKeyup(e,t),focus:t=>n.handleFocus(e,t)}},ki=(e,t,n)=>Do((()=>{if(e.current){const r=("tab"===n?Si:hi)(je(e.current),t);return{onKeyUp:r.keyup,onKeyDown:r.keydown,onFocus:r.focus}}return{onKeyDown:y,onKeyUp:y,onFocus:y}}),[e.current]),Mi=({items:e})=>{const t=To(null);return fo("div",{ref:t,className:"tox-view__toolbar",tabIndex:-1,...ki(t,".tox-button:not([disabled])","flow"),children:T(e,((e,t)=>{var n,r;return"title"===e.type?fo("div",{className:"tox-view__label tox-view__label--large",tabindex:-1,children:e.label},t):e.hide?null:fo("button",{className:(r=null!==(n=e.primary)&&void 0!==n&&n,"tox-button "+(r?"tox-button--primary tox-view__align-right":"tox-button--secondary")),onClick:e.onAction,type:"button",disabled:e.disabled,children:e.label},t)}))})},Ei=({id:e,avatar:t,name:n})=>{const[r,o]=No(t);return Ro((()=>{o(t)}),[t]),fo("img",{className:"tox-revisionhistory__avatar",src:r,onError:()=>{o(or({id:e,name:n}))}})},Ai=()=>{const e=Oo(qo);return fo("img",{className:"tox-revisionhistory__card-check-icon",src:Do((()=>e.map((e=>{return t=e.editor,M.from(t.ui.registry.getAll().icons.checkmark).fold(b(""),(e=>{let t=e;return ce(e,"xmlns")||(t=e.replace("svg",'svg xmlns="http://www.w3.org/2000/svg"')),`data:image/svg+xml, ${encodeURIComponent(t)}`}));var t})).getOr("")),[e])})},Ni=({revision:e,isSelected:t,onSelect:n,showAuthor:r})=>{const o=Bo(e.createdAt),i=tinymce.i18n.translate(["Revision on {0}",o]),s=Do((()=>e.author),[e]);return fo("div",{role:"listitem",children:fo("div",{"aria-pressed":t,className:"tox-revisionhistory__card "+(t?"tox-revisionhistory__card--selected":""),tabIndex:-1,onClick:n,"aria-label":i,role:"button",children:[fo("div",{children:e.internalType&&fo("span",{className:"tox-revisionhistory__card-label",children:tinymce.i18n.translate(e.internalType.toUpperCase())})}),fo("div",{className:"tox-revisionhistory__card-content",children:[r&&fo(Ei,{...s}),fo("div",{className:"tox-revisionhistory__card-info",children:[fo("span",{className:"tox-revisionhistory__card-date-label",children:o}),r&&fo("span",{className:"tox-revisionhistory__card-author-name","aria-label":s.name,children:tinymce.i18n.translate(s.name)})]}),t&&fo(Ai,{})]})]})})},Ri=({revisions:e,onRevisionSelected:t})=>{const[n,r]=No(""),o=[".tox-revisionhistory__card",".tox-revisionhistory__norevision"].join(", "),i=To(null),s=ki(i,o,"flow"),a=tinymce.i18n.translate("No revisions"),l=tinymce.i18n.translate("Revision History"),c=Oo(qo).map((e=>br(e.editor))).getOr(!1),u=e=>{r(e),t(e)};return Ro((()=>{p(e)&&!n&&B(e,0).each((e=>u(e.revisionId)))}),[e]),fo("div",{className:"tox-revisionhistory__sidebar",tabIndex:-1,children:[fo("h1",{className:"tox-revisionhistory__sidebar-title",children:l}),fo("div",{role:"list",ref:i,className:"tox-revisionhistory__revisions",tabIndex:-1,...s,children:p(e)?0===e.length?fo("div",{role:"listitem",className:"tox-revisionhistory__norevision",children:a}):T(e,((e,t)=>fo(Ni,{showAuthor:c,isSelected:e.revisionId===n,revision:e,onSelect:()=>u(e.revisionId)},t))):null})]})},Ti=({restore:e,goBack:t,getRevisions:n,getRevision:r,editor:o})=>{const i=To(null),s=[".tox-view__toolbar",".tox-revisionhistory__revisions"].join(", "),[a,l]=No(M.none()),c=ki(i,s,"tab"),[u,h]=No(""),[f,d]=No(""),[g,v]=No(!1),y=tinymce.i18n.translate("Restore this version"),x=tinymce.i18n.translate("Revision History"),C=tinymce.i18n.translate("Close"),S=a.fold(b(x),(({createdAt:e})=>Bo(e))),[k,E]=No(),A=async e=>{if(p(k)){o.setProgressState(!0);const t=await(async(e,t,n)=>{const r=[];return $(t,(t=>t.revisionId===e)).each((e=>{r.push(t[e]),e<=t.length-2&&r.push(t[e+1])})),await Promise.all(T(r,n))})(e,k,r);if(o.removed||o.setProgressState(!1),t.length>0&&!o.removed){let e="";const[n,r]=t,i=Fo(n);e=p(r)?pt(Bn(Fo(r),i,yr(o))):i,(e=>{if(k&&e.length>0){const t=((e,t)=>{const n=[...e];return D(t,(e=>{e&&$(n,(t=>((e,t)=>e.revisionId===t.revisionId)(e,t))).each((t=>{n[t]=e}))})),n})(k,e);E(t)}})(t),l(M.some(n)),h(((e,t)=>{const n=vr(t),r=((e,t)=>{return o=t,n=e.parser.parse(o,{insert:!0}),r=e.schema,tinymce.html.Serializer({validate:!0},r).serialize(n);var n,r,o})(t,e),o=M.from(xr(t)).map((e=>``)).getOr(""),i=ae(Cr(t),' crossorigin="anonymous"').getOr(""),s=``,a=I(t.contentCSS,((e,n)=>`${e}`),""),l=t.dom.encode,c=M.from(wr(t)).map((e=>` class="${l(e)}"`)).getOr(""),u=M.from(t.getBody()).map((e=>l(e.dir))).bind((e=>ae(""!==e,` dir="${e}"`))).getOr(""),h=(e=>{const t=((e,t)=>{const n=[],r=m(t)?e=>R(n,(n=>t(n,e))):e=>N(n,e);for(let t=0,o=e.length;t{const n=J(tinymce.ScriptLoader.getScriptAttributes(t),((t,n)=>` ${e.dom.encode(n)}="${e.dom.encode(t)}"`));return`